/* openDart Dashboard - Professional Dark Theme */

/* ─── Base & Variables ───────────────────────────────────────────── */
:root {
  --bg: #0b0f1a;
  --bg-sidebar: #0f1420;
  --bg-card: #141b2d;
  --bg-card-hover: #1a2340;
  --bg-input: #0d1220;
  --border: #1e2a42;
  --border-hover: #2d3f66;
  --text: #e2e8f0;
  --text-muted: #7a8ba8;
  --text-dim: #4a5870;
  --primary: #38bdf8;
  --primary-dark: #0284c7;
  --primary-glow: rgba(56, 189, 248, 0.12);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --autodarts: #e74c3c;
  --scolia: #3498db;
  --sidebar-w: 240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── Layout: Sidebar + Content ──────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.sidebar-brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.sidebar-brand h1 .merge { color: var(--primary); }
.sidebar-brand h1 .brand { color: var(--primary); }
.sidebar-brand .tagline {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
}
.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}
.sidebar-user .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}
.sidebar-user .user-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .user-status {
  font-size: 0.65rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 28px 32px;
  min-height: 100vh;
}

/* ─── Mobile Toggle ──────────────────────────────────────────────── */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  z-index: 90;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.mobile-header .menu-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}
.mobile-header h1 { font-size: 1.1rem; font-weight: 800; }
.mobile-header h1 .merge { color: var(--primary); }
.mobile-header h1 .brand { color: var(--primary); }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ─── Page Header ────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.page-header .btn {
  margin-left: auto;
}
.page-header .subtitle {
  flex-basis: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* ─── Status Cards Row ───────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}
.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-value.online { color: var(--success); }
.stat-card .stat-value.offline { color: var(--danger); }

/* ─── Section ────────────────────────────────────────────────────── */
.section {
  margin-bottom: 28px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .count {
  background: var(--primary-dark);
  color: white;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* ─── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.15s;
}
.card:hover {
  border-color: var(--border-hover);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

/* ─── Match History ──────────────────────────────────────────────── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  transition: border-color 0.15s;
}
.history-item:hover {
  border-color: var(--border-hover);
}
.history-item .plat-tag {
  flex-shrink: 0;
}
.history-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-main);
}
.history-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.history-type {
  font-weight: 600;
  white-space: nowrap;
}
.history-players {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-shrink: 0;
}
.history-winner {
  color: var(--success);
  font-weight: 600;
}

/* ─── Extension / Autodarts Setup ────────────────────────────────── */
.ad-connect-info { font-size: 0.85rem; }

.ext-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.8rem;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 6px;
}
.ext-status.ext-ok {
  background: rgba(34,197,94,0.08);
  color: var(--success);
}
.ext-status.ext-missing {
  background: rgba(239,68,68,0.08);
  color: var(--danger);
}

.ext-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.ext-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-muted);
}
.ext-step code {
  background: rgba(255,255,255,0.06);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--text);
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.ext-waiting {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(56,189,248,0.06);
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Lobby Cards ────────────────────────────────────────────────── */
.lobby-card { composes: card; }
.lobby-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.lobby-meta {
  display: flex;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 12px;
}
.lobby-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-list { display: flex; flex-direction: column; gap: 6px; }
.player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}
.player-row .platform-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: white;
}
.player-row .platform-badge.autodarts { background: var(--autodarts); }
.player-row .platform-badge.scolia { background: var(--scolia); }
.player-row .platform-badge.dartmerge { background: var(--primary-dark); }
.player-row .platform-badge.opendart { background: var(--primary-dark); }
.player-row .player-name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.player-row .host-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.player-row .empty { color: var(--text-dim); font-style: italic; font-size: 0.85rem; }

