:root {
  --black: #050505;
  --black-soft: #111111;
  --panel: rgba(14, 14, 14, 0.88);
  --panel-light: rgba(255, 255, 255, 0.95);
  --gold: #c79a2b;
  --gold-light: #f3d47a;
  --gold-dark: #7d5a12;
  --red: #b90f1c;
  --red-deep: #610912;
  --cream: #f5efe1;
  --muted: #9f9a91;
  --success: #1f8f5f;
  --warning: #d48b1d;
  --danger: #b51f2c;
  --blue: #1b5d8f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --radius: 22px;
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --sans: Inter, Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--cream);
  background:
    radial-gradient(circle at 15% 10%, rgba(199, 154, 43, 0.22), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(185, 15, 28, 0.22), transparent 25%),
    linear-gradient(135deg, #030303 0%, #171010 56%, #050505 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.07) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%);
  background-size: 18px 18px;
  z-index: -1;
}

a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.logo { max-width: 420px; width: 100%; height: auto; display: block; }
.app-shell { display: grid; grid-template-columns: 310px 1fr; min-height: 100vh; }
.sidebar {
  background: rgba(0, 0, 0, 0.72);
  border-right: 1px solid rgba(199, 154, 43, 0.34);
  padding: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .logo { margin: 0 auto 24px; }
.sidebar h1, .hero-title, .screen-title {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  font-weight: 400;
}
.sidebar h1 { font-size: 1.25rem; text-align: center; margin: 0 0 10px; }
.sidebar .subtitle { text-align: center; color: var(--muted); font-size: 0.86rem; line-height: 1.5; margin-bottom: 26px; }

.nav-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  margin: 8px 0;
  border: 1px solid rgba(199, 154, 43, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--cream);
  transition: 0.18s ease;
}
.nav-button:hover, .nav-button.active {
  background: linear-gradient(135deg, rgba(199, 154, 43, 0.25), rgba(185, 15, 28, 0.18));
  border-color: rgba(243, 212, 122, 0.72);
  transform: translateY(-1px);
}
.nav-button small { color: var(--gold-light); }

.sidebar-system-status {
  margin: 14px 0 20px;
  padding: 10px 10px 8px;
  border: 1px solid rgba(199, 154, 43, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.008));
}

.sidebar-system-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: rgba(159, 154, 145, 0.85);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.sidebar-system-status-header small {
  color: rgba(243, 212, 122, 0.82);
  font-size: 0.58rem;
}

.sidebar-system-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 10px;
}

.sidebar-system-inline-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.sidebar-system-inline-item span {
  color: rgba(159, 154, 145, 0.84);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.sidebar-system-inline-item strong {
  color: rgba(243, 212, 122, 0.94);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 700;
}

.sidebar-system-metric {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.sidebar-system-metric:last-child {
  margin-bottom: 0;
}

.sidebar-system-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 0.68rem;
}

.sidebar-system-metric-row span {
  color: rgba(245, 239, 225, 0.88);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sidebar-system-metric-row strong {
  color: rgba(243, 212, 122, 0.86);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.sidebar-system-track {
  position: relative;
  height: 3px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.055);
}

.sidebar-system-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(243, 212, 122, 0.72), rgba(199, 154, 43, 0.92));
  transition: width 0.25s ease, background 0.25s ease;
}

.sidebar-system-fill.warning {
  background: linear-gradient(90deg, rgba(241, 193, 90, 0.75), rgba(212, 139, 29, 0.92));
}

.sidebar-system-fill.danger {
  background: linear-gradient(90deg, rgba(216, 90, 99, 0.75), rgba(181, 31, 44, 0.92));
}

