@font-face{font-family:Pixel;src:url(/fonts/pixel.woff2) format('woff2');font-display:block}
@font-face{font-family:"Press Start 2P";src:url(/fonts/pixel.woff2) format('woff2');font-display:block}
@font-face{font-family:Inter;src:url(/fonts/inter-latin.woff2) format('woff2');font-weight:400 800;font-display:swap}
:root{--ink:#120c0a;--cream:#f4e7cf;--red:#c8261b;--gold:#f2b632;--green:#5fd35a;--night:#1b1440;--dirt:#6b4a33}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;height:100%;background:var(--ink);color:var(--cream);font-family:Inter,Arial,sans-serif;overscroll-behavior:none}
body{touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
.g-app{max-width:560px;height:100vh;height:100dvh;margin:0 auto;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);background:linear-gradient(#1b1440,#3a2160 40%,#6b4a33 60%,#4a3222)}

/* site nav, game style */
.g-nav{position:relative;z-index:20;display:flex;align-items:center;gap:8px;padding:6px 10px;background:#0b0807;border-bottom:3px solid var(--red);font-family:Pixel,monospace;font-size:9px}
.g-nav a,.g-nav button{color:var(--cream);text-decoration:none;font:inherit;background:none;border:0;cursor:pointer;padding:6px 4px}
.g-home{display:flex;align-items:center;gap:6px;margin-right:auto}
.g-home img{width:34px;height:auto}
.g-book{background:var(--red)!important;padding:6px 9px!important;box-shadow:0 3px 0 #7a140c}
.g-navbtn{border:2px solid var(--cream)!important;padding:5px 8px!important}
.g-nav :is(a,button):is(:hover,:focus-visible){color:var(--gold);outline:none}
.g-links{position:absolute;right:8px;top:calc(100% + 6px);display:flex;flex-direction:column;min-width:200px;padding:8px 12px;background:#0b0807;border:3px solid var(--cream);box-shadow:0 0 0 3px #0b0807,6px 6px 0 rgba(0,0,0,.6)}
.g-links>a{padding:10px 4px 10px 18px!important;position:relative;font-size:10px}
.g-links>a:is(:hover,:focus-visible)::before{content:'▶';position:absolute;left:2px;color:var(--gold)}
.g-links-cta{display:flex;flex-direction:column;gap:8px;margin-top:8px;padding-top:10px;border-top:2px dashed #4a3f3a}
.g-links-cta a{text-align:center;padding:9px!important;background:var(--red);box-shadow:0 3px 0 #7a140c;font-size:9px}
.g-links-cta a+a{background:none;border:2px solid var(--cream);box-shadow:none}

/* HUD: the top bar from William's own game screen */
.g-hud{display:grid;grid-template-columns:auto 1fr auto auto auto;align-items:center;gap:8px;padding:7px 10px;background:linear-gradient(#0d0a26,#1b1440);border-bottom:3px solid var(--ink);box-shadow:0 3px 0 #3a2a6a;font-family:Pixel,monospace;font-size:9px;line-height:1.5;text-shadow:2px 2px 0 #000}
.g-face{width:38px;height:38px;image-rendering:pixelated;border:3px solid var(--cream);background:#2b211e;box-shadow:0 0 0 2px #000}
.g-who{display:flex;flex-direction:column;min-width:0;gap:2px}
.g-who b{font-weight:400;font-size:10px}
.g-hearts{color:#ff3b2f;font-size:12px;letter-spacing:1px;line-height:1}
.g-hearts i{font-style:normal;color:#4a2a3a}
.g-served{font-size:8px}
.g-score,.g-best{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
.g-score small,.g-best small{font-size:7px;opacity:.85}
.g-score b{font-size:13px;color:var(--gold);font-weight:400}
.g-score.bump b{animation:bump .25s steps(3)}
@keyframes bump{0%{transform:translateY(-3px) scale(1.15)}100%{transform:none}}
.g-best b{font-size:9px;font-weight:400}
.g-mute{background:none;border:0;font-size:18px;padding:4px;cursor:pointer;color:inherit}

.g-stage{position:relative;flex:1;min-height:0;display:grid;place-items:center;overflow:hidden}
.g-frame{position:relative;container-type:size;box-shadow:0 0 0 2px #000}
.g-cv{display:block;width:100%;height:100%;image-rendering:pixelated;touch-action:none}

/* overlay screens */
.g-screen{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2.6cqw;padding:4cqw;text-align:center;background:rgba(12,8,30,.72);overflow:auto;font-family:Pixel,monospace;line-height:1.6;text-shadow:.6cqw .6cqw 0 #000}
.g-screen h1,.g-screen h2{font-family:Pixel,monospace;font-weight:400;margin:0;line-height:1.15;color:var(--cream)}
.g-screen h2{font-size:6.6cqw;text-shadow:.8cqw .8cqw 0 var(--red),1.2cqw 1.2cqw 0 #000}

/* title: logo up in the sky, menu box bottom-left like William's screen */
.g-title{background:none;justify-content:space-between;padding:2cqw 3.5cqw 3cqw;overflow:hidden}
.g-top{display:flex;flex-direction:column;align-items:center;gap:1.6cqw;animation:drop .7s steps(7) both}
@keyframes drop{from{transform:translateY(-40cqw)}to{transform:none}}
.g-logo{width:30cqw;height:auto;filter:drop-shadow(1cqw 1cqw 0 #000)}
.g-title h1{font-size:6.8cqw;white-space:nowrap;color:var(--gold);text-shadow:.8cqw .8cqw 0 var(--red),1.6cqw 1.6cqw 0 #000;animation:glow 1.2s steps(2) infinite}
@keyframes glow{50%{color:#fff3a8}}
.g-sub{font-size:2.9cqw;margin:0;color:var(--cream)}
.g-bottom{align-self:stretch;display:flex;flex-direction:column;align-items:flex-start;gap:2cqw}
.g-prize{margin:0;padding:1.6cqw 2.4cqw;background:rgba(12,8,30,.85);border:.8cqw solid var(--gold);font-size:2.7cqw;text-align:center;max-width:84cqw;margin-top:1cqw;box-shadow:1cqw 1cqw 0 #000;line-height:1.7}
.g-prize b{color:var(--gold);font-weight:400}
.g-menu{display:flex;flex-direction:column;align-items:stretch;gap:0;min-width:50cqw;padding:1.6cqw 2.6cqw;background:#0b0807;border:1cqw solid var(--cream);box-shadow:0 0 0 .8cqw #0b0807,1.8cqw 1.8cqw 0 rgba(0,0,0,.6)}
.g-menu button,.g-menu a{font-family:Pixel,monospace;font-size:3.4cqw;text-align:left;color:var(--cream);background:none;border:0;padding:1.6cqw .8cqw 1.6cqw 6cqw;text-decoration:none;cursor:pointer;position:relative;text-shadow:none;line-height:1.2}
.g-menu :is(button,a):is(:hover,:focus-visible){color:var(--gold);outline:none}
.g-menu :is(button,a):is(:hover,:focus-visible)::before,.g-menu :first-child::before{content:'▶';position:absolute;left:.6cqw;top:1.7cqw;font-size:3.4cqw;color:var(--cream);animation:blink .6s steps(2) infinite}
@keyframes blink{50%{opacity:0}}
.g-menu:has(:is(button,a):is(:hover,:focus-visible)) :first-child:not(:hover,:focus-visible)::before{content:none}
.g-foot{font-size:3.2cqw;margin:0;align-self:flex-end;color:var(--cream)}
.g-how{text-align:left;max-width:88cqw;margin:0;padding:3cqw 3cqw 3cqw 8cqw;font-size:3cqw;line-height:1.75;background:rgba(12,8,30,.9);border:.8cqw solid var(--cream)}
.g-how li{margin:1.2cqw 0}
.g-how b{font-weight:400;color:var(--gold)}
.ok{color:var(--green)!important}

/* chalkboard panels (game over, high scores) */
.g-chalk{width:88cqw;min-height:96cqw;padding:13cqw 11cqw 18cqw;background:url(/game/chalk.png) center/100% 100% no-repeat;image-rendering:pixelated;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2cqw;text-shadow:none;color:#eeeae0}
.g-chalk h2{font-size:4.6cqw;white-space:nowrap;color:#fff;text-shadow:.6cqw .6cqw 0 rgba(200,38,27,.9)}
.g-board{list-style:none;margin:0;padding:0;width:100%;font-size:3.6cqw;counter-reset:r}
.g-board li{display:grid;grid-template-columns:7cqw 1fr auto;gap:2cqw;padding:.6cqw 1cqw;counter-increment:r}
.g-board li::before{content:counter(r);color:var(--gold)}
.g-board li.me{background:rgba(200,38,27,.8)}
.g-board .none{display:block;font-size:3cqw;line-height:1.7}
.g-board .none::before{content:none}
.g-yday{margin:0;font-size:2.6cqw;opacity:.9}
.g-final{font-size:10cqw;margin:0;color:var(--gold);line-height:1;text-shadow:.8cqw .8cqw 0 #000}
.g-stats{margin:0;font-size:2.6cqw;line-height:1.8}
.g-enter{display:flex;flex-direction:column;align-items:center;gap:1.6cqw}
.g-enter label{font-size:2.8cqw}
.g-enter input{width:34cqw;font-family:Pixel,monospace;font-size:7cqw;text-align:center;letter-spacing:.2em;text-transform:uppercase;padding:1.4cqw 0 1.4cqw .2em;background:#0b0807;color:var(--gold);border:.8cqw solid var(--cream);border-radius:0;caret-color:var(--gold)}
.g-enter button,.g-claim button,.g-coupon>button,.g-coupon [data-n]{font-family:Pixel,monospace;font-size:3.4cqw;padding:2.4cqw 4cqw;border:0;background:var(--red);color:#fff;box-shadow:0 1.2cqw 0 #7a140c,0 0 0 .8cqw #000;cursor:pointer;text-shadow:.4cqw .4cqw 0 #000}
.g-enter button:active,.g-claim button:active{transform:translateY(1cqw);box-shadow:0 .2cqw 0 #7a140c,0 0 0 .8cqw #000}
.g-result{font-size:2.8cqw;line-height:1.8}
.g-result b{color:var(--gold);font-weight:400}
.g-claim{position:absolute;left:50%;top:48%;transform:translate(-50%,-50%);width:78cqw;padding:3cqw;background:var(--gold);color:var(--ink);font-size:3cqw;line-height:1.8;text-shadow:none;border:.8cqw solid var(--ink);box-shadow:1.4cqw 1.4cqw 0 #000;animation:pop .5s steps(5) both}
@keyframes pop{from{transform:translate(-50%,-50%) scale(.2)}}
.g-claim button{margin-top:2cqw}
.g-coupon{background:rgba(12,8,30,.94)}
.g-ticket{background:var(--cream);color:var(--ink);padding:5cqw 4cqw 4cqw;width:84cqw;border:1cqw dashed var(--red);box-shadow:2cqw 2cqw 0 var(--red);text-shadow:none;font-family:Inter,sans-serif;animation:pop2 .5s steps(5) both}
@keyframes pop2{from{transform:scale(.2) rotate(-8deg)}}
.g-ticket h2{color:var(--ink);text-shadow:none;font-size:5.4cqw}
.g-ticket .code{font-family:Pixel,monospace;font-size:8cqw;color:var(--red);margin:2cqw 0}
.g-ticket p{margin:1.6cqw 0;font-size:3.8cqw}
.g-ticket small{display:block;font-size:3cqw;opacity:.75;margin-top:1.2cqw}
.g-toast{position:absolute;left:50%;bottom:4cqw;transform:translateX(-50%);width:max-content;max-width:90cqw;background:var(--cream);color:var(--ink);padding:2cqw 3cqw;font-family:Pixel,monospace;font-size:2.8cqw;line-height:1.6;z-index:5;box-shadow:1cqw 1cqw 0 #000}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
