:root {
  --nav-h: 56px;
  --ink: #f6f3ec;
  --muted: #b9b2a4;
  --bg: #14110c;
  --panel: rgba(20, 17, 12, .78);
  --panel-solid: #1d1913;
  --line: rgba(255, 240, 210, .14);
  --accent: #f4b41a;
  --accent-2: #ffd36a;
  --cool: #59b7ff;
  --good: #52d68a;
  --warn: #ffc23d;
  --bad: #ff6a5f;
  --display: "Arial Black", "Segoe UI Black", "Helvetica Neue", Arial, system-ui, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); }
body.is-playing { overscroll-behavior: none; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 5px; border-radius: 5px; border: 1px solid rgba(255,255,255,.3); border-bottom-width: 2px; background: rgba(255,255,255,.08); font: 800 11.5px/1.55 var(--text); text-align: center; }

.game { position: relative; height: calc(100vh - var(--nav-h)); height: calc(100dvh - var(--nav-h)); min-height: 320px; overflow: hidden; background: #8aa3b8; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.is-playing .game { touch-action: none; }
.stage { position: absolute; inset: 0; }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; font-size: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.hud-tl { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; max-width: min(460px, 56vw); }
.hud-load { flex-basis: 100%; display: flex; gap: 6px; align-items: center; }
.job-chip { display: flex; flex-direction: column; gap: 2px; line-height: 1.22; min-width: 200px; }
.job-chip span { font-size: 11px; color: var(--accent); letter-spacing: .09em; text-transform: uppercase; font-weight: 800; }
.job-chip strong { font-size: 13.5px; font-weight: 650; }
.progress { height: 5px; border-radius: 3px; background: rgba(255,255,255,.13); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s; }
.job-chip.pulse { animation: pulse .6s; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(244,180,26,.7); } 100% { box-shadow: 0 0 0 14px rgba(244,180,26,0); } }
.time-chip { font-variant-numeric: tabular-nums; font-weight: 800; }
.hud-tr { position: absolute; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); display: flex; gap: 6px; pointer-events: auto; }
.icon-btn { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .15s, transform .1s; }
.icon-btn:hover { background: rgba(48, 40, 28, .92); }
.icon-btn:active { transform: scale(.95); }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.btn-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.load-chip { display: flex; gap: 10px; align-items: center; padding: 7px 12px 7px 9px; }
.load-icon { width: 46px; height: 34px; color: #e9e3d6; }
.load-icon svg { width: 100%; height: 100%; display: block; }
#load-fill { fill: var(--accent); transition: y .15s; }
.load-chip.full #load-fill { fill: var(--good); }
.load-chip.spill #load-fill { fill: var(--bad); }
.load-txt { display: flex; flex-direction: column; line-height: 1.15; font-variant-numeric: tabular-nums; }
.load-txt strong { font-size: 15px; }
.load-txt span { font-size: 12px; color: var(--muted); }
.mach-chip { font-size: 12px; display: flex; gap: 6px; align-items: baseline; padding: 5px 10px; }
.mach-chip span { color: var(--muted); font-weight: 700; }
.mach-chip b { color: var(--accent-2); }
.hints { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: min(620px, 70vw); pointer-events: none; }
.hint { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; animation: hintIn .35s ease; }
.hint.now { border-color: rgba(244,180,26,.75); box-shadow: 0 0 0 1px rgba(244,180,26,.35) inset; }
@keyframes hintIn { from { opacity: 0; transform: translateY(6px); } }
.toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -6px); background: rgba(20,17,12,.88); border: 1px solid rgba(244,180,26,.5); padding: 10px 18px; border-radius: 14px; font-weight: 800; font-size: 17px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; text-align: center; max-width: 86vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.sandbox-bar { position: absolute; right: calc(10px + var(--safe-r)); top: calc(62px + var(--safe-t)); display: flex; gap: 4px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; max-width: 60vw; }
.sb-btn { min-height: 44px; min-width: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); padding: 0 10px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; backdrop-filter: blur(6px); }
.sb-btn .sw { width: 14px; height: 14px; border-radius: 4px; background: #7b5a3d; display: inline-block; }

/* ---------- touch ---------- */
.touch { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.t-left { position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(24px + var(--safe-b)); pointer-events: auto; }
.t-stick { position: relative; width: 150px; height: 150px; touch-action: none; }
.t-stick .ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(20,17,12,.25), rgba(20,17,12,.55)); border: 2px solid rgba(255,240,210,.32); }
.t-stick .knob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe08a, #e9a512); box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.t-stick span { position: absolute; left: 0; right: 0; bottom: -18px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: rgba(255,255,255,.75); text-shadow: 0 1px 2px #000; }
.t-right { position: absolute; right: calc(12px + var(--safe-r)); bottom: calc(24px + var(--safe-b)); display: flex; gap: 12px; align-items: flex-end; pointer-events: auto; }
.t-lever { position: relative; width: 64px; height: 176px; border-radius: 32px; background: rgba(20,17,12,.5); border: 2px solid rgba(255,240,210,.3); touch-action: none; }
.t-lever .slot { position: absolute; left: 50%; top: 22px; bottom: 22px; width: 6px; margin-left: -3px; border-radius: 3px; background: rgba(255,255,255,.18); }
.t-lever .thumb { position: absolute; left: 50%; top: 50%; width: 52px; height: 40px; margin: -20px 0 0 -26px; border-radius: 14px; background: linear-gradient(#ffe08a, #e2a10f); box-shadow: 0 3px 10px rgba(0,0,0,.45); }
.t-lever.on { border-color: rgba(244,180,26,.8); }
.t-lever b { position: absolute; left: 0; right: 0; text-align: center; font-size: 9px; letter-spacing: .06em; color: rgba(255,255,255,.65); }
.lv-top { top: 6px; } .lv-bot { bottom: 6px; }
.t-lever span { position: absolute; left: -10px; right: -10px; bottom: -17px; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: .1em; color: rgba(255,255,255,.8); text-shadow: 0 1px 2px #000; }
.t-aux { display: flex; flex-direction: column; gap: 8px; }
.t-btn { min-width: 58px; min-height: 48px; border-radius: 14px; border: 2px solid rgba(255,240,210,.32); background: rgba(20,17,12,.55); font-weight: 800; font-size: 11px; letter-spacing: .05em; touch-action: none; }
.t-btn.on { background: rgba(244,180,26,.55); }

/* ---------- overlays ---------- */
.overlay { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; }
.menu { background: linear-gradient(90deg, rgba(14,11,7,.88) 0%, rgba(14,11,7,.55) 46%, rgba(14,11,7,0) 72%); place-items: center start; padding-left: max(28px, 5vw); }
.menu-card { max-width: 470px; width: 100%; }
.kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.menu h1 { font-family: var(--display); font-size: clamp(30px, 4.4vw, 48px); line-height: 1.02; margin: 0 0 12px; letter-spacing: -.01em; text-shadow: 0 3px 18px rgba(0,0,0,.45); }
.tagline { margin: 0 0 18px; color: #e6dfd1; font-size: 15.5px; line-height: 1.45; max-width: 440px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.cta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 15px 20px; border-radius: 16px; border: 0; background: linear-gradient(180deg, #ffcf47, #f0a412); color: #1b1408; font-family: var(--display); font-size: 22px; box-shadow: 0 10px 30px rgba(240,164,18,.35), 0 2px 0 rgba(255,255,255,.4) inset; transition: transform .1s, filter .15s; }
.cta small { font-family: var(--text); font-size: 13px; font-weight: 700; opacity: .75; }
.cta:hover { filter: brightness(1.05); } .cta:active { transform: scale(.98); }
.cta.small { font-size: 17px; padding: 12px 18px; align-items: center; width: auto; }
.steam-entry { grid-column:1 / -1; border-color: rgba(244,180,26,.65); }
.roller-chip { display:flex; flex-direction:column; gap:2px; font-size:12px; }
.roller-chip strong { color:var(--accent-2); }
.roller-chip span { color:var(--muted); font-size:11px; }
.roller-active .t-right { display:none; }
.roller-active .hud-tr [aria-pressed=true] { border-color:var(--accent); color:var(--accent-2); }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mbtn { text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(30,25,18,.82); display: flex; flex-direction: column; gap: 2px; min-height: 56px; transition: background .15s, border-color .15s; }
.mbtn:hover { background: rgba(50,41,28,.92); border-color: rgba(244,180,26,.45); }
.mbtn b { font-size: 15px; } .mbtn small { font-size: 12px; color: var(--muted); }
.fine { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
.panel { background: rgba(10,8,5,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.panel-card { width: min(860px, 100%); max-height: calc(100% - 8px); overflow: auto; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.panel-card header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--panel-solid); border-bottom: 1px solid var(--line); }
.panel-card h2 { margin: 0; font-family: var(--display); font-size: 21px; flex: 1; }
.back, .close { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-size: 18px; }
.panel-body { padding: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.card { text-align: left; border-radius: 16px; border: 1px solid var(--line); background: #262017; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .12s; }
.card:hover { border-color: rgba(244,180,26,.6); transform: translateY(-2px); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(244,180,26,.35); }
.card img, .card .thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #3a3226; }
.card .cb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.card h3 { margin: 0; font-size: 16px; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tag { font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px; border-radius: 8px; background: rgba(255,255,255,.08); color: #e7dfcf; }
.tag.gold { background: #e9b928; color: #2a1f05; } .tag.silver { background: #c9d0d8; color: #1b2028; } .tag.bronze { background: #c98a52; color: #2a1606; }
.bars { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; font-size: 11.5px; color: var(--muted); align-items: center; margin-top: 4px; }
.bars i { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; display: block; }
.bars i::after { content: ""; display: block; height: 100%; width: var(--v); background: var(--accent); }
.section-h { margin: 18px 0 8px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #2a2319; font-weight: 700; }
.pill.sel { background: var(--accent); color: #1b1408; border-color: var(--accent); }
.pill[disabled] { opacity: .45; cursor: not-allowed; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.setting label { font-weight: 650; } .setting small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; margin-top: 2px; }
.setting input[type=range] { width: 160px; accent-color: var(--accent); }
.switch { width: 52px; height: 30px; border-radius: 15px; border: 1px solid var(--line); background: #3a3226; position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #d8d0c0; transition: left .15s; }
.switch[aria-checked=true] { background: var(--accent); } .switch[aria-checked=true]::after { left: 26px; background: #1b1408; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 18px; font-size: 13.5px; }
.keys div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.done { background: rgba(10,8,5,.5); }
.done-card { width: min(440px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 22px; padding: 22px 22px 18px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .4s cubic-bezier(.2,1.4,.4,1); max-height: 100%; overflow: auto; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.medal { width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 30px; color: #2a1f05; background: radial-gradient(circle at 35% 30%, #fff6c8, #e9b928 55%, #a87b10); box-shadow: 0 8px 24px rgba(233,185,40,.4); }
.medal.silver { background: radial-gradient(circle at 35% 30%, #fff, #c9d0d8 55%, #7d8794); }
.medal.bronze { background: radial-gradient(circle at 35% 30%, #ffe2c4, #c98a52 55%, #7a4a20); }
.medal.none { background: radial-gradient(circle at 35% 30%, #777, #444); color: #ddd; font-size: 15px; }
.done-card h2 { margin: 4px 0 2px; font-family: var(--display); font-size: 25px; }
.done-sub { margin: 0; color: var(--muted); font-size: 14px; }
.score { margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.score b { font-family: var(--display); font-size: 44px; } .score span { color: var(--muted); font-weight: 700; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; text-align: left; margin: 10px 0; font-size: 14px; }
.stats dt { color: var(--muted); } .stats dd { margin: 0; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.best { margin: 4px 0 12px; font-size: 13px; color: var(--accent-2); min-height: 1em; }
.done-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.done-actions .cta { grid-column: 1 / -1; }
.ghost { min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: transparent; font-weight: 700; }
.ghost:hover { background: rgba(255,255,255,.06); }
.tools { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 15; background: rgba(20,17,12,.92); border: 1px solid var(--line); border-radius: 20px; padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); width: min(560px, calc(100% - 24px)); }
.tools-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: #2a2319; font-size: 13px; font-weight: 750; min-height: 96px; }
.tool svg { width: 46px; height: 34px; }
.tool.sel { border-color: var(--accent); background: #3a2f1c; }
.tool[aria-disabled=true] { opacity: .4; }
.tool kbd { font-size: 10px; }
.tools-note { margin: 10px 2px 0; font-size: 13px; color: var(--muted); text-align: center; min-height: 1.2em; }
.loading { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; align-content: center; gap: 12px; background: #1d1913; color: var(--muted); font-weight: 700; }
.loading[hidden] { display: none; }
.game:not([data-phase=loading]) .loading { display: none; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.nojs { position: absolute; inset: 0; display: grid; place-items: center; }
.about { max-width: 820px; margin: 0 auto; padding: 28px 18px 60px; color: #ddd5c6; line-height: 1.55; }
.about h2 { font-family: var(--display); font-size: 24px; color: var(--ink); }
.about h3 { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .menu { background: linear-gradient(0deg, rgba(14,11,7,.92) 0%, rgba(14,11,7,.75) 58%, rgba(14,11,7,.1) 100%); place-items: end center; padding: 14px 14px calc(14px + var(--safe-b)); }
  .menu h1 { font-size: 29px; }
  .tagline { font-size: 14px; margin-bottom: 12px; }
  .cta { font-size: 19px; padding: 13px 16px; }
  .mbtn { padding: 10px 12px; min-height: 52px; }
  .hud-tl { max-width: calc(100vw - 220px); }
  .job-chip { min-width: 0; }
  .job-chip strong { font-size: 12.5px; }
  .hints { display: none; }
  .load-chip { padding: 5px 9px 5px 7px; } .load-icon { width: 34px; height: 26px; }
  .mach-chip { display: none; }
  .icon-btn { padding: 0 8px; } .icon-btn .btn-label { display: none; }
  .sandbox-bar { top: auto; bottom: calc(200px + var(--safe-b)); right: calc(10px + var(--safe-r)); max-width: 50vw; }
  body.touch-ui .hud:has(#sandbox-bar:not([hidden])) .hints { top: calc(184px + var(--safe-t)); bottom: auto; max-width: 85vw; }
  .tools-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 520px) {
  .menu { place-items: center start; background: linear-gradient(90deg, rgba(14,11,7,.92) 0%, rgba(14,11,7,.6) 60%, rgba(14,11,7,0) 85%); padding: 10px 18px; }
  .menu-card { max-width: 620px; }
  .menu-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .menu-grid .mbtn { min-height:44px; padding:7px 10px; }
  .menu h1 { font-size: 24px; margin-bottom: 6px; } .tagline { display: none; } .kicker { display: none; }
  .t-stick { width: 128px; height: 128px; } .t-lever { height: 140px; width: 58px; }
  .fine { display: none; }
}
@media (max-width: 380px), (max-height: 700px) and (max-width: 760px) {
  .t-stick { width: 132px; height: 132px; } .t-lever { height: 150px; width: 58px; }
  .menu h1 { font-size: 26px; } .tagline { display: none; }
}
/* touch layouts: one short hint at the top instead of the desktop key bar */
body.touch-ui .hints { top: calc(10px + var(--safe-t)); bottom: auto; left: 50%; max-width: 46vw; display: flex; }
body.touch-ui .hints .hint:not(:first-child) { display: none; }
body.touch-ui .hints .hint kbd { display: none; }
@media (max-width: 760px) { body.touch-ui .hints { top: auto; bottom: calc(196px + var(--safe-b)); max-width: 60vw; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Brief job directions: one pickup and one destination, clear of the controls. */
.objective-guide { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.objective-marker { position: absolute; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -100%); color: var(--accent-2); filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.objective-label { padding: 3px 8px; border: 1px solid currentColor; border-radius: 6px; background: rgba(20,17,12,.88); color: inherit; font-size: 12px; font-weight: 750; line-height: 1.35; white-space: nowrap; }
.objective-marker svg { display: block; width: 30px; height: 30px; margin-top: 5px; overflow: visible; fill: currentColor; stroke: #231c10; stroke-width: 1.5; stroke-linejoin: round; }
.objective-marker[data-role=destination] { color: #8ef0b3; }
.objective-marker[data-active=true] .objective-label { background: #f6cb55; color: #241b08; border-color: #fff1bb; }
.objective-marker[data-role=destination][data-active=true] .objective-label { background: #8ef0b3; color: #0b2b19; border-color: #d9ffe6; }
@media (max-width: 760px) { .objective-label { font-size: 11px; padding: 3px 6px; } .objective-marker svg { width: 26px; height: 26px; } }

/* Keep every starting job and machine choice in view on compact screens. */
.job-tips { margin-top: 10px; font-size: 13px; color: var(--muted); }
.job-tips summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent-2); font-weight: 750; }
.job-tips summary::before { content: "+"; margin-right: 8px; }
.job-tips[open] summary::before { content: "−"; }
.job-brief { margin: 0; font-size: 14px; line-height: 1.35; }
@media (max-width: 760px), (max-height: 760px) {
  .job-options { gap: 7px; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .job-options .card .cb { padding: 8px 10px; gap: 3px; }
  .job-options .card p { display: none; }
  .job-options .card .meta { margin: 0; }
  .job-options .meta .tag:not(:first-child):not(:last-child) { display: none; }
  .machine-options { gap: 8px; }
  .machine-options .card { display: grid; grid-template-columns: 86px 1fr; align-items: center; min-height: 74px; }
  .machine-options .card img, .machine-options .card .thumb { width: 86px; height: 70px; aspect-ratio: auto; }
  .machine-options .card .cb { padding: 7px 9px; gap: 3px; }
  .machine-options .bars { display: none; }
  .panel-body[data-kind=pickMachine] { padding: 12px; }
  .panel-body[data-kind=pickMachine] .section-h { margin: 10px 0 6px; }
}
@media (max-height: 520px) and (min-width: 700px) {
  .job-options, .machine-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .machine-options .card { grid-template-columns: 72px 1fr; }
  .machine-options .card img, .machine-options .card .thumb { width: 72px; height: 60px; }
  .machine-options .card p { display: none; }
  .machine-options .card h3 { font-size: 14px; }
}

/* Free Play keeps every site action and machine choice in the first view. */
@media (max-width: 760px), (max-height: 900px) {
  .panel-body[data-kind=free] { padding: 12px; }
  .free-intro { margin: 0 0 10px; font-size: 13px; line-height: 1.35; }
  .panel-body[data-kind=free] .section-h { margin: 10px 0 6px; }
  .site-options { grid-template-columns: 1fr; gap: 6px; }
  .site-options .cb { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px; }
  .site-options .cb h3 { font-size: 13px; }
  .site-options .cb p { display: none; }
  .site-options .row { margin: 0 !important; flex-wrap: nowrap; gap: 4px; }
  .site-options .pill { padding: 0 8px; font-size: 12px; min-width: 44px; }
  .free-machines .machine-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .free-machines .machine-options .card { display: flex; min-height: 84px; }
  .free-machines .machine-options img, .free-machines .machine-options .thumb { width: 100%; height: 49px; object-fit: contain; }
  .free-machines .machine-options .cb { padding: 5px; }
  .free-machines .machine-options h3 { font-size: 12px; line-height: 1.2; }
  .free-machines .machine-options p, .free-machines .machine-options .bars { display: none; }
}
@media (max-height: 520px) and (min-width: 700px) {
  .panel-body[data-kind=free] { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px 14px; }
  .free-intro { grid-column: 1 / -1; margin: 0; }
  .panel-body[data-kind=free] .section-h { margin-top: 0; }
  .site-options .cb { padding: 2px 8px; }
  .free-machines .machine-options { grid-template-columns: 1fr; }
  .free-machines .machine-options .card { display: grid; grid-template-columns: 64px 1fr; min-height: 48px; }
  .free-machines .machine-options img, .free-machines .machine-options .thumb { height: 48px; }
  .panel-card:has(.panel-body[data-kind=free]) header { padding: 6px 12px; }
}

@media (max-width:500px) {
  .site-options .cb { padding:2px 8px; }
  .free-machines .machine-options .card { display:grid; grid-template-columns:58px 1fr; align-items:center; min-height:58px; }
  .free-machines .machine-options img, .free-machines .machine-options .thumb { width:58px; height:54px; }
}
@media (max-height:520px) and (min-width:700px) {
  .menu-grid .steam-entry { grid-column:auto; }
  .panel-body[data-kind=free] { padding:4px 10px; gap:2px 14px; }
  .panel-card:has(.panel-body[data-kind=free]) { max-height:100%; }
  .free-intro { font-size:12px; line-height:1.2; }
  .site-options, .free-machines .machine-options { gap:4px; }
  .site-options .cb { padding:0 8px; }
  .free-machines .machine-options .card { min-height:46px; }
  .free-machines .machine-options img, .free-machines .machine-options .thumb { height:40px; }
  .panel-card:has(.panel-body[data-kind=free]) header { padding:2px 12px; }
}

/* Account controls are available from the main menu, clear of driving and job selectors. */
body.is-playing .rex-progress-pill, body:has(#menu[hidden]) .rex-progress-pill { display: none; }

#menu .rex-progress-pill { position: static; width: 100%; max-width: none; margin-top: 10px; padding: 6px 9px; border-radius: 12px; background: rgba(20,17,12,.85); color: var(--ink); box-shadow: none; }
#menu .rex-progress-pill button { background: var(--accent); color: #21190c; margin-left: auto; }
@media (max-height: 520px) and (min-width: 700px) { .menu-card { max-width: 620px; } }