.invite-code {
  margin-top: 10px;
  padding: 6px 10px;
  background: rgba(56,189,248,0.06);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.invite-code strong { color: var(--primary); font-family: 'Courier New', monospace; }

/* ─── Match Cards ────────────────────────────────────────────────── */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.match-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}
.match-card.live {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.08);
}
.match-card.live:hover {
  box-shadow: 0 0 28px rgba(34, 197, 94, 0.14);
  border-color: var(--success);
}
.match-scores {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 16px;
  margin: 10px 0 14px;
}
.match-player {
  text-align: center;
  flex: 1;
}
.match-player .plat-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  color: white;
  margin-bottom: 4px;
}
.match-player .plat-tag.scolia { background: var(--scolia); }
.match-player .plat-tag.autodarts { background: var(--autodarts); }
.match-player .plat-tag.dartmerge { background: var(--primary-dark); }
.match-player .plat-tag.opendart { background: var(--primary-dark); }
.match-player .name { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2px; }
.match-player .score {
  font-size: 2.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.match-player .score.active { color: var(--primary); }
.match-player .legs { font-size: 0.75rem; color: var(--text-dim); margin-top: 2px; }
.match-vs {
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 300;
}
.match-info {
  display: flex;
  justify-content: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.match-info .live-tag { color: var(--success); font-weight: 700; }

/* ─── Empty State ────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: 10px;
}
.empty-state .empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  opacity: 0.4;
}
.empty-state p { font-size: 0.85rem; }

/* ─── Status Dot ─────────────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot.green { background: var(--success); }
.dot.red { background: var(--danger); }
.dot.gray { background: var(--text-dim); }
.dot.yellow { background: var(--warning); }

/* ─── Login / Form Card ──────────────────────────────────────────── */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px;
  max-width: 420px;
  margin: 40px auto 0;
}
.form-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.form-card .form-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 20px;
}
.form-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-card .form-error {
  color: #ef4444;
  font-size: 0.82rem;
  padding: 6px 10px;
  background: rgba(239,68,68,0.1);
  border-radius: 6px;
}
.form-card .form-link {
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.form-card .form-link a {
  color: var(--primary);
  text-decoration: none;
}

/* ─── Inputs ─────────────────────────────────────────────────────── */
.input, select.input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.input:focus, select.input:focus {
  border-color: var(--primary);
}
.input::placeholder { color: var(--text-dim); }

select.input {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%237a8ba8'%3E%3Cpath d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-danger {
  background: rgba(239,68,68,0.12);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239,68,68,0.2);
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-full { width: 100%; }

/* ─── Profile Card ───────────────────────────────────────────────── */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-weight: 600; font-size: 1rem; }
.profile-meta { font-size: 0.8rem; color: var(--text-dim); margin-top: 1px; }
.profile-card .btn { margin-left: auto; flex-shrink: 0; }

/* ─── Platform Cards ─────────────────────────────────────────────── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
}
.platform-card.linked {
  border-color: rgba(34,197,94,0.3);
}
.platform-card.disabled {
  opacity: 0.55;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: white;
  text-transform: uppercase;
  flex-shrink: 0;
}
.platform-icon.scolia { background: var(--scolia); }
.platform-icon.autodarts { background: var(--autodarts); }
.platform-name { font-weight: 600; font-size: 0.95rem; }
.platform-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.platform-status.linked { background: rgba(34,197,94,0.12); color: var(--success); }
.platform-status.soon { background: rgba(245,158,11,0.12); color: var(--warning); }

.platform-body {
  font-size: 0.85rem;
}
.ext-detected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.25);
  border-radius: 6px;
  font-size: 0.82rem;
  color: #81c784;
  margin-bottom: 4px;
}
.platform-body .muted {
  color: var(--text-dim);
  line-height: 1.5;
}

/* Scolia user info in platform card */
.scolia-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.scolia-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--scolia);
}
.scolia-user .su-name { font-weight: 600; font-size: 0.9rem; }
.scolia-user .su-meta { font-size: 0.75rem; color: var(--text-dim); }

/* Board items */
.board-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.board-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  font-size: 0.85rem;
}
.board-item .board-name { flex: 1; font-weight: 500; }
.board-item .board-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.board-item .board-status.online { background: rgba(34,197,94,0.12); color: var(--success); }
.board-item .board-status.offline { background: rgba(239,68,68,0.1); color: var(--danger); }

