@font-face { font-family: "Lilita One"; src: url("fonts/lilita-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Rubik"; src: url("fonts/rubik-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
	--grill: #2b1d14;
	--board: #3a2618;
	--board-hi: #4a3120;
	--mustard: #ffc529;
	--ketchup: #e63b2e;
	--pickle: #5f9e35;
	--bun: #e8a85c;
	--bun-dark: #c9823a;
	--text: #fff4de;
	--muted: #d9c3a3;
	--display: "Lilita One", "Arial Black", Impact, sans-serif;
	--body: "Rubik", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; background: #6ec3f4; font-family: var(--body); color: var(--text); -webkit-user-select: none; user-select: none; }
#game canvas { display: block; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-start; justify-content: flex-start; padding: clamp(10px, 2.5vw, 34px); overflow-y: auto; }
.screen.center { align-items: flex-start; justify-content: center; background: rgba(27, 18, 12, 0.55); }
.screen.center > .board { margin: auto; }
.board { background: var(--board); border: 4px solid var(--grill); border-radius: 18px; box-shadow: 0 0 0 4px var(--mustard), 0 14px 0 4px var(--grill); padding: clamp(16px, 2.2vw, 26px); }
.menu-board { width: min(420px, 100%); margin: auto 0 auto clamp(0px, 4vw, 60px); }
.panel-board { width: min(520px, 100%); margin: auto 0 auto clamp(0px, 4vw, 60px); }
.screen.center .panel-board { margin: auto; }
.small-board { width: min(340px, 100%); text-align: center; }
.results-board { width: min(760px, 100%); }
h2 { font-family: var(--display); font-weight: 400; font-size: 2.4rem; color: var(--mustard); margin: 0 0 12px; line-height: 1; letter-spacing: 0.5px; }
.muted { color: var(--muted); }

/* ---------- the burger logo ---------- */
.logo { margin: 4px 0 12px; display: flex; flex-direction: column; align-items: stretch; font-weight: 400; }
.logo > span { display: block; }
.bun-top { background: var(--bun); border: 4px solid var(--grill); border-bottom: none; border-radius: 120px 120px 10px 10px / 70px 70px 10px 10px; padding: clamp(10px, 2.2vh, 18px) 10px 4px; text-align: center; position: relative;
	background-image: radial-gradient(ellipse 4px 7px at 18% 34%, #fff4de 98%, transparent), radial-gradient(ellipse 4px 7px at 31% 22%, #fff4de 98%, transparent), radial-gradient(ellipse 4px 7px at 70% 22%, #fff4de 98%, transparent), radial-gradient(ellipse 4px 7px at 83% 36%, #fff4de 98%, transparent), radial-gradient(ellipse 4px 7px at 50% 16%, #fff4de 98%, transparent); }
.bun-top > span, .patty > span { font-family: var(--display); font-size: clamp(1.9rem, min(6vw, 6.4vh), 3.2rem); line-height: 1; letter-spacing: 1px; color: var(--text); -webkit-text-stroke: 2px var(--grill); paint-order: stroke fill; text-shadow: 0 4px 0 var(--grill); }
.lettuce { height: 14px; margin: 0 -6px; background: radial-gradient(circle at 50% 0, var(--pickle) 9px, transparent 10px) 0 0 / 18px 14px repeat-x; position: relative; }
.lettuce::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 5px; background: var(--pickle); }
.cheese { height: 18px; margin: -6px 6px -8px; background: var(--mustard); clip-path: polygon(0 0, 100% 0, 100% 45%, 91% 45%, 87% 100%, 83% 45%, 61% 45%, 57% 80%, 53% 45%, 26% 45%, 22% 100%, 18% 45%, 0 45%); position: relative; z-index: 1; }
.patty { background: #5a3420; border: 4px solid var(--grill); border-radius: 14px; padding: clamp(4px, 1vh, 8px) 10px clamp(3px, 0.8vh, 6px); text-align: center; }
.patty > span { color: var(--mustard); }
.bun-bottom { height: clamp(14px, 2.6vh, 22px); background: var(--bun-dark); border: 4px solid var(--grill); border-top: none; border-radius: 6px 6px 24px 24px; margin: 0 8px; }
.tagline { margin: 0 0 16px; font-size: 1.02rem; line-height: 1.45; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
	.logo { animation: drop 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
	@keyframes drop { from { transform: translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- controls ---------- */
.seg { display: flex; background: var(--grill); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; border-radius: 999px; padding: 9px 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.seg button.on { background: var(--mustard); color: var(--grill); }
.mode-seg { margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.lbl { width: 60px; font-weight: 600; color: var(--muted); flex: none; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--grill); background: var(--bun); color: var(--grill); font-weight: 800; font-size: 1.2rem; line-height: 1; }
.stepper b { font-family: var(--display); font-weight: 400; font-size: 1.6rem; min-width: 1.4em; text-align: center; color: var(--text); }
input { font: inherit; background: var(--grill); color: var(--text); border: 3px solid var(--board-hi); border-radius: 10px; padding: 8px 10px; min-width: 0; }
input:focus { border-color: var(--mustard); }
#nameInput { flex: 1; }

.rider { background: var(--board-hi); border-radius: 14px; padding: 10px; margin-bottom: 10px; display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.ptag { font-family: var(--display); font-size: 1.15rem; color: var(--grill); border: 3px solid var(--grill); border-radius: 10px; padding: 3px 9px; }
.rider .seg button { padding: 7px 8px; font-size: 0.9rem; }
.swatches { grid-column: 1 / -1; display: flex; gap: 7px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--grill); padding: 0; }
.swatches button.on { box-shadow: 0 0 0 3px var(--mustard); }
.swatches button:disabled { opacity: 0.25; cursor: not-allowed; }
.vdesc { grid-column: 1 / -1; font-size: 0.86rem; color: var(--muted); }

.btn { border: 3px solid var(--grill); border-radius: 14px; background: var(--ketchup); color: var(--text); font-weight: 800; padding: 10px 16px; box-shadow: 0 5px 0 var(--grill); transition: transform 0.06s, box-shadow 0.06s; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--grill); }
.btn.big { font-family: var(--display); font-weight: 400; font-size: 1.5rem; padding: 10px 24px; letter-spacing: 0.5px; }
.btn.alt { background: var(--mustard); color: var(--grill); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--board-hi); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

.room-join { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.joinbox { display: flex; gap: 8px; }
#codeInput { width: 92px; text-transform: uppercase; font-family: var(--display); font-size: 1.2rem; letter-spacing: 2px; text-align: center; }
.roomcode { font-weight: 600; color: var(--muted); }
.roomcode b { font-family: var(--display); font-weight: 400; font-size: 2rem; color: var(--mustard); letter-spacing: 3px; margin-left: 6px; }
#roomPlayers { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
#roomPlayers li { background: var(--board-hi); border-radius: 10px; padding: 6px 10px; display: flex; align-items: center; gap: 8px; }
#roomPlayers .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--grill); flex: none; }
#roomPlayers .host { margin-left: auto; font-size: 0.8rem; color: var(--mustard); }
.netstatus { min-height: 1.2em; margin: 8px 0 0; font-size: 0.9rem; color: var(--muted); }

.howto { display: grid; gap: 6px; margin-top: 14px; font-size: 0.92rem; line-height: 1.4; color: var(--muted); }
.howto b { color: var(--text); font-weight: 600; }
.controls { margin-top: 12px; font-size: 0.85rem; line-height: 1.9; color: var(--muted); }
kbd { font-family: var(--body); font-weight: 600; font-size: 0.8rem; background: var(--grill); color: var(--text); border-radius: 6px; padding: 2px 6px; border-bottom: 2px solid #000; }

/* ---------- results ---------- */
.table-wrap { overflow-x: auto; }
#resultsTable { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
#resultsTable th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--board-hi); white-space: nowrap; }
#resultsTable td { padding: 7px 8px; border-bottom: 1px solid var(--board-hi); white-space: nowrap; }
#resultsTable td.place { font-family: var(--display); font-size: 1.3rem; color: var(--mustard); }
#resultsTable tr.me td { background: rgba(255, 197, 41, 0.14); }
#resultsTable .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--grill); margin-right: 6px; vertical-align: -1px; }
.awards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.awards span { background: var(--board-hi); border-radius: 999px; padding: 6px 12px; font-size: 0.88rem; }

/* ---------- loading / countdown ---------- */
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--grill); color: var(--mustard); font-family: var(--display); font-size: 2rem; z-index: 50; }
#countdown { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 15; font-family: var(--display); font-size: clamp(5rem, 18vw, 11rem); color: var(--mustard); -webkit-text-stroke: 6px var(--grill); paint-order: stroke fill; text-shadow: 0 10px 0 var(--grill); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
.phud { position: absolute; left: 0; right: 0; overflow: hidden; --s: 1; }
#hud.split .phud { --s: 0.78; }
#hud.split .phud + .phud { border-top: 4px solid var(--grill); }
.phud .pl { position: absolute; left: 14px; top: 10px; font-family: var(--display); color: var(--text); -webkit-text-stroke: calc(4px * var(--s)) var(--grill); paint-order: stroke fill; line-height: 1; display: flex; align-items: baseline; gap: 4px; }
.phud .pl .n { font-size: calc(4rem * var(--s)); }
.phud .pl .suf { font-size: calc(1.8rem * var(--s)); }
.phud .pl .of { font-size: calc(1.4rem * var(--s)); color: var(--muted); margin-left: 4px; }
.phud .who { position: absolute; left: 16px; top: calc(78px * var(--s)); font-weight: 800; font-size: calc(0.95rem * var(--s)); padding: 2px 8px; border-radius: 8px; color: var(--grill); border: 2px solid var(--grill); }
.phud .clock { position: absolute; right: 14px; top: 10px; text-align: right; background: rgba(43, 29, 20, 0.82); border-radius: 12px; padding: 6px 12px; }
.phud .clock b { display: block; font-family: var(--display); font-weight: 400; font-size: calc(1.6rem * var(--s)); color: var(--mustard); }
.phud .clock span { font-size: calc(0.85rem * var(--s)); color: var(--muted); }
.phud .fx { position: absolute; left: 50%; transform: translateX(-50%); top: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 60%; }
.phud .fx span { background: rgba(43, 29, 20, 0.85); border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: calc(0.85rem * var(--s)); }
.phud .next { position: absolute; left: 50%; transform: translateX(-50%); top: calc(48px * var(--s)); display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(43, 29, 20, 0.85); border-radius: 14px; padding: 6px 12px; font-weight: 600; font-size: calc(0.95rem * var(--s)); white-space: nowrap; }
.phud .next .nr { display: flex; align-items: center; gap: 10px; }
.phud .next .d { font-family: var(--display); font-weight: 400; color: var(--mustard); font-size: calc(1.2rem * var(--s)); }
.phud .next .hint { display: block; text-align: center; font-weight: 400; font-size: calc(0.8rem * var(--s)); color: var(--muted); }
.phud .meters { position: absolute; left: 14px; bottom: 14px; width: min(300px, 46%); background: rgba(43, 29, 20, 0.88); border-radius: 16px; padding: 10px 12px; display: grid; gap: 8px; }
.phud .meter { display: grid; grid-template-columns: calc(64px * var(--s)) 1fr calc(64px * var(--s)); align-items: center; gap: 8px; font-size: calc(0.9rem * var(--s)); }
.phud .meter label { color: var(--muted); font-weight: 600; }
.phud .meter b { text-align: right; font-family: var(--display); font-weight: 400; font-size: calc(1.15rem * var(--s)); }
.phud .bar { height: calc(14px * var(--s)); background: #1b120c; border-radius: 999px; overflow: hidden; }
.phud .bar i { display: block; height: 100%; width: 50%; border-radius: 999px; }
.phud .meter.fuel .bar i { background: var(--pickle); }
.phud .meter.weight .bar i { background: linear-gradient(90deg, var(--bun), var(--ketchup)); }
.phud .pen { font-size: calc(0.8rem * var(--s)); color: var(--muted); }
.phud .speedo { position: absolute; right: 16px; bottom: 12px; text-align: right; font-family: var(--display); line-height: 0.9; color: var(--text); -webkit-text-stroke: calc(4px * var(--s)) var(--grill); paint-order: stroke fill; }
.phud .speedo b { font-weight: 400; font-size: calc(3.6rem * var(--s)); }
.phud .speedo span { display: block; font-size: calc(1.1rem * var(--s)); }
.phud .banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; font-family: var(--display); color: var(--mustard); -webkit-text-stroke: calc(5px * var(--s)) var(--grill); paint-order: stroke fill; font-size: calc(3rem * var(--s)); line-height: 1.05; white-space: nowrap; }
.phud .banner small { display: block; font-size: 0.42em; color: var(--text); -webkit-text-stroke: calc(3px * var(--s)) var(--grill); }
.phud.lowfuel .meter.fuel .bar i { background: var(--ketchup); }
@media (prefers-reduced-motion: no-preference) {
	.phud.lowfuel .meter.fuel { animation: blink 0.8s steps(2) infinite; }
	@keyframes blink { 50% { opacity: 0.45; } }
}

.menu { position: absolute; left: 50%; bottom: calc(14px * var(--s)); transform: translateX(-50%); width: min(620px, 94%); background: var(--board); border: 4px solid var(--grill); border-radius: 16px; box-shadow: 0 0 0 3px var(--mustard); padding: 10px; }
.menu .mh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.menu .mh .ic { font-size: calc(2.2rem * var(--s)); line-height: 1; }
.menu .mh .nm { font-family: var(--display); font-size: calc(1.5rem * var(--s)); color: var(--mustard); line-height: 1; }
.menu .mh .bl { font-size: calc(0.85rem * var(--s)); color: var(--muted); }
.menu .items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu .it { background: var(--board-hi); border: 3px solid transparent; border-radius: 12px; padding: 8px; position: relative; }
.menu .it.sel { border-color: var(--mustard); background: #5a3a24; }
.menu .it .in { font-weight: 800; font-size: calc(0.95rem * var(--s)); margin-bottom: 4px; padding-right: 18px; }
.menu .it .st { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: calc(0.82rem * var(--s)); }
.menu .it .st .f { color: #9fdc6a; font-weight: 600; }
.menu .it .st .w { color: #ff9a8a; font-weight: 600; }
.menu .it .st .t { color: var(--muted); }
.menu .it .ef { margin-top: 4px; font-size: calc(0.78rem * var(--s)); color: var(--mustard); }
.menu .it kbd { position: absolute; right: 6px; top: 6px; }
.menu .hint { margin-top: 8px; font-size: calc(0.8rem * var(--s)); color: var(--muted); text-align: center; }
.menu .full { margin-top: 6px; font-size: calc(0.8rem * var(--s)); color: #ff9a8a; text-align: center; }
.menu .prog { margin-top: 8px; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: calc(0.9rem * var(--s)); }
.menu .prog .bar { flex: 1; height: 12px; background: #1b120c; border-radius: 999px; overflow: hidden; }
.menu .prog .bar i { display: block; height: 100%; background: var(--mustard); width: 0; }

#minimap { position: fixed; right: 12px; top: 50%; transform: translateY(-50%); z-index: 11; pointer-events: none; background: rgba(43, 29, 20, 0.7); border-radius: 14px; }

@media (max-width: 640px) {
	.phud { --s: 0.7; }
	.menu .items { grid-template-columns: 1fr; }
	#minimap { display: none; }
}

/* ---------- audio toggles ---------- */
.audio-row { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 4px; }
.audio-row.center { justify-content: center; }
.chipbtn { border: 2px solid var(--board-hi); background: var(--grill); color: var(--text); border-radius: 999px; padding: 5px 11px; font-size: 0.82rem; font-weight: 600; }
.chipbtn.off { color: var(--muted); opacity: 0.75; }
.btn.small { padding: 6px 12px; font-size: 0.85rem; box-shadow: 0 3px 0 var(--grill); }
.room-event { justify-content: space-between; flex-wrap: wrap; }

/* ---------- course map screen ---------- */
.event-board { width: min(1040px, 100%); }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.ev-head h2 { margin: 0; }
.ev-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.map-wrap { border: 4px solid var(--grill); border-radius: 16px; overflow: hidden; background: #2a8fb8; }
.map { display: block; width: 100%; height: auto; }
.map .pin { cursor: pointer; }
.map .pin:hover circle:first-child { fill: #ffe08a; }
.map .plabel { font-family: var(--display); font-size: 15px; fill: #fff4de; stroke: #2b1d14; stroke-width: 4px; paint-order: stroke fill; }
.map .pin.on .plabel { fill: #ffc529; }
.ev-side { display: grid; gap: 12px; }
.cup-list { display: grid; gap: 8px; }
.cup { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--board-hi); border: 3px solid transparent; border-radius: 14px; padding: 8px 10px; color: var(--text); }
.cup.on { border-color: var(--mustard); background: #5a3a24; }
.cup .ci { font-size: 1.8rem; }
.cup b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--mustard); }
.cup small { color: var(--muted); font-size: 0.8rem; }
.course-card { background: var(--board-hi); border-radius: 14px; padding: 12px; }
.course-card h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: var(--mustard); line-height: 1.05; }
.course-card p { margin: 6px 0 10px; font-size: 0.92rem; line-height: 1.4; }
.course-card canvas { width: 100%; height: auto; border-radius: 10px; display: block; border: 3px solid var(--grill); }
.chip { display: inline-block; background: var(--grill); border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.88rem; color: var(--muted); }
.stats b { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--text); }
.cup-courses { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.cup-courses li { display: flex; gap: 10px; align-items: center; }
.cup-courses .num { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--ketchup); border: 3px solid var(--grill); display: grid; place-items: center; font-family: var(--display); color: var(--text); }
.cup-courses b { display: block; }
.cup-courses small { color: var(--muted); font-size: 0.8rem; }
@media (max-width: 820px) {
	.ev-body { grid-template-columns: 1fr; }
}

/* ---------- results extras ---------- */
#resultsSub { margin: -4px 0 10px; }
#resultsTable td.pts, .mini td.pts { font-family: var(--display); color: var(--mustard); font-size: 1.15rem; }
.standings { margin-top: 14px; background: var(--board-hi); border-radius: 14px; padding: 10px 12px; }
.standings h3 { margin: 0 0 6px; font-family: var(--display); font-weight: 400; color: var(--mustard); }
.standings p { margin: 8px 0 0; }
.mini { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.mini th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px; }
.mini td { padding: 5px 8px; border-top: 1px solid var(--board); }
.mini td.place { font-family: var(--display); color: var(--mustard); }
.mini tr.me td { background: rgba(255, 197, 41, 0.14); }
.mini .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--grill); margin: 0 6px 0 2px; vertical-align: -1px; }
.results-board { max-height: calc(100vh - 40px); overflow-y: auto; }

/* ---------- ceremony bar ---------- */
.ceremony-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 18; width: min(860px, calc(100% - 24px)); background: var(--board); border: 4px solid var(--grill); border-radius: 18px; box-shadow: 0 0 0 4px var(--mustard), 0 10px 0 4px var(--grill); padding: 12px 14px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cb-text b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.6rem; color: var(--mustard); line-height: 1.05; }
.cb-text span { color: var(--muted); }
.cb-actions { display: flex; gap: 8px; flex-wrap: wrap; }


/* ---------- main menu ---------- */
.screen.side { align-items: flex-start; }
.screen.side > .board { margin-top: auto; margin-bottom: auto; }
.main-menu { display: grid; gap: clamp(6px, 1.2vh, 10px); margin-top: clamp(8px, 1.8vh, 16px); }
.mbtn { border: 3px solid var(--grill); border-radius: 14px; background: var(--board-hi); color: var(--text); font-family: var(--display); font-size: clamp(1.15rem, 2.9vh, 1.5rem); letter-spacing: 0.5px; padding: clamp(6px, 1.25vh, 10px) 16px; text-align: left; box-shadow: 0 4px 0 var(--grill); transition: transform 0.06s, box-shadow 0.06s, background 0.1s; }
.mbtn.primary { background: var(--ketchup); }
.mbtn:hover, .mbtn:focus-visible { background: var(--mustard); color: var(--grill); }
.mbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--grill); }

.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.board-head h2 { margin: 0; }
.setting-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.lbl.wide { width: 120px; }
.grow { flex: 1; min-width: 0; }
.val { width: 46px; text-align: right; font-weight: 600; color: var(--muted); }
.small-note { font-size: 0.86rem; margin: 14px 0 0; }
input[type=range] { accent-color: var(--mustard); padding: 0; border: none; background: none; height: 28px; }
.dot.inline { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--grill); margin-right: 6px; vertical-align: -1px; }
#roomLobby .actions { margin-top: 14px; }

/* ---------- how to play ---------- */
.howto-board { width: min(900px, 100%); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs button { border: 3px solid var(--grill); background: var(--board-hi); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-weight: 600; }
.tabs button.on { background: var(--mustard); color: var(--grill); }
.tab-body { max-height: min(62vh, 560px); overflow-y: auto; padding-right: 4px; }
.howto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.howto-grid > div { background: var(--board-hi); border-radius: 14px; padding: 10px 12px; }
.howto-grid b { color: var(--mustard); font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.howto-grid p { margin: 6px 0 0; line-height: 1.5; font-size: 0.93rem; }
.howto-grid small { display: block; color: var(--muted); margin: 2px 0 6px; }
.food-table { width: 100%; border-collapse: collapse; }
.food-table td { padding: 8px; border-bottom: 1px solid var(--board-hi); vertical-align: top; font-size: 0.92rem; }
.food-table .ji { font-size: 1.8rem; width: 44px; }
.food-table b { display: block; font-family: var(--display); font-weight: 400; color: var(--mustard); font-size: 1.1rem; }
.food-table small { color: var(--muted); }
.food-table .items { line-height: 1.6; white-space: nowrap; }
.food-table .f { color: #9fdc6a; font-weight: 600; }
.food-table .w { color: #ff9a8a; font-weight: 600; }

/* stat pips (garage and how to play) */
.stat { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.88rem; margin: 4px 0; }
.pips { display: flex; gap: 4px; }
.pips i { width: 18px; height: 10px; border-radius: 3px; background: #1b120c; }
.pips i.on { background: var(--mustard); }

/* ---------- quit ---------- */
.quit-board p { line-height: 1.5; margin: 0 0 16px; }
.quit-burger { font-size: 3.4rem; line-height: 1; margin-bottom: 6px; }

/* ---------- garage ---------- */
.garage { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.garage > * { pointer-events: auto; }
.garage-top { position: absolute; left: 0; right: 0; top: 14px; display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; pointer-events: none; }
.garage-top h2 { margin: 0; font-size: clamp(1.8rem, 4.5vh, 2.6rem); -webkit-text-stroke: 5px var(--grill); paint-order: stroke fill; }
.big-chip { font-size: 0.95rem; padding: 6px 14px; border: 3px solid var(--grill); }
.garage-halves { position: absolute; left: 0; right: 0; top: clamp(60px, 10vh, 80px); bottom: clamp(80px, 13vh, 100px); display: grid; grid-template-columns: 1fr; pointer-events: none; }
.garage-halves.two { grid-template-columns: 1fr 1fr; }
.ghalf { position: relative; pointer-events: none; }
.ghalf > * { pointer-events: auto; }
.garage-halves.two .ghalf + .ghalf { border-left: 4px solid var(--grill); }
.gcol { position: absolute; left: clamp(10px, 2.5vw, 34px); top: 0; width: min(290px, 42%); max-height: 100%; overflow-y: auto; background: rgba(43, 29, 20, 0.88); border: 3px solid var(--grill); border-radius: 16px; padding: 10px; }
.garage-halves.two .gcol { width: min(250px, 46%); }
.ghead { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.gkeys { font-size: 0.78rem; color: var(--muted); line-height: 1.7; }
.glist { display: grid; gap: 6px; }
.gride { display: flex; gap: 10px; align-items: center; text-align: left; border: 3px solid transparent; background: var(--board-hi); color: var(--text); border-radius: 12px; padding: clamp(5px, 1vh, 8px) 10px; }
.gride .gi { font-size: 1.7rem; line-height: 1; }
.gride b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.15rem; }
.gride small { color: var(--muted); font-size: 0.78rem; }
.gride.on { border-color: var(--mustard); background: #5a3a24; }
.gride.on b { color: var(--mustard); }
.gcolors { margin-top: 10px; }
.gstats { position: absolute; right: clamp(10px, 2.5vw, 34px); bottom: 0; width: min(330px, 40%); background: rgba(43, 29, 20, 0.9); border: 3px solid var(--grill); border-radius: 16px; padding: 10px 14px; }
.garage-halves.two .gstats { width: min(260px, 46%); }
.gstats h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.4rem; color: var(--mustard); }
.gtop { color: var(--muted); font-size: 0.85rem; margin: 2px 0 6px; }
.gstats p { margin: 8px 0 0; font-size: 0.86rem; line-height: 1.4; color: var(--muted); }
.gready { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(-1 * clamp(70px, 11vh, 88px)); min-width: 200px; }
.gready.is-ready { background: var(--pickle); }
.garage-bottom { position: absolute; left: 0; right: 0; bottom: 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 clamp(10px, 2.5vw, 34px); pointer-events: none; }
.garage-bottom > * { pointer-events: auto; }
#garageBack { justify-self: start; }
.garage-go { justify-self: center; }
.race-btn { font-size: clamp(1.8rem, 4.6vh, 2.4rem) !important; padding: 10px 56px !important; }
.garage-wait { font-weight: 600; color: var(--text); background: rgba(43, 29, 20, 0.85); border-radius: 999px; padding: 8px 16px; display: inline-block; }

.garage .btn.ghost { background: var(--board); border-color: var(--grill); }
.gcolors button { width: 25px; height: 25px; }
.gcolors { gap: 6px; }
.garage-halves.two .gstats p { display: none; }
.garage-halves.two .gstats { padding: 8px 12px; }
.garage-halves.two .stat { font-size: 0.8rem; margin: 2px 0; }
.garage-halves.two .gcolors button { width: 21px; height: 21px; }
.garage-halves.two .gcolors { gap: 5px; }
.garage-halves.two .gride small { display: none; }

input { -webkit-user-select: text; user-select: text; }
