:root {
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f6efdc; background: #0c1713; font-synthesis: none;
  --cream: #f6efdc; --amber: #f4bb55; --green: #152720; --lime: #c8e78a;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, [role=slider]:focus-visible, a:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
#stage { width: 100%; max-width: 480px; height: 100%; height: 100dvh; max-height: 1000px; margin: 0 auto; position: relative; overflow: hidden; background: #19271f; isolation: isolate; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
header { position: absolute; top: calc(6px + env(safe-area-inset-top)); left: 18px; right: 12px; display: flex; align-items: center; gap: 16px; height: 44px; z-index: 4; }
.brand { color: var(--cream); text-decoration: none; font-size: 21px; letter-spacing: -1px; font-weight: 850; margin-right: auto; }
.brand span { font-weight: 450; letter-spacing: 0; font-size: 11px; color: #c9cebb; }
#round { font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 1px; color: #d1d5c2; }
#help-open { border: 1px solid #f6efdc26; width: 40px; height: 40px; border-radius: 50%; background: transparent; color: #d6ddc6; font-size: 16px; }
#tap-mount { position: absolute; left: -14px; top: calc(var(--tap-y) - var(--tap-size)*.57); width: calc(var(--tap-x) + 14px); height: calc(var(--tap-size)*.24); border: 1px solid #bca06b80; border-radius: 0 6px 6px 0; background: linear-gradient(#4d3d24,#927644 18%,#dbc088 34%,#977944 54%,#503e25 92%); box-shadow: 0 8px 10px #0004; pointer-events: none; }
#tap-mount i { position: absolute; left: 15px; top: -11px; bottom: -11px; width: 13px; border-radius: 50%; background: linear-gradient(90deg,#382d1c,#c6a466 45%,#655030); box-shadow: 3px 0 3px #0004; }
#spout { position: absolute; left: var(--tap-x); top: var(--tap-y); width: calc(var(--tap-size)*128/140); height: var(--tap-size); transform: translate(-50%,-95.7143%); pointer-events: none; filter: drop-shadow(4px 5px 4px #0003); }
#spout svg { display: block; width: 100%; height: 100%; }
.tap-badge { fill: var(--tap-badge,#ad442e); }
.tap-lever { transform-origin: 64px 78px; transition: transform .12s; }
.pouring .tap-lever { transform: rotate(-15deg); }
#play-controls { position: absolute; bottom: calc(12px + env(safe-area-inset-bottom)); left: 16px; right: 16px; }
#coach { min-height: 28px; text-align: center; padding: 0 4px 9px; }
#cue-title { font-size: 12px; font-weight: 550; line-height: 1.4; color: #d9dec7; }
#coach[data-cue=serve] #cue-title { color: var(--lime); }
#coach[data-cue=stop] #cue-title, #coach[data-cue=spill] #cue-title, #coach[data-cue=foaming] #cue-title, #coach[data-cue=pause] #cue-title, #coach[data-cue=firststop] #cue-title { color: var(--amber); }
.control-row { display: grid; grid-template-columns: minmax(0,1fr) 82px; gap: 10px; align-items: stretch; }
#controls { min-width: 0; }
.pour-rail { position: relative; height: 66px; border: 1px solid #f4bb5550; border-radius: 40px; background: #243524e8; touch-action: none; user-select: none; cursor: ew-resize; }
.rail-guide { position: absolute; inset: 30px 28px; background: repeating-linear-gradient(90deg,#e6ce943e 0px,#e6ce943e 2px,transparent 2px,transparent 10px); }
.rail-knob { position: absolute; top: 6px; left: calc(6px + (100% - 66px)*var(--position)); width: 52px; height: 52px; border-radius: 50%; background: var(--amber); box-shadow: 0 3px 0 #916331,0 5px 14px #0004; display: grid; place-items: center; z-index: 2; }
.rail-knob svg { width: 28px; height: 28px; transform: rotate(calc(-1*var(--angle))); fill: none; stroke: #2b3724; stroke-width: 2; transition: transform .08s; }
.held .rail-knob { background: #ffe29c; box-shadow: 0 0 0 5px #f4bb5525,0 3px 0 #916331; }
.rail-word { position: absolute; top: 27px; font-size: 8px; font-weight: 750; letter-spacing: .8px; color: #c6cfb4; pointer-events: none; }
.rail-word.left { left: 22px; } .rail-word.right { right: 18px; }
.primary { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 50px; border: 0; border-radius: 10px; background: var(--amber); color: #243221; padding: 12px 16px; font-size: 15px; font-weight: 800; letter-spacing: -.2px; box-shadow: 0 3px 0 #9a7139; }
.primary span { font-size: 22px; line-height: 20px; }
.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #9a7139; }
.primary:disabled { color: #bcc8ad80; background: #293a27dd; box-shadow: inset 0 0 0 1px #e1e6cd24; }
.primary.ready { background: var(--lime); box-shadow: 0 3px 0 #81964f; }
#serve { flex-direction: column; justify-content: center; gap: 4px; padding: 8px; font-size: 13px; border-radius: 17px; }
.overlay { position: absolute; inset: 0; z-index: 8; background: var(--green); display: flex; flex-direction: column; padding: calc(24px + env(safe-area-inset-top)) 28px calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.intro-top { display: flex; justify-content: space-between; font-size: 9px; letter-spacing: 1.8px; color: #b9c3a9; padding-bottom: 18px; border-bottom: 1px solid #c6d0b82b; }
.intro-main { padding: 28px 0 24px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { font-size: 9px; letter-spacing: 1.5px; color: #c2cbb6; margin-bottom: 20px; }
h1 { font-size: clamp(60px,15vw,88px); line-height: .84; letter-spacing: -5px; font-weight: 900; }
h1 em { font-style: normal; color: var(--amber); }
.intro-copy { font-size: 14px; line-height: 1.5; color: #c2cbb6; margin-top: 24px; }
.instructions { display: flex; gap: 12px; margin-bottom: 13px; font-size: 12px; line-height: 1.4; color: #c2cbb6; }
.instructions>span { font-size: 10px; line-height: 18px; color: var(--amber); }
.instructions b { color: var(--cream); font-weight: 700; }
.intro-bottom .primary { margin-top: 22px; }
.intro-note { text-align: center; font-size: 8px; letter-spacing: 1.6px; color: #8b9c87; margin: 16px 0 8px; }
.sheet { position: absolute; z-index: 6; bottom: calc(12px + env(safe-area-inset-bottom)); left: 14px; right: 14px; border-radius: 16px; padding: 16px; background: #f4eedc; color: #203124; box-shadow: 0 12px 32px #0004; }
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#result-kicker { font-size: 8px; font-weight: 650; letter-spacing: 1px; color: #617057; }
.sheet h2 { font-size: 21px; line-height: 1.1; letter-spacing: -.6px; margin-top: 5px; }
.score { display: flex; align-items: baseline; gap: 5px; flex-shrink: 0; }
.score b { font-size: 45px; letter-spacing: -2px; line-height: 1.05; }
.score span { font-size: 10px; opacity: .55; }
#result-tip { font-size: 12px; line-height: 1.4; margin: 9px 0 12px; }
.result-actions { display: flex; align-items: center; gap: 14px; }
#details-toggle { border: 0; background: none; color: #4e6145; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; min-height: 44px; flex-shrink: 0; }
.result-actions .primary { margin-left: auto; width: auto; min-width: 155px; min-height: 44px; font-size: 13px; gap: 20px; }
#breakdown { display: grid; grid-template-columns: repeat(4,1fr); border-top: 1px solid #1f312522; padding-top: 10px; margin: 0 0 12px; }
#breakdown span { font-size: 9px; color: #586750; }
#breakdown b { display: block; font-size: 16px; margin-top: 3px; color: #263a28; }
#breakdown small { font-size: 9px; font-weight: 400; color: #68725b; }
#help { position: fixed; inset: 0; margin: auto; width: min(360px,calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 22px; border: 1px solid #f5e9c830; border-radius: 18px; background: var(--green); color: var(--cream); }
#help::backdrop { background: #08120bd6; }
.help-heading { display: flex; align-items: center; justify-content: space-between; }
.help-heading h2 { font-size: 25px; letter-spacing: -.8px; }
#help-close { height: 44px; width: 44px; border: 0; background: none; font-size: 27px; color: var(--cream); }
#help ol { padding-left: 18px; margin: 20px 0; font-size: 13px; line-height: 1.5; color: #d0d8bd; }
#help li { margin-bottom: 13px; padding-left: 5px; }
#help li::marker { color: var(--amber); }
#help b { color: var(--cream); }
.help-scoring { font-size: 12px; line-height: 1.6; border-top: 1px solid #d0d8bd30; padding-top: 15px; color: #d0d8bd; }
.keyboard-help { font-size: 11px; line-height: 1.5; margin-top: 14px; color: #a3b093; }
#mute { margin-top: 18px; border: 1px solid #f6efdc30; border-radius: 8px; min-height: 44px; width: 100%; background: none; color: var(--cream); font-size: 13px; }
#end { justify-content: flex-start; padding-top: 40px; padding-bottom: 40px; }
#end>* { flex-shrink: 0; } #end>.eyebrow { margin-top: auto; }
#end h2 { font-size: 58px; line-height: .93; font-weight: 850; letter-spacing: -3px; }
#end .score { margin-top: 24px; color: var(--amber); } #end .score b { font-size: 85px; }
#end-sub { font-size: 14px; color: #c2cbb6; }
#end-pints { margin: 26px 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; }
#end-pints div { background: #c3d8ac10; border: 1px solid #c3d8ac20; border-radius: 8px; padding: 10px 4px; text-align: center; font-size: 9px; color: #b2c1a3; }
#end-pints b { display: block; font-size: 23px; color: var(--cream); margin-top: 5px; }
#again { margin-bottom: auto; } #ab-end { width: 100%; margin-bottom: 20px; } #ab-end:empty { display: none; }
#debug { position: absolute; bottom: 0; left: 0; z-index: 20; background: #000b; color: #bfb; font-size: 10px; }
#glfail { position: absolute; inset: 0; z-index: 99; padding: 70px 25px; background: var(--green); }
#stage.title header, #stage.menu header { visibility: hidden; }
#level-picker { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
#level-picker button { display: grid; gap: 5px; padding: 10px 8px; text-align: left; border: 1px solid #f6efdc30; border-radius: 10px; background: #ffffff06; color: var(--cream); }
#level-picker button[aria-pressed=true] { background: #f4bb5517; border-color: var(--amber); }
#level-picker button:disabled { opacity: .42; }
#level-picker span { font-size: 9px; letter-spacing: 1px; color: var(--amber); }
#level-picker b { font-size: 13px; } #level-picker small { font-size: 9px; color: #c2cbb6; }
#level-note { font-size: 10px; line-height: 1.45; color: #b9c3a9; margin: 10px 0 16px; }
#title .intro-main { padding: 20px 0; }
#title h1 { font-size: clamp(52px,14vw,74px); letter-spacing: -.045em; line-height: .90; }
#title .intro-copy { margin-top: 17px; }
#unlock-card { font-size: 14px; line-height: 1.5; border-left: 2px solid var(--amber); padding: 9px 13px; margin-bottom: 22px; background: #f4bb550b; color: #d6dec7; }
#continue { margin-bottom: 12px; }
#again.secondary { color: var(--cream); background: transparent; box-shadow: none; border: 1px solid #f6efdc35; }
.text-button { color: #bfcaaf; background: none; border: 0; min-height: 44px; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
#choose-tap { margin-top: 9px; }
.segmented { display: flex; gap: 4px; padding: 4px; background: #07150d66; border: 1px solid #f6efdc25; border-radius: 12px; }
.segmented button { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: #becbb0; font-size: 13px; font-weight: 700; }
.segmented button[aria-pressed=true] { background: var(--cream); color: var(--green); box-shadow: 0 2px 5px #0002; }
#mode-picker { margin-top: 16px; flex-shrink: 0; }
#stage[data-mode=table] #round { max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }
#stage[data-mode=table] #result-kicker { display: block; overflow-wrap: anywhere; }
.table-overlay { padding: calc(28px + env(safe-area-inset-top)) 24px calc(18px + env(safe-area-inset-bottom)); }
.table-overlay>* { flex-shrink: 0; }
.table-overlay h2 { font-size: clamp(44px,12vw,62px); line-height: .94; letter-spacing: -.045em; font-weight: 850; }
.table-copy { font-size: 13px; line-height: 1.5; color: #c2cbb6; margin: 14px 0 20px; overflow-wrap: anywhere; }
#table-form fieldset { border: 0; }
#table-form legend { font-size: 11px; color: #bfcaaf; margin-bottom: 9px; }
#player-names { display: grid; gap: 12px; margin-top: 20px; }
#player-names label { display: grid; grid-template-columns: 65px minmax(0,1fr); align-items: center; gap: 12px; font-size: 11px; color: #bfcaaf; }
#player-names input { font: inherit; font-size: 16px; color: var(--cream); background: #f6efdc09; border: 1px solid #f6efdc35; border-radius: 9px; padding: 11px 12px; min-width: 0; width: 100%; }
#player-names input::placeholder { color: #8d9e83; }
#player-names input:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
#setup-back { margin-top: 10px; }
#handoff .eyebrow { margin-bottom: 12px; }
.handoff-main { flex: 1 0 auto; padding: 25px 0; }
#handoff-label { color: #bfcaaf; font-size: 14px; margin-bottom: 18px; }
#handoff-title { overflow-wrap: anywhere; color: var(--amber); }
.handoff-seal { margin-top: 28px; display: grid; place-items: center; width: 70px; height: 70px; border: 1px solid #f4bb5566; border-radius: 50%; font-size: 43px; color: var(--amber); }
#handoff-tap { margin-bottom: 12px; }
#handoff-steps { padding-left: 18px; font-size: 12px; line-height: 1.5; color: #c2cbb6; margin: 0 0 20px; }
#handoff-steps li { padding-left: 5px; margin-bottom: 7px; }
#handoff-steps li::marker { color: var(--amber); }
#table-end .eyebrow { margin-bottom: 14px; }
#table-end h2 { font-size: clamp(40px,11vw,52px); }
#table-end-sub { margin: 12px 0 18px; }
#table-glasses { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.table-pint { min-width: 0; text-align: center; border: 1px solid #c7d7b626; background: #f6efdc05; border-radius: 12px; padding: 12px 8px; }
.table-pint.winner { border-color: var(--amber); background: #f4bb550c; }
.pint-rank { display: block; font-size: 8px; letter-spacing: 1.5px; color: #a9b99b; }
.winner .pint-rank { color: var(--amber); }
.table-pint svg { display: block; height: 116px; width: 100%; margin: 5px auto 1px; }
.table-pint h3 { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; line-height: 1.25; }
.table-pint p { margin-top: 5px; }
.table-pint p b { font-size: 26px; line-height: 1; letter-spacing: -1px; }
.table-pint p span { font-size: 10px; color: #a9b99b; }
#rematch-note { font-size: 11px; margin: 16px 0 12px; }
#table-edit { margin-top: 6px; }
@media(min-width:481px) { body { background: radial-gradient(ellipse at 50% 40%,#343023,#09120f 75%); } #stage { box-shadow: 0 0 70px #0007; } }
@media(max-height:740px) { .intro-main { padding: 22px 0; } .intro-copy { margin-top: 18px; } h1 { font-size: 66px; } .instructions { margin-bottom: 9px; } .intro-bottom .primary { margin-top: 15px; } .eyebrow { margin-bottom: 14px; } }
@media(max-height:620px) { .intro-main { padding: 16px 0; } .intro-main .eyebrow,.intro-note { display: none; } h1 { font-size: 52px; } .intro-copy { font-size: 12px; margin-top: 12px; } .instructions { font-size: 11px; margin-bottom: 7px; } .overlay { padding: 16px 24px; } .intro-top { padding-bottom: 12px; } #play-controls { bottom: 8px; } .sheet { padding: 12px; } .sheet h2 { font-size: 19px; } #result-tip { font-size: 11px; } #end h2 { font-size: 45px; } #end .score b { font-size: 65px; } }
@media(max-width:350px) { .brand span { display: none; } .control-row { grid-template-columns: minmax(0,1fr) 70px; gap: 8px; } .sheet h2 { font-size: 18px; } .sheet .score b { font-size: 39px; } .result-actions .primary { min-width: 130px; } }
@media(prefers-reduced-motion:reduce) { * { transition: none !important; } }

/* Keep the invitation and start action inside a short phone screen. */
#title{padding:18px 24px 16px;gap:0}
#title .intro-top{padding-bottom:10px}
#title .intro-main{padding:16px 0;flex:0 0 auto}
#title .intro-main .eyebrow{margin-bottom:10px}
#title h1{font-size:clamp(43px,12vw,58px);line-height:.96}
#title .intro-copy{margin-top:10px;font-size:14px}
#title #level-note{margin:8px 0 12px;font-size:12px}
#title .instructions{margin-bottom:8px;font-size:12px}
#title .intro-bottom .primary{margin-top:12px;min-height:50px}
#title .intro-note{margin:12px 0 0}
@media(max-height:650px){#title .intro-main{padding:12px 0}#title h1{font-size:42px}#title .intro-main .eyebrow,#title .intro-note{display:none}#title .intro-copy{margin-top:7px}#title .instructions{margin-bottom:6px}#title #level-note{font-size:11px;margin:7px 0}#title .intro-top{font-size:9px}}
