:root {
  --ink:#111714; --paper:#f6f5f1; --card:#fff; --green:#17543a; --mute:#55605a; --line:#d9d8d2; --red:#b4331f;
  --head:"Barlow Condensed", "Bahnschrift Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--paper); color:var(--ink); font:16px/1.5 system-ui, sans-serif; }
header { background:var(--ink); color:#fff; display:flex; align-items:center; gap:12px; padding:10px 16px; }
header strong { font-family:var(--head); font-size:1.35rem; letter-spacing:.14em; flex:1; }
main { max-width:680px; margin:0 auto; padding:20px 16px 110px; }
h1, h2, .time, .num { font-family:var(--head); font-variant-numeric:tabular-nums; }
h1 { font-size:2.5rem; line-height:1.02; text-transform:uppercase; margin:0 0 6px; overflow-wrap:anywhere; }
h2 { font-size:1.35rem; text-transform:uppercase; letter-spacing:.04em; margin:28px 0 8px; }
.sub { color:var(--mute); margin:0 0 18px; }
button, input, textarea, select { font:inherit; color:inherit; }
button { min-height:48px; padding:10px 16px; border:1px solid var(--ink); border-radius:6px; background:transparent; cursor:pointer; font-weight:600; }
button.main { width:100%; background:var(--green); border-color:var(--green); color:#fff; margin-top:12px; }
button.wide { width:100%; margin-top:10px; }
button.plain { border:0; min-height:40px; padding:4px 6px; color:inherit; }
button.danger { color:var(--red); border-color:var(--red); }
button:disabled { opacity:.45; cursor:default; }
label { display:block; font-weight:600; font-size:.92rem; margin-bottom:14px; }
input, textarea, select { display:block; width:100%; margin-top:4px; padding:12px; background:#fff; border:1px solid var(--line); border-radius:6px; }
.two { display:grid; grid-template-columns:1fr 1fr; gap:0 12px; align-items:end; }
.check { display:flex; gap:10px; align-items:center; } .check input { width:22px; height:22px; margin:0; }
#message { margin:0; padding:10px 16px; background:#fff; border-bottom:1px solid var(--line); font-weight:600; text-align:center; position:sticky; top:0; z-index:3; }
#message:empty { display:none; }

.hero { position:relative; margin:-20px -16px 20px; background:var(--ink); color:#fff; }
.hero img { display:block; width:100%; height:min(62vw, 360px); object-fit:cover; }
.hero div { position:absolute; inset:auto 0 0; padding:60px 16px 16px; background:linear-gradient(transparent, #111714f0); }
.hero p { margin:0; }
.trophy { display:block; width:100%; height:auto; aspect-ratio:3 / 2; object-fit:cover; border-radius:6px 6px 0 0; }
.trophy + .podium { border-radius:0 0 6px 6px; }

.entry { display:block; width:100%; text-align:left; background:var(--card); border:1px solid var(--line); margin-bottom:10px; padding:14px 16px; }
.entry b { display:block; font-family:var(--head); font-size:1.5rem; text-transform:uppercase; overflow-wrap:anywhere; }
.entry span { color:var(--mute); font-weight:400; }

.game { display:grid; grid-template-columns:64px minmax(0,1fr) 40px; gap:0 12px; align-items:center; width:100%; text-align:left; padding:12px; background:var(--card); border:0; border-bottom:1px solid var(--line); border-radius:0; font-weight:500; }
.game:disabled { opacity:1; }
.game .time { grid-row:1 / span 3; font-size:1.55rem; font-weight:700; line-height:1.1; }
.game .time small { display:block; font:500 .8rem system-ui, sans-serif; color:var(--mute); }
.game .stage { grid-column:2 / -1; color:var(--mute); font-size:.8rem; text-transform:uppercase; letter-spacing:.06em; }
.game .team { grid-column:2; overflow-wrap:anywhere; font-size:1.05rem; }
.game .num { grid-column:3; text-align:right; font-size:1.5rem; font-weight:700; line-height:1.2; }
.game.next { border-left:5px solid var(--green); }
.game.next .team { font-size:1.35rem; font-weight:700; }

table { width:100%; border-collapse:collapse; background:var(--card); font-variant-numeric:tabular-nums; }
th, td { padding:10px 5px; border-bottom:1px solid var(--line); text-align:center; }
th { font-size:.75rem; color:var(--mute); text-transform:uppercase; }
th:nth-child(2), td:nth-child(2) { text-align:left; overflow-wrap:anywhere; }
td:last-child { font-family:var(--head); font-size:1.25rem; font-weight:700; }
td button { min-height:40px; padding:2px 12px; margin-left:8px; }
.podium { background:var(--ink); color:#fff; border-radius:6px; padding:6px 18px 14px; }
.podium ol { margin:0; padding-left:1.6em; }
.podium li { padding:3px 0; } .podium li:first-child { font:700 1.8rem var(--head); text-transform:uppercase; }

nav { position:fixed; left:0; right:0; bottom:0; display:flex; background:#fff; border-top:1px solid var(--line); padding-bottom:env(safe-area-inset-bottom); }
nav button { flex:1; border:0; border-radius:0; border-top:4px solid transparent; min-height:60px; color:var(--mute); }
nav button[aria-current] { border-top-color:var(--green); color:var(--ink); }

dialog { width:min(520px, 100%); max-width:100%; margin:auto auto 0; border:0; border-radius:12px 12px 0 0; padding:20px 16px 24px; color:var(--ink); }
dialog::backdrop { background:#111714b0; }
.stepper { display:grid; grid-template-columns:minmax(0,1fr) 56px 56px 56px; gap:8px; align-items:center; margin:12px 0; }
.stepper span { font-weight:600; overflow-wrap:anywhere; }
.stepper button { min-height:56px; padding:0; font-size:1.7rem; }
.stepper output { text-align:center; font:700 2.4rem var(--head); }

.print-only { display:none; }
@media print {
  header, nav, #message, .screen-only, td button { display:none !important; }
  .print-only { display:block; }
  main { max-width:none; padding:0; }
  .game { break-inside:avoid; }
}