.main { padding: 34px; overflow-x: hidden; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.topbar h2 { margin: 0; font-size: 2rem; letter-spacing: -0.03em; }
.topbar p { margin: 6px 0 0; color: var(--muted); }

.panel {
  background: var(--panel);
  border: 1px solid rgba(199, 154, 43, 0.24);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(18px);
}
.panel.light { background: var(--panel-light); color: #18130b; }
.panel h3 { margin: 0 0 18px; font-size: 1.1rem; color: var(--gold-light); letter-spacing: 0.04em; text-transform: uppercase; }
.panel.light h3 { color: var(--gold-dark); }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea {
  border-radius: 14px;
  border: 1px solid rgba(199, 154, 43, 0.28);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  outline: none;
}
.panel.light .field input, .panel.light .field select, .panel.light .field textarea {
  background: #fff;
  color: #19140d;
  border-color: #dbc27b;
}
.field textarea { min-height: 128px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-light); box-shadow: 0 0 0 3px rgba(199, 154, 43, 0.18); }

.history-search-results {
  max-height: 240px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(199, 154, 43, 0.28);
  background: rgba(255, 255, 255, 0.04);
  margin-top: 10px;
}

.history-search-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--cream);
  text-align: left;
  padding: 10px 12px;
}

.history-search-item:hover {
  background: rgba(199, 154, 43, 0.14);
}

.history-search-item.active {
  background: linear-gradient(135deg, rgba(199, 154, 43, 0.35), rgba(185, 15, 28, 0.18));
  color: #fff7d6;
}

.history-search-item small {
  color: var(--muted);
}

.history-search-results .muted {
  margin: 0;
  padding: 10px 12px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--cream);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  font-weight: 800;
  letter-spacing: 0.02em;
  transition: 0.18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0,0,0,0.24); }
.btn.primary { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: #120e08; }
.btn.red { background: linear-gradient(135deg, var(--red-deep), var(--red)); }
.btn.green { background: linear-gradient(135deg, #0f5f42, var(--success)); }
.btn.blue { background: linear-gradient(135deg, #153d64, var(--blue)); }
.btn.ghost { background: transparent; color: var(--gold-light); border-color: rgba(199,154,43,0.45); }
.btn.small { padding: 8px 12px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.timer-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  background:
    linear-gradient(120deg, rgba(0,0,0,0.82), rgba(90,4,12,0.68)),
    radial-gradient(circle at 70% 20%, rgba(243,212,122,0.16), transparent 32%);
}
.timer-card::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(243,212,122,0.28);
}
.timer-status {
  position: relative;
  z-index: 4;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold-light);
  font-weight: 900;
  font-size: 0.85rem;
}
.timer-display {
  font-family: var(--mono);
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1;
  margin: 16px 0 22px;
  letter-spacing: 0.05em;
  text-shadow: 0 10px 38px rgba(199,154,43,0.25);
}

.timer-safety-meta {
  margin: 10px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

.timer-safety-meta strong {
  color: var(--gold-light);
  font-weight: 800;
}

.timer-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  margin: 12px 0 20px;
  position: relative;
  z-index: 2;
}

.timer-watch-shell {
  width: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -16px 0 -22px;
  position: relative;
  z-index: 1;
}

.timer-watch-shell cswc-watch-timer {
  --watch-size: clamp(188px, 21vw, 276px);
  --watch-aspect: 1 / 1;
  --watch-face-fit: contain;
  --watch-face-position: 50% 50%;
  --watch-center-x: 50%;
  --watch-center-y: 50%;
  --watch-hour-hand-length: 0.16;
  --watch-minute-hand-length: 0.225;
  --watch-second-hand-length: 0.22;
  --watch-second-tail-length: 0.034;
  --watch-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.timer-hero .timer-display {
  margin: 0;
  position: relative;
  z-index: 4;
}

.live-top-stats {
  position: relative;
  z-index: 4;
}

.flip-timer {
  display: flex;
  align-items: center;
  gap: clamp(4px, 0.7vw, 10px);
  flex-wrap: nowrap;
  width: 100%;
  user-select: none;
}

.timer-display.flip-timer {
  justify-content: flex-start;
}

.screen-timer.flip-timer {
  justify-content: center;
}

.flip-digit-box {
  width: clamp(44px, 5.5vw, 88px);
  height: clamp(72px, 8.5vw, 128px);
  border-radius: 8px;
  border: 2px solid rgba(214, 159, 69, 0.88);
  background:
    linear-gradient(180deg, rgba(78, 48, 35, 0.52), rgba(24, 14, 12, 0.95) 42%, rgba(10, 8, 8, 0.98)),
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.06), transparent 52%);
  box-shadow:
    inset 0 0 0 1px rgba(246, 205, 126, 0.24),
    0 8px 18px rgba(0, 0, 0, 0.44);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flip-digit-char {
  font-family: var(--serif);
  font-size: clamp(3.3rem, 6.6vw, 6.2rem);
  line-height: 1;
  color: #d6d3cd;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transform: translateY(-1px);
}

.flip-separator {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5.5vw, 5rem);
  line-height: 1;
  color: rgba(228, 176, 86, 0.92);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
  padding: 0 clamp(1px, 0.2vw, 3px);
}

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(199,154,43,0.18);
}
.stat span { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.stat strong { display: block; font-size: 1.8rem; margin-top: 8px; color: var(--gold-light); }

.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid rgba(199,154,43,0.18); }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.08); vertical-align: middle; }
th { background: rgba(199,154,43,0.14); color: var(--gold-light); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; }
tr:hover td { background: rgba(255,255,255,0.035); }
.panel.light th { background: #f1e3bb; color: #60450d; }
.panel.light td { border-bottom-color: #eee0bd; }
.panel.light tr:hover td { background: #fff8e6; }

.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); background: #151515; }
.name-cell { display: flex; align-items: center; gap: 12px; }
.name-cell strong { display: block; }
.name-cell small { display: block; color: var(--muted); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 5px 9px; border-radius: 999px; background: rgba(199,154,43,0.16); color: var(--gold-light); font-weight: 900; font-size: 0.78rem; }
.badge.green { background: rgba(31,143,95,0.18); color: #9df0c8; }
.badge.red { background: rgba(181,31,44,0.20); color: #ffb2b9; }
.badge.gray { background: rgba(255,255,255,0.11); color: #ddd; }

.hidden { display: none !important; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(480px, 100%); }
.login-card .logo { margin: 0 auto 28px; }
.error { color: #ffbdc4; background: rgba(181,31,44,0.2); border: 1px solid rgba(181,31,44,0.4); border-radius: 14px; padding: 10px 12px; }
.success { color: #c8ffe4; background: rgba(31,143,95,0.18); border: 1px solid rgba(31,143,95,0.45); border-radius: 14px; padding: 10px 12px; }
.muted { color: var(--muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: min(560px, 100%);
  margin: 0;
}

.quick-adjust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.public-page { min-height: 100vh; padding: 30px; }
.public-hero {
  display: grid;
  grid-template-columns: minmax(240px, 420px) 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
}
.hero-title { font-size: clamp(2rem, 5vw, 4.8rem); line-height: 0.96; margin: 0; }
.hero-sub { color: var(--muted); font-size: 1.05rem; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: rgba(181,31,44,0.26); color: #ffdce0; font-weight: 900; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
.live-dot { width: 9px; height: 9px; background: #ff2b3d; border-radius: 50%; box-shadow: 0 0 20px #ff2b3d; }

.result-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.competitor-card {
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(199,154,43,0.2);
}
.competitor-card img { width: 100%; height: 165px; object-fit: cover; background: #111; }
.competitor-card .body { padding: 14px; }
.competitor-card h4 { margin: 0 0 4px; font-size: 1.05rem; }
.competitor-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.competitor-card .time { font-family: var(--mono); font-size: 1.35rem; color: var(--gold-light); margin-top: 10px; }

.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 46vw);
  gap: 20px;
  align-items: stretch;
}

.live-left-column {
  min-width: 0;
}

.live-top-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-leaderboard-panel {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.live-leaderboard-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.live-judge-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(199, 154, 43, 0.28);
  background: rgba(255, 255, 255, 0.05);
}

.live-judge-card h4 {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  font-size: 0.8rem;
}

.live-judge-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-judge-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}

.live-judge-text strong,
.live-judge-text small {
  display: block;
}

.live-judge-text small {
  color: var(--muted);
}

.live-judge-card.muted-state {
  opacity: 0.85;
}

.live-leaderboard-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.live-leaderboard-table th,
.live-leaderboard-table td {
  padding: 10px 10px;
}

.live-leaderboard-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.live-leaderboard-table th:nth-child(1),
.live-leaderboard-table td:nth-child(1) {
  width: 86px;
}

.live-leaderboard-table th:nth-child(3),
.live-leaderboard-table td:nth-child(3) {
  width: 112px;
}

.live-leaderboard-table th:nth-child(4),
.live-leaderboard-table td:nth-child(4) {
  width: 116px;
}

.live-leaderboard-table th:nth-child(5),
.live-leaderboard-table td:nth-child(5) {
  width: 126px;
}

.live-leaderboard-table td:nth-child(4),
.live-leaderboard-table td:nth-child(5) {
  white-space: nowrap;
}

.leader-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.leader-avatar {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
}

.leader-text {
  min-width: 0;
}

.leader-text strong,
.leader-text small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leader-text small {
  color: var(--muted);
}

.card-indicator {
  display: inline-block;
  width: 11px;
  height: 15px;
  border-radius: 2px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.card-indicator.yellow {
  border-color: #f6c33a;
  background: #f6c33a;
}

.card-indicator.red {
  border-color: #d12a36;
  background: #d12a36;
}

.card-indicator.none {
  border-color: rgba(255, 255, 255, 0.45);
  background: transparent;
}

.card-dot-btn {
  width: 34px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(199, 154, 43, 0.45);
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.card-dot-btn::before {
  content: "";
  width: 12px;
  height: 16px;
  border-radius: 2px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.card-dot-btn.yellow::before {
  border-color: #f6c33a;
  background: #f6c33a;
}

.card-dot-btn.red::before {
  border-color: #d12a36;
  background: #d12a36;
}

.card-dot-btn:disabled {
  cursor: not-allowed;
  opacity: 0.92;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.name-with-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  vertical-align: middle;
}

.name-with-flag > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-flag {
  display: inline-block;
  width: 1.2em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  vertical-align: middle;
}

.country-emoji {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.screen-page { min-height: 100vh; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.screen-header { display: grid; grid-template-columns: 300px 1fr 300px; align-items: center; gap: 18px; }
.screen-title { text-align: center; font-size: clamp(2.2rem, 4.8vw, 5.4rem); line-height: 0.94; margin: 0; }
.screen-timer { font-family: var(--mono); font-size: clamp(4rem, 11vw, 12rem); text-align: center; line-height: 1; color: var(--gold-light); }
.screen-timer.flip-timer .flip-digit-box {
  width: clamp(66px, 6.8vw, 132px);
  height: clamp(104px, 10.3vw, 186px);
}

.screen-timer.flip-timer .flip-digit-char {
  font-size: clamp(4.6rem, 8.2vw, 8.8rem);
}

.screen-timer.flip-timer .flip-separator {
  font-size: clamp(4rem, 7vw, 7.2rem);
}
.screen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; flex: 1; }
.screen-list { font-size: clamp(1.2rem, 1.6vw, 2rem); }
.screen-list table { min-width: unset; }
.screen-list th, .screen-list td { padding: 16px; }

.screen-competitor-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.screen-competitor-avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
}

.screen-competitor-text {
  min-width: 0;
}

.screen-competitor-text strong,
.screen-competitor-text small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen-competitor-text small {
  color: var(--muted);
}

.inline-toggle {
  justify-content: flex-start;
}

.toggle-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(199, 154, 43, 0.24);
  background: rgba(255, 255, 255, 0.05);
  color: var(--cream);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.45;
}

.toggle-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
}

.event-config-note {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(199, 154, 43, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 239, 225, 0.84);
  line-height: 1.45;
  min-height: 48px;
}

.registration-open {
  background: rgba(31, 143, 95, 0.16);
  border: 1px solid rgba(31, 143, 95, 0.38);
}

.registration-closed {
  background: rgba(185, 15, 28, 0.16);
  border: 1px solid rgba(185, 15, 28, 0.34);
}

.screen2-page {
  gap: 26px;
}

.screen2-header {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: stretch;
}

.screen2-title-panel {
  display: grid;
  align-content: center;
  gap: 12px;
  text-align: left;
}

.screen2-title-panel .screen-title {
  text-align: left;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.screen2-kicker {
  margin: 0;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
}

.screen2-grid {
  display: grid;
  grid-template-columns: minmax(340px, 430px) 1fr;
  gap: 22px;
  flex: 1;
}

.screen2-qr-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.screen2-qr-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  border-radius: 24px;
  border: 1px solid rgba(199, 154, 43, 0.22);
  background:
    radial-gradient(circle at top, rgba(243, 212, 122, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.03);
  padding: 20px;
}

.screen2-qr-shell svg {
  width: min(100%, 320px);
  height: auto;
}

.screen2-code-block {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(199, 154, 43, 0.22);
}

.screen2-code-block span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.screen2-code-block strong {
  color: var(--gold-light);
  font-family: var(--mono);
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.screen2-roster-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.screen2-roster-head small {
  color: var(--muted);
  font-family: var(--mono);
}

.registration-card-grid {
  display: grid;
  gap: 14px;
}

.registration-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(199, 154, 43, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.registration-card-avatar {
  width: 64px;
  height: 64px;
}

.registration-card-text {
  min-width: 0;
}

.registration-card-text strong,
.registration-card-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.registration-card-text small {
  color: var(--muted);
  margin-top: 4px;
}

.registration-card-badge {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.registration-card-badge span {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
}

.registration-card-badge strong {
  color: var(--gold-light);
  font-family: var(--mono);
}

.join-page {
  padding: 28px;
}

.join-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.join-main {
  display: grid;
  gap: 22px;
}

.join-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
}

.join-side-panel {
  position: sticky;
  top: 28px;
}

.join-side-stats {
  margin-bottom: 18px;
}

.join-photo-preview {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(199, 154, 43, 0.22);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
}

.join-photo-preview img {
  width: 100%;
  height: 210px;
  object-fit: cover;
}

.join-registration-list {
  display: grid;
  gap: 12px;
}

.join-registration-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.join-registration-row:last-child {
  border-bottom: 0;
}

.join-registration-avatar {
  width: 52px;
  height: 52px;
}

.join-registration-text {
  min-width: 0;
}

.join-registration-text strong,
.join-registration-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-registration-text small {
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 22px; }
  .grid.two, .grid.three, .grid.four, .stat-grid, .public-hero, .screen-grid, .screen-header, .live-layout, .screen2-grid, .screen2-header, .join-shell, .join-hero { grid-template-columns: 1fr; }
  .live-top-stats { grid-template-columns: 1fr; }
  .live-leaderboard-panel { position: static; max-height: none; height: auto; }
  .timer-hero { grid-template-columns: 1fr; justify-items: center; }
  .timer-hero .timer-display { justify-content: center; }
  .screen-header { text-align: center; }
  .screen2-title-panel .screen-title { text-align: center; }
  .screen2-title-panel { text-align: center; }
  .join-side-panel { position: static; }
}

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .public-page, .screen-page, .join-page { padding: 18px; }
  .timer-display { font-size: 3rem; }
  .flip-timer { gap: 4px; }
  .flip-digit-box { width: 34px; height: 58px; border-width: 1.6px; }
  .flip-digit-char { font-size: 2.9rem; }
  .flip-separator { font-size: 2.4rem; }
  .screen-timer.flip-timer .flip-digit-box { width: 40px; height: 64px; }
  .screen-timer.flip-timer .flip-digit-char { font-size: 3.2rem; }
  .screen-timer.flip-timer .flip-separator { font-size: 2.7rem; }
  .panel { padding: 18px; }
  .registration-card,
  .join-registration-row { grid-template-columns: 48px minmax(0, 1fr); }
  .registration-card-badge,
  .join-registration-row .badge { grid-column: 2; justify-items: start; }
}
