/* The little kitchen: warm wood, paper tickets and crisp game furniture.
   This final presentation layer leaves the existing game states and hooks intact. */
:root {
  color-scheme: light;
  --ink: #29272b;
  --paper: #fff6e2;
  --cream: #ebd5ae;
  --red: #e85343;
  --red-dark: #a6332d;
  --yellow: #ffc65a;
  --green: #79a65b;
  --blue: #70b9c9;
  --panel: #292b31;
  --wood: #a86538;
  --wood-dark: #643e2a;
  --muted: #806b56;
  --paper-border: #d7ba8c;
}

html, body { background: #24252b; font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select { font-family: inherit; }
button { transition: background-color .15s, box-shadow .15s, transform .15s; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #398c9b; outline-offset: 4px; }
button:not(:disabled):hover { filter: brightness(1.05); }
button:disabled { cursor: not-allowed; }
.eyebrow { color: #aa6041; font-size: .66rem; letter-spacing: .12em; }
.game-shell { width: min(100vw, 1600px); height: 100dvh; max-height: 1100px; background: #25272d; box-shadow: 0 0 80px #1118; }

/* The game HUD sits above the room, like the fascia of a restaurant. */
.topbar {
  grid-template-columns: minmax(210px, .85fr) minmax(240px, 1.5fr) auto;
  min-height: 108px;
  padding: 14px 28px 15px;
  gap: 22px;
  background: #24252c;
  border-bottom: 5px solid #553b30;
  box-shadow: 0 3px 0 #d89b57;
}
.brand-lockup { gap: 15px; }
.brand-mark, .auth-logo {
  width: 62px; height: 62px; padding: 6px;
  border: 3px solid #191b21; border-radius: 11px;
  background: #ef6557;
  box-shadow: inset 0 4px 0 #ff9381, inset 0 -5px 0 #ca423a, 0 4px 0 #15171c;
  transform: none;
}
.brand-mark svg, .auth-logo svg { width: 100%; height: 100%; image-rendering: pixelated; }
.brand-lockup h1 { color: #fff9eb; font-size: clamp(1.8rem, 2.6vw, 2.6rem); font-weight: 1000; letter-spacing: .03em; text-shadow: 2px 3px 0 #08090c; }
.brand-lockup p { display: block; color: #fff5e0; font-size: .76rem; letter-spacing: .07em; margin-top: 8px; }
.order-rail { min-height: 76px; gap: 10px; padding: 2px 3px 5px; }
.order-ticket {
  max-width: 236px; padding: 8px 11px 10px;
  border: 2px solid #c8a063; border-radius: 4px;
  background: #fff6e2; box-shadow: inset 0 0 0 3px #fffdf0, 0 4px 0 #1118;
  transform: none;
}
.order-ticket:first-child { border-color: #edbd6c; transform: none; }
.ticket-label { color: #9a7b50; font-size: .55rem; letter-spacing: .06em; }
.ticket-face { font-size: .83rem; }
.recipe-row { gap: 8px; margin-top: 3px; font-size: .95rem; letter-spacing: -.02em; }
.food-icon { width: 21px; height: 21px; font-size: 1.5rem; }
.food-icon.salad {
  width: 28px; height: 28px; border: 0; border-radius: 0;
  color: transparent; font-size: 0; text-shadow: none; image-rendering: pixelated;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' shape-rendering='crispEdges'%3E%3Cpath d='M9 8h14v3h5v5h2v9h-4v4h-5v3H10v-3H6v-4H3v-9h2v-5h4z' fill='%234e3027'/%3E%3Cpath d='M10 10h12v3h5v5h1v6h-4v4H11v-2H7v-4H5v-7h3v-3h2z' fill='%23ed4330'/%3E%3Cpath d='M10 12h10v2h4v8h-3v4H11v-3H8v-8h2z' fill='%23fa563a'/%3E%3Cpath d='M10 14h4v3h-4zM8 17h3v4H8z' fill='%23ffb073'/%3E%3Cpath d='M22 16h3v7h-4v3H11v-2h9v-3h2z' fill='%23cd3229'/%3E%3Cpath d='M14 1h5v5h5v2h3v3h-8v5h-5v-5H7V7h7z' fill='%2339502a'/%3E%3Cpath d='M16 2h2v5h5v2h-6v4h-2V9h-5V8h6z' fill='%2378a443'/%3E%3Cpath d='M10 8h5v2h-5zM19 7h4v2h-4z' fill='%239fbc59'/%3E%3C/svg%3E") center / contain no-repeat;
}
.timer { height: 8px; margin-top: 8px; border: 1px solid #b99b67; border-radius: 3px; background: #dfcba4; }
.timer span { background: linear-gradient(#85bd60 0 30%, #5ca747 30% 75%, #4a943c 75%); }
.scoreboard { gap: 0; padding: 10px 4px 10px 12px; border: 2px solid #42444e; border-radius: 12px; background: #1d2530; box-shadow: inset 0 2px 0 #ffffff05; text-align: left; }
.hud-stat { display: flex; align-items: center; gap: 9px; padding: 0 12px; }
.hud-stat + .hud-stat { border-left: 1px solid #73767d66; }
.scoreboard span { color: #f4eee1; font-size: .66rem; font-weight: 600; letter-spacing: .08em; }
.scoreboard strong { margin-top: 3px; color: #fffaf0; font-size: 1.65rem; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.round-clock strong { min-width: 3.4ch; font-size: 1.65rem; }
.scoreboard #comboLabel { font-size: 1rem; min-width: 4.1em; margin-top: 7px; white-space: nowrap; }
.hud-icon { position: relative; display: block; flex: 0 0 auto; font-style: normal; }
.clock-icon { width: 29px; height: 31px; border: 3px solid #c96948; border-radius: 50%; background: #fff7df; box-shadow: 0 2px 0 #08090c; }
.clock-icon::before { content: ""; position: absolute; width: 8px; height: 4px; top: -7px; left: 7px; background: #da8c42; box-shadow: 2px -2px 0 #ffc65a; }
.clock-icon::after { content: ""; position: absolute; width: 5px; height: 10px; left: 11px; top: 5px; border-left: 2px solid #443831; border-bottom: 2px solid #443831; }
.fork-icon { width: 23px; height: 36px; }
.fork-icon svg { width: 100%; height: 100%; }
.coin-icon { display: grid; place-items: center; width: 31px; height: 31px; border: 3px solid #d08a2e; border-radius: 50%; color: #a06029; background: #ffd367; box-shadow: inset 0 0 0 2px #ffe697, 0 2px 0 #08090c; font-size: 1rem; }
.fullscreen-button { width: 30px; height: 32px; margin: 0 4px 0 9px; border: 0; border-radius: 5px; background: transparent; color: #c4c6cc; box-shadow: none; font-size: 1.3rem; }
.game-shell.lobby-mode .scoreboard { border: 0; background: none; box-shadow: none; padding: 0; }
.game-shell.lobby-mode .fullscreen-button { width: 42px; height: 42px; border: 1px solid #55565d; background: #ffffff08; }
.game-shell.lobby-mode .order-area::before { color: #ccba9e; font-size: .66rem; letter-spacing: .12em; }
.game-stage, .game-shell.lobby-mode .game-stage { background: #97765c; }
.screen-shade { background: #2e211c8c; backdrop-filter: blur(3px); }
.objective { top: 13px; padding: 8px 17px; border: 1px solid #9b744a; border-radius: 4px; color: #5d4430; background: #fff7e8eb; box-shadow: 0 3px 0 #50372740; font-size: .72rem; font-weight: 800; }
.tipbar { min-height: 38px; padding: 8px 28px; gap: 10px; background: #24252c; color: #d3c5ae; font-size: .65rem; }
.status-dot { width: 6px; height: 6px; background: #9bc778; box-shadow: none; }
.slogan { color: #b7a488; font-size: .62rem; letter-spacing: .1em; }
.keyboard-hints { display: flex; gap: 15px; margin-left: auto; color: #d4c8b6; font-size: .67rem; }
.keyboard-hints > span { white-space: nowrap; }
kbd { padding: 2px 4px; border: 1px solid #67615a; border-radius: 3px; color: #e7d9c3; background: #ffffff07; font: inherit; }
.keyboard-hints + .slogan { margin-left: 14px; }
.lobby-mode .keyboard-hints { display: none; }

/* Account entry: the kitchen is visible before a player steps inside. */
.auth-shell { grid-template-columns: 1fr 1fr; align-items: center; padding: 100px max(6vw, 32px) 65px; gap: 7vw; background: linear-gradient(90deg, #332720bd 0%, #33272052 47%, #3327205e 100%), url("./assets/kitchen-room.png") center / cover, #ad7a4d; }
.auth-shell::before { opacity: 1; background: linear-gradient(0deg, #34251c9e, transparent 45%, #211e23aa); }
.auth-brand { top: 6vh; left: max(6vw, 32px); gap: 15px; transform: none; }
.auth-logo { width: 68px; height: 68px; }
.auth-brand strong { font-size: 2.6rem; letter-spacing: .04em; text-shadow: 2px 3px 0 #38251d; }
.auth-brand small { font-size: .7rem; letter-spacing: .12em; color: #fff4da; }
.auth-welcome { position: relative; z-index: 1; align-self: center; padding-top: 35px; text-shadow: 0 2px 4px #3f271f60; }
.welcome-kicker { font-size: .62rem; letter-spacing: .17em; color: #f9dcaa; font-weight: 800; }
.auth-welcome h1 { margin: 17px 0 22px; font-size: clamp(3rem, 5.6vw, 5.5rem); line-height: 1.17; font-weight: 950; letter-spacing: -.02em; color: #fff8e8; }
.auth-welcome > p:last-child { color: #fff1d5; font-size: .95rem; line-height: 1.9; }
.auth-card { justify-self: end; width: min(100%, 470px); padding: 33px; border: 3px solid #7c5132; border-radius: 7px; background: #fff5df; box-shadow: inset 0 0 0 5px #f9e8c7, 0 10px 0 #5d3c2980, 0 20px 50px #251a2340; text-align: left; }
.agreement-card, .account-card { margin-top: 12px; }
.auth-card .eyebrow { margin-top: 0; font-size: .65rem; color: #bd6650; letter-spacing: .12em; }
.auth-card h2 { margin: 8px 0 13px; color: #413026; font-size: 1.7rem; line-height: 1.4; }
.auth-card > p:not(.eyebrow) { margin-bottom: 23px; color: #8a725e; font-size: .8rem; line-height: 1.8; }
.auth-card button { padding: 12px 16px; border-radius: 5px; font-size: .85rem; box-shadow: inset 0 1px 0 #ffffff38, 0 4px 0 var(--red-dark); }
.auth-card button.auth-secondary { color: #806045; background: #ead7b4; box-shadow: 0 4px 0 #c7a578; }
.agreement-links { justify-content: flex-start; gap: 18px; margin: 15px 0 24px; }
.agreement-links a { padding: 0 0 3px; border-bottom: 1px solid #b5946a; border-radius: 0; color: #886240; background: none; font-size: .75rem; }
.auth-card > small { margin-top: 18px; color: #917b66; font-size: .65rem; text-align: center; }
.account-card form { gap: 14px; }
.account-card label { gap: 6px; color: #775b43; font-size: .72rem; }
.account-card input { padding: 11px 12px; border: 1px solid #cfb48b; border-radius: 4px; background: #fffaf0; font-size: .8rem; }
.account-card form button { margin-top: 7px; }
.auth-card .auth-switch { display: block; margin: 20px auto 0; color: #966549; font-size: .72rem; box-shadow: none; }
.auth-brand-line { left: max(6vw, 32px); bottom: 5vh; color: #fff0d5; font-size: .73rem; letter-spacing: .22em; }
.login-progress { grid-column: 2; text-align: center; }
.login-spinner { border-width: 5px; }

/* The lobby is a warm restaurant noticeboard, with a clear route into play. */
.lobby-panel, .menu-screen, .room-panel {
  color: #513f31; padding: 27px 34px 18px;
  background: linear-gradient(#fff4dfed, #ead1aeed), url("./assets/kitchen-room.png") center 45% / cover, #ead2b0;
}
.lobby-panel::before { inset: 0; opacity: .28; background: repeating-linear-gradient(0deg, transparent 0 89px, #ba8e5c22 90px 91px); transform: none; }
.lobby-header { grid-template-columns: 1fr auto 1fr; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid #b791603d; }
.profile-avatar { width: 49px; height: 49px; border: 2px solid #825733; border-radius: 8px; color: #fff7e0; background: #bf7c47; box-shadow: inset 0 3px 0 #e2a266, 0 3px 0 #8a5733; transform: none; }
.profile-name { width: min(25vw, 245px); color: #4b3528; font-size: 1.2rem; }
.account-status { margin-top: 5px; color: #95795e; font-size: .62rem; }
.lobby-heading span { color: #b47a4f; font-size: .58rem; letter-spacing: .15em; }
.lobby-heading strong { color: #58412d; font-size: 1.6rem; margin-top: 7px; letter-spacing: .08em; }
.lobby-heading small { margin-top: 8px; color: #9c8166; font-size: .62rem; }
.lobby-panel .header-settings { min-width: 135px; padding: 10px 15px; border: 1px solid #c9aa7c; border-radius: 5px; color: #6c4e35; background: #fff5e0; box-shadow: 0 3px 0 #c6a778; font-size: .83rem; }
.lobby-panel .header-settings small { margin-top: 5px; color: #a38665; font-size: .54rem; }
.lobby-panel .lobby-grid { grid-template-columns: minmax(0, 2.3fr) minmax(255px, .87fr); gap: 22px; margin-top: 25px; }
.lobby-room-preview { grid-template-columns: minmax(235px, .9fr) minmax(305px, 1.1fr); gap: 22px; }
.lobby-level-card, .lobby-player-stage, .partners-column { border: 2px solid #ccb18a; border-radius: 7px; background: #fff7e6; box-shadow: 0 5px 0 #bb986b55; }
.lobby-level-card { display: flex; flex-direction: column; padding: 11px 11px 17px; }
.mini-kitchen { flex: 1; height: auto; min-height: 160px; margin-bottom: 21px; border: 1px solid #b99060; border-radius: 3px; background: url("./assets/kitchen-room.png") center / cover, #c49a69; image-rendering: pixelated; }
.mini-kitchen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 70%, #4b342531); pointer-events: none; }
.mini-kitchen .poster-counter { border-width: 3px; border-color: #573b2a; background: linear-gradient(#ffe0a0 4px, #efb768 4px 20px, #e5a054 20px); box-shadow: inset 0 -9px 0 #a25132, 4px 6px 0 #3e271c38; }
.mini-kitchen .poster-counter-back { top: 42%; height: 37px; }
.mini-kitchen .poster-counter-left, .mini-kitchen .poster-counter-right { top: calc(42% + 28px); bottom: 18%; width: 33px; }
.mini-kitchen .tomato-one, .mini-kitchen .tomato-two { top: calc(42% + 6px); width: 19px; height: 19px; border-color: #603721; }
.lobby-level-card > .poster-label { top: 23px; left: 23px; padding: 6px 10px; border: 1px solid #c29b5c; border-radius: 3px; color: #745430; background: #fff0c8; box-shadow: 0 2px 0 #44271125; font-size: .59rem; }
.lobby-level-card > .eyebrow, .lobby-level-card > h2, .lobby-level-card > p:not(.eyebrow) { margin-left: 10px; margin-right: 10px; }
.lobby-level-card > .eyebrow { margin-top: 0; margin-bottom: 8px; font-size: .64rem; }
.lobby-level-card h2 { margin-top: 0; margin-bottom: 10px; color: #473527; font-size: 1.55rem; line-height: 1.3; }
.lobby-level-card > p:not(.eyebrow) { min-height: 3em; margin-bottom: 19px; color: #8e7861; font-size: .73rem; line-height: 1.75; }
.lobby-panel .change-level-button { width: calc(100% - 20px); margin: 0 10px; padding: 9px; border: 1px solid #c9aa7b; border-radius: 4px; color: #7d5b39; background: #f4e4c3; box-shadow: 0 3px 0 #c3a274; font-size: .72rem; }
.lobby-player-stage { justify-content: center; padding: 25px 21px; background: linear-gradient(#fff8e9, #fff2d6); }
.lobby-player-stage .stage-note { margin: 0 5px 25px; color: #8f745a; font-size: .76rem; line-height: 1.9; }
.player-podiums { gap: 13px; margin-bottom: 30px; }
.player-podium { min-width: 0; padding: 22px 8px 17px; border: 1px dashed #c9a977; border-radius: 4px; background: #f0e2c666; }
.player-podium.occupied { border: 1px solid #dcb881; background: #ffebc0; box-shadow: inset 0 3px 0 #fff8e4; }
.podium-avatar { width: 78px; height: 88px; margin-bottom: 16px; padding: 4px; border: 0; border-radius: 0; color: #bc9b6d; background: none; box-shadow: none; }
.podium-avatar svg { width: 100%; height: 100%; filter: drop-shadow(0 5px 0 #795a3220); }
.podium-avatar.empty { position: relative; width: 70px; height: 88px; border: 0; border-radius: 0; color: #b99d72; background: none; font-size: 2.1rem; font-weight: 400; }
.podium-avatar.empty::before { content: ""; position: absolute; inset: 18px 7px; border: 2px dashed #d7bc90; border-radius: 50%; }
.player-podium b { max-width: 100%; overflow: hidden; color: #795131; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.player-podium small { margin-top: 6px; color: #a48b6c; font-size: .54rem; }
.lobby-main-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lobby-main-actions #startButton { grid-column: 1 / -1; padding: 15px; background: #e95644; box-shadow: inset 0 2px 0 #ff8c70, 0 4px 0 #a63428; }
.lobby-panel .lobby-main-actions button { min-width: 0; padding: 11px 7px; border: 1px solid #bd823f; border-radius: 5px; color: #77502c; background: #f3d397; box-shadow: inset 0 1px 0 #fff2cf, 0 4px 0 #b88b4e; font-size: .77rem; }
.lobby-panel .lobby-main-actions #startButton { color: #fffaf0; border-color: #bf4332; font-size: 1rem; }
.lobby-panel .lobby-main-actions .coop-button { border-color: #a2b197; color: #52624a; background: #dce3bc; box-shadow: inset 0 1px 0 #f2f5dd, 0 4px 0 #97a07f; }
.lobby-main-actions small { margin-top: 5px; color: #957b51; font-size: .52rem; }
.lobby-main-actions #startButton small { color: #ffe2c9; font-size: .58rem; }
.lobby-main-actions .coop-button small { color: #849072; }
.lobby-player-stage .lobby-keyboard-guide { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 10px; row-gap: 7px; margin: 21px 0 0; color: #9b8061; font-size: .61rem; line-height: 1.6; text-align: center; }
.lobby-keyboard-guide > span { white-space: nowrap; }
.lobby-keyboard-guide kbd { padding: 2px 4px; border-color: #d3bc95; color: #84623d; background: #fffaf0; box-shadow: 0 1px 0 #d3bc95; }
.partners-column { padding: 22px 18px 18px; color: #5d4934; background: #f5e8ce; }
.partners-title h3 { font-size: 1.2rem; }
.partners-title .eyebrow { color: #a3845d; font-size: .58rem; }
.lobby-panel .partner-code { padding: 7px; border: 1px solid #ceaf7b; border-radius: 4px; color: #9d6538; background: #ffefd0; box-shadow: 0 2px 0 #d7bc90; font-size: .6rem; }
.lobby-panel .partners-copy { margin: 12px 0 7px; color: #9d8468; font-size: .68rem; line-height: 1.7; }
.add-partner { margin: 12px 0 16px; gap: 7px; }
.add-partner input, .lobby-panel .join-room input { padding: 9px 8px; border: 1px solid #d1b58a; border-radius: 4px; color: #775737; background: #fffaef; font-size: .69rem; }
.add-partner input::placeholder, .lobby-panel .join-room input::placeholder { color: #b09a7f; }
.lobby-panel .add-partner button, .lobby-panel .join-room button { padding: 8px 9px; min-width: 45px; border-radius: 4px; background: #b48453; box-shadow: 0 3px 0 #7f5b37; font-size: .66rem; }
.partner-list { flex: 1; min-height: 85px; max-height: none; padding: 10px 0; border-top: 1px dashed #d6bd94; }
.lobby-panel .partner-empty { align-self: center; margin: 15px 10px; color: #a58c6c; font-size: .7rem; line-height: 1.8; }
.partner-card { padding: 9px 8px; border-radius: 4px; background: #fff5de; }
.partner-info strong { color: #775237; }
.partner-info small { color: #a58a69; }
.quick-join { flex-wrap: wrap; gap: 11px; margin-top: 12px; padding-top: 16px; border-top: 1px solid #cfb68b; }
.quick-join strong { color: #77583a; font-size: .72rem; }
.quick-join small { margin-top: 5px; color: #a28b6c; font-size: .57rem; }
.lobby-panel .join-room { width: 100%; }
.lobby-panel .join-room input { flex: 1; min-width: 0; width: auto; }
.lobby-footer { padding-top: 20px; color: #ae9070; font-size: .57rem; }
.lobby-footer .status-dot { background: #92a56d; }

/* Secondary screens share the same paper, wood and brass. */
.menu-header, .room-header { padding-bottom: 18px; border-color: #c9ad81; }
.menu-header h2, .room-header h2 { color: #60442d; font-size: 1.5rem; }
.menu-header > button, .room-header > button { border: 1px solid #c7a877; border-radius: 4px; color: #775536; background: #fff3d9; box-shadow: 0 3px 0 #bd9b69; }
.level-screen-body { grid-template-columns: 150px minmax(300px, 1fr) 280px; gap: 20px; padding-top: 24px; height: calc(100% - 72px); }
.chapter-list button, .settings-tabs button { border: 1px solid #d1b68e; border-radius: 5px; color: #a79175; background: #ebddc3; }
.chapter-list button.active, .settings-tabs button.active { color: #fff5e0; background: #b98149; box-shadow: inset 0 2px 0 #d39d61, 0 3px 0 #805533; }
.level-route { border: 2px solid #ba986c; border-radius: 6px; background: linear-gradient(#fff0da55, #f8e2bc88), url("./assets/kitchen-room.png") center / cover; }
.level-route::before { border-color: #fff4d8; }
.level-node { border: 3px solid #b98b4b; border-radius: 6px; min-height: 134px; background: #ecd5ab; box-shadow: 0 5px 0 #6a482c66; }
.level-node.active { border-color: #e38a46; background: #fff5df; transform: translateY(-9px); box-shadow: 0 5px 0 #a76d35, 0 0 0 4px #fff6d957; }
.level-node span { color: #aa6637; }
.level-node b { color: #68472e; }
.level-detail, .settings-card, .room-level { border: 2px solid #d4b688; border-radius: 6px; color: #634a32; background: #fff6e2; box-shadow: 0 5px 0 #bc996449; }
.level-detail { padding: 22px; }
.level-detail h3 { color: #64452d; }
.level-detail dl div { border-radius: 3px; background: #f1dfbb; }
.level-actions button { border-radius: 4px; }
.level-actions .match-button { background: #c6924e; box-shadow: 0 4px 0 #896137; }
.level-actions .coop-button { color: #506447; background: #d7dfb5; box-shadow: 0 4px 0 #93a27b; }
.settings-body { padding-top: 24px; }
.settings-card { padding: 24px; }
.settings-tabs { gap: 12px; }
.setting-row, .account-setting { padding-block: 17px; border-color: #ddc7a2; }
.setting-row select, .account-setting button { border-radius: 4px; }
.account-setting #bindEmailButton { color: #5a6c4e; background: #d7dfb5; }
.account-setting #logoutButton { color: #8d6643; background: #e9d8b9; }
.room-level p:not(.eyebrow), .room-level small { color: #9b8165; }
.room-level #roomSpectators { display: block; margin-top: 6px; line-height: 1.4; }
.room-player { border-color: #c5a270; border-radius: 6px; background: #fff1d566; }
.room-player.occupied { border-color: #ceaa70; background: #ffe9bd; }
.room-player > span { border: 3px solid #987449; border-radius: 8px; color: #b39064; background: #eedfc1; box-shadow: 0 5px 0 #a6854e33; }
.room-player.occupied > span { color: #fff8eb; background: #bf8851; }
.room-player small { color: #a08768; }
.room-panel > .room-actions { border-color: #c9ad81; }
.room-panel > .room-actions p { color: #9b8061; }
.room-header .room-code { color: #a26335; background: #fff4da; }
.result-panel, .matchmaking-panel, .install-panel { border: 3px solid #855b37; border-radius: 7px; box-shadow: inset 0 0 0 4px #f7e4bf, 0 8px 0 #51382255; }
.result-panel h2, .matchmaking-panel h2, .install-panel h2 { color: #69482d; }
.result-panel button, .matchmaking-panel button, .install-panel button { border-radius: 5px; }
.rotate-device { color: #fff2d7; background: radial-gradient(ellipse at 50% 35%, #785136, #302921 78%); }
.rotate-phone { border-color: #ffedc8; border-radius: 9px; }
.rotate-device small { color: #b8a182; }
.joystick { border-color: #fff1d573; background: #56392438; }
.joystick-knob { border-color: #79573490; background: #fff1d8d9; }
.action-stack button { border-color: #fff2d09c; }
.drop-button { background: #719888; }

/* Laptop and tablet layouts keep each action reachable without tiny columns. */
@media (max-width: 1180px) and (min-height: 561px) {
  .topbar { padding-inline: 20px; gap: 14px; grid-template-columns: 220px minmax(210px, 1fr) auto; }
  .brand-mark { width: 53px; height: 53px; }
  .brand-lockup h1 { font-size: 1.25rem; white-space: nowrap; }
  .hud-stat { padding-inline: 8px; gap: 7px; }
  .hud-icon { display: none; }
  .lobby-panel, .menu-screen, .room-panel { padding: 22px 24px 16px; }
  .lobby-panel .lobby-grid { grid-template-columns: minmax(0, 1fr) 255px; gap: 16px; margin-top: 20px; }
  .lobby-room-preview { grid-template-columns: minmax(180px, .9fr) minmax(225px, 1fr); gap: 15px; }
  .lobby-player-stage { padding: 20px 14px; }
  .lobby-level-card h2 { font-size: 1.3rem; }
  .partners-column { padding: 19px 14px; }
  .lobby-panel .lobby-main-actions button { font-size: .69rem; }
  .lobby-main-actions small { display: none; }
  .level-screen-body { grid-template-columns: 115px minmax(260px, 1fr) 245px; gap: 14px; }
  .level-route { padding: 12px; gap: 7px; }
  .level-detail { padding: 16px; }
  .keyboard-hints + .slogan { display: none; }
}

/* A compact, complete horizontal phone layout; portrait still uses the game gate. */
@media (max-height: 560px) and (orientation: landscape) {
  .game-shell { width: 100%; height: 100dvh; max-height: none; }
  .topbar { min-height: 65px; padding: 6px 12px 7px; grid-template-columns: 170px minmax(180px, 1fr) auto; gap: 9px; border-bottom-width: 3px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 39px; height: 39px; padding: 3px; border-width: 2px; border-radius: 6px; }
  .brand-lockup h1 { font-size: 1rem; white-space: nowrap; }
  .brand-lockup p { display: block; margin-top: 4px; font-size: .49rem; letter-spacing: .03em; }
  .order-rail { min-height: 49px; gap: 6px; padding-bottom: 3px; }
  .order-ticket { padding: 4px 7px 5px; border-width: 1px; border-radius: 2px; box-shadow: inset 0 0 0 2px #fffdf0, 0 2px 0 #1118; }
  .ticket-label { font-size: .44rem; }
  .ticket-face { font-size: .6rem; }
  .recipe-row { margin-top: 1px; gap: 5px; font-size: .65rem; }
  .food-icon { width: 13px; height: 13px; font-size: 1rem; }
  .food-icon.salad { width: 18px; height: 18px; }
  .timer { height: 5px; margin-top: 4px; border-radius: 1px; }
  .scoreboard { padding: 6px 2px; border-width: 1px; border-radius: 7px; }
  .hud-stat { gap: 5px; padding: 0 8px; }
  .hud-icon { display: none; }
  .scoreboard span { font-size: .48rem; letter-spacing: .04em; }
  .scoreboard strong, .round-clock strong { margin-top: 2px; font-size: 1.1rem; }
  .scoreboard #comboLabel { font-size: .66rem; margin-top: 5px; }
  .fullscreen-button { width: 23px; height: 25px; margin-left: 3px; font-size: 1rem; }
  .game-shell.lobby-mode .fullscreen-button { width: 29px; height: 29px; }
  .game-shell.lobby-mode .order-area::before { font-size: .53rem; }
  .tipbar { display: none; }
  .objective { top: 8px; max-width: calc(100% - 24px); padding: 5px 11px; font-size: .58rem; }
  .lobby-panel, .menu-screen, .room-panel { inset: 0; width: 100%; height: 100%; max-height: none; padding: 10px 13px 9px; border: 0; border-radius: 0; box-shadow: none; transform: none; }
  .lobby-header { grid-template-columns: 1fr auto 1fr; padding-bottom: 9px; gap: 10px; }
  .profile-lockup { gap: 8px; }
  .profile-avatar { width: 34px; height: 34px; border-radius: 5px; font-size: .78rem; }
  .profile-name { font-size: .85rem; width: min(25vw, 205px); }
  .lobby-header .eyebrow { font-size: .47rem; }
  .account-status { margin-top: 3px; font-size: .5rem; }
  .lobby-heading span { font-size: .43rem; }
  .lobby-heading strong { margin-top: 4px; font-size: 1rem; }
  .lobby-heading small { display: none; }
  .lobby-panel .header-settings { min-width: 103px; padding: 5px 9px; font-size: .63rem; }
  .lobby-panel .header-settings small { display: block; margin-top: 3px; font-size: .43rem; }
  .lobby-panel .lobby-grid { grid-template-columns: minmax(0, 1fr) 235px; gap: 10px; margin-top: 11px; }
  .lobby-room-preview { grid-template-columns: minmax(145px, .86fr) minmax(220px, 1.14fr); gap: 10px; }
  .lobby-level-card, .lobby-player-stage, .partners-column { border-width: 1px; border-radius: 4px; }
  .lobby-level-card { padding: 6px 6px 10px; }
  .mini-kitchen { min-height: 58px; margin-bottom: 8px; }
  .lobby-level-card > .poster-label { top: 12px; left: 12px; padding: 3px 6px; font-size: .43rem; }
  .lobby-level-card > .eyebrow, .lobby-level-card > h2 { margin-left: 5px; margin-right: 5px; }
  .lobby-level-card > .eyebrow { margin-bottom: 4px; font-size: .49rem; }
  .lobby-level-card h2 { margin-bottom: 8px; font-size: 1rem; }
  .lobby-level-card > p:not(.eyebrow) { display: none; }
  .lobby-panel .change-level-button { width: calc(100% - 10px); margin-inline: 5px; padding: 5px; font-size: .56rem; }
  .lobby-player-stage { padding: 10px 12px; }
  .lobby-player-stage .stage-note { margin: 0 0 8px; font-size: .56rem; line-height: 1.5; }
  .player-podiums { gap: 9px; margin-bottom: 10px; }
  .player-podium { padding: 8px 5px 6px; }
  .podium-avatar, .podium-avatar.empty { width: 42px; height: 46px; margin-bottom: 5px; padding: 0; font-size: 1.4rem; }
  .podium-avatar.empty::before { inset: 6px 4px; }
  .player-podium b { font-size: .59rem; }
  .player-podium small { display: none; }
  .lobby-main-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lobby-panel .lobby-main-actions #startButton { padding: 7px; font-size: .73rem; }
  .lobby-panel .lobby-main-actions button { padding: 6px 4px; font-size: .6rem; border-radius: 3px; }
  .lobby-main-actions small { display: none; }
  .lobby-player-stage .lobby-keyboard-guide { display: none; }
  .partners-column { padding: 11px 10px 10px; }
  .partners-title h3 { font-size: .88rem; }
  .partners-title .eyebrow { font-size: .46rem; }
  .lobby-panel .partner-code { padding: 5px; font-size: .48rem; }
  .lobby-panel .partners-copy { display: none; }
  .add-partner { margin: 10px 0 8px; gap: 5px; }
  .add-partner input, .lobby-panel .join-room input { padding: 6px; font-size: .57rem; }
  .lobby-panel .add-partner button, .lobby-panel .join-room button { min-width: 35px; padding: 5px 6px; font-size: .55rem; }
  .partner-list { min-height: 30px; padding: 5px 0; }
  .lobby-panel .partner-empty { margin: 4px 7px; font-size: .55rem; line-height: 1.5; }
  .quick-join { gap: 6px; margin-top: 7px; padding-top: 8px; }
  .quick-join strong { font-size: .58rem; }
  .quick-join small { display: none; }
  .lobby-panel .join-room { gap: 5px; }
  .lobby-footer { display: none; }
  .menu-header, .room-header { padding-bottom: 8px; }
  .menu-header h2, .room-header h2 { font-size: 1rem; }
  .menu-header .eyebrow, .room-header .eyebrow { font-size: .48rem; }
  .menu-header > button, .room-header > button { min-width: 85px; padding: 6px 10px; font-size: .6rem; }
  .level-screen-body { grid-template-columns: 103px minmax(260px, 1fr) 225px; gap: 10px; padding-top: 11px; height: calc(100% - 42px); }
  .chapter-list button { padding: 10px 8px; font-size: .66rem; }
  .level-route { padding: 11px; gap: 7px; }
  .level-node { min-height: 90px; padding: 8px 4px; border-width: 2px; }
  .level-node span { font-size: 1rem; }
  .level-node b { font-size: .58rem; }
  .level-node small { font-size: .48rem; }
  .level-detail { padding: 11px; }
  .level-detail .eyebrow { margin: 0 0 4px; font-size: .52rem; }
  .level-detail h3 { font-size: 1rem; }
  .level-detail > p:not(.eyebrow) { font-size: .54rem; }
  .level-detail dl { margin: 5px 0; gap: 4px; }
  .level-detail dl div { padding: 4px 6px; font-size: .54rem; }
  .level-actions { gap: 5px; }
  .level-actions button { padding: 5px; font-size: .59rem; }
  .settings-body { grid-template-columns: 103px minmax(400px, 600px); gap: 12px; padding-top: 11px; }
  .settings-tabs { gap: 8px; }
  .settings-tabs button { padding: 9px; font-size: .64rem; }
  .settings-card { padding: 12px 18px; }
  .settings-card h3 { font-size: .86rem; }
  .setting-row, .account-setting { padding: 8px 3px; font-size: .68rem; }
  .setting-row small, .account-setting small { font-size: .51rem; }
  .room-body { grid-template-columns: minmax(205px, .7fr) minmax(380px, 1fr); gap: 16px; padding: 10px 0; }
  .room-level { padding: 12px; }
  .room-level h3 { font-size: 1rem; }
  .room-level p:not(.eyebrow), .room-level small { font-size: .59rem; }
  .room-level #roomSpectators { margin-top: 3px; font-size: .54rem; }
  .room-player { padding: 13px 9px; }
  .room-player > span { width: 54px; height: 54px; margin-bottom: 9px; }
  .room-panel > .room-actions button { min-width: 150px; padding: 7px 12px; font-size: .67rem; }
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(330px, 1.08fr); gap: 40px; padding: 43px 6vw 22px; }
  .auth-brand { top: 22px; left: 6vw; transform: none; gap: 10px; }
  .auth-logo { width: 42px; height: 42px; padding: 2px; border-width: 2px; border-radius: 6px; }
  .auth-brand strong { font-size: 1.7rem; }
  .auth-brand small { font-size: .45rem; }
  .auth-welcome { padding-top: 42px; }
  .welcome-kicker { font-size: .43rem; }
  .auth-welcome h1 { margin: 12px 0; font-size: 2.6rem; }
  .auth-welcome > p:last-child { font-size: .69rem; line-height: 1.7; }
  .auth-card { width: 100%; margin-top: 0; padding: 20px 23px; }
  .auth-card h2 { margin: 6px 0 9px; font-size: 1.2rem; }
  .auth-card > p:not(.eyebrow) { margin-bottom: 12px; font-size: .65rem; line-height: 1.6; }
  .auth-card .eyebrow { font-size: .52rem; }
  .agreement-links { gap: 15px; margin: 12px 0 16px; }
  .agreement-links a { font-size: .63rem; }
  .auth-card button { padding: 8px 10px; font-size: .68rem; }
  .auth-card > small { margin-top: 11px; font-size: .55rem; }
  .account-card form { grid-template-columns: 1fr 1fr; gap: 9px; }
  .account-card input { padding: 7px 8px; font-size: .66rem; }
  .account-card label { gap: 4px; font-size: .6rem; }
  .account-card form button { margin-top: 0; }
  .auth-card .auth-switch { margin-top: 13px; font-size: .6rem; }
  .auth-brand-line { left: 6vw; bottom: 20px; font-size: .55rem; }
}

@media (orientation: portrait) {
  .auth-shell { display: flex; flex-direction: column; justify-content: center; gap: 0; padding: 118px 22px 65px; background-position: 47% center; }
  .auth-shell::before { background: #30241a55; }
  .auth-brand { top: 6vh; left: 50%; gap: 12px; transform: translateX(-50%); }
  .auth-logo { width: 56px; height: 56px; padding: 4px; }
  .auth-brand strong { font-size: 2.1rem; }
  .auth-brand small { font-size: .54rem; }
  .auth-welcome { display: none; }
  .auth-card { width: min(100%, 430px); margin-top: 0; padding: 27px 24px; }
  .auth-card h2 { font-size: 1.5rem; }
  .auth-card > p:not(.eyebrow) { font-size: .76rem; }
  .auth-brand-line { bottom: 5vh; left: 50%; transform: translateX(-50%); font-size: .62rem; white-space: nowrap; }
  .account-card form { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}

/* Account verification and recovery share the existing account card. */
.email-verification { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; grid-column: 1 / -1; }
.account-card form .email-verification button { grid-column: auto; margin: 0; padding: 11px 12px; font-size: .72rem; }
#authStatus { display: block; margin-top: 10px; color: #586a47; line-height: 1.6; }
#authStatus:empty { display: none; }
.email-verification.hidden { display: none; }

.handoff-signals { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.handoff-signals.hidden { display: none; }
.handoff-signals button { padding: 8px 10px; font-size: .7rem; }
.level-route { grid-template-columns: repeat(4, minmax(56px, 1fr)); grid-template-rows: repeat(2, minmax(94px, 1fr)); overflow: auto; }

.food-icon.burger { width: 26px; height: 26px; font-size: 23px; line-height: 1; background: none; text-shadow: none; }
@media (max-height: 500px) { .food-icon.burger { width: 18px; height: 18px; font-size: 17px; } }
@media (max-height: 500px) { .level-route { gap: 8px; padding: 10px; } .level-node { min-height: 84px; } }

/* The lobby fills the screen exactly: a long partner list or leaderboard scrolls inside its own pane instead of stretching the page. */
.lobby-panel .lobby-grid { grid-template-rows: minmax(0, 1fr); }
.lobby-panel .partners-column { min-height: 0; overflow: hidden; }
.lobby-panel .partner-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lobby-panel .lobby-room-preview { min-height: 0; grid-template-rows: minmax(0, 1fr); }
.lobby-panel .lobby-level-card, .lobby-panel .lobby-player-stage { min-height: 0; }
.lobby-panel .lobby-player-stage, .lobby-panel .lobby-level-card { overflow-y: auto; overscroll-behavior: contain; }
@media (max-height: 960px) {
  .lobby-player-stage { padding: 14px 16px; }
  .lobby-player-stage .stage-note { margin-bottom: 10px; line-height: 1.6; }
  .player-podiums { margin-bottom: 14px; }
  .player-podium { padding: 10px 8px 9px; }
  .podium-avatar, .podium-avatar.empty { height: 64px; margin-bottom: 8px; }
  .podium-avatar { width: 58px; }
}
