:root{--green:#073f32;--deep:#042a23;--gold:#e7bd56;--cream:#fff4d6;--muted:#b2c7bb;--display:Impact,"Arial Rounded MT Bold","Arial Black",sans-serif;--body:"Helvetica Neue",Arial,sans-serif}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#03271f;color:var(--cream);font-family:var(--body);overscroll-behavior:none;-webkit-text-size-adjust:100%}
body{display:flex;align-items:center;justify-content:center;height:100dvh;background:radial-gradient(ellipse at 50% 25%,#175841,#03231d 80%);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer;touch-action:manipulation}button:focus-visible{outline:3px solid #fff7d8;outline-offset:4px}button:active{transform:translateY(2px)}
#stage{position:relative;overflow:hidden;background:#093f31;touch-action:none;isolation:isolate;box-shadow:0 0 90px #00150dcc}
#game{display:block;position:absolute;inset:0;touch-action:none;cursor:grab}#game:active{cursor:grabbing}
.hud{position:absolute;inset:0;pointer-events:none}.hud.is-hidden{visibility:hidden}.hud-brand{position:absolute;top:max(8px,env(safe-area-inset-top));left:12px;right:12px;height:45px;display:flex;align-items:center;gap:9px;color:#fff4d6;text-shadow:0 2px 8px #003624;font:24px/1 var(--display);letter-spacing:.04em}.hud-brand img{width:44px;height:44px;border-radius:50%;box-shadow:0 2px 8px #00362455}.hud-brand button{margin-left:auto;pointer-events:auto;width:44px;height:42px;border:1px solid #e7bd5680;border-radius:12px;background:#063b31ed;font:bold 24px/1 Arial}
.hud-row{position:absolute;top:max(62px,calc(env(safe-area-inset-top) + 55px));left:12px;right:12px;display:grid;grid-template-columns:1fr 1fr 1.15fr;gap:0;background:linear-gradient(120deg,#0c493beF,#032f28f5);border:1.5px solid #d9b75b;border-radius:15px;box-shadow:0 5px 16px #002c2845;padding:10px 0}.hud-pill{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border-right:1px solid #d2b87040;min-width:0}.hud-pill:last-child{border:0}.hud-label{font-size:9px;font-weight:700;text-transform:uppercase;letter-spacing:.15em;color:#f4d58c}.hud-value{font:bold 28px/1 var(--body);font-variant-numeric:tabular-nums;color:#fff9e9}.bars{display:flex;gap:3px;transform:skew(-12deg);height:22px;align-items:center}.bars i{height:18px;width:7px;background:#55756a;border-radius:1px}.bars i.on{background:#b5d66b}.bars i.on:nth-child(n+5){background:#ecc96b}.bars i.on:nth-child(n+7){background:#f0805d}#hud-time.is-low{color:#ff8b77;animation:pulse .6s infinite alternate}@keyframes pulse{to{opacity:.6}}
#driving-hint{position:absolute;bottom:max(12px,env(safe-area-inset-bottom));left:0;right:0;text-align:center;margin:0;font-size:12px;font-weight:600;text-shadow:0 2px 5px #000;letter-spacing:.12em;color:#f5ebd6;opacity:.85}
.overlay{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;padding:max(16px,env(safe-area-inset-top)) 20px max(16px,env(safe-area-inset-bottom));background:#01271bbb;backdrop-filter:blur(5px)}.overlay[hidden]{display:none}
.panel{position:relative;width:min(100%,410px);text-align:center;border:1px solid #d8bb70;border-radius:25px;background:radial-gradient(ellipse at top,#165b43,#06362b 80%);padding:26px 24px;box-shadow:0 24px 80px #001f1bbc;overflow:hidden}
.start-screen{background:linear-gradient(#062e26f5,#064432f5);backdrop-filter:none;padding:12px 20px}.start-panel{display:flex;flex-direction:column;justify-content:space-evenly;height:100%;max-height:880px;padding:8px 0;border:0;background:none;box-shadow:none;overflow:visible}.start-heading{position:relative}.logo{display:block;width:90px;height:90px;margin:0 auto 10px;filter:drop-shadow(0 5px 8px #001b1880)}.eyebrow{font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:#e9d6a8;margin:12px 0 8px}.title{font:clamp(44px,12vw,66px)/.94 var(--display);letter-spacing:.015em;margin:0;color:#fff3d4;text-shadow:0 2px 0 #ba8d35,0 5px 0 #062a22}.title span{color:#f4cb69}.section-label{text-transform:uppercase;font-size:9px;letter-spacing:.24em;color:#e5d2a3;margin:18px 0 0}.car-preview{display:block;width:78%;height:clamp(120px,21vh,210px);object-fit:contain;margin:5px auto 3px;filter:drop-shadow(0 14px 10px #001d19b0)}.car-switcher{display:grid;grid-template-columns:1fr 1fr 1.22fr;padding:4px;border:1px solid #b6cbbb30;border-radius:12px;gap:3px;background:#002b2180}.car-switcher button{display:flex;align-items:center;justify-content:center;gap:5px;padding:11px 3px;font-size:11px;font-weight:bold;background:transparent;border:1px solid transparent;border-radius:8px;color:#c4d1c3;min-height:42px}.car-switcher button[aria-pressed=true]{background:#e6c16d;color:#153d30;border-color:#fff0b7;box-shadow:0 2px 6px #002d2380}.car-switcher i{display:block;width:7px;height:7px;border-radius:50%;background:var(--swatch);box-shadow:0 0 0 1px #ffffff40}.car-name{font-size:13px;font-weight:700;margin:11px 0 4px}.fair-note{font-size:10px;color:#afc4b4;margin:0}.food-rule{display:flex;align-items:center;justify-content:center;margin:14px auto 10px;gap:6px}.food-rule img{width:37px;height:43px;object-fit:contain}.food-rule img:nth-child(2){width:29px;margin-right:6px}.food-rule p{margin:0;text-align:left;font-size:13px}.food-rule strong{display:block;color:#f6d98d}.food-rule span{display:block;font-size:11px;color:#c3d0be;margin-top:4px}.small-rule{font-size:11px;color:#c4d0c1;margin:9px 0}.hint{font-size:12px;color:#dfdfc8;margin:12px 0}.btn{display:flex;align-items:center;justify-content:space-between;gap:16px;appearance:none;border:1px solid #ffedb0;background:linear-gradient(120deg,#f7dea0,#e7b64b);border-radius:12px;color:#143c2e;font-size:19px;font-weight:800;padding:17px 22px;width:100%;box-shadow:0 4px 0 #9d7830,0 8px 18px #001c1845}.btn span{font-size:24px;line-height:20px}.start-time{font-size:9px;color:#a8bdad;margin:12px 0 0}
.logo-small{width:74px;height:74px;margin:8px auto 10px}.finish-stripe{height:9px;position:absolute;top:0;left:0;right:0;background:repeating-conic-gradient(#ecdab2 0% 25%,#194a3a 0% 50%) 0/18px 18px}.brand{font-size:9px;text-transform:uppercase;letter-spacing:.2em;color:#dac695;margin:10px 0}.end-title{font:34px/1 var(--display);letter-spacing:.02em;margin:6px 0 8px}.reason{display:inline-block;margin:2px 0 20px;padding:6px 13px;border:1px solid #b8cdbc30;border-radius:100px;color:#c9d8c9;font-size:11px}.score-label{font-size:10px;text-transform:uppercase;letter-spacing:.25em;color:#e0cb94;margin:0}.score{font:clamp(74px,23vw,112px)/1 var(--display);margin:4px 0 10px;color:#f3d17b;font-variant-numeric:tabular-nums;text-shadow:0 4px 0 #7d6228}.message{font-size:21px;line-height:1.22;font-weight:750;min-height:2.44em;display:flex;align-items:center;justify-content:center;margin:6px 0 18px}.stats{font-size:11px;color:#bdcfbd;margin:0 0 8px}.end-car{font-size:10px;color:#a8bdaa;margin:0 0 18px}.share{padding-top:18px;border-top:1px solid #d5b96855;font-size:12px;font-weight:600;line-height:1.5;color:#e9d7a9;margin:0 0 18px}.text-button{border:0;background:none;color:#c9d2bb;font-size:11px;padding:16px 10px 0;min-height:40px;text-decoration:underline;text-underline-offset:3px}.pause-panel .hint{margin:16px 0 26px}
.loading{position:absolute;inset:45% 0 auto;text-align:center;color:#e9d7a9}.loading[hidden]{display:none}.boot-error{position:absolute;left:14px;right:14px;bottom:20px;z-index:20;background:#7b2525;color:white;padding:16px;border-radius:12px}.boot-error[hidden]{display:none}
@media(min-height:900px){.logo{width:110px;height:110px}.start-panel{padding:25px 0}.start-screen{padding:20px 28px}}
@media(max-height:700px){.logo{width:65px;height:65px;margin-bottom:5px}.title{font-size:46px}.eyebrow{font-size:9px;margin:7px 0}.section-label{margin-top:10px}.car-preview{height:125px}.food-rule{margin:9px 0 5px}.hint{margin:8px 0}.btn{padding:13px 18px;font-size:17px}.panel-end{padding:17px 21px}.logo-small{width:58px;height:58px}.reason{margin-bottom:10px}.score{font-size:78px}.message{font-size:18px;margin-bottom:12px}.share{padding-top:12px;margin-bottom:12px}.end-car{margin-bottom:10px}}
@media(max-height:500px){.overlay{padding:10px 18px}.start-panel{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto 1fr;gap:6px 24px;max-width:660px;align-items:center}.start-heading{grid-column:1;align-self:end}.start-heading .logo{width:42px;height:42px;float:left;margin-right:10px}.title{font-size:32px}.eyebrow{font-size:7px;margin:3px 0 5px}.garage{grid-column:1;grid-row:2;align-self:start}.car-preview{height:110px;margin:0 auto}.section-label{font-size:8px;margin:5px 0 0}.car-switcher button{font-size:9px;min-height:34px;padding:6px 2px}.car-name{font-size:10px;margin:6px 0}.fair-note{font-size:8px}.start-rules{grid-column:2;grid-row:1/3}.food-rule{flex-wrap:wrap}.food-rule img{height:48px;width:45px}.food-rule p{flex:0 0 100%;text-align:center;margin-top:7px}.small-rule{font-size:10px;line-height:1.4}.hint{font-size:11px;margin:12px 0}.start-time{font-size:8px;line-height:1.4}.btn{font-size:15px;padding:12px}.panel-end{display:grid;width:min(100%,650px);grid-template-columns:1fr 1.3fr;column-gap:24px;padding:16px 22px;align-items:center}.panel-end .logo{grid-column:1;grid-row:1/3;width:48px;height:48px;margin:0 auto}.panel-end .brand{grid-column:1;grid-row:3;font-size:8px;margin:4px 0}.panel-end .end-title{grid-column:1;grid-row:4;font-size:24px;margin:4px 0}.reason{grid-column:1;grid-row:5;margin:0 auto 4px;font-size:10px;padding:4px 8px}.score-label{grid-column:1;grid-row:6;font-size:8px}.score{grid-column:1;grid-row:7/11;font-size:72px;margin:0}.message{grid-column:2;grid-row:1/5;font-size:17px;margin:0 0 9px;min-height:0}.stats{grid-column:2;grid-row:5;font-size:9px}.end-car{grid-column:2;grid-row:6;font-size:9px;margin-bottom:7px}.share{grid-column:2;grid-row:7;font-size:10px;margin-bottom:10px;padding-top:10px}.panel-end .btn{grid-column:2;grid-row:8}.text-button{grid-column:2;grid-row:9/11;padding-top:10px;font-size:10px;min-height:30px}.hud-brand{top:6px;left:10px;height:30px;font-size:18px}.hud-brand img{width:28px;height:28px}.hud-brand button{height:30px;width:38px;font-size:19px}.hud-row{top:42px;left:15%;right:15%;padding:5px 0}.hud-pill{gap:2px}.hud-value{font-size:20px}.hud-label{font-size:7px}.bars{height:17px}.bars i{height:14px;width:6px}.hud-brand{pointer-events:none}#driving-hint{bottom:8px;font-size:9px}}
@media(prefers-reduced-motion:reduce){#hud-time.is-low{animation:none}}
/* Strong system-font fallback on devices without Impact. */
.title,.end-title,.score,.hud-brand{font-weight:900}
@media (min-height:501px) and (max-height:620px){
  .start-screen{padding:8px 18px}.start-panel{padding:0}.start-heading .logo{width:50px;height:50px}.eyebrow{font-size:8px;margin:5px 0}.title{font-size:39px}.car-preview{height:104px}.section-label{margin-top:6px}.car-switcher button{min-height:37px;padding:8px 2px;font-size:10px}.car-name{margin-top:8px}.food-rule{margin-top:6px}.food-rule img{height:33px}.food-rule p{font-size:12px}.food-rule span{font-size:10px}.small-rule{font-size:10px;margin:6px 0}.start-time{margin-top:8px;font-size:8px}.hint{font-size:11px;margin:7px 0}.btn{padding:12px 17px}
}
