:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, sans-serif;
  color: #f3f0f8;
  background: #101017;
  --surface: #181822;
  --field: #11111a;
  --line: #30303e;
  --muted: #b6b3c4;
  --accent: #c9bcff;
  --live: #b5e6b0;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, textarea, select { font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; line-height: 1.05; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; letter-spacing: -.015em; }
.muted { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.wrap { width: min(100% - 3rem, 78rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: #14141d; }
.topbar-inner { display: flex; justify-content: space-between; gap: 1rem; align-items: center; min-height: 4rem; }
.wordmark { display: flex; align-items: center; gap: .65rem; font-weight: 750; white-space: nowrap; letter-spacing: -.025em; }
.mark { display: inline-block; width: .9rem; height: .9rem; border: 2px solid var(--accent); border-radius: 3px; transform: rotate(45deg); }
.clock { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.phase, .status, .entrant {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .35rem .7rem;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 620;
}
.phase[data-phase="live"], .status[data-active="true"] { color: var(--live); border-color: #395a3a; background: #18291b; }
#countdown, #duel-budget { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .8rem; }
main { padding-block: clamp(2rem, 5vw, 3.75rem) 4rem; }
.welcome { padding-block: 2rem; max-width: 37rem; }
.welcome p { color: var(--muted); margin-top: 1rem; }
.event-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.75rem; }
.event-heading p { margin-top: .65rem; }
.entrant { flex: 0 1 auto; overflow-wrap: anywhere; }
.notice { background: #312127; border: 1px solid #7c4357; color: #ffd6e1; border-radius: .7rem; padding: .75rem 1rem; margin-bottom: 1rem; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(20rem, 1fr); gap: 1rem; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; min-width: 0; }
.panel-heading { padding: 1.15rem 1.25rem; }
.panel-heading p { margin-top: .3rem; }
.split { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; }
.table-scroll { overflow: auto; max-height: 22rem; border-radius: 0 0 .9rem .9rem; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .87rem; }
th, td { padding: .7rem .6rem; border-top: 1px solid var(--line); }
thead { color: var(--muted); white-space: nowrap; font-size: .78rem; }
thead th { position: sticky; top: 0; z-index: 1; background: #1c1c28; }
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child, td:last-child { padding-right: 1.25rem; }
tbody tr[data-you="true"] { background: #232133; }
td.name { min-width: 7rem; max-width: 16rem; font-weight: 650; overflow-wrap: anywhere; }
td.numeric { font-variant-numeric: tabular-nums; font-family: var(--mono); text-align: center; }
th:nth-child(3), th:nth-child(4), th:nth-child(5) { text-align: center; }
td.points { font-weight: 700; color: var(--accent); }
td.eligibility { min-width: 7rem; color: var(--muted); }
.defense form, .duel-body { padding: 0 1.25rem 1.25rem; }
label { display: block; margin-bottom: .45rem; font-size: .85rem; font-weight: 650; }
textarea, select { color: inherit; background: var(--field); border: 1px solid #48485b; border-radius: .55rem; }
textarea { width: 100%; resize: vertical; min-height: 4.5rem; padding: .65rem .75rem; line-height: 1.5; }
#prompt { font: .86rem/1.6 var(--mono); }
textarea::placeholder { color: #9995aa; }
select { max-width: 100%; padding: .4rem; font-size: .85rem; }
.feedback { margin: .4rem 0 .75rem; }
.feedback:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .7rem; }
.button { border: 1px solid transparent; border-radius: .55rem; padding: .55rem .8rem; font-size: .83rem; font-weight: 690; }
.primary { color: #18132b; background: var(--accent); }
.primary:hover:not(:disabled) { background: #e0d8ff; }
.secondary { background: #232330; border-color: #424255; color: #ece9f8; }
.secondary:hover:not(:disabled) { background: #2d2b40; }
.small { padding: .4rem .55rem; }
.practice { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: 1rem; color: var(--muted); font-size: .85rem; }
.practice ol { line-height: 1.55; padding-left: 1.2rem; }
.matches { margin-top: 1rem; }
.duel-info { display: flex; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; padding-block: 0 .85rem; }
.transcript { list-style: none; padding: .7rem; margin: 0 0 1rem; border: 1px solid var(--line); background: var(--field); border-radius: .65rem; max-height: 21rem; overflow: auto; }
.turn { padding: .6rem .75rem; }
.turn + .turn { border-top: 1px solid var(--line); }
.turn p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.turn strong { display: block; font-size: .78rem; color: var(--accent); margin-bottom: .25rem; }
.turn p + p { margin-top: .55rem; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 57rem) {
  .dashboard { grid-template-columns: minmax(0, 1fr); }
  .defense { grid-row: 1; }
}
@media (max-width: 36rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .event-heading { align-items: flex-start; flex-direction: column; }
  .topbar-inner { padding-block: .65rem; }
  .clock { gap: .25rem; }
  table, thead { font-size: .75rem; }
  thead { white-space: normal; }
  th, td { padding: .52rem .26rem; }
  th:first-child, td:first-child { padding-left: .55rem; }
  th:last-child, td:last-child { padding-right: .55rem; }
  td.name { min-width: 3.5rem; }
  td.eligibility { min-width: 0; }
  .eligibility .button { padding: .4rem; font-size: .73rem; }
}
