:root {
  color-scheme: dark;
  --ink: #f6f1e8;
  --muted: #a9a2b5;
  --paper: #111116;
  --panel: rgba(28, 28, 36, 0.88);
  --panel-strong: #22222c;
  --line: rgba(246, 241, 232, 0.13);
  --rose: #ff4d7d;
  --rose-dark: #9d2148;
  --teal: #42d7c8;
  --gold: #f4c95d;
  --green: #60d394;
  --blue: #79a7ff;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 77, 125, 0.18), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(66, 215, 200, 0.14), transparent 34%),
    linear-gradient(180deg, #171720 0%, #101014 60%, #0c0c10 100%);
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 28px 0 30px;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(2.75rem, 7vw, 6.8rem);
}

.subtitle {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.55;
}

.version-mark {
  display: inline-flex;
  margin: 16px 0 0;
  border: 1px solid rgba(66, 215, 200, 0.32);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(66, 215, 200, 0.1);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-logo {
  display: block;
  width: 176px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: var(--shadow);
  object-fit: cover;
}

.arena {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1.08fr) minmax(300px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.side-panel {
  display: grid;
  gap: 16px;
}

.next-panel,
.scoreboard-panel,
.status-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.next-panel,
.scoreboard-panel,
.status-panel {
  padding: 28px;
}

.next-panel strong {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 950;
  line-height: 0.95;
}

.next-panel span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.scoreboard-list {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.score-row {
  display: grid;
  gap: 8px;
}

.score-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.score-line span {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

.score-line strong {
  color: var(--gold);
  font-size: 2rem;
  font-weight: 950;
}

.score-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(246, 241, 232, 0.08);
}

.score-track span {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--rose));
}

.score-empty {
  margin: 10px 0 0;
  color: var(--muted);
}

.round-header,
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(246, 241, 232, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge[data-status="open"] {
  border-color: rgba(96, 211, 148, 0.42);
  background: rgba(96, 211, 148, 0.13);
  color: var(--green);
}

.status-badge[data-status="upcoming"] {
  border-color: rgba(121, 167, 255, 0.42);
  background: rgba(121, 167, 255, 0.13);
  color: var(--blue);
}

.status-badge[data-status="won"] {
  border-color: rgba(244, 201, 93, 0.55);
  background: rgba(244, 201, 93, 0.16);
  color: var(--gold);
}

.status-badge[data-status="closed"] {
  border-color: rgba(169, 162, 181, 0.24);
  background: rgba(169, 162, 181, 0.09);
  color: var(--muted);
}

.history-panel {
  padding: 22px;
}

.status-panel h2 {
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.countdown {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  margin-top: 18px;
  border: 1px solid rgba(244, 201, 93, 0.54);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(244, 201, 93, 0.2), rgba(255, 77, 125, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.countdown span {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.countdown strong {
  min-width: 0;
  font-size: clamp(1.65rem, 5vw, 3rem);
  font-weight: 950;
  line-height: 1;
  text-align: right;
}

.times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.times div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(246, 241, 232, 0.05);
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  font-size: 1.08rem;
  font-weight: 850;
}

.player-line,
.result {
  min-height: 28px;
  color: var(--muted);
  line-height: 1.5;
}

.pinch-button {
  width: 100%;
  min-height: 78px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--rose), #ff7a59);
  color: #fff;
  cursor: pointer;
  font-size: clamp(1.6rem, 5vw, 3rem);
  font-weight: 950;
  box-shadow: 0 12px 0 var(--rose-dark);
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.pinch-button:not(:disabled):active {
  transform: translateY(8px);
  box-shadow: 0 4px 0 var(--rose-dark);
}

.pinch-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.result {
  margin-bottom: 0;
  font-weight: 750;
}

.result[data-status="open"] {
  color: var(--green);
}

.result[data-status="upcoming"] {
  color: var(--blue);
}

.result[data-status="won"] {
  color: var(--gold);
}

.result[data-status="closed"] {
  color: var(--muted);
}

.result[data-status="message"] {
  color: #ff9ab5;
}

.icon-button {
  min-width: 42px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(246, 241, 232, 0.06);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 850;
}

.history-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  padding: 14px 14px 14px 16px;
  background: rgba(246, 241, 232, 0.05);
}

.history-list strong {
  display: block;
  margin-bottom: 4px;
}

.history-list span {
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  .hero,
  .arena,
  .times,
  .countdown {
    grid-template-columns: 1fr;
  }

  .countdown strong {
    text-align: left;
  }

  .hero-logo {
    width: 132px;
    justify-self: start;
  }

  .status-panel,
  .history-panel {
    padding: 18px;
  }
}
