body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #222;
  color: #eee;
  margin: 0;
}
.admin-container {
  max-width: 600px;
  margin: 30px auto;
  padding: 20px;
  background: #2f2f2f;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}
h1 {
  margin-top: 0;
}
.sync-status {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  background: #444;
  color: #ccc;
  vertical-align: middle;
  letter-spacing: .5px;
  transition: background .25s ease, color .25s ease;
  cursor: pointer;
  user-select: none;
}
.sync-status.loading { background: #005fa0; color: #d8ecff; }
.sync-status.ok { background: #1f6f3d; color: #d8ffd8; }
.sync-status.error { background: #7f1f1f; color: #ffd8d8; }
.sync-status.idle { background: #444; color: #ccc; }
.sync-status:hover { filter: brightness(1.15); }
.sync-status:active { transform: scale(.95); }
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.controls button,
.controls input {
  padding: 10px 14px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
}
.controls button {
  cursor: pointer;
  background: #444;
  color: #fff;
}
.controls button:hover {
  background: #555;
}
#admin-token {
  flex: 1 1 180px;
  background: #1b1b1b;
  color: #eee;
  border: 1px solid #444;
}
.status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  background: #1b1b1b;
  padding: 15px;
  border-radius: 8px;
}
.status div {
  font-size: 14px;
}
.log {
  background: #1b1b1b;
  padding: 12px;
  min-height: 120px;
  font-family: monospace;
  font-size: 12px;
  border-radius: 8px;
  overflow: auto;
  /* Preserve appended newline characters so each log entry appears on its own line */
  white-space: pre-wrap;
}
.log div { margin-bottom: 2px; }
.log div:nth-last-child(-n+3) { font-weight: 600; }

/* Progress Feed */
.progress-feed {
  background: #1b1b1b;
  margin-top: 18px;
  padding: 14px 16px 18px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.progress-header { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.progress-header h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: .5px;
  font-weight: 600;
  color: #f0f0f0;
}
.progress-clear {
  background:#333;
  color:#eee;
  border:1px solid #444;
  padding:6px 12px;
  border-radius:6px;
  font-size:12px;
  letter-spacing:.5px;
  cursor:pointer;
  transition:background .2s ease, color .2s ease, transform .15s ease;
}
.progress-clear:hover { background:#3d3d3d; }
.progress-clear:active { transform:scale(.95); }
.progress-clear:focus { outline:2px solid #666; outline-offset:2px; }
.progress-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #262626;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.3;
  position: relative;
  animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform:translateY(0);} }
.progress-item .progress-meta { display: flex; flex-direction: column; }
.progress-item .player-name { font-weight: 600; color: #fff; }
.progress-item .timestamp { font-size: 10px; opacity: .6; }
.progress-item .badge {
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .5px;
  background: #444;
  color: #eee;
  flex-shrink: 0;
}
.badge.line { background: #DF9134; color:#FFFFFF; }
.badge.half { background: #CD0000; color:#FFFFFF; }
.badge.completed { background: #1f6f3d; color:#FFFFFF; }
.progress-empty { font-size: 12px; opacity: .65; }
button#btn-start {
  background: #28a745;
}
button#btn-reset {
  background: #c82333;
}
button#btn-start:hover {
  background: #218838;
}
button#btn-reset:hover {
  background: #a91124;
}

/* Pause state styling (blue) applied dynamically via class on the button when label changes */
button#btn-start.pause-state {
  background: #0d6efd;
  color: #fff;
}
button#btn-start.pause-state:hover {
  background: #0b5ed7;
}
button#btn-start.pause-state:active {
  background: #0a58ca;
}