/* Board stats row */
.board-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bstat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  text-align: center;
  flex: 1;
  min-width: 60px;
}
.bstat-val {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}
.bstat-lbl {
  display: block;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.stats-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 10px 0 4px;
}
.stats-section {
  margin: 8px 0;
}
.platform-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.btn-xs {
  font-size: 0.7rem;
  padding: 4px 10px;
}
.last-updated {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}
.empty-state-sm {
  padding: 16px;
  text-align: center;
}

/* Board item with details */
.board-item-detail {
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.board-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.board-item-top .board-name { flex: 1; font-weight: 500; }
.board-detail {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 3px;
  padding-left: 16px;
  font-family: 'Courier New', monospace;
}

/* Inline Scolia connect form */
.connect-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.connect-form .input { font-size: 0.85rem; padding: 8px 12px; }

/* ─── Create Match Form ──────────────────────────────────────────── */
.create-form {
  max-width: 480px;
}
.create-form .card {
  padding: 28px;
}
.create-form form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ─── Messages ───────────────────────────────────────────────────── */
.msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.msg.error { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.msg.success { background: rgba(34,197,94,0.1); color: var(--success); border: 1px solid rgba(34,197,94,0.2); }

/* ─── Live Match ─────────────────────────────────────────────────── */
.match-info-bar {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.scoreboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sb-player {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.3s;
}
.sb-player.active {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(59,130,246,0.15);
}
.sb-player.winner {
  border-color: var(--success);
  box-shadow: 0 0 20px rgba(34,197,94,0.15);
}
.sb-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 6px 0 4px;
}
.sb-score {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin: 8px 0;
}
.sb-player.active .sb-score { color: #60a5fa; }
.sb-player.winner .sb-score { color: var(--success); }
.sb-legs {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.sb-stats {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  gap: 10px;
  justify-content: center;
}
.score-input-section {
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}
.turn-indicator {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--primary);
}
.turn-indicator.spectator { color: var(--text-dim); }
.score-form {
  display: flex;
  gap: 8px;
  max-width: 320px;
  margin: 0 auto;
}
.score-input-field {
  font-size: 1.4rem;
  text-align: center;
  font-weight: 700;
  flex: 1;
}
.turn-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.turn-list::-webkit-scrollbar {
  display: none;
}
.turn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.85rem;
}
.turn-player {
  flex: 1;
  font-weight: 500;
}
.turn-points {
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}
.turn-points.high { color: var(--success); }
.turn-points.busted { color: var(--danger); }
.turn-remaining {
  color: var(--text-dim);
  font-size: 0.75rem;
}
.auto-badge {
  display: inline-block;
  background: var(--primary, #00bcd4);
  color: #000;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}
.auto-score-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}
.auto-score-toggle .toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.auto-score-toggle input[type="checkbox"] {
  accent-color: var(--primary, #00bcd4);
  width: 16px;
  height: 16px;
}
.auto-submitting {
  color: var(--primary, #00bcd4);
  font-size: 0.75rem;
  animation: autoPulse 1s infinite;
}
@keyframes autoPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.auto-score-conflict {
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.4);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.conflict-header {
  font-weight: 700;
  color: #ff9800;
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.conflict-body {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.conflict-body p {
  margin: 0 0 8px 0;
}
.conflict-actions {
  display: flex;
  gap: 8px;
}
.finished-tag {
  color: var(--success);
  font-weight: 700;
}
.lobby-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.lobby-status-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}
.lobby-status-tag.open { color: var(--success); }
.lobby-status-tag.full { color: var(--warning, #f59e0b); }

/* ─── Match: Board Streams + Scoreboards Grid ───────────────────── */
.match-players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.match-player-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.match-player-col.active .sb-player { border-color: var(--primary); }
.match-player-col.winner .sb-player { border-color: var(--success); }

/* Board camera stream placeholder */
.board-stream {
  aspect-ratio: 16 / 9;
  background: #0a0e18;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.stream-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  gap: 6px;
}
.stream-icon { font-size: 2.2rem; opacity: 0.5; }
.stream-label { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stream-sublabel { font-size: 0.75rem; color: var(--text-muted); }
.stream-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0; left: 0;
}

/* ─── Match: Layout (main + chat sidebar) ────────────────────────── */
.match-layout {
  display: flex;
  gap: 16px;
}
.match-main {
  flex: 1;
  min-width: 0;
}
.match-chat-sidebar {
  width: 320px;
  flex-shrink: 0;
  height: calc(100vh - 100px);
}

/* ─── Match: Live Chat (Twitch-style) ────────────────────────────── */
.match-chat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  position: sticky;
  top: 80px;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.chat-header .chat-viewers {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-dim);
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { display: none; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg {
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 3px 0;
  word-break: break-word;
}
.chat-msg .chat-name {
  font-weight: 700;
  margin-right: 6px;
}
.chat-msg .chat-name.player { color: var(--primary); }
.chat-msg .chat-name.spectator { color: var(--text-muted); }
.chat-msg .chat-text { color: var(--text); }
.chat-msg.system {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.78rem;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--primary); }
.chat-input::placeholder { color: var(--text-dim); }
.chat-send-btn {
  background: var(--primary);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.chat-send-btn:hover { opacity: 0.85; }
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Streamer mode: chat is more compact, highlighted own messages */
.chat-msg.own-msg { background: rgba(56, 189, 248, 0.06); border-radius: 4px; padding: 3px 6px; margin: 0 -6px; }

/* Live tag pulse */
.live-tag {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.finished-tag {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .mobile-header {
    display: flex;
  }
  .content {
    margin-left: 0;
    padding: 72px 16px 20px;
  }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-card .btn { margin-left: 0; }
  .match-players-grid { grid-template-columns: 1fr; }
  .match-layout { flex-direction: column; }
  .match-chat-sidebar { width: 100%; }
  .match-chat { height: 360px; position: static; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}

/* ─── Spectator Mode ─────────────────────────────────────────────── */
.spectator-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.spectator-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(245, 158, 11, 0.10);
  color: var(--warning);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-left: 12px;
}

/* ─── Live Watch Badge (match cards) ─────────────────────────────── */
.live-watch-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  cursor: pointer;
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: live-pulse 2s ease-in-out infinite;
}

/* ─── Match Status Bar (connection + spectator indicator) ────────── */
.match-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

/* ─── Connection Indicator ───────────────────────────────────────── */
.connection-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
}
.conn-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.conn-dot.green {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}
.conn-dot.orange {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
  animation: conn-pulse 1.5s ease-in-out infinite;
}
.conn-dot.red {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}
@keyframes conn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Reconnect Banner ───────────────────────────────────────────── */
.reconnect-banner {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  border-radius: 6px;
  transition: all 0.3s ease;
  margin-bottom: 0;
}
.reconnect-banner.show {
  padding: 8px 12px;
  max-height: 40px;
  margin-bottom: 8px;
}

/* ─── Player Disconnect Warning ──────────────────────────────────── */
.player-disconnect-warn {
  background: rgba(245, 158, 11, 0.10);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  text-align: center;
}
.player-disconnect-warn .warn-icon {
  font-size: 0.9rem;
  margin-right: 4px;
}

/* ─── Match Resume Overlay ───────────────────────────────────────── */
.match-resume-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  transition: opacity 0.3s ease;
}
.match-resume-overlay.fade-out {
  opacity: 0;
}
.resume-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: resume-spin 0.8s linear infinite;
}
@keyframes resume-spin {
  to { transform: rotate(360deg); }
}
.resume-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ─── Scoring Pad ────────────────────────────────────────────────── */
.sp-turn-bar { display:flex; align-items:center; gap:8px; padding:10px 14px; background:var(--bg-card); border-radius:10px; margin-bottom:12px; }
.sp-turn-player { display:flex; flex-direction:column; align-items:center; flex:1; padding:8px; border-radius:8px; transition:all .2s; }
.sp-turn-player.active { background:rgba(56,189,248,.12); box-shadow:0 0 12px rgba(56,189,248,.2); }
.sp-turn-name { font-size:.85rem; color:var(--text-dim); }
.sp-turn-remaining { font-size:1.6rem; font-weight:700; color:var(--text); }
.sp-turn-player.active .sp-turn-remaining { color:var(--primary); }
.sp-turn-round { font-size:.75rem; color:var(--text-muted); white-space:nowrap; }

.sp-section { background:var(--bg-card); border-radius:12px; padding:16px; margin-bottom:16px; }

.turn-indicator { text-align:center; font-size:1rem; font-weight:600; color:var(--text-dim); padding:8px; margin-bottom:12px; }
.turn-indicator.my-turn { color:var(--primary); animation:pulse-glow 2s ease-in-out infinite; }
@keyframes pulse-glow { 0%,100%{text-shadow:0 0 4px rgba(56,189,248,.3)} 50%{text-shadow:0 0 16px rgba(56,189,248,.6)} }

.sp-mode-toggle { display:flex; gap:6px; justify-content:center; margin-bottom:12px; }
.btn-xs { padding:4px 12px; font-size:.75rem; border-radius:6px; }

.sp-display { text-align:center; font-size:3rem; font-weight:700; color:var(--text); padding:12px; background:var(--bg); border-radius:10px; margin-bottom:12px; min-height:60px; line-height:1; font-family:'JetBrains Mono',monospace; }

.sp-quick-scores { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin-bottom:12px; }
.sp-quick-btn { padding:8px 14px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); font-size:.85rem; font-weight:600; cursor:pointer; transition:all .15s; }
.sp-quick-btn:hover:not(:disabled) { background:var(--primary); color:#000; border-color:var(--primary); }
.sp-quick-btn:disabled { opacity:.3; cursor:not-allowed; }
.sp-quick-btn.gold { border-color:#f59e0b; color:#f59e0b; }
.sp-quick-btn.gold:hover:not(:disabled) { background:#f59e0b; color:#000; }
.sp-quick-btn.green { border-color:#22c55e; color:#22c55e; }
.sp-quick-btn.green:hover:not(:disabled) { background:#22c55e; color:#000; }
.sp-quick-btn.blue { border-color:var(--primary); color:var(--primary); }
.sp-quick-btn.blue:hover:not(:disabled) { background:var(--primary); color:#000; }

.sp-numpad { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; max-width:260px; margin:0 auto 12px; }
.sp-num-btn { height:52px; border:1px solid var(--border); border-radius:10px; background:var(--bg); color:var(--text); font-size:1.3rem; font-weight:600; cursor:pointer; transition:all .15s; }
.sp-num-btn:hover:not(:disabled) { background:rgba(56,189,248,.15); border-color:var(--primary); }
.sp-num-btn:disabled { opacity:.3; cursor:not-allowed; }
.sp-num-btn.sp-fn { font-size:.9rem; color:var(--text-dim); }

.sp-submit-btn { width:100%; padding:14px; border:none; border-radius:10px; background:var(--primary); color:#000; font-size:1.1rem; font-weight:700; cursor:pointer; transition:all .15s; margin-bottom:8px; }
.sp-submit-btn:hover:not(:disabled) { filter:brightness(1.15); }
.sp-submit-btn:disabled { opacity:.3; cursor:not-allowed; }

.sp-undo-btn { width:100%; padding:10px; border:1px solid rgba(245,158,11,.4); border-radius:8px; background:rgba(245,158,11,.08); color:#f59e0b; font-size:.85rem; font-weight:600; cursor:pointer; transition:all .15s; }
.sp-undo-btn:hover { background:rgba(245,158,11,.15); }

/* Detail Mode */
.sp-dart-slots { display:flex; gap:8px; justify-content:center; margin-bottom:12px; }
.sp-dart-slot { flex:1; max-width:100px; padding:10px 6px; border:2px solid var(--border); border-radius:10px; text-align:center; cursor:pointer; transition:all .15s; }
.sp-dart-slot.current { border-color:var(--primary); box-shadow:0 0 8px rgba(56,189,248,.2); }
.sp-dart-slot.filled { border-color:rgba(56,189,248,.4); background:rgba(56,189,248,.05); }
.sp-dart-label { display:block; font-size:.7rem; color:var(--text-dim); }
.sp-dart-value { display:block; font-size:1.2rem; font-weight:700; color:var(--text); }
.sp-detail-total { text-align:center; font-size:1.3rem; color:var(--text); margin-bottom:12px; }

.sp-segment-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:4px; max-width:320px; margin:0 auto 10px; }
.sp-seg-btn { height:42px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); font-size:.9rem; font-weight:600; cursor:pointer; transition:all .15s; }
.sp-seg-btn:hover:not(:disabled) { background:rgba(56,189,248,.15); border-color:var(--primary); }
.sp-seg-btn:disabled { opacity:.3; cursor:not-allowed; }
.sp-seg-btn.sp-bull { grid-column:span 2; background:rgba(239,68,68,.1); border-color:rgba(239,68,68,.3); color:#ef4444; }
.sp-seg-btn.sp-bull:hover:not(:disabled) { background:#ef4444; color:#fff; }

.sp-multiplier-row { display:flex; gap:6px; justify-content:center; margin-bottom:12px; }
.sp-mult-btn { padding:8px 16px; border:1px solid var(--border); border-radius:8px; background:var(--bg); color:var(--text); font-size:.8rem; font-weight:600; cursor:pointer; transition:all .15s; }
.sp-mult-btn:hover:not(:disabled) { background:rgba(56,189,248,.15); border-color:var(--primary); }
.sp-mult-btn.sp-miss { border-color:rgba(239,68,68,.3); color:#ef4444; }
.sp-mult-btn.sp-miss:hover:not(:disabled) { background:#ef4444; color:#fff; }

.sp-auto-badge-area { text-align:center; min-height:20px; }

/* Turn History */
.turn-list { max-height:300px; overflow-y:auto; }
.turn-row { display:flex; align-items:center; gap:10px; padding:6px 10px; border-bottom:1px solid rgba(255,255,255,.04); font-size:.85rem; }
.turn-row.player-0 { border-left:3px solid var(--primary); }
.turn-row.player-1 { border-left:3px solid #ef4444; }
.turn-player { flex:1; color:var(--text-dim); }
.turn-points { font-weight:700; color:var(--text); min-width:40px; text-align:right; }
.turn-points.high { color:#22c55e; }
.turn-points.max { color:#f59e0b; text-shadow:0 0 6px rgba(245,158,11,.4); }
.turn-points.busted { color:#ef4444; text-decoration:line-through; }
.turn-remaining { color:var(--text-muted); font-size:.75rem; min-width:40px; text-align:right; }

/* Match Finished */
.match-finished-overlay { text-align:center; padding:20px; }
.match-finished-overlay h2 { font-size:2rem; font-weight:800; margin-bottom:4px; }
.mf-winner-name { font-size:1.5rem; font-weight:700; color:var(--primary); margin-bottom:20px; }
.mf-duration { color:var(--text-muted); font-size:.85rem; margin-bottom:20px; }
.mf-stats-table { width:100%; border-collapse:collapse; margin-bottom:20px; }
.mf-stats-table th { padding:6px 10px; color:var(--text-muted); font-size:.75rem; font-weight:500; text-transform:uppercase; }
.mf-stats-table td { padding:8px 10px; text-align:center; font-size:.9rem; }
.mf-stats-table td:first-child { text-align:right; color:var(--primary); font-weight:600; }
.mf-stats-table td:last-child { text-align:left; color:#ef4444; font-weight:600; }
.mf-stats-table td:nth-child(2) { color:var(--text-dim); font-size:.8rem; }
.mf-stats-table tr:nth-child(even) { background:rgba(255,255,255,.02); }
.mf-actions { display:flex; gap:10px; justify-content:center; margin-top:16px; }

/* Auto-Score Toggle */
.auto-score-toggle { display:flex; align-items:center; justify-content:center; gap:8px; padding:8px; margin-bottom:10px; }
.toggle-label { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:.85rem; color:var(--text-dim); }
.auto-submitting { color:var(--primary); font-size:.75rem; animation:blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }
