:root {
  --bg: #f3efe5;
  --panel: rgba(255, 251, 244, 0.92);
  --panel-strong: #fff9ef;
  --ink: #14213d;
  --muted: #5b6475;
  --line: rgba(20, 33, 61, 0.12);
  --accent: #d95d39;
  --accent-soft: rgba(217, 93, 57, 0.14);
  --success: #1f7a53;
  --warn: #b06c00;
  --danger: #9f2a2a;
  --shadow: 0 24px 70px rgba(20, 33, 61, 0.14);
}


.commentator-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Barlow", "Segoe UI", sans-serif;
  background: #f6f8fb;
  color: #212529;
}

.commentator-shell {
  min-height: 100vh;
}

.commentator-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(13, 110, 253, 0.14);
  background: #0d6efd;
  position: sticky;
  top: 0;
  z-index: 40;
}

.commentator-title {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.commentator-class-badge,
.monitor-status-pill,
.commentator-count-pill,
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.commentator-class-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.monitor-status-pill {
  margin-left: 0;
}

.monitor-live {
  background: rgba(25, 135, 84, 0.2);
  color: #d1ffe5;
}

.monitor-paused {
  background: rgba(108, 117, 125, 0.28);
  color: #eef2f6;
}

.commentator-last-updated {
  margin-left: auto;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

.commentator-admin-link {
  text-decoration: none;
  color: #0b5ed7;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.commentator-main {
  padding: 14px;
}

.commentator-card {
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 46, 78, 0.08);
}

.commentator-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e8edf3;
  font-weight: 700;
  background: #f8fafc;
}

.commentator-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.commentator-filter-label {
  font-size: 0.8rem;
  color: #5c6a79;
}

.commentator-filter-select {
  border-radius: 8px;
  border: 1px solid #ced7e3;
  background: #fff;
  color: #1f2d3d;
  padding: 6px 8px;
  min-width: 170px;
}

.commentator-count-pill {
  background: #e9eef5;
  color: #48596d;
}

.commentator-table-wrap {
  overflow: auto;
}

.commentator-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.commentator-table thead th {
  background: #f4f7fb;
  padding: 11px 10px;
  text-align: left;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #617286;
  white-space: nowrap;
}

.commentator-table td {
  padding: 10px;
  border-top: 1px solid #e7edf4;
  vertical-align: middle;
}

.commentator-table tbody tr:nth-child(odd) {
  background: #fcfdff;
}

.commentator-table tbody tr:hover {
  background: #eef5ff;
}

.commentator-empty {
  text-align: center;
  color: #6b7785;
  padding: 20px;
}

.rank-cell,
.bib-cell {
  font-weight: 700;
}

.badge {
  margin-right: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
}

.status-finished {
  background: rgba(13, 110, 253, 0.14);
  color: #0a58ca;
}

.status-running {
  background: rgba(25, 135, 84, 0.16);
  color: #0f5132;
}

.status-waiting {
  background: #f0f2f5;
  color: #5c636a;
}

.status-dns {
  background: rgba(255, 193, 7, 0.2);
  color: #664d03;
}

.status-dnf {
  background: rgba(220, 53, 69, 0.18);
  color: #842029;
}

.status-displayed {
  background: #212529;
  color: #fff;
}

.row-dns td {
  background: rgba(255, 193, 7, 0.14);
}

.row-dnf td {
  background: rgba(220, 53, 69, 0.12);
}

.js-cmt-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.finish-gap {
  margin-top: 4px;
  font-size: 0.77rem;
  color: #6c757d;
}

.cmt-splits-list {
  display: grid;
  gap: 4px;
}

.cmt-split-row {
  display: grid;
  grid-template-columns: minmax(46px, auto) minmax(82px, auto) minmax(72px, auto) minmax(44px, auto);
  gap: 8px;
  align-items: center;
  font-size: 0.79rem;
  white-space: nowrap;
}

.split-gap-positive {
  color: #dc3545;
}

.split-gap-negative {
  color: #198754;
}

.split-gap-neutral {
  color: #6c757d;
}

.split-speed {
  color: #8a97a6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 93, 57, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(20, 33, 61, 0.12), transparent 28%),
    linear-gradient(140deg, #f7f3ea 0%, #ece5d4 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero,
.panel,
.admin-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  overflow: hidden;
  position: relative;
  padding: 28px;
  margin-bottom: 24px;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(217, 93, 57, 0.16), rgba(20, 33, 61, 0));
}

.hero-top,
.hero-stats,
.layout,
.section-heading,
.status-row,
.nav-links {
  display: flex;
  gap: 16px;
}

.hero-top,
.section-heading,
.status-row,
.nav-links {
  align-items: center;
  justify-content: space-between;
}

.hero-title {
  margin: 8px 0;
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.96;
}

.eyebrow,
.timeline-time,
.section-count,
.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
}

.hero-copy {
  max-width: 760px;
  position: relative;
  z-index: 1;
}

.hero-stats {
  flex-wrap: wrap;
  margin-top: 22px;
}

.stat-card {
  min-width: 170px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat-card strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 8px;
}

.health-pill,
.status-chip,
.nav-links a,
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
}

.health-pill,
.status-chip {
  padding: 8px 12px;
  font-size: 0.82rem;
  text-transform: capitalize;
}

.health-pill {
  background: rgba(20, 33, 61, 0.08);
}

.status-chip {
  background: rgba(20, 33, 61, 0.08);
}

.status-chip--finished {
  background: rgba(31, 122, 83, 0.14);
  color: var(--success);
}

.status-chip--on_course {
  background: rgba(217, 93, 57, 0.16);
  color: var(--accent);
}

.status-chip--queued,
.status-chip--standby {
  background: rgba(176, 108, 0, 0.14);
  color: var(--warn);
}

.status-chip--dnf,
.status-chip--dns {
  background: rgba(159, 42, 42, 0.14);
  color: var(--danger);
}

.layout {
  align-items: flex-start;
}

.layout > * {
  min-width: 0;
}

.panel {
  padding: 22px;
}

.primary-column {
  flex: 1.5;
  display: grid;
  gap: 24px;
}

.secondary-column {
  flex: 0.95;
  display: grid;
  gap: 24px;
  position: sticky;
  top: 20px;
}

.active-list,
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.active-card,
.timeline-card {
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.active-card h3,
.timeline-card h3,
.section-heading h2 {
  margin: 4px 0;
}

.active-meta {
  margin-left: auto;
  text-align: right;
}

.leaderboard-stack {
  display: grid;
  gap: 20px;
}

.leaderboard-group {
  display: grid;
  gap: 14px;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.62);
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.row-note {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 4px;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 7px;
  background: linear-gradient(180deg, var(--accent), #f1c27d);
  box-shadow: 0 0 0 6px rgba(217, 93, 57, 0.12);
}

.empty-state {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px dashed var(--line);
  color: var(--muted);
}

.nav-links {
  margin-bottom: 20px;
}

.nav-links a,
.button {
  text-decoration: none;
  border: 0;
  cursor: pointer;
  padding: 11px 16px;
  background: var(--ink);
  color: #fff9ef;
}

.nav-links a.secondary,
.button.secondary {
  background: rgba(20, 33, 61, 0.08);
  color: var(--ink);
}

.admin-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid--single {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.inline-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 122, 83, 0.14);
  color: var(--success);
  border: 1px solid rgba(31, 122, 83, 0.2);
}

.code-block {
  padding: 16px;
  border-radius: 18px;
  background: #1d2538;
  color: #f7f3ea;
  overflow: auto;
}

@media (max-width: 960px) {
  .commentator-header,
  .commentator-card-header,
  .commentator-header-tools {
    flex-wrap: wrap;
  }

  .commentator-last-updated {
    margin-left: 0;
  }

  .commentator-filter-select {
    min-width: 120px;
  }

  .commentator-table {
    min-width: 980px;
  }

  .layout,
  .hero-top,
  .section-heading,
  .status-row,
  .nav-links,
  .form-grid {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .secondary-column {
    position: static;
  }

  .active-meta {
    margin-left: 0;
    text-align: left;
  }

  th,
  td {
    white-space: normal;
  }
}
