:root {
  color-scheme: light;
  --ink: #181717;
  --paper: #fcf0db;
  --blue: #2247ad;
  --red: #a72c23;
  --top: 76px;
  --display: Impact, Haettenschweiler, 'Arial Narrow Bold', 'Franklin Gothic Heavy', system-ui, sans-serif;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--paper);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
a { color: inherit; }
button, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.masthead { color: var(--paper); background: var(--ink); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.mast-inner { max-width: 1640px; height: var(--top); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { flex: 0 0 auto; color: var(--paper); }
h1, .brand-name { margin: 0; font: 900 clamp(1.7rem, 3.2vw, 2.85rem)/1 var(--display); letter-spacing: .012em; text-transform: uppercase; }
.mast-link { min-height: 44px; display: flex; align-items: center; font-weight: 700; font-size: .94rem; text-underline-offset: .22em; white-space: nowrap; }
.stage {
  --hud-height: 120px;
  --pad-height: calc(60px + env(safe-area-inset-bottom));
  isolation: isolate;
  position: relative; margin-inline: auto; width: 100%; max-width: 1680px;
  height: clamp(385px, calc(100dvh - var(--top) - 13px - env(safe-area-inset-top)), 1000px);
  overflow: hidden; border-block: 4px solid var(--ink); background: #e9af91;
  user-select: none; -webkit-user-select: none;
}
#play-space { position: absolute; inset: var(--hud-height) 0 var(--pad-height); pointer-events: none; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; -webkit-touch-callout: none; }
#game:focus-visible { outline-offset: -7px; }
.game-tools { position: absolute; z-index: 4; inset: 13px max(16px, env(safe-area-inset-right)) auto auto; display: flex; gap: 7px; }
.tool, .button, .pad { min-width: 44px; min-height: 44px; color: var(--ink); border: 2px solid var(--ink); font-weight: 800; background: var(--paper); }
.tool { width: 46px; height: 46px; display: grid; place-items: center; box-shadow: 2px 3px var(--ink); border-radius: 50%; }
.tool .cross, .tool[aria-pressed=false] .waves { display: none; }
.tool[aria-pressed=false] .cross { display: block; }
.tool:hover, .button:hover { background: white; }
.scoreboard { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: grid; grid-template-columns: 1fr minmax(77px,.66fr) 1fr; width: min(390px, calc(100% - 230px)); color: var(--paper); background: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px #18171733; border-radius: 5px; overflow: hidden; font-variant-numeric: tabular-nums; }
.side-score { padding: 6px 9px; display: flex; align-items: center; justify-content: space-between; gap: 5px; font-size: .94rem; font-weight: 800; }
.blue { background: var(--blue); color: #fff7e2; }
.red { background: var(--red); color: #fff7e2; }
.side-score strong { font: 900 2.35rem/.95 var(--display); }
.team-symbol { width: 16px; height: 16px; flex: 0 0 auto; display: inline-block; }
.blue .team-symbol { border-block: 3px solid currentColor; height: 11px; transform: skewY(-21deg); }
.red .team-symbol { border: 3px solid currentColor; border-radius: 50%; }
.clock { min-width: 0; display: grid; place-items: center; align-content: center; padding: 3px 4px; }
.clock strong { font: 800 1.3rem/1.03 system-ui, sans-serif; white-space: nowrap; }
.scoreboard[data-warm=true] .clock strong { font-size: .9rem; }
.clock span { font-size: .75rem; white-space: nowrap; }
.rally-message { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 20px); color: var(--ink); text-align: center; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1px 9px; padding: 5px 13px; border: 2px solid var(--ink); background: #fcf0db; font-size: .88rem; box-shadow: 2px 3px var(--ink); pointer-events: none; }
.rally-message[data-team="0"] { background: var(--blue); color: #fff7e2; }
.rally-message[data-team="1"] { background: var(--red); color: #fff7e2; }
.rally-message[data-point] { background: #ffd168; color: var(--ink); }
.overlay { position: absolute; z-index: 3; inset: 0; pointer-events: none; display: grid; justify-items: center; align-items: start; padding: 0 12px; }
.menu { align-content: start; padding-top: clamp(32px, 8.5dvh, 105px); }
.ticket {
  pointer-events: auto; text-align: center; width: min(360px, 100%);
  border: 3px solid var(--ink); outline: 1px solid #996f58; outline-offset: -8px;
  background: var(--paper); padding: 17px 20px 11px; box-shadow: 7px 8px var(--ink);
  border-radius: 4px 4px 21px 4px;
}
.ticket-title { margin: 0; text-transform: uppercase; font: 900 clamp(3rem, 7.6dvh, 5.85rem)/.87 var(--display); letter-spacing: .012em; }
.menu .ticket-title > span { display: block; }
.ticket-dot { color: #c13c26; }
.ticket-copy { margin: 9px 0 13px; font-size: .94rem; font-weight: 700; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.button { padding: 6px 13px; box-shadow: 2px 3px var(--ink); border-radius: 3px; }
.button:active, .tool:active { transform: translate(2px,2px); box-shadow: none; }
.button.primary { background: #ffcc6a; }
.button.primary:hover { background: #ffdc92; }
.match-options { display: flex; flex-wrap: wrap; column-gap: 7px; justify-content: center; margin-top: 8px; }
.match-options label { display: flex; gap: 4px; align-items: center; font-size: .82rem; font-weight: 750; }
.match-options select { min-height: 44px; border: 0; background: transparent; padding: 3px 1px; color: var(--ink); font-weight: 800; }
.intermission { align-items: center; background: #21161455; padding-top: 36px; }
#result { align-items: start; padding-top: clamp(105px, 21dvh, 204px); }
.stage[data-mode=won] #result { background: #21161438; }
.sheet { padding: 20px 15px; }
.sheet .ticket-title { font-size: clamp(2.4rem, 6dvh, 4.7rem); margin-bottom: 12px; line-height: .96; }
.options { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.options .button { font-size: .82rem; padding: 5px 8px; }
.options .button[aria-pressed=true] { background: #e0e8f4; }
.options .button[aria-pressed=true]::before { content: '✓ '; }
#practice { pointer-events: auto; margin-left: auto; font-size: .88rem; white-space: nowrap; }
.controls { position: absolute; inset: auto max(11px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left)); z-index: 2; display: flex; justify-content: space-between; gap: 12px; pointer-events: none; }
.pad { pointer-events: auto; touch-action: none; -webkit-touch-callout: none; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 47px; min-width: min(152px, 39%); border-radius: 4px; padding: 5px 13px; box-shadow: 3px 4px var(--ink); }
.pad[data-held=true] { box-shadow: 0 2px var(--ink), inset 0 0 0 2px currentColor; }
.pad[data-ready] { background: #ffdd77; color: var(--ink); }
.pad-action { margin-left: .35em; font-size: .86em; }
.pad kbd { display: inline-block; font: 800 .85rem/1.25 system-ui, sans-serif; padding: 3px 6px; border: 1px solid currentColor; border-radius: 3px; }
.noscript { position: absolute; bottom: 8px; left: 8px; background: var(--paper); padding: 8px; }
.editorial { display: grid; grid-template-columns: minmax(175px, .7fr) minmax(0, 2fr); gap: clamp(28px, 6vw, 92px); max-width: 1030px; margin: auto; padding: clamp(36px, 7vw, 95px) 25px; line-height: 1.65; }
.editorial-rail { align-self: start; display: grid; justify-items: start; padding-top: 5px; font-weight: 750; }
.editorial-rail a { display: flex; min-height: 44px; align-items: center; text-underline-offset: .24em; }
.editorial h2 { scroll-margin-top: 20px; }
.rail-ball { width: 46px; height: 46px; background: url('/favicon.svg') center / contain no-repeat; }
.editorial h2, .document h2 { font-size: clamp(1.25rem, 3.5vw, 1.65rem); line-height: 1.18; margin: 1.6em 0 .45em; }
.editorial h2:first-child { margin-top: 0; }
.editorial p, .document p { margin: 0 0 .9rem; }
.editorial ul { padding-left: 1.15rem; }
.editorial li { margin-bottom: .6rem; }
details { border-bottom: 1px solid #ba9d84; }
summary { cursor: pointer; padding: 10px 0; font-weight: 750; }
.footer { background: var(--ink); color: var(--paper); }
.footer div { max-width: 1030px; margin: auto; display: flex; flex-wrap: wrap; gap: 20px; padding: 14px 25px; }
.footer a { min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: .2em; }
.document { max-width: 730px; min-height: 70dvh; margin: auto; padding: 40px 22px 65px; line-height: 1.65; }
.document h1 { margin-bottom: 22px; }
@media (max-width: 680px) {
  :root { --top: 62px; }
  .masthead { padding-inline: max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-left)); }
  .stage { --hud-height: 110px; }
  .logo { width: 34px; height: 34px; }
  .brand { gap: 4px; }
  .mast-link { font-size: .86rem; }
  .game-tools { top: 8px; right: 8px; gap: 4px; }
  .tool { width: 44px; height: 44px; }
  .scoreboard { top: 8px; left: 8px; transform: none; width: min(352px, calc(100% - 111px)); grid-template-columns: 1fr 61px 1fr; }
  .side-score { padding-inline: 5px; gap: 4px; font-size: .76rem; }
  .side-score strong { font-size: 1.75rem; }
  .side-score .team-symbol { width: 11px; height: 11px; border-width: 2px; }
  .clock strong { font-size: 1.04rem; }
  .clock span { font-size: .66rem; }
  .scoreboard[data-warm=true] .clock strong { font-size: .74rem; }
  .rally-message { top: 61px; padding-inline: 8px; font-size: .81rem; }
  .menu { padding-top: clamp(50px, 8.6dvh, 83px); }
  .ticket { width: min(290px, 100%); box-shadow: 5px 6px var(--ink); }
  .ticket-title { font-size: clamp(3.1rem, 8.25dvh, 4.15rem); }
  .controls:has(.pad.red[hidden]) .blue { min-width: min(176px, 58%); }
  .controls:not(:has(.pad.red[hidden])) .pad { min-width: 44%; }
  .editorial { grid-template-columns: 1fr; padding-inline: 18px; gap: 20px; }
  .editorial-rail { display: none; }
}
@media (max-height: 455px) and (orientation: landscape) {
  :root { --top: 49px; }
  .stage {
    --hud-height: 72px;
    --hud-left: max(8px, env(safe-area-inset-left));
    --hud-right: max(8px, env(safe-area-inset-right));
    --board-width: min(295px, 33%);
    height: max(290px, calc(100dvh - var(--top) - 2px - env(safe-area-inset-top)));
  }
  .logo { width: 31px; height: 31px; }
  h1, .brand-name { font-size: 1.75rem; }
  .menu { padding-top: 12px; }
  .ticket { width: min(325px, 100%); padding-block: 10px 6px; }
  .ticket-title { font-size: 2.2rem; }
  .menu .ticket-title > span { display: inline; }
  .ticket-copy { margin: 5px 0 10px; }
  .match-options { margin-top: 4px; }
  .scoreboard { top: 8px; left: var(--hud-left); transform: none; width: var(--board-width); grid-template-columns: 1fr minmax(61px, .7fr) 1fr; }
  .side-score { padding-inline: 5px; font-size: .76rem; }
  .side-score strong { font-size: 1.7rem; }
  .clock strong { font-size: 1.05rem; }
  .clock span { font-size: .66rem; }
  .scoreboard[data-warm=true] .clock strong { font-size: .73rem; }
  .game-tools { top: 8px; right: var(--hud-right); }
  .rally-message {
    top: 8px; left: calc(var(--hud-left) + var(--board-width) + 10px);
    right: calc(var(--hud-right) + 105px); width: auto; min-height: 44px;
    transform: none; font-size: .82rem;
  }
  .intermission { padding-top: 58px; }
  #result { padding-top: 57px; }
  #result .sheet .ticket-title { font-size: 2.15rem; margin-bottom: 6px; }
}
@media (max-width: 340px) {
  .mast-link { display: none; }
  .side-score .team-symbol { display: none; }
  #practice { padding-inline: 7px; }
}
@media (pointer: coarse) {
  .pad kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.language-switch {
  max-width: 1030px;
  margin: auto;
  padding: 8px 18px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 12px;
  font-size: .88rem;
}
.language-switch a { display: inline-flex; min-height: 44px; align-items: center; text-underline-offset: .22em; }
.language-switch [aria-current=page], .language-switch > span { font-weight: 750; }
.language-switch [aria-current=page] { text-decoration: none; }
.editorial h1 { margin-bottom: .65em; }
.editorial table { width: 100%; margin-block: 1rem; border-collapse: collapse; font-size: .92em; }
.editorial th, .editorial td {
  border-bottom: 1px solid #aa9380;
  padding: .5em .4em;
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.button, .match-options label, .match-options select { max-width: 100%; }
.sheet .ticket-title { overflow-wrap: anywhere; }
.clock { grid-template-columns: minmax(0, 1fr); text-align: center; }
html:not([lang=en]) .scoreboard[data-warm=true] {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1fr);
}
html:not([lang=en]) .clock span, html:not([lang=en]) .scoreboard[data-warm=true] .clock strong {
  max-width: 100%;
  white-space: normal;
  hyphens: auto;
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  html:not([lang=en]) .scoreboard { grid-template-columns: minmax(0, .9fr) minmax(0, .8fr) minmax(0, 1.3fr); }
  html:not([lang=en]) .scoreboard[data-warm=true] {
    grid-template-columns: minmax(0, .7fr) minmax(0, 1.2fr) minmax(0, 1.1fr);
  }
  html:not([lang=en]) .scoreboard[data-warm=true] .clock strong {
    font-size: clamp(.58rem, 3vw, .74rem);
  }
  html:not([lang=en]) .side-score .team-symbol { display: none; }
  html:not([lang=en]) .side-score { min-width: 0; }
  html:not([lang=en]) .team-name { font-size: .73rem; white-space: nowrap; }
  .pad { padding-inline: 8px; }
  .pad-action { margin-left: .25em; }
}
