:root {
  color-scheme: light;
  --bg: #ffffff; --ink: #1c2331; --muted: #596473; --line: #dfe3ea;
  --blue: #216e9d; --orange: #a94523; --rose: #96366f;
  font: 16px/1.4 Arial, Helvetica, sans-serif;
  color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; font-synthesis: none;
}
* { box-sizing: border-box; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-width: 0; min-height: 100svh; }
body { padding-inline: max(20px, env(safe-area-inset-left)); background: var(--bg); }
button, a { font: inherit; color: inherit; }
a { text-decoration: none; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; color: #596473; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.topbar, main, footer { max-width: 1500px; margin-inline: auto; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 34px; font-weight: 900; font-style: italic; letter-spacing: -.085em; }
.brand span { color: var(--blue); }
.header-controls { display: flex; gap: 12px; align-items: center; }
.toggle, .help { border: 1px solid var(--line); background: transparent; height: 44px; border-radius: 24px; }
.toggle { display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 14px; }
.toggle-dot { position: relative; width: 23px; height: 13px; border-radius: 9px; background: #e0e6ee; }
.toggle-dot::after { content: ''; position: absolute; width: 9px; height: 9px; top: 2px; left: 12px; border-radius: 50%; background: var(--blue); }
.toggle[aria-pressed="false"] .toggle-dot::after { left: 2px; background: #7b8693; }
.help { width: 44px; font-size: 18px; }
.scoreboard { position: relative; z-index: 2; width: min(340px, 100%); margin: 2px auto -58px; display: grid; grid-template-columns: 1fr 80px 1fr; align-items: center; gap: 20px; }
.team-score { display: flex; align-items: center; gap: 14px; }
.team-score span { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.team-score b { font-size: 42px; line-height: 1; font-weight: 500; }
.opponents-score { justify-content: flex-end; }
.clock { text-align: center; font: 16px ui-monospace, monospace; color: #546276; }
.stage { position: relative; height: clamp(420px, 65svh, 750px); margin-inline: -20px; overflow: hidden; }
#arena { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#arena:active { cursor: grabbing; }
#arena:focus { outline: none; }
body[data-input="keyboard"] #arena:focus-visible { outline: 2px dashed #647082; outline-offset: -4px; }
.goal-label { position: absolute; pointer-events: none; font-size: 14px; font-weight: 700; white-space: nowrap; transform: translate(-50%, -100%); background: #ffffffef; padding: 3px 6px; border-radius: 3px; }
[data-goal="0"] { color: var(--blue); }
[data-goal="1"] { color: var(--orange); }
[data-goal="2"] { color: var(--rose); }
.launch { position: absolute; z-index: 3; top: 48%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.play { pointer-events: auto; border: 1px solid #c5cedb; min-width: 140px; min-height: 56px; padding: 0 28px; border-radius: 32px; background: #f4f6ff; color: #101320; font-weight: 700; font-size: 18px; box-shadow: none; }
.play:disabled { background: #eef1f5; color: #596473; box-shadow: none; }
#result { margin-bottom: 20px; padding: 14px 30px; background: #ffffffed; border-radius: 18px; }
#result-title { display: block; font-size: 24px; white-space: nowrap; }
#result-score { display: block; margin-top: 4px; font-size: 42px; }
.paused { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%); padding: 16px 30px; border-radius: 16px; background: #ffffffed; font-size: 28px; font-weight: 700; pointer-events: none; }
.gesture-hint { position: absolute; bottom: 9%; left: 50%; transform: translateX(-50%); font-size: 14px; color: #596473; pointer-events: none; white-space: nowrap; }
.opponents { width: min(930px, 100%); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: -4px auto 0; position: relative; z-index: 2; }
.opponents article { --color: var(--blue); border-top: 2px solid var(--color); padding-top: 12px; min-width: 0; }
.opponents article:nth-child(2) { --color: var(--orange); }
.opponents article:nth-child(3) { --color: var(--rose); }
.opponent-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opponent-heading h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--color); }
.decision { color: #596473; font-size: 14px; margin-top: 7px; text-transform: capitalize; }
.decision::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--color); }
[data-thinking="true"] .decision::before { background: transparent; border: 1px solid var(--color); }
[data-error="true"] .decision { color: #a5412c; }
.measurements { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: #2f3b4f; font: 14px ui-monospace, monospace; white-space: nowrap; }
.transport { display: flex; justify-content: center; gap: 12px; margin: 24px 0 4px; }
.transport button { min-height: 44px; border: 1px solid var(--line); background: transparent; padding: 0 18px; border-radius: 24px; font-size: 14px; }
.transport button:disabled { border-color: #e8ecf2; }
#replay:not(:disabled) { border-color: #91a2bb; }
#notice { min-height: 20px; margin: 12px 0; color: #596473; text-align: center; font-size: 14px; }
#notice[data-error="true"] { color: #a5412c; }
footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e2e6ed; }
.keff { font-size: 16px; font-weight: 700; letter-spacing: -.05em; color: #647082; }
.keff span { color: #1c2331; }
footer nav { display: flex; gap: 10px; }
footer nav a { width: 44px; height: 44px; display: grid; place-items: center; color: #647082; }
footer svg { width: 17px; height: 17px; fill: currentColor; }
footer a:last-child svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
footer a:last-child .insta-dot { fill: currentColor; stroke: none; }
dialog { max-width: 440px; width: calc(100% - 32px); padding: 30px; background: #ffffff; color: var(--ink); border: 1px solid #d8dee8; border-radius: 14px; }
dialog::backdrop { background: #19233580; backdrop-filter: blur(6px); }
dialog h2 { margin: 12px 0 18px; font-size: 32px; line-height: 1.1; letter-spacing: -.035em; }
dialog p { font-size: 16px; line-height: 1.6; color: #465165; }
.close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 28px; }
@media (max-width: 700px) {
 body { padding-inline: 14px; }
 .topbar { height: 58px; }
 .brand { font-size: 30px; }
 .header-controls { gap: 8px; }
 .toggle { padding-inline: 12px; }
 .scoreboard { width: min(280px, 100%); margin-top: 6px; margin-bottom: -42px; gap: 12px; grid-template-columns: 1fr 66px 1fr; }
 .team-score { gap: 10px; }
 .team-score b { font-size: 32px; }
 .stage { margin-inline: -14px; height: clamp(350px, 55svh, 540px); }
 .goal-label { font-size: 14px; }
 .opponents { gap: 12px; margin-top: 0; }
 .opponents article { padding-top: 10px; }
 .opponent-heading { display: block; }
 .opponent-heading h2 { font-size: 14px; min-height: 36px; }
 .measurements { display: grid; gap: 3px; font-size: 14px; }
 .decision { margin-top: 7px; }
 .transport { margin-top: 20px; gap: 8px; }
 .transport button { padding-inline: 14px; }
 #notice { margin: 8px 0; }
 footer { min-height: 50px; }
 .gesture-hint { bottom: 7%; }
}
@media (hover: hover) {
 .play:not(:disabled):hover { background: #e9f3fa; }
 .transport button:not(:disabled):hover, .toggle:hover, .help:hover { border-color: #91a2bb; background: #f5f7fa; }
 a:hover { color: #1c2331; }
}
@media (prefers-reduced-motion: no-preference) {
 button { transition: background-color 120ms, border-color 120ms, transform 120ms; }
 button:not(:disabled):active { transform: scale(.97); }
}
@media (forced-colors: active) {
 button { border: 1px solid ButtonText; }
 .opponents article { border-color: CanvasText; }
}
/* Compact supporting controls; the rink remains the main interaction. */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.small { width: 16px; height: 16px; }
.text-button { border: 0; background: transparent; padding: 8px 0; min-height: 44px; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.text-link, dialog a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.icon-button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 24px; }
.transport button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.daily-play { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; }
#budget-info { color: var(--muted); }
.github-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; font-size: 14px; }
.opponent-heading { display: block; position: relative; padding-right: 0; }
.model-kind { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
button.model-kind { color: var(--blue); padding: 0; min-height: 28px; text-align: left; }
.persona { display: flex; align-items: center; gap: 8px; color: var(--color); font-size: 14px; margin: -5px 0 7px; }
.avatar { width: 42px; height: 42px; overflow: visible; }
.avatar-body { fill: #d7edfc; stroke: var(--color); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transform-origin: 32px 44px; }
[data-opponent="1"] .avatar-body { fill: #ffdecd; }
[data-opponent="2"] .avatar-body { fill: #fbdcec; }
.face { stroke: #283044; stroke-width: 2.5; }
.face .cheek { fill: #ed9fa9; stroke: none; }
.face .smile { fill: none; }
[data-thinking="true"] .avatar-body { transform: rotate(-5deg) translateY(-1px); }
[data-thinking="true"] .face { transform: translateX(2px); }
[data-error="true"] .avatar { opacity: .65; }
.install-nudge { max-width: 450px; margin: 12px auto; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 16px; font-size: 14px; }
.install-nudge img { border-radius: 10px; }
.install-nudge span { flex: 1; }
dialog { max-height: calc(100svh - 40px); overflow-y: auto; overscroll-behavior: contain; }
dialog h2 { padding-right: 16px; }
.model-config { margin: 20px 0; }
.model-config dt { font-size: 16px; font-weight: 700; margin-top: 16px; }
.model-config dd { margin: 4px 0 0; color: #465165; font-size: 15px; line-height: 1.5; }
code { font-size: .92em; overflow-wrap: anywhere; }
progress { width: 100%; height: 6px; border: 0; border-radius: 5px; overflow: hidden; accent-color: var(--blue); background: #e0e6ee; }
progress::-webkit-progress-bar { background: #e0e6ee; }
progress::-webkit-progress-value { background: var(--blue); }
progress::-moz-progress-bar { background: var(--blue); }
#signup-form label { display: block; font-size: 14px; }
#signup-email { width: 100%; margin: 8px 0 16px; padding: 12px; border: 1px solid #788391; border-radius: 10px; font: 16px/1.5 Arial, sans-serif; color: var(--ink); background: white; user-select: text; -webkit-user-select: text; caret-color: var(--blue); }
#signup-email::placeholder { color: #596473; }
input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
#signup-form .consent { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; margin-bottom: 20px; }
.consent input { accent-color: var(--blue); width: 20px; height: 20px; flex: none; margin-top: 1px; }
.privacy-note, #signup-status { font-size: 14px; }
#signup-status[data-error="true"] { color: #a5412c; }
@media (max-width:700px) {
 .opponent-heading { padding-right: 0; }
 .opponent-heading h2 { min-height: 0; }
 .model-kind { min-height: 28px; }
 .persona { gap: 5px; }
 footer { flex-wrap: wrap; gap: 8px; }
 footer nav { gap: 0; }
 .github-link { gap: 4px; }
 .github-link .icon { width: 17px; }
}
@media (prefers-reduced-motion: no-preference) {
 button { transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 150ms ease-out; }
 button:not(:disabled):active { transform: scale(.96); }
 .avatar-body, .face { transition: transform 300ms cubic-bezier(.2,0,0,1); }
 dialog { opacity: 0; transform: translateY(8px); transition: opacity 180ms ease-out, transform 220ms cubic-bezier(.2,0,0,1), display 220ms allow-discrete, overlay 220ms allow-discrete; }
 dialog[open] { opacity: 1; transform: translateY(0); }
 @starting-style { dialog[open] { opacity: 0; transform: translateY(12px); } }
 .toggle-dot::after { transition: left 200ms cubic-bezier(.2,0,0,1), background-color 150ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
 [data-thinking="true"] .avatar-body, [data-thinking="true"] .face { transform: none; }
}
/* Match notices sit on the rink, without reserving an empty page row. */
.stage #notice { position: absolute; bottom: 8px; left: 14px; right: 14px; z-index: 3; margin: 0; min-height: 0; pointer-events: none; }
.stage #notice:not(:empty) { width: fit-content; max-width: calc(100% - 28px); margin-inline: auto; padding: 4px 8px; border-radius: 8px; background: #ffffffef; }
@media (max-width: 700px), (max-width: 1000px) and (max-height: 500px) {
 html { height: 100%; min-height: 0; overscroll-behavior: none; }
 body { position: fixed; inset: 0; height: 100dvh; min-height: 0; overscroll-behavior: none; display: grid; grid-template-rows: 50px minmax(0, 1fr) 44px; padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left)); }
 .topbar, main, footer { width: 100%; min-width: 0; margin: 0; }
 .topbar { height: 50px; }
 main { position: relative; min-height: 0; display: grid; grid-template-rows: 32px minmax(0, 1fr) auto 44px 44px; row-gap: 4px; }
 .scoreboard { margin: 0 auto; width: min(280px, 100%); height: 32px; }
 .team-score b { font-size: 30px; }
 .stage { height: auto; min-height: 0; margin: 0 -12px; }
 .opponents { width: 100%; gap: 10px; margin: 0; }
 .opponents article { padding-top: 4px; }
 .persona { height: 30px; margin: 0 0 2px; }
 .persona .avatar { width: 30px; height: 30px; }
 .persona > span:not(.taunt) { display: inline; font-weight: 700; }
 .opponent-heading { display: block; padding: 0; }
 .opponent-heading h2 { min-height: 0; font-size: 14px; line-height: 1.4; }
 .model-kind { min-height: 24px; font-size: 14px; line-height: 24px; }
 button.model-kind { min-height: 24px; }
 .decision { margin-top: 1px; line-height: 20px; }
 .measurements { display: grid; gap: 0; margin-top: 2px; line-height: 18px; }
 .transport { margin: 0; gap: 6px; }
 .transport button { padding-inline: 12px; }
 .daily-play { gap: 12px; flex-wrap: nowrap; min-width: 0; }
 .daily-play .text-button { white-space: nowrap; }
 footer { min-height: 0; height: 44px; flex-wrap: nowrap; gap: 4px; }
 footer nav { gap: 0; }
 .github-link { gap: 4px; }
 .github-link .icon { width: 17px; }
 .install-nudge { position: absolute; z-index: 5; top: 40px; left: 0; right: 0; width: min(450px, 100%); margin: 0 auto; padding: 6px 8px; background: white; box-shadow: 0 6px 24px #1c233118; }
 .gesture-hint { bottom: 8px; }
 .stage:has(#notice:not(:empty)) .gesture-hint { visibility: hidden; }
 #result { margin-bottom: 8px; padding: 6px 18px; }
 #result-title { font-size: 20px; }
 #result-score { font-size: 30px; }
 dialog { max-height: calc(100dvh - 24px); scrollbar-width: none; }
 dialog::-webkit-scrollbar { display: none; }
}
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
 body { grid-template-rows: 44px minmax(0, 1fr) 44px; }
 .topbar { height: 44px; }
 main { grid-template-columns: minmax(0, 1fr) minmax(290px, 42%); grid-template-rows: minmax(0, 1fr) 44px 44px; column-gap: 12px; }
 .scoreboard { position: absolute; left: 0; top: 4px; width: calc(58% - 16px); z-index: 3; }
 .stage { grid-column: 1; grid-row: 1 / 4; margin: 0; }
 .opponents { grid-column: 2; grid-row: 1; align-self: end; }
 .transport { grid-column: 2; grid-row: 2; }
 .daily-play { grid-column: 2; grid-row: 3; }
 .install-nudge { right: auto; width: calc(58% - 16px); top: 40px; }
 .gesture-hint { bottom: 0; }
}

/* Mascots react to conceded goals without changing the layout or the AI state. */
.persona { position: relative; }
.taunt { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 4; width: max-content; max-width: min(170px, 44vw); padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px 14px 14px 3px; background: white; color: var(--ink); font-size: 14px; line-height: 1.25; box-shadow: 0 4px 14px #1c233112; pointer-events: none; }
[data-opponent="2"] .taunt { left: auto; right: 0; border-radius: 14px 14px 3px 14px; }
[data-reacting="true"] .face .eyes { transform: translateY(1px) scaleY(.85); transform-origin: center; }
[data-reacting="true"] .face .smile { transform: rotate(180deg); transform-origin: 32px 40px; }
@media (prefers-reduced-motion: no-preference) {
 [data-reacting="true"] .avatar-body { animation: pip-huff 650ms cubic-bezier(.2,.7,.2,1); }
 [data-opponent="1"][data-reacting="true"] .avatar-body { animation-name: momo-stomp; }
 [data-opponent="2"][data-reacting="true"] .avatar-body { animation-name: bibi-wobble; }
 [data-reacting="true"] .taunt { animation: taunt-in 220ms cubic-bezier(.2,.7,.2,1); }
 @keyframes pip-huff { 0%,100% { transform: rotate(0); } 20%,60% { transform: rotate(-12deg); } 40%,80% { transform: rotate(10deg); } }
 @keyframes momo-stomp { 0%,100% { transform: translateY(0) scale(1); } 25%,65% { transform: translateY(-8px) scale(.96,1.04); } 45%,85% { transform: translateY(1px) scale(1.08,.9); } }
 @keyframes bibi-wobble { 0%,100% { transform: rotate(0); } 30% { transform: rotate(16deg) translateY(-4px); } 60% { transform: rotate(-12deg); } 80% { transform: rotate(6deg); } }
 @keyframes taunt-in { from { opacity: 0; transform: translateY(5px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
}
@media (max-width: 700px) and (orientation: portrait) {
 main { isolation: isolate; grid-template-rows: minmax(0, 1fr) auto 44px 44px; }
 .scoreboard { position: absolute; top: 8px; left: 0; right: 0; width: 100%; height: auto; z-index: 0; grid-template-columns: 1fr 48px 1fr; gap: 0; align-items: start; pointer-events: none; }
 .team-score { flex-direction: column; gap: 0; justify-content: flex-start; }
 .team-score span { order: -1; font-size: 14px; }
 .team-score b { font-size: clamp(64px, min(54vw, calc(42dvh - 144px)), 220px); font-weight: 800; letter-spacing: -.065em; line-height: .95; }
 .clock { padding-top: 2px; }
 .stage { z-index: 1; }
 .launch { top: 56%; }
 .install-nudge { top: auto; bottom: 96px; }
}

@media (max-width: 700px) and (max-height: 650px) and (orientation: portrait) {
 .scoreboard { top: 0; }
 .team-score b { font-size: 64px; }
}

/* Reactions sit above play and never intercept a gesture. */
.goal-reaction { --color: var(--blue); position: absolute; z-index: 4; top: 42px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100% - 24px); padding: 8px 14px 8px 8px; border-radius: 20px; background: #ffffffdb; backdrop-filter: blur(6px); pointer-events: none; }
.goal-reaction[data-character="1"] { --color: var(--orange); }
.goal-reaction[data-character="2"] { --color: var(--rose); }
.goal-reaction[data-character="1"] .avatar-body { fill: #ffdecd; }
.goal-reaction[data-character="2"] .avatar-body { fill: #fbdcec; }
.reaction-avatar { width: 56px; height: 56px; flex: none; }
.reaction-avatar .avatar { width: 100%; height: 100%; }
.reaction-member { display: block; width: 100%; height: 100%; }
.goal-reaction[data-celebrating="true"] { gap: 12px; }
.goal-reaction[data-celebrating="true"] .reaction-avatar { display: flex; gap: 4px; width: 122px; height: auto; }
.goal-reaction[data-celebrating="true"] .reaction-member { --color: var(--blue); flex: 0 0 38px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--color); font-size: 14px; line-height: 1.2; }
.goal-reaction[data-celebrating="true"] .reaction-member[data-character="1"] { --color: var(--orange); }
.goal-reaction[data-celebrating="true"] .reaction-member[data-character="2"] { --color: var(--rose); }
.goal-reaction[data-celebrating="true"] .reaction-member .avatar { width: 38px; height: 38px; }
.goal-reaction[data-celebrating="true"] .reaction-member[data-character="0"] .avatar-body { fill: #d7edfc; }
.goal-reaction[data-celebrating="true"] .reaction-member[data-character="1"] .avatar-body { fill: #ffdecd; }
.goal-reaction[data-celebrating="true"] .reaction-member[data-character="2"] .avatar-body { fill: #fbdcec; }
.goal-reaction[data-celebrating="true"] .reaction-copy { min-width: 0; display: grid; grid-template-columns: 1fr; gap: 3px; }
.goal-reaction[data-celebrating="true"] .reaction-name { color: var(--ink); }
[data-celebrating="true"] .face .smile { transform: scale(1.15); transform-origin: 32px 40px; }
[data-celebrating="true"] .face .eyes { transform: scaleY(.75); transform-origin: 32px 31px; }
.reaction-copy { display: grid; gap: 1px; font-size: 14px; line-height: 1.35; }
.reaction-name { color: var(--color); font-weight: 700; }
.reaction-quote { color: var(--ink); }
.reaction-cheer { margin-top: 3px; color: #465165; }
@media (prefers-reduced-motion: no-preference) {
 .goal-reaction[data-character="1"] .avatar-body { animation-name: momo-stomp; }
 .goal-reaction[data-character="2"] .avatar-body { animation-name: bibi-wobble; }
 [data-celebrating="true"] .avatar-body { animation: team-cheer 650ms cubic-bezier(.2,0,0,1) 2; }
 .goal-reaction[data-celebrating="true"] .avatar-body { animation: team-cheer 650ms cubic-bezier(.2,0,0,1) 2; }
 [data-celebrating="true"] .reaction-member[data-character="1"] .avatar-body { animation-delay: 100ms; }
 [data-celebrating="true"] .reaction-member[data-character="2"] .avatar-body { animation-delay: 200ms; }
 @keyframes team-cheer { 0%,100% { transform: rotate(0) translateY(0); } 30% { transform: rotate(-6deg) translateY(-3px); } 65% { transform: rotate(6deg) translateY(-2px); } }
}
@media (prefers-reduced-motion: reduce) {
 .goal-reaction[data-celebrating="true"] .reaction-member { animation: team-appear 150ms ease-out; }
 @keyframes team-appear { from { opacity: 0; } to { opacity: 1; } }
}
/* A single-screen desktop arena with the opponents beside the table. */
@media (min-width: 701px) and (min-height: 501px), (min-width: 1001px) {
 html { height: 100%; min-height: 0; overscroll-behavior: none; }
 body { position: fixed; inset: 0; height: 100dvh; min-height: 0; display: grid; grid-template-rows: 64px minmax(0, 1fr) 44px; padding: 0 24px; }
 .topbar, main, footer { width: 100%; min-width: 0; margin: 0 auto; max-width: 1600px; }
 .topbar { height: 64px; }
 main { position: relative; min-height: 0; display: grid; grid-template-columns: clamp(170px, 18vw, 240px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 44px 44px; column-gap: 24px; }
 .scoreboard { position: absolute; z-index: 2; top: 4px; left: calc(clamp(170px, 18vw, 240px) + 24px); right: 0; width: 320px; max-width: calc(100% - 220px); height: 64px; margin: 0 auto; }
 .team-score b { font-size: 64px; }
 .stage { grid-column: 2; grid-row: 1 / 3; min-height: 0; height: auto; margin: 0; }
 .opponents { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-self: center; width: 100%; gap: clamp(12px, 3dvh, 30px); margin: 0; }
 .opponents article { padding-top: 8px; }
 .persona { height: 44px; margin: 0 0 4px; font-size: 16px; font-weight: 700; }
 .persona .avatar { width: 44px; height: 44px; }
 .opponent-heading h2 { font-size: 16px; }
 .model-kind { min-height: 24px; }
 button.model-kind { min-height: 24px; }
 .decision { margin-top: 3px; }
 .measurements { display: flex; margin-top: 4px; font-size: 14px; gap: 8px; }
 .transport { grid-column: 2; grid-row: 3; margin: 0; align-items: center; }
 .daily-play { grid-column: 1; grid-row: 2 / 4; display: flex; flex-direction: column; justify-content: center; gap: 0; flex-wrap: nowrap; }
 footer { height: 44px; min-height: 0; }
 .goal-reaction { position: fixed; top: 3px; left: 50%; max-width: 380px; padding-block: 5px; }
 .goal-reaction[data-celebrating="true"] { position: absolute; top: 74px; max-width: min(380px, calc(100% - 24px)); padding-block: 8px; }
 .reaction-avatar { width: 44px; height: 44px; }
 .reaction-copy { grid-template-columns: auto 1fr; column-gap: 6px; }
 .reaction-cheer { grid-column: 1 / -1; margin: 0; }
 .install-nudge { position: absolute; z-index: 5; top: auto; bottom: 52px; left: auto; right: 12px; width: min(400px, 55%); margin: 0; padding: 6px 8px; background: #fffffff2; }
 .gesture-hint { bottom: 5px; }
}
@media (min-width: 701px) and (min-height: 501px) and (max-height: 700px), (min-width: 1001px) and (max-height: 700px) {
 .opponents { gap: 10px; }
 .persona { height: 30px; margin-bottom: 0; }
 .persona .avatar { width: 30px; height: 30px; }
 .opponents article { padding-top: 4px; }
 .opponent-heading h2 { font-size: 14px; }
 .decision, .measurements { margin-top: 0; }
}

@media (min-width: 701px) and (min-height: 501px) and (max-height: 600px) {
 .opponents article { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 8px; }
 .persona { grid-column: 1; grid-row: 1 / 3; height: auto; flex-direction: column; gap: 0; font-size: 14px; }
 .opponent-heading, .decision { grid-column: 2; }
 .measurements { grid-column: 1 / -1; }
}

/* Keep the score visible through the rink without extra rendering passes. */
#arena { opacity: .84; }
.share-app-control { position: relative; }
#share-app { display: grid; place-items: center; }
.copied-symbol, [data-copied="true"] .share-symbol { display: none; }
[data-copied="true"] .copied-symbol { display: block; }
#share-status { position: absolute; top: calc(100% + 6px); right: 0; z-index: 6; width: max-content; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fffffff2; color: var(--ink); font-size: 14px; pointer-events: none; }
#share-app-guide label { display: block; font-size: 14px; color: var(--muted); }
#app-link { width: 100%; margin-top: 8px; padding: 12px; border: 1px solid #788391; border-radius: 10px; background: white; color: var(--ink); font: 16px/1.5 Arial, sans-serif; user-select: text; -webkit-user-select: text; }
/* A compact mode switch keeps match settings out of the playing surface. */
#play-settings { padding: 24px; border-radius: 24px; }
#play-settings fieldset { min-width: 0; padding: 0; border: 0; margin: 0; }
#play-settings legend { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #edf0f5; border-radius: 16px; padding: 4px !important; }
.mode-options label, .level-options label { position: relative; cursor: pointer; }
#play-settings input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-options span { min-height: 44px; display: grid; place-items: center; font-weight: 700; border-radius: 12px; }
.mode-options input:checked + span { background: white; box-shadow: 0 2px 6px #1c233112; }
#play-settings input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }
#mode-description { font-size: 14px; min-height: 44px; margin: 16px 0; }
.level-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.level-options span { display: grid; gap: 4px; padding: 12px; min-height: 80px; border: 1px solid var(--line); border-radius: 14px; font-size: 16px; font-weight: 700; }
.level-options small { font-size: 14px; font-weight: 400; color: var(--muted); line-height: 1.35; }
.level-options input:checked + span { border-color: var(--ink); background: #f4f6fa; box-shadow: inset 0 0 0 1px var(--ink); }
.settings-bottom { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 24px; }
.settings-bottom .play { min-width: 0; min-height: 48px; padding-inline: 22px; font-size: 16px; }
#unlimited-play { font-size: 14px; color: var(--muted); }
body[data-mode="arcade"] button.model-kind { color: var(--muted); cursor: default; }
@media (prefers-reduced-motion: no-preference) {
 .mode-options span, .level-options span { transition: background-color 180ms ease-out, border-color 180ms ease-out, box-shadow 180ms ease-out; }
}
