@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Sans:wght@500;600;700;800&display=swap");

:root {
  font-family: "DM Sans", system-ui, sans-serif;
  color: #202421;
  background: #e8d9bd;
  font-synthesis: none;
  --yellow: #f8c83e;
  --green: #167348;
  --dark-green: #0d4b34;
  --cream: #fff8e9;
  --ink: #222822;
  --car-color: #ef4e43;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.45), transparent 30%),
    #d8c5a3;
  overflow-x: hidden;
}

button { font: inherit; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #2e95ff; outline-offset: 2px; }

.game-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 80px rgba(65, 45, 24, .22);
}

.topbar {
  height: 82px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fffdf7;
  border-bottom: 5px solid var(--yellow);
  position: relative;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; line-height: .9; }
.brand-mark, .modal-logo {
  width: 50px; height: 50px; border-radius: 14px 4px 14px 4px;
  display: grid; place-items: center;
  font-family: "Archivo Black"; font-size: 20px;
  color: white; background: var(--green);
  box-shadow: inset -5px -5px 0 rgba(0,0,0,.12);
  transform: rotate(-3deg);
}
.brand strong { font: 18px "Archivo Black"; display: block; letter-spacing: -.6px; }
.brand span { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 5px; }

.stats { display: flex; align-self: stretch; }
.stat {
  min-width: 105px; padding: 12px 22px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  border-left: 1px solid #e5dfd2;
}
.stat:last-child { border-right: 1px solid #e5dfd2; }
.stat span { text-transform: uppercase; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: #7a7a70; }
.stat strong { font: 23px "Archivo Black"; }
.stat.money strong { color: var(--green); }
.stat.combo strong { color: #e16a2b; }
.stat.hot { animation: comboPulse .8s infinite alternate; background: #fff2c7; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.market-cap {
  min-width: 126px; height: 48px; padding: 6px 11px; border: 2px solid #ded8ca; border-radius: 11px;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  background: #fffdf7; color: var(--ink); text-decoration: none; transition: .22s ease;
}
.market-cap > span { display: flex; align-items: center; gap: 4px; grid-column: 1 / 2; }
.market-cap > span i {
  width: 6px; height: 6px; border-radius: 50%; background: #39b968;
  box-shadow: 0 0 0 3px rgba(57,185,104,.14); animation: livePulse 1.2s infinite alternate;
}
.market-cap > span b { color: #767166; font-size: 7px; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.market-cap strong { grid-column: 1 / 2; font: 16px "Archivo Black"; color: var(--green); white-space: nowrap; }
.market-cap small {
  grid-column: 2; grid-row: 1 / 3; align-self: center; padding: 3px 4px; border-radius: 4px;
  background: #e9f7ec; color: #288a4b; font-size: 6px; font-weight: 900;
}
.market-cap:hover { border-color: var(--green); transform: translateY(-2px); }
.market-cap.fresh { background: #eaf8ec; border-color: #69bc7e; }
.language-picker { position: relative; }
.language-button {
  height: 42px; min-width: 58px; padding: 0 10px; border: 2px solid #ded8ca; border-radius: 21px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  background: white; cursor: pointer; transition: .2s ease;
}
.language-button > span { display: grid; place-items: center; }
.language-button b { color: #777267; font-size: 10px; }
.language-button:hover, .language-picker.open .language-button { border-color: var(--green); transform: translateY(-2px); }
.language-menu {
  position: absolute; z-index: 80; right: 0; top: 51px; width: 175px; padding: 7px;
  border: 2px solid #ddd4c4; border-radius: 13px; background: #fffdf7;
  box-shadow: 0 12px 30px rgba(36,30,20,.22);
  opacity: 0; visibility: hidden; transform: translateY(-7px); transition: .18s ease;
}
.language-picker.open .language-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.language-menu button {
  width: 100%; padding: 8px 9px; border: 0; border-radius: 8px;
  display: flex; align-items: center; gap: 9px; background: transparent; color: var(--ink);
  cursor: pointer; text-align: left;
}
.language-menu button:hover, .language-menu button.active { background: #edf7ee; color: var(--green); }
.language-menu button b { font-size: 11px; }
.flag {
  position: relative; width: 25px; height: 17px; flex: none; overflow: hidden;
  display: inline-block; border: 1px solid rgba(30,30,25,.22); border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.flag-de { background: linear-gradient(#161616 0 33.33%, #d52b1e 33.33% 66.66%, #f7c800 66.66%); }
.flag-fr { background: linear-gradient(90deg, #1749a0 0 33.33%, #fff 33.33% 66.66%, #e33b36 66.66%); }
.flag-ru { background: linear-gradient(#fff 0 33.33%, #2455a4 33.33% 66.66%, #d52b35 66.66%); }
.flag-ja { background: radial-gradient(circle, #bd1731 0 31%, transparent 33%), #fff; }
.flag-es { background: linear-gradient(#aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%); }
.flag-bg { background: linear-gradient(#fff 0 33.33%, #13966f 33.33% 66.66%, #d6262f 66.66%); }
.flag-en { background: #17467e; }
.flag-en::before, .flag-en::after { content: ""; position: absolute; inset: 0; }
.flag-en::before {
  background:
    linear-gradient(28deg, transparent 42%, white 43% 56%, transparent 57%),
    linear-gradient(-28deg, transparent 42%, white 43% 56%, transparent 57%);
}
.flag-en::after {
  background:
    linear-gradient(90deg, transparent 38%, white 38% 62%, transparent 62%),
    linear-gradient(transparent 32%, white 32% 68%, transparent 68%),
    linear-gradient(90deg, transparent 44%, #c92435 44% 56%, transparent 56%),
    linear-gradient(transparent 42%, #c92435 42% 58%, transparent 58%);
}
.icon-button {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid #ded8ca;
  background: white; color: var(--ink); cursor: pointer; font-size: 20px; font-weight: 900;
  transition: .2s ease;
}
.icon-button:hover, .icon-button.active { border-color: var(--green); background: var(--green); color: white; transform: translateY(-2px); }
.help-button {
  height: 42px; padding: 0 12px; border: 2px solid #ded8ca; border-radius: 21px;
  display: flex; align-items: center; gap: 7px; background: white; color: var(--ink);
  cursor: pointer; transition: .2s ease;
}
.help-button b {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: #403a24; font: 13px "Archivo Black";
}
.help-button span { font-size: 9px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.help-button:hover { border-color: var(--green); transform: translateY(-2px); }
.leaderboard-toggle { display: none; font-size: 17px; }

.scene {
  height: 500px; position: relative; overflow: hidden;
  background: #8cc9db url("/src/assets/game/drive-thru-background-worker.webp") center center / cover no-repeat;
  border-bottom: 8px solid #4d463d;
  isolation: isolate;
}
.scene::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(18,25,25,.12) 100%);
}
.normie-marquee {
  position: absolute; z-index: 6; top: 11px; left: 50%; transform: translateX(-50%) rotate(-.5deg);
  min-width: 360px; padding: 7px 26px 9px; border: 3px solid #f4c847; border-radius: 5px;
  background: linear-gradient(180deg, #153f35, #0b2d27); color: #fff8df;
  box-shadow: 0 5px 0 rgba(55,30,10,.35), inset 0 0 20px rgba(255,255,255,.08);
  font: 17px "Archivo Black"; letter-spacing: 2px; text-align: center;
  text-shadow: 0 2px 0 #08211c;
}
.normie-marquee span { color: #f6ca3f; }
.normie-billboard {
  position: absolute; z-index: 7; left: 18px; top: 105px; width: 205px; height: 300px;
  overflow: hidden; border: 6px solid #fff2c6; border-radius: 17px;
  background: linear-gradient(155deg, #183f35 0 54%, #f4c63d 54% 100%);
  box-shadow: 0 10px 0 #17352e, 0 16px 22px rgba(20,25,20,.35);
  transform: rotate(-1.5deg);
}
.normie-billboard::before {
  content: ""; position: absolute; inset: 8px; border: 2px solid rgba(255,255,255,.25);
  border-radius: 9px; pointer-events: none;
}
.leaderboard-panel {
  position: absolute; z-index: 7; right: 14px; top: 95px; width: 175px; min-height: 146px;
  padding: 10px; border: 4px solid #f1ca4b; border-radius: 12px;
  background: linear-gradient(180deg, rgba(14,55,45,.96), rgba(7,35,29,.96)); color: white;
  box-shadow: 0 7px 0 #16392f, 0 13px 20px rgba(19,25,20,.28);
  transition: opacity .2s ease, transform .2s ease;
}
.leaderboard-heading { display: flex; gap: 7px; align-items: center; padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.2); }
.leaderboard-heading > span { font-size: 20px; }
.leaderboard-heading strong { display: block; font: 10px "Archivo Black"; letter-spacing: .8px; }
.leaderboard-heading small { display: block; color: #bcd6c7; font-size: 6px; text-transform: uppercase; letter-spacing: 1px; }
.leaderboard-list { margin: 7px 0 0; padding: 0; list-style: none; }
.leaderboard-list li { display: grid; grid-template-columns: 16px 1fr auto; align-items: center; gap: 5px; padding: 3px 1px; }
.leaderboard-list li > b { color: #f3cf51; font: 9px "Archivo Black"; }
.leaderboard-list li span strong { display: block; max-width: 75px; overflow: hidden; text-overflow: ellipsis; font-size: 8px; white-space: nowrap; }
.leaderboard-list li span small { margin: 0; color: #9fc0ad; font: 5px monospace; text-transform: none; letter-spacing: 0; }
.leaderboard-list li em { color: #fff3ae; font: normal 9px "Archivo Black"; }
.empty-board { display: block !important; text-align: center; color: #91ad9e; padding-top: 18px !important; }
.scene:has(.order-bubble:not(.hidden)) .leaderboard-panel { opacity: .28; transform: translateX(8px) scale(.92); }
.scene:has(.order-bubble:not(.hidden)) .leaderboard-panel:hover {
  opacity: 1;
  transform: translateX(0) scale(1);
}
.billboard-burst {
  position: absolute; width: 210px; height: 210px; right: -88px; bottom: 14px;
  border-radius: 50%; background: repeating-conic-gradient(#fff5bf 0 9deg, transparent 9deg 18deg);
  opacity: .28;
}
.billboard-copy { position: relative; z-index: 2; padding: 19px 15px; color: white; }
.billboard-kicker { display: block; color: #f6d765; font-size: 7px; font-weight: 900; letter-spacing: 1.6px; }
.billboard-copy strong { display: block; font: 31px "Archivo Black"; letter-spacing: -1px; text-shadow: 0 3px 0 #0a261f; }
.billboard-copy small { display: block; color: #eaf6e7; font-size: 7px; font-weight: 900; letter-spacing: 1.8px; }
.normie-mc {
  position: absolute; z-index: 2; width: 190px; height: 223px; right: -13px; bottom: 19px;
  background: url("/src/assets/game/normie-mc.webp") center bottom / contain no-repeat;
  filter: drop-shadow(-5px 8px 5px rgba(18,28,20,.28));
}
.contract-chip {
  position: absolute; z-index: 4; left: 9px; right: 9px; bottom: 8px; height: 29px;
  display: flex; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,.45);
  border-radius: 7px; padding: 4px 6px; background: rgba(8,32,27,.9); color: white; cursor: pointer;
}
.contract-chip span { flex: none; padding: 3px 5px; border-radius: 4px; background: #f6ca3f; color: #17352e; font-size: 7px; font-weight: 900; }
.contract-chip code { overflow: hidden; text-overflow: ellipsis; font: 6px monospace; white-space: nowrap; }
.contract-chip:hover, .contract-chip.copied { background: #11634d; }
.sky { display: none; }
.cloud { position: absolute; width: 110px; height: 28px; border-radius: 30px; background: rgba(255,255,255,.7); }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud::before { width: 48px; height: 48px; left: 19px; bottom: 0; }
.cloud::after { width: 63px; height: 63px; right: 8px; bottom: 0; }
.cloud-one { top: 42px; left: 8%; }
.cloud-two { top: 72px; right: 10%; transform: scale(.7); opacity: .7; }
.city {
  position: absolute; bottom: 0; width: 100%; height: 95px; opacity: .18;
  background: linear-gradient(90deg,
    #185761 0 7%, transparent 7% 9%, #185761 9% 14%, transparent 14% 18%,
    #185761 18% 27%, transparent 27% 30%, #185761 30% 36%, transparent 36% 40%,
    #185761 40% 51%, transparent 51% 55%, #185761 55% 61%, transparent 61% 66%,
    #185761 66% 76%, transparent 76% 80%, #185761 80% 87%, transparent 87% 90%, #185761 90%);
}

.shop { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.shop > .awning, .shop > .shop-sign, .shop > .brick-wall { display: none; }
.brick-wall {
  position: absolute; inset: 46px 0 0;
  background-color: #d9bd92;
  background-image:
    linear-gradient(335deg, rgba(122,85,47,.12) 23px, transparent 23px),
    linear-gradient(155deg, rgba(122,85,47,.12) 23px, transparent 23px);
  background-size: 58px 58px;
}
.awning { height: 48px; display: flex; position: relative; z-index: 2; overflow: hidden; }
.awning span { flex: 1; background: var(--green); clip-path: polygon(0 0,100% 0,92% 100%,8% 100%); }
.awning span:nth-child(even) { background: var(--yellow); }
.shop-sign {
  position: absolute; z-index: 5; top: -20px; left: 50%; transform: translateX(-50%) rotate(-1deg);
  background: #fffef2; border: 4px solid var(--dark-green); padding: 6px 22px;
  color: var(--green); font: 13px "Archivo Black"; letter-spacing: 2px; white-space: nowrap;
  box-shadow: 5px 5px 0 rgba(0,0,0,.12);
}
.road-lines { display: none; }
.road-lines::before { content: ""; position: absolute; inset: 15px 0 auto; height: 6px; background: #f1d65a; box-shadow: 0 9px 0 #f1d65a; }
.road-lines span { position: absolute; bottom: 32px; width: 150px; height: 9px; background: rgba(255,255,255,.55); transform: skewX(-25deg); }
.road-lines span:nth-child(1) { left: 4%; }
.road-lines span:nth-child(2) { left: 44%; }
.road-lines span:nth-child(3) { right: 4%; }

.car {
  --car-color: #ef4e43;
  position: absolute; z-index: 8; bottom: 20px; left: 50%; width: 470px; height: 270px;
  transform: translateX(-50%); transition: transform 1.1s cubic-bezier(.18,.77,.25,1);
}
.car.no-transition { transition: none !important; }
.car.from-right.arriving { transform: translateX(calc(100vw + 100%)); }
.car.from-queue.arriving { transform: translateX(calc(50vw + 58%)) scale(.78); }
.car.leaving-happy, .car.leaving-angry { transform: translateX(calc(-100vw - 100%)); transition-duration: 1.25s; }
.car.leaving-happy .car-art { animation: happyBounce .3s infinite alternate; }
.car.leaving-angry .car-art { animation: angryShake .12s infinite; }
.car-shadow { position: absolute; bottom: 12px; left: 45px; right: 30px; height: 30px; background: rgba(0,0,0,.35); filter: blur(9px); border-radius: 50%; }
.car-art {
  position: absolute; inset: 0;
  background: var(--vehicle-art, url("/src/assets/game/customer-car.webp")) center bottom / contain no-repeat;
  filter: drop-shadow(0 8px 5px rgba(0,0,0,.25));
}
.vehicle-family { width: 560px; height: 285px; }
.vehicle-friends { width: 500px; height: 275px; }
.traffic-queue {
  position: absolute; z-index: 8; right: -330px; bottom: 20px; width: 470px; height: 270px;
  opacity: 0; transform: translateX(0) scale(.78); transform-origin: bottom center;
  transition: opacity .45s ease, transform .75s cubic-bezier(.18,.77,.25,1);
  pointer-events: none;
}
.traffic-queue.vehicle-family { width: 560px; height: 285px; right: -390px; }
.traffic-queue.vehicle-friends { width: 500px; height: 275px; right: -350px; }
.traffic-queue.visible { opacity: .96; transform: translateX(-180px) scale(.78); }
.queued-car { position: absolute; inset: 0; background-position: right bottom; background-size: contain; background-repeat: no-repeat; filter: drop-shadow(0 5px 4px rgba(0,0,0,.24)); }
.honk-bubble {
  position: absolute; left: 40px; top: -4px; padding: 6px 10px; border: 3px solid #292c27; border-radius: 12px;
  background: #fff6c9; color: #d3462f; font: 13px "Archivo Black"; opacity: 0; transform: scale(.5) rotate(-8deg);
}
.traffic-queue.honking .honk-bubble { opacity: 1; animation: honkPop .28s 3 alternate; }
.served-sandwiches {
  position: absolute; z-index: 4; top: 85px; left: 47%; width: 190px; height: 95px;
  pointer-events: none;
}
.served-sandwiches i {
  --served-index: 0;
  position: absolute; width: 98px; height: 70px;
  left: 0; top: 0;
  background: url("/src/assets/game/served-sub.webp") center / contain no-repeat;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.3));
  transform: rotate(calc(-9deg + var(--served-index) * 12deg));
  animation: sandwichReveal .3s cubic-bezier(.17,1.5,.55,1);
}
.served-sandwiches i:nth-child(2) { left: 50px; top: 7px; }
.served-sandwiches i:nth-child(3) { left: 100px; top: 14px; }
.vehicle-compact .served-sandwiches { left: 50%; top: 85px; }
.vehicle-family .served-sandwiches { left: 52%; top: 80px; }
.vehicle-market-tape {
  position: absolute; z-index: 5; left: 39%; bottom: 57px; min-width: 132px; height: 25px;
  padding: 3px 10px; border: 2px solid rgba(255,255,255,.75); border-radius: 5px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(12,48,39,.9); color: white; box-shadow: 0 2px 0 rgba(0,0,0,.28);
  transform: skewX(-4deg);
}
.vehicle-market-tape span {
  color: #f7ce48; font: 8px "Archivo Black"; letter-spacing: .55px;
  white-space: nowrap; text-shadow: 0 1px 0 rgba(0,0,0,.45);
}
.vehicle-family .vehicle-market-tape { left: 39%; bottom: 63px; }
.queue-tape { transform: skewX(-4deg) scale(.9); }
.car-reaction {
  position: absolute; z-index: 3; top: 50px; left: 48%; font-size: 30px;
  opacity: 0; transform: scale(.6); transition: .2s ease;
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.25));
}
.car.leaving-happy .car-reaction, .car.leaving-angry .car-reaction { opacity: 1; transform: scale(1); }
.car-body {
  position: absolute; left: 0; right: 0; bottom: 24px; height: 86px; background: var(--car-color);
  border: 5px solid #35352f; border-radius: 42px 25px 16px 19px;
  box-shadow: inset 0 -15px 0 rgba(0,0,0,.12);
}
.car-roof {
  position: absolute; width: 205px; height: 73px; top: -69px; left: 98px;
  background: var(--car-color); border: 5px solid #35352f; border-bottom: 0;
  border-radius: 75px 65px 0 0; transform: skewX(-8deg);
}
.car-window {
  position: absolute; z-index: 2; left: 177px; top: -59px; width: 103px; height: 54px;
  background: #9fd7e4; border: 4px solid #35352f; border-radius: 7px 37px 3px 3px;
  overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
}
.car-window span { font-size: 44px; line-height: 44px; }
.car-door { position: absolute; left: 165px; top: 2px; width: 126px; height: 75px; border: 3px solid rgba(42,42,38,.6); border-radius: 4px 5px 18px 8px; }
.car-door::after { content: ""; position: absolute; right: 12px; top: 12px; width: 24px; height: 4px; border-radius: 5px; background: #35352f; }
.headlight { position: absolute; left: -4px; top: 27px; width: 17px; height: 27px; border-radius: 3px 10px 10px 3px; background: #fff3a6; border: 3px solid #35352f; }
.taillight { position: absolute; right: -4px; top: 20px; width: 13px; height: 24px; border-radius: 7px 2px 2px 7px; background: #c71f2e; border: 3px solid #35352f; }
.wheel { position: absolute; bottom: 0; width: 62px; height: 62px; border-radius: 50%; background: #292b2a; border: 5px solid #454743; display: grid; place-items: center; }
.wheel i { width: 24px; height: 24px; border-radius: 50%; background: #b7b7ae; border: 5px solid #686b67; }
.wheel-back { right: 50px; }
.wheel-front { left: 53px; }

.order-bubble {
  z-index: 12; position: absolute; width: 280px; left: calc(50% + 195px); bottom: 188px;
  padding: 16px 18px; border: 4px solid #292c27; border-radius: 18px;
  background: #fffdf5; box-shadow: 7px 8px 0 rgba(0,0,0,.17);
  transition: .25s ease; transform-origin: bottom left;
}
.order-bubble::after { content: ""; position: absolute; left: 24px; bottom: -18px; width: 28px; height: 28px; background: #fffdf5; border-right: 4px solid #292c27; border-bottom: 4px solid #292c27; transform: rotate(45deg); }
.order-bubble.hidden { opacity: 0; transform: scale(.7) translateY(20px); pointer-events: none; }
.bubble-heading { display: flex; align-items: center; gap: 7px; padding-bottom: 9px; border-bottom: 2px dashed #d9d3c5; }
.bubble-heading span { font-size: 23px; }
.bubble-heading strong { font-size: 11px; }
.order-title { margin: 10px 0 5px; display: flex; justify-content: space-between; gap: 8px; font: 10px "Archivo Black"; color: var(--green); letter-spacing: 1.4px; }
.order-title b { color: #dc7a22; font-size: 9px; white-space: nowrap; }
.order-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; align-items: center; margin: 3px 0; font-size: 11px; }
.order-row b { line-height: 1.2; }
.order-row small { font-size: 7px; color: #8b897e; font-weight: 900; }
.order-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot); border: 1px solid rgba(0,0,0,.14); }

.patience-panel {
  z-index: 13; position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  width: 380px; color: white; transition: .2s;
}
.patience-panel.hidden { opacity: 0; transform: translate(-50%, 10px); }
.patience-label { display: flex; justify-content: space-between; margin-bottom: 5px; text-transform: uppercase; font-size: 9px; font-weight: 900; letter-spacing: 1.3px; text-shadow: 0 2px 2px #222; }
.patience-track { height: 13px; padding: 3px; border-radius: 20px; background: #252824; box-shadow: 0 2px 0 rgba(255,255,255,.3); }
#patience-bar { height: 100%; width: 100%; border-radius: 20px; background: #65c94d; transition: background .3s; }
#patience-bar.warning { background: #f1bb36; }
#patience-bar.danger { background: #e34c3e; animation: dangerPulse .35s infinite alternate; }

.reaction {
  z-index: 16; position: absolute; left: 50%; top: 105px; transform: translateX(-50%) rotate(-2deg);
  padding: 15px 27px; background: white; border: 4px solid #292c27; border-radius: 15px;
  box-shadow: 7px 7px 0 rgba(0,0,0,.18); font: 20px "Archivo Black";
  animation: reactionPop .35s cubic-bezier(.17,1.6,.55,1);
}
.reaction span { margin-right: 10px; }
.reaction.success { color: var(--green); }
.reaction.failure { color: #d73f32; }
.reaction.hidden { display: none; }

.workbench {
  display: grid; grid-template-columns: 38% 62%; min-height: 360px;
  background: #fff9eb;
}
.builder { padding: 24px 30px; border-right: 2px solid #ded6c7; background: #f3e9d5; }
.builder-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.eyebrow { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: 2px; }
.builder h2 { margin: 2px 0 0; font: 24px "Archivo Black"; text-transform: uppercase; }
.clear-button { border: 0; background: transparent; color: #907f6a; font-size: 11px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.sandwich-preview {
  height: 205px; display: flex; align-items: center; justify-content: center; position: relative;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.8), transparent 66%);
}
.empty-sandwich { text-align: center; color: #9b8e7b; }
.empty-sandwich span { display: block; font-size: 64px; filter: grayscale(.5); opacity: .65; transform: rotate(-8deg); }
.empty-sandwich p { margin: 4px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.sandwich-stack { width: min(350px, 88%); display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 9px 5px rgba(73,49,26,.2)); }
.bread-top { width: 90%; height: 48px; background: var(--bread); border-radius: 80% 80% 15% 15%; border: 3px solid rgba(87,50,18,.35); position: relative; z-index: 10; box-shadow: inset 0 7px 0 rgba(255,255,255,.22); }
.bread-top i { position: absolute; width: 12px; height: 5px; border-radius: 50%; background: #fff0b5; transform: rotate(-15deg); }
.bread-top i:nth-child(1) { left: 22%; top: 15px; }.bread-top i:nth-child(2) { left: 43%; top: 7px; }.bread-top i:nth-child(3) { right: 22%; top: 17px; }.bread-top i:nth-child(4) { right: 42%; top: 28px; }
.layers { width: 100%; display: flex; flex-direction: column; align-items: center; margin: -2px 0; z-index: 5; }
.sandwich-layer {
  width: 88%; height: 25px; margin-top: -5px;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: calc(8 - var(--i));
  transform: translateX(calc((var(--i) % 3 - 1) * 5px));
}
.sandwich-layer img {
  width: 82%; height: 28px; object-fit: fill;
  filter: drop-shadow(0 3px 2px rgba(71,43,20,.24));
  transform: scaleX(1.08);
}
.layer-protein { height: 28px; }
.layer-protein img { width: 84%; height: 32px; }
.layer-cheese { height: 20px; }
.layer-cheese img { width: 80%; height: 24px; }
.layer-veggies { height: 21px; }
.layer-veggies img { width: 79%; height: 25px; }
.layer-sauces { height: 13px; }
.layer-sauces img { width: 70%; height: 14px; transform: scaleX(1.1) scaleY(.72); }
.bread-bottom { width: 88%; height: 28px; background: var(--bread); border-radius: 15% 15% 45% 45%; border: 3px solid rgba(87,50,18,.35); box-shadow: inset 0 -6px 0 rgba(87,50,18,.12); }
.no-fillings { color: #a28565; font-size: 10px; font-weight: 800; padding: 5px; }
.sandwich-caption { position: absolute; bottom: 3px; text-align: center; }
.sandwich-caption b { display: block; font-size: 11px; text-transform: uppercase; }
.sandwich-caption span { color: #8c7d69; font-size: 9px; }
.serve-button {
  width: 100%; border: 0; padding: 15px 18px; border-radius: 9px;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--green); color: white; font: 16px "Archivo Black";
  text-transform: uppercase; cursor: pointer; box-shadow: 0 5px 0 var(--dark-green);
  transition: .15s;
}
.serve-button:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--dark-green); }
.serve-button:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 var(--dark-green); }
.serve-button:disabled { background: #aaa79d; box-shadow: 0 5px 0 #7a7972; cursor: not-allowed; opacity: .65; }
.serve-button b { font-size: 23px; }

.ingredients-panel { background: #fffdf7; overflow: hidden; }
.tabs { display: flex; border-bottom: 2px solid #e6dfd1; padding: 0 18px; overflow-x: auto; }
.tab {
  flex: 1; min-width: max-content; padding: 18px 14px 14px; border: 0; border-bottom: 5px solid transparent;
  background: transparent; color: #8d887e; text-transform: uppercase; font-size: 10px; font-weight: 900; letter-spacing: .7px; cursor: pointer;
}
.tab:hover { color: var(--green); }
.tab.active { color: var(--green); border-color: var(--yellow); }
.ingredient-grid {
  display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: 13px;
  padding: 22px; max-height: 315px; overflow-y: auto;
}
.ingredient-button {
  min-height: 132px; padding: 10px 7px 8px; border: 2px solid #e0d9cd; border-radius: 12px; background: white;
  display: grid; grid-template-rows: 78px minmax(30px, auto); align-items: center; justify-items: center; gap: 2px;
  position: relative; cursor: pointer; box-shadow: 0 4px 0 #e7dfd3; transition: .15s ease;
}
.ingredient-button:hover:not(:disabled) { transform: translateY(-3px); border-color: #9dbda7; box-shadow: 0 7px 0 #e7dfd3; }
.ingredient-button.selected { border-color: var(--green); background: #eff9ee; box-shadow: 0 4px 0 #a9cfb4; }
.ingredient-button:disabled { opacity: .55; cursor: not-allowed; }
.ingredient-button b {
  position: relative; z-index: 2; width: 100%; min-height: 28px; padding: 4px 2px 0;
  display: flex; align-items: center; justify-content: center;
  background: white; font-size: 10px; line-height: 1.15; text-transform: uppercase; text-align: center;
  overflow-wrap: anywhere;
}
.ingredient-button.selected b { background: #eff9ee; }
.ingredient-icon { width: 88px; height: 76px; overflow: hidden; position: relative; display: grid; place-items: center; }
.ingredient-icon img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 5px 4px rgba(78,50,20,.18));
}
.check { position: absolute; top: 7px; right: 7px; width: 19px; height: 19px; border-radius: 50%; display: none; place-items: center; color: white; background: var(--green); font-size: 11px; }
.selected .check { display: grid; }

.overlay {
  position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(18, 44, 32, .82); backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden; transition: .3s ease;
  overflow-y: auto;
}
.overlay.active { opacity: 1; visibility: visible; }
.modal {
  width: min(540px, 100%); padding: 38px 45px; background: #fffaf0; border: 6px solid #282c27;
  border-radius: 25px 8px 25px 8px; text-align: center; box-shadow: 15px 16px 0 rgba(0,0,0,.25);
  transform: translateY(20px) rotate(-1deg); transition: .4s cubic-bezier(.17,1.2,.6,1);
}
.overlay.active .modal { transform: translateY(0) rotate(-1deg); }
.modal-logo { margin: -66px auto 20px; width: 72px; height: 72px; font-size: 28px; box-shadow: inset -7px -7px 0 rgba(0,0,0,.12), 5px 6px 0 #282c27; }
.start-languages {
  display: flex; justify-content: center; gap: 5px; margin: -5px 0 13px;
}
.start-languages button {
  width: 36px; height: 30px; padding: 0; border: 2px solid transparent; border-radius: 8px;
  display: grid; place-items: center; background: #eee6d6; cursor: pointer; transition: .15s ease;
}
.start-languages button:hover, .start-languages button.active {
  border-color: var(--green); background: white; transform: translateY(-2px);
}
.start-leaderboard {
  margin: 12px 0 8px; padding: 10px 14px; border: 2px solid #d8c8a8; border-radius: 12px;
  background: linear-gradient(180deg, #173f35, #0b2e27); color: white; text-align: left;
}
.start-leaderboard .leaderboard-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px;
}
.start-leaderboard .leaderboard-list li { padding: 3px; }
.start-leaderboard .leaderboard-list li span strong { max-width: 120px; font-size: 9px; }
.start-leaderboard .leaderboard-list li span small { font-size: 6px; }
.start-leaderboard .leaderboard-list li em { font-size: 10px; }
.leaderboard-overlay { z-index: 120; }
.leaderboard-modal { width: min(430px, 100%); text-align: left; }
.leaderboard-modal .leaderboard-heading { color: var(--ink); border-bottom-color: #d8cdb9; }
.leaderboard-modal .leaderboard-heading strong { font-size: 18px; }
.leaderboard-modal .leaderboard-heading small { color: #797164; font-size: 8px; }
.leaderboard-modal .leaderboard-list { margin: 16px 0 22px; }
.leaderboard-modal .leaderboard-list li {
  grid-template-columns: 28px 1fr auto; min-height: 44px; padding: 7px 9px;
  border-bottom: 1px solid #dfd5c4;
}
.leaderboard-modal .leaderboard-list li > b { color: var(--green); font-size: 15px; }
.leaderboard-modal .leaderboard-list li span strong { max-width: 210px; color: var(--ink); font-size: 13px; }
.leaderboard-modal .leaderboard-list li span small { color: #82796b; font-size: 8px; }
.leaderboard-modal .leaderboard-list li em { color: #b27508; font-size: 15px; }
.help-overlay { z-index: 125; }
.help-modal {
  width: min(760px, 100%); max-height: calc(100dvh - 40px); padding: 30px 34px;
  overflow-y: auto; text-align: left;
}
.help-heading {
  display: flex; align-items: center; gap: 12px; padding-bottom: 12px;
  border-bottom: 2px solid #ded3c0;
}
.help-heading > span {
  width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: #403a24; font: 22px "Archivo Black";
}
.help-heading strong { display: block; font: 23px "Archivo Black"; text-transform: uppercase; }
.help-heading small { margin: 0; color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: 2px; }
.help-intro { max-width: none !important; margin: 14px 0 !important; color: #625c51 !important; font-weight: 700; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.help-card {
  min-height: 112px; padding: 12px; border: 2px solid #e0d5c1; border-radius: 12px;
  display: grid; grid-template-columns: 34px 1fr; gap: 10px; background: #f7eedf;
}
.help-card > b {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--green); color: white; font: 16px "Archivo Black";
}
.help-card strong { display: block; margin-bottom: 4px; color: var(--ink); font: 12px "Archivo Black"; text-transform: uppercase; }
.help-card p { margin: 0; color: #6f675a; font-size: 10px; line-height: 1.45; }
.rotate-overlay { z-index: 140; }
.rotate-modal { width: min(420px, 100%); padding: 32px; }
.rotate-modal h2 { margin: 12px 0 8px; font: 27px "Archivo Black"; text-transform: uppercase; }
.rotate-modal p { margin-bottom: 20px; }
.rotate-modal .secondary-button { margin-top: 12px; margin-bottom: 0; }
.phone-rotate {
  width: 125px; height: 70px; margin: 0 auto 14px; border: 7px solid var(--green); border-radius: 16px;
  display: grid; place-items: center; background: #e8f3e8; transform: rotate(-6deg);
  box-shadow: 8px 8px 0 #d8c9ad;
}
.phone-rotate span { color: var(--green); font: 34px "Archivo Black"; animation: rotateHint 1.3s ease-in-out infinite alternate; }
.player-profile {
  margin: 14px 0 8px; padding: 12px; border-radius: 12px; background: #f0e6d2;
  display: grid; grid-template-columns: 1fr 1.45fr; gap: 8px; text-align: left;
}
.player-profile label span { display: block; margin: 0 0 4px 3px; color: #746b5e; font-size: 7px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.player-profile input {
  width: 100%; height: 38px; border: 2px solid #d4c7b1; border-radius: 8px; padding: 0 10px;
  background: #fffdf7; color: var(--ink); font-size: 11px; outline: 0;
}
.player-profile input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,115,72,.12); }
.player-profile > small {
  grid-column: 1 / -1; margin: 3px 3px 0; padding: 7px 9px; border-radius: 7px;
  background: #e4f1e6; color: #316b4b; font-size: 8px; font-weight: 700;
  line-height: 1.35; text-transform: none; letter-spacing: .2px;
}
.profile-error { grid-column: 1 / -1; color: #c83b32; font-size: 8px; text-align: center; }
.profile-error.hidden { display: none; }
.modal-kicker { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: 4px; }
.modal h1 { margin: 5px 0 14px; font: 49px/0.86 "Archivo Black"; letter-spacing: -2px; }
.modal h1 em { color: #e5a813; font-style: normal; }
.modal p { max-width: 400px; margin: 0 auto 22px; color: #6f6c63; font-size: 13px; line-height: 1.6; }
.how-to { display: flex; justify-content: center; gap: 14px; margin: 22px 0; }
.how-to span { font-size: 10px; font-weight: 800; }
.how-to i { display: block; font-style: normal; }
.how-to b { display: grid; place-items: center; width: 26px; height: 26px; margin: 0 auto 5px; border-radius: 50%; background: var(--yellow); color: #3d3b2d; }
.primary-button {
  width: 100%; padding: 16px 22px; border: 0; border-radius: 9px; background: var(--green); color: white;
  display: flex; justify-content: center; gap: 20px; font: 17px "Archivo Black"; text-transform: uppercase;
  cursor: pointer; box-shadow: 0 6px 0 var(--dark-green); transition: .15s;
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--dark-green); }
.secondary-button {
  width: 100%; min-height: 42px; margin: 0 0 10px; border: 2px solid var(--green); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; color: var(--green); cursor: pointer;
  font-size: 11px; font-weight: 900; text-transform: uppercase;
}
.secondary-button b {
  width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center;
  background: var(--yellow); color: #403a24;
}
.secondary-button:hover { background: #e9f3e9; }
.modal small { display: block; margin-top: 16px; color: #9c9689; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.game-over-modal h1 { margin: 8px 0 25px; font-size: 42px; }
.final-score { display: flex; flex-direction: column; padding: 17px; background: #efe5cf; border-radius: 12px; }
.final-score span, .result-grid span { font-size: 9px; text-transform: uppercase; font-weight: 900; letter-spacing: 1.5px; color: #7f786a; }
.final-score strong { font: 42px "Archivo Black"; color: var(--green); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 24px; }
.result-grid div { padding: 11px 4px; background: #f6eee0; border-radius: 8px; }
.result-grid span { display: block; font-size: 7px; }
.result-grid b { font: 19px "Archivo Black"; }

.byte-mode {
  --yellow: #8bff49;
  --green: #4f2dd4;
  --dark-green: #281078;
  --cream: #f5f1ff;
}
.byte-mode .scene {
  background-image:
    linear-gradient(rgba(70,31,190,.36), rgba(35,11,100,.5)),
    url("/src/assets/game/drive-thru-background-worker.webp");
  background-size: cover;
  background-position: center;
}
.byte-mode .sky { filter: hue-rotate(70deg) saturate(1.3); }
.byte-mode .shop-sign::after { content: " • BYTE MODE"; color: #792bd4; }
.byte-mode .road-lines::after {
  content: "0101  FRESH BLOCKS  1010"; position: absolute; bottom: 8px; right: 20px;
  color: #8bff49; font: 8px monospace; letter-spacing: 2px; opacity: .65;
}

@keyframes wheelSpin { to { transform: rotate(-360deg); } }
@keyframes happyBounce { to { transform: translateY(-5px) rotate(-1deg); } }
@keyframes angryShake { 0%,100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
@keyframes reactionPop { from { opacity: 0; transform: translateX(-50%) scale(.4) rotate(6deg); } }
@keyframes dangerPulse { to { opacity: .55; } }
@keyframes comboPulse { to { transform: scale(1.05); } }
@keyframes livePulse { to { opacity: .45; } }
@keyframes honkPop { to { opacity: 1; transform: scale(1) rotate(4deg); } }
@keyframes sandwichReveal { from { opacity: 0; transform: translateY(15px) scale(.45) rotate(-15deg); } }
@keyframes rotateHint { to { transform: rotate(90deg); } }

@media (max-width: 900px) {
  .topbar { padding: 0 14px; }
  .brand strong { font-size: 14px; }
  .brand span { letter-spacing: 3px; }
  .stat { min-width: 75px; padding: 10px; }
  .market-cap { min-width: 112px; padding-inline: 8px; }
  .help-button { width: 42px; padding: 0; justify-content: center; }
  .help-button span { display: none; }
  .order-bubble { left: auto; right: 18px; bottom: 168px; }
  .normie-billboard { width: 155px; height: 225px; top: 135px; left: 8px; }
  .leaderboard-panel { width: 145px; right: 8px; top: 105px; }
  .billboard-copy strong { font-size: 23px; }
  .normie-mc { width: 145px; height: 170px; }
  .contract-chip code { font-size: 5px; }
  .workbench { grid-template-columns: 1fr; }
  .builder { border-right: 0; border-bottom: 2px solid #ded6c7; }
  .ingredient-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 650px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .topbar {
    height: auto; min-height: 74px; flex-wrap: wrap;
    padding: calc(9px + env(safe-area-inset-top)) 14px 9px; gap: 6px;
  }
  .brand-mark { width: 40px; height: 40px; font-size: 16px; }
  .header-actions { margin-left: auto; }
  .market-cap {
    position: absolute; right: 14px; top: 78px; z-index: 19;
    min-width: 116px; height: 42px; padding: 4px 8px;
    box-shadow: 0 4px 12px rgba(28,24,16,.14);
  }
  .market-cap strong { font-size: 14px; }
  .language-button { min-width: 48px; height: 38px; padding: 0 7px; }
  .language-menu { position: fixed; top: 67px; right: 8px; width: 165px; }
  .leaderboard-toggle { display: grid; place-items: center; }
  .help-button { width: 38px; height: 38px; }
  .stats { order: 3; width: 100%; height: 55px; justify-content: center; }
  .stat { flex: 1; }
  .scene { height: 360px; background-position: center; }
  .shop { left: 0; right: 0; }
  .car { width: 380px; height: 220px; transform: translateX(-50%) scale(.86); transform-origin: bottom center; }
  .car.from-right.arriving { transform: translateX(calc(100vw + 100%)) scale(.86); }
  .car.from-queue.arriving { transform: translateX(calc(50vw + 58%)) scale(.7); }
  .car.leaving-happy, .car.leaving-angry { transform: translateX(calc(-100vw - 100%)) scale(.86); }
  .vehicle-family { width: 440px; }
  .vehicle-friends { width: 400px; }
  .traffic-queue { bottom: 20px; transform: scale(.62); transform-origin: right bottom; }
  .traffic-queue.visible { transform: translateX(-115px) scale(.62); }
  .order-bubble { width: 230px; right: 8px; bottom: 155px; padding: 11px; }
  .normie-marquee { min-width: 260px; top: 7px; font-size: 12px; padding: 5px 12px; }
  .normie-billboard { width: 112px; height: 160px; top: 105px; left: 5px; border-width: 3px; }
  .leaderboard-panel { width: 108px; min-height: 95px; right: 5px; top: 116px; padding: 6px; border-width: 3px; }
  .scene:has(.order-bubble:not(.hidden)) .leaderboard-panel:active,
  .scene:has(.order-bubble:not(.hidden)) .leaderboard-panel:focus-within {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  .leaderboard-heading small, .leaderboard-panel li span small { display: none; }
  .leaderboard-panel li { grid-template-columns: 12px 1fr auto; gap: 2px; }
  .leaderboard-panel li span strong { max-width: 43px; font-size: 6px; }
  .leaderboard-panel li em { font-size: 7px; }
  .billboard-copy { padding: 10px 7px; }
  .billboard-kicker, .billboard-copy small { display: none; }
  .billboard-copy strong { font-size: 16px; }
  .normie-mc { width: 102px; height: 122px; right: -7px; bottom: 13px; }
  .contract-chip { height: 19px; left: 4px; right: 4px; bottom: 3px; padding: 2px 3px; }
  .contract-chip span { font-size: 5px; padding: 2px 3px; }
  .contract-chip code { font-size: 4px; }
  .order-row { font-size: 9px; }
  .patience-panel { width: 85%; }
  .builder { padding: 15px; }
  .builder h2 { font-size: 19px; }
  .clear-button { min-height: 44px; padding: 0 8px; }
  .sandwich-preview { height: 160px; }
  .serve-button { min-height: 52px; }
  .tabs { padding: 0 6px; }
  .tab { min-height: 48px; padding: 13px 10px 9px; }
  .ingredient-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; max-height: 310px; }
  .ingredient-button {
    min-height: 108px; padding: 7px 5px 6px;
    grid-template-rows: 62px minmax(32px, auto);
  }
  .ingredient-icon { width: 72px; height: 60px; }
  .player-profile { grid-template-columns: 1fr; }
  .player-profile > small, .profile-error { grid-column: 1; }
  .modal { margin: auto; padding: 30px 18px 24px; border-width: 4px; }
  .modal-logo { margin-top: -52px; width: 60px; height: 60px; }
  .modal h1 { font-size: 35px; }
  .modal p { margin-bottom: 14px; line-height: 1.4; }
  .start-leaderboard { margin: 8px 0 6px; padding: 8px 10px; }
  .start-leaderboard .leaderboard-list { grid-template-columns: 1fr; }
  .start-leaderboard .leaderboard-list li:nth-child(n+4) { display: none; }
  .start-leaderboard .leaderboard-list li span strong { max-width: 150px; }
  .leaderboard-modal { margin: auto; }
  .leaderboard-modal .leaderboard-heading small { display: block; }
  .help-modal { margin: auto; max-height: calc(100dvh - 24px); padding: 20px 16px; }
  .help-heading strong { font-size: 18px; }
  .help-grid { grid-template-columns: 1fr; gap: 8px; }
  .help-card { min-height: 0; padding: 10px; }
  .help-card p { font-size: 10px; }
  .rotate-modal { padding: 26px 18px; }
  .rotate-modal h2 { font-size: 23px; }
  .how-to { gap: 7px; }
  .start-languages { flex-wrap: wrap; }
  .start-languages button { width: 44px; height: 40px; }
  .player-profile input { height: 44px; font-size: 16px; }
  .primary-button { min-height: 52px; }
}

@media (max-height: 600px) and (orientation: landscape) {
  .topbar {
    min-height: 58px; height: 58px; padding: 5px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
    flex-wrap: nowrap;
  }
  .brand-mark { width: 38px; height: 38px; }
  .brand span { display: none; }
  .stats { order: initial; width: auto; height: 58px; }
  .stat { min-width: 68px; padding: 6px 9px; }
  .stat strong { font-size: 18px; }
  .market-cap { position: static; height: 40px; min-width: 105px; }
  .scene { height: 300px; }
  .normie-billboard { width: 105px; height: 150px; top: 90px; }
  .leaderboard-panel { top: 85px; }
  .order-bubble { bottom: 105px; }
  .patience-panel { width: min(340px, 55vw); }
  .workbench { grid-template-columns: 36% 64%; min-height: 280px; }
  .builder { border-right: 2px solid #ded6c7; border-bottom: 0; }
  .sandwich-preview { height: 145px; }
  .ingredient-grid { grid-template-columns: repeat(4, minmax(92px, 1fr)); max-height: 220px; }
  .ingredient-button { min-height: 96px; grid-template-rows: 54px minmax(30px, auto); }
  .ingredient-icon { width: 66px; height: 52px; }
  .overlay { align-items: start; padding: 18px max(18px, env(safe-area-inset-right)) 18px max(18px, env(safe-area-inset-left)); }
  .modal { max-width: 620px; padding: 20px 28px; }
  .modal-logo { display: none; }
  .modal h1 { font-size: 32px; margin-bottom: 8px; }
  .modal p { margin-bottom: 8px; }
  .how-to { margin: 10px 0; }
  .player-profile { margin: 8px 0 5px; padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
