:root {
  color-scheme: light;
  --sky: #f0c9ad;
  --earth: #9a754d;
  --road: #393d40;
  --walk: #d2c9b3;
  --owned: #8da65e;
  --locked: #586674;
  --danger: #b33a2b;
  --ink: #252927;
  --paper: #f3ecdc;
  --ui: "Avenir Next", Avenir, system-ui, sans-serif;
  font-family: var(--ui);
  color: var(--ink);
  background: var(--earth);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button { color: inherit; font: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, [role="button"]:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
[hidden] { display: none !important; }
.game { position: relative; width: 100%; height: 100dvh; min-height: 540px; overflow: hidden; background: var(--sky); }
.world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; z-index: 5; top: max(10px, env(safe-area-inset-top)); left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); display: grid; grid-template-columns: minmax(100px, 1fr) minmax(145px, auto); grid-template-areas: "cash pay" "brand brand"; align-items: start; gap: 7px; pointer-events: none; }
.cash-sign { grid-area: cash; width: max-content; min-width: 116px; display: grid; grid-template-columns: 24px auto; align-items: center; padding: 6px 10px 7px 7px; color: var(--paper); background: var(--ink); border: 3px solid #181b1a; box-shadow: 0 4px #181b1a; font-variant-numeric: tabular-nums; }
.cash-sign > span { grid-row: span 2; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: var(--ink); background: var(--owned); font-size: 13px; font-weight: 900; }
#cash { font-size: 24px; line-height: 1; letter-spacing: -.04em; }
#cash.debt { color: #ff9b8a; }
#rate { margin-top: 4px; color: #c6d0b3; font-size: 10px; line-height: 1; font-weight: 800; }
.brand-sign { grid-area: brand; justify-self: center; display: flex; gap: 6px; align-items: center; padding: 3px 8px; color: var(--paper); background: #333638; border: 2px solid #202323; box-shadow: 0 3px #202323; }
.brand-sign small { font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.brand-sign b { font: 700 12px/1 Georgia, serif; letter-spacing: .04em; }
.brand-sign .clock { display: grid; margin-left: 4px; padding-left: 8px; border-left: 2px solid #4a4f50; text-align: left; font-variant-numeric: tabular-nums; }
.brand-sign .clock b { font: 900 14px/1 var(--ui); letter-spacing: .02em; color: #f2dc2f; }
.brand-sign .clock small { margin-top: 2px; font-size: 7px; color: #c6d0b3; }
.payday { grid-area: pay; justify-self: end; min-width: 112px; padding: 6px 9px; color: var(--paper); background: var(--ink); border: 3px solid #181b1a; box-shadow: 0 4px #181b1a; text-align: right; }
.payday b, .payday span { display: block; }
.payday b { font-size: 11px; line-height: 1.05; letter-spacing: .06em; }
.payday span { margin-top: 3px; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; }
.payday.cooldown { color: #d0d0c9; }
.action:active { transform: scale(.96); }
.terminal { position: absolute; z-index: 9; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-height: min(56dvh, 520px); display: flex; flex-direction: column; padding: 12px; color: var(--paper); background: #292e30; border: 3px solid #181b1c; box-shadow: 0 6px #181b1c; }
.terminal-head { display: flex; justify-content: space-between; align-items: flex-start; }
.terminal-head small { color: #b5c98d; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.terminal-head h2 { margin: 2px 0 0; font: 700 21px/1 Georgia, serif; }
.terminal-head > button { width: 40px; height: 40px; border: 2px solid #141718; background: #454c4d; color: var(--paper); font-size: 25px; line-height: 1; }
.company-summary { display: flex; gap: 7px; flex-wrap: wrap; margin: 9px 0; font-size: 11px; font-weight: 800; }
.company-summary span { padding: 4px 7px; color: var(--ink); background: #c0c6b1; }
.company-summary .review-note { flex: 1 0 100%; color: var(--paper); background: transparent; padding: 2px 0 0; font-weight: 600; }
.terminal-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.terminal-tabs button { min-height: 36px; padding: 4px; border: 0; color: #ddd8ca; background: #414749; font-size: 10px; font-weight: 900; letter-spacing: .05em; }
.terminal-tabs button.active { color: #1d2419; background: #a6be7d; }
.terminal-content { min-height: 0; overflow: auto; padding: 8px 1px 2px; overscroll-behavior: contain; }
.action-group { margin: 0 0 10px; }
.action-group h3 { margin: 0 0 5px; color: #c2ceab; font-size: 10px; letter-spacing: .11em; }
.action-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.action { min-height: 48px; padding: 7px 8px; border: 2px solid #151819; color: var(--ink); background: #d2c9b3; text-align: left; font-size: 11px; line-height: 1.15; font-weight: 850; }
.action strong, .action small { display: block; }
.action small { margin-top: 4px; font-size: 10px; font-weight: 700; opacity: .75; }
.action.ready { color: #172013; background: #a6be7d; }
.action:disabled { color: #b7b9b5; background: #505859; border-color: #424849; cursor: default; opacity: .72; }
.action:disabled:active { transform: none; }
.product-card { padding: 7px; border-left: 4px solid var(--owned); background: #353b3d; font-size: 11px; }
.product-card b { display: block; margin-bottom: 3px; }
.product-card p { margin: 0; line-height: 1.4; }
.world-hint { position: absolute; z-index: 6; left: 50%; top: 22%; width: max-content; max-width: 90vw; transform: translateX(-50%); padding: 6px 10px; color: var(--paper); background: var(--ink); border: 2px solid #171a19; box-shadow: 0 3px #171a19; font-size: 12px; font-weight: 900; pointer-events: none; opacity: 0; transition: opacity .18s; }
.world-hint.on { opacity: 1; }
.review-float { position: absolute; z-index: 7; left: 50%; top: 15%; width: max-content; max-width: min(92vw, 520px); transform: translateX(-50%); padding: 6px 10px; color: var(--ink); background: #f0e7cd; border: 2px solid #36332c; border-left-width: 6px; font-size: 12px; font-weight: 800; line-height: 1.3; pointer-events: none; opacity: 0; }
.review-float.good { border-left-color: #6f9a3e; }
.review-float.bad { background: #f6d4cc; border-left-color: var(--danger); }
.review-float.on { animation: feedback 2.8s ease both; }
#money-float-layer { position: absolute; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.money-float.spend { color: #ffb4a6; }
.money-float { position: absolute; color: var(--paper); font-size: 20px; font-weight: 950; font-variant-numeric: tabular-nums; text-shadow: 0 2px #202321; animation: money-flight .78s cubic-bezier(.2,.7,.35,1) forwards; }

/* World: flat-shaded dimetric blocks, no outlines (Claim Avenue look). */
.plot-target { cursor: pointer; }
.plot-target.rival-static { cursor: default; }
.plot-target.rival-static.rogue .land { animation: rival-flash 1.1s ease-in-out infinite; }
.plot-target .action-ring { fill: none; stroke: #fff6c8; stroke-width: 3; stroke-dasharray: 9 6; opacity: 0; }
.plot-target.ready .action-ring { opacity: 1; animation: ring-pulse 1.25s ease-in-out infinite; }
.plot-target:hover .action-ring, .plot-target:focus-visible .action-ring { opacity: .8; }
.plot-target .plot-art, .walker .walker-art, .payday-target { transform-box: fill-box; transform-origin: center bottom; transition: transform .12s ease; }
.plot-target:active .plot-art, .walker [role="button"]:active .walker-art, .payday-target:active { transform: scale(.97); }
.roof-trim { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.4; }
.sign-text { font: 900 10px var(--ui); text-anchor: middle; letter-spacing: .05em; }
.sign-text.big { font-size: 15px; letter-spacing: .02em; }
.beacon { fill: #e5392f; animation: beacon 1.6s ease-in-out infinite; }
.hit { fill: transparent; pointer-events: all; }
.mover { pointer-events: none; animation: drive linear infinite; will-change: transform; }
.walker [role="button"] { pointer-events: auto; cursor: pointer; }
.walker .walker-tag { fill: var(--paper); font: 900 9px var(--ui); text-anchor: middle; paint-order: stroke; stroke: #252927; stroke-width: 3px; }
.walker .walker-tag.coin { fill: #f2dc2f; font-size: 11px; }
.walker.rival .walker-art { animation: bob .45s ease-in-out infinite alternate; }
.walker.candidate.ready .walker-art { animation: talent-pulse 1.7s ease-in-out infinite; }
.payday-target { cursor: pointer; }
.payday-target.ready .die { animation: die-glow 1.1s ease-in-out infinite; }
.payday-target .chip-mark { fill: #1f2a2d; font: 900 26px var(--ui); text-anchor: middle; dominant-baseline: middle; }

@keyframes drive { from { transform: translate(var(--x0), var(--y0)); } to { transform: translate(var(--x1), var(--y1)); } }
@keyframes ring-pulse { 50% { opacity: .3; } }
@keyframes rival-flash { 50% { fill: #d98bb0; } }
@keyframes beacon { 50% { opacity: .35; } }
@keyframes bob { to { transform: translateY(-3px); } }
@keyframes die-glow { 50% { opacity: .55; } }
@keyframes talent-pulse { 50% { transform: scale(1.08); } }
@keyframes feedback { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -18px); } }
@keyframes money-flight { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1); } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(.55); } }
@media (min-width: 760px) {
  .hud { grid-template-columns: 1fr auto 1fr; grid-template-areas: "cash brand pay"; align-items: start; }
  .brand-sign { justify-self: center; padding: 7px 12px; }
  .brand-sign small { font-size: 10px; }
  .brand-sign b { font-size: 15px; }
  .payday { min-width: 112px; }
  .terminal { left: auto; right: max(16px, env(safe-area-inset-right)); top: 88px; bottom: max(16px, env(safe-area-inset-bottom)); width: min(440px, 40vw); max-height: none; }
  .terminal-content { flex: 1; }
  .action { min-height: 54px; font-size: 12px; }
}
@media (max-width: 759px) { .terminal { bottom: max(16px, env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (prefers-reduced-motion: reduce) { .mover { animation-duration: 30s !important; animation-iteration-count: infinite !important; animation-play-state: paused !important; } }

/* Expanded lab menu */
.company-summary .bad { background: #e3a293; }
.action-group h3 span { float: right; color: #8f9a86; font-weight: 700; letter-spacing: .02em; }
.action.current { background: #c0c6b1; border-style: dashed; }
.action.tiny { min-height: 0; padding: 4px 10px; }
.action.tiny small { display: none; }
.role-row { display: grid; grid-template-columns: 1fr auto; gap: 5px; margin-bottom: 5px; }
.meter { position: relative; height: 20px; margin: 0 0 6px; background: #1f2425; border: 2px solid #151819; overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; background: #6d7a5c; transition: width var(--duration-normal, .3s) ease; }
.meter.good i { background: #7fa14e; }
.meter.bad i { background: #b55a45; }
.meter.rival i { background: #5d6b78; }
.meter span { position: relative; z-index: 1; display: block; padding: 2px 6px; font-size: 10px; font-weight: 900; letter-spacing: .03em; }
.model-card { margin-bottom: 8px; padding: 8px; background: #353b3d; border-left: 4px solid #7fa14e; }
.model-card.new { border-left-color: #f2c94c; }
.model-card.locked { opacity: .55; border-left-color: #5d6468; }
.model-card header { margin-bottom: 6px; }
.model-card header b { display: block; font-size: 13px; }
.model-card header small { color: #b9c2a8; font-size: 10px; font-weight: 700; }
.model-card .action { width: 100%; }
.product-card.live { border-left-color: #9fe05a; }
.product-card.good { border-left-color: #f2c94c; }
.product-card p { margin: 4px 0 0; }
.action-group > p { margin: 0 0 6px; color: #c2c9b6; font-size: 11px; line-height: 1.35; }
.review { margin-bottom: 4px; padding: 5px 7px; background: #353b3d; border-left: 3px solid #6d7a5c; font-size: 11px; line-height: 1.35; }
.review b { color: #f2c94c; letter-spacing: .05em; }
.review small { color: #9aa38f; }
.review.good { border-left-color: #7fa14e; }
.review.bad { border-left-color: var(--danger); }
.rival-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid #3c4345; font-size: 11px; }
.rival-row small { color: #b9c2a8; text-align: right; }
.ledger { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin-bottom: 8px; padding: 8px; background: #1f2425; font-size: 12px; font-variant-numeric: tabular-nums; }
.ledger span { color: #b9c2a8; }
.ledger .good { color: #a6d36b; }
.ledger .bad { color: #ff9b8a; }
.inbox { position: absolute; z-index: 10; left: 50%; top: 50%; width: min(92vw, 420px); transform: translate(-50%, -50%); padding: 16px; color: var(--ink); background: #f3ecdc; border: 3px solid #181b1a; box-shadow: 0 8px 0 #181b1a, 0 20px 50px rgba(0, 0, 0, .35); animation: inbox-in var(--duration-normal, .3s) cubic-bezier(.16, 1, .3, 1); }
.inbox small { color: var(--danger); font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.inbox h2 { margin: 4px 0 6px; font: 700 22px/1.1 Georgia, serif; }
.inbox p { margin: 0 0 12px; font-size: 14px; line-height: 1.4; }
.inbox-options { display: grid; gap: 6px; }
.inbox .action { min-height: 44px; }
@keyframes inbox-in { from { opacity: 0; transform: translate(-50%, -44%); } }
@media (min-width: 760px) { .terminal-tabs { grid-template-columns: repeat(6, 1fr); } .terminal-tabs button { font-size: 9px; } }

/* Guided tutorial: a spotlight ring that dims everything else, plus a coach card. Clicks pass through. */
.coach { position: absolute; inset: 0; z-index: 11; pointer-events: none; }
.coach.center { background: rgba(10, 14, 20, .5); }
.coach-ring { position: absolute; left: 0; top: 0; border: 3px solid #f2dc2f; border-radius: 10px; box-shadow: 0 0 0 200vmax rgba(10, 14, 20, .45); transition: transform var(--duration-normal, .3s) cubic-bezier(.16, 1, .3, 1), width var(--duration-normal, .3s), height var(--duration-normal, .3s); animation: coach-pulse 1.4s ease-in-out infinite; }
.coach.center .coach-ring { display: none; }
.coach-card { position: absolute; left: 0; top: 0; width: min(88vw, 330px); padding: 12px 14px; color: var(--paper); background: #1f2425; border: 3px solid #f2dc2f; box-shadow: 0 6px 0 #0d1011; pointer-events: auto; transition: transform var(--duration-normal, .3s) cubic-bezier(.16, 1, .3, 1); }
.coach.center .coach-card { left: 50%; top: 50%; transform: translate(-50%, -50%) !important; }
.coach-card small { color: #f2dc2f; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.coach-card p { margin: 6px 0 10px; font-size: 15px; font-weight: 700; line-height: 1.35; }
.coach-actions { display: flex; gap: 8px; align-items: center; }
.coach-next { min-height: 40px; padding: 6px 14px; border: 2px solid #0d1011; color: #172013; background: #a6be7d; font-weight: 900; }
.coach-skip { margin-left: auto; padding: 6px 4px; border: 0; color: #9aa38f; background: none; font-size: 11px; font-weight: 800; text-decoration: underline; }
@keyframes coach-pulse { 50% { border-color: #fff6c8; } }
