:root {
  --ink: #0F1F18; --muted: #4F5F57; --line: #D9E2DD; --bg: #FFFFFF; --soft: #F3F7F5;
  --green: #0A6B3B; --green-dark: #064A28; --green-tint: #E6F2EB;
  --amber-bg: #FFF1D6; --amber-ink: #7A4100; --red: #A32020;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: #E9EFEC; font-size: 15px; line-height: 1.4; }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; background: var(--bg); display: flex; flex-direction: column; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .pad { padding: 20px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; } .tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }

header.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 800; font-size: 18px; color: var(--green); }
main { flex: 1; padding: 16px; padding-bottom: 88px; }
nav.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { flex: 1; height: 56px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); border-top: 3px solid transparent; }
nav.tabs button[aria-current="page"] { color: var(--green); border-top-color: var(--green); }

button { font: inherit; cursor: pointer; }
.btn { min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--green); background: var(--bg); color: var(--green); font-weight: 600; font-size: 15px; }
.btn.primary { background: var(--green); color: #fff; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.link { border: 0; background: none; color: var(--green); font-weight: 600; padding: 12px 4px; min-height: 44px; }
.round { width: 48px; height: 48px; border-radius: 24px; border: 1px solid var(--green); background: var(--bg); color: var(--green); font-size: 24px; font-weight: 600; line-height: 1; flex-shrink: 0; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input, select { font: inherit; font-size: 16px; height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: var(--bg); color: var(--ink); width: 100%; }
input:focus, select:focus, button:focus-visible { outline: 3px solid #7FC7A0; outline-offset: 1px; }

.card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.card.soft { background: var(--soft); border-color: transparent; }
.card.dark { background: var(--ink); color: #fff; border-color: transparent; }
.card.dark .muted { color: #D5DDD8; }
.card.pick { border: 2px solid var(--green); }
.vehicle-photo { display: block; width: 100%; max-height: 210px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.vehicle-photo-placeholder { width: 100%; min-height: 132px; aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; background: var(--soft); color: var(--muted); }
.vehicle-photo-placeholder span { font-size: 56px; line-height: 1; }
.vehicle-photo-placeholder small { font-size: 12px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green); }
.card.dark .eyebrow { color: #BFE3CD; }
.big { font-size: 34px; font-weight: 800; line-height: 1; }
.price { font-size: 18px; font-weight: 700; }
.tag { display: inline-block; background: var(--amber-bg); color: var(--amber-ink); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 12px; }
.tag.green { background: var(--green-tint); color: var(--green-dark); }
.notice { background: var(--green-tint); color: var(--green-dark); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; }
.notice.warn { background: var(--amber-bg); color: var(--amber-ink); }

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seg button { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-weight: 600; text-transform: capitalize; }
.seg button[aria-pressed="true"] { border: 2px solid var(--green); background: var(--green-tint); color: var(--green-dark); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; font-weight: 600; }
.chips button[aria-pressed="true"] { border-color: var(--amber-ink); background: var(--amber-bg); color: var(--amber-ink); }

#map { height: 260px; border-radius: 16px; background: #DCE8E0; z-index: 0; }
.dot { width: 12px; height: 12px; border-radius: 6px; border: 3px solid var(--green); flex-shrink: 0; }
.dot.end { border-radius: 2px; border-color: var(--ink); background: var(--ink); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11px; color: var(--muted); }
.bars i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: #A9C4B5; min-height: 4px; }
.bars .top i { background: var(--green); } .bars .top span { color: var(--ink); font-weight: 700; }
.tally { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--line); }
.tally .yes { background: var(--green); } .tally .no { background: #E0A458; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

#toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); max-width: 440px; width: calc(100% - 32px); background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; display: none; z-index: 1000; }
#toast.show { display: block; } #toast.err { background: var(--red); }

.demobar { background: var(--amber-bg); color: var(--amber-ink); font-size: 12.5px; font-weight: 600; text-align: center; padding: 6px 12px; }
ol.how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

textarea { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; resize: vertical; color: var(--ink); background: var(--bg); }
textarea:focus { outline: 3px solid #7FC7A0; outline-offset: 1px; }
.tip { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

.btn.sos { background: var(--red); border-color: var(--red); color: #fff; }
.linkbtn { display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.linkbtn:focus-within { outline: 3px solid #7FC7A0; outline-offset: 1px; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.card.alert { border: 2px solid var(--red); }
.tag.red { background: var(--red); color: #fff; }
details summary { cursor: pointer; padding: 8px 0; }

/* Waffi Heist */
.ggrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ggrid .btn { min-height: 56px; padding: 6px 10px; font-size: 14px; }
.ggrid .btn[aria-pressed="true"] { background: var(--green-tint); border-width: 2px; color: var(--green-dark); opacity: 1; }
.gmsg { font-weight: 600; }
.walls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wall { background: #D8D2C4; border-radius: 10px; padding: 10px; min-height: 96px; display: flex; flex-direction: column; gap: 6px; }
.wall > .muted { color: #4A4436; }
.flyer { background: #FFFDF5; color: var(--ink); font-size: 12px; line-height: 1.3; padding: 6px 8px; border: 1px solid #B9B09A; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.flyer.f0 { transform: rotate(-1.5deg); } .flyer.f1 { transform: rotate(1deg); margin-top: -4px; } .flyer.f2 { transform: rotate(-0.5deg); margin-top: -4px; }

/* Waffi Heist 3D town */
#world { position: fixed; inset: 0; z-index: 2000; background: #BFE3F5; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
#world canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#world .btn { min-height: 44px; padding: 0 12px; font-size: 13px; background: rgba(255,255,255,0.94); }
#world .btn.primary { background: var(--green); } #world .btn.danger { background: #fff; }
.w-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: linear-gradient(rgba(15,31,24,0.8), rgba(15,31,24,0)); font-size: 13px; font-weight: 600; flex-wrap: wrap; }
#w-msg { position: absolute; top: 108px; left: 10px; right: 10px; margin: 0; pointer-events: none; background: rgba(15,31,24,0.9); padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.w-pad { position: absolute; left: 10px; bottom: 196px; display: grid; grid-template-columns: repeat(3, 54px); grid-template-rows: repeat(2, 54px); gap: 6px; }
.w-pad button { border: 0; border-radius: 14px; background: rgba(15,31,24,0.72); color: #fff; display: flex; align-items: center; justify-content: center; touch-action: none; }
.w-pad button:active { background: var(--green); }
.w-pad [data-k=up] { grid-column: 2; grid-row: 1; } .w-pad [data-k=left] { grid-column: 1; grid-row: 2; } .w-pad [data-k=down] { grid-column: 2; grid-row: 2; } .w-pad [data-k=right] { grid-column: 3; grid-row: 2; }
#w-climb { position: absolute; right: 12px; bottom: 208px; min-height: 60px; min-width: 96px; font-size: 16px; }
#w-bar { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,31,24,0.94); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; user-select: text; -webkit-user-select: text; }
#w-bar .w-title { font-size: 14px; font-weight: 600; }
#w-bar .w-opts { display: flex; flex-direction: column; gap: 6px; }
#w-bar .w-opts button { min-height: 44px; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.08); color: #fff; font: inherit; font-size: 14px; }
#w-bar .w-opts button[aria-pressed="true"] { border-color: #BFE3CD; background: rgba(10,107,59,0.6); }
#w-bar input { height: 44px; }
.w-court { display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid rgba(255,255,255,0.25); padding-bottom: 8px; }
.w-court .w-log { font-size: 13px; max-height: 92px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.w-court .row { flex-wrap: wrap; }
#w-panel:empty { display: none; }
.w-sheet { position: absolute; left: 8px; right: 8px; bottom: 8px; background: #fff; color: var(--ink); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 3; user-select: text; }
.w-sheet .w-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.w-sheet .chips button { min-height: 40px; } .w-sheet .chips button[aria-pressed="true"] { outline: 3px solid var(--green); outline-offset: 1px; }
.w-sheet input[type=range] { padding: 0; height: 32px; }
#world.editing .w-pad, #world.editing #w-bar, #world.editing #w-climb { display: none; }
@media (min-width: 700px) { #w-bar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border-radius: 16px 16px 0 0; } }

/* 3D town: action-game look */
#world { background: #A9BCC6; }
#world #w-map { inset: auto; top: 82px; right: 10px; width: 120px; height: 65px; border: 1px solid rgba(255,255,255,0.45); border-radius: 6px; }
#w-compass { position: absolute; top: 152px; right: 10px; left: auto; transform: none; width: 120px; text-align: center; box-sizing: border-box; padding: 3px 12px; border-radius: 4px; background: rgba(20,26,22,0.6); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; white-space: pre; font-variant-numeric: tabular-nums; }
#w-hud { text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.6); }
.w-pad button { border-radius: 27px; background: rgba(20,26,22,0.5); border: 1px solid rgba(255,255,255,0.35); }
#world.editing #w-map, #world.editing #w-compass { display: none; }

.w-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; background: #EEF1EF; border-radius: 10px; padding: 4px; }
.w-tabs button { min-height: 40px; border: 0; border-radius: 8px; background: transparent; font-weight: 700; font-size: 13px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.w-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.scene-text { font-size: 17px; font-weight: 600; line-height: 1.35; }
.scene-opt { text-align: left; justify-content: flex-start; padding: 10px 14px; height: auto; min-height: 48px; }
.crewdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(127,127,127,.6); vertical-align: middle; }
#w-snatch { position: absolute; left: 16px; right: 16px; top: 40%; z-index: 6; background: rgba(140,20,20,.92); color: #fff; padding: 14px; border-radius: 14px; display: grid; gap: 10px; text-align: center; }
#w-snatch[hidden] { display: none; }
#w-people { position: absolute; left: 16px; right: 16px; top: 120px; z-index: 6; background: var(--card, #fff); color: var(--text, #111); padding: 12px; border-radius: 14px; display: grid; gap: 8px; max-height: 60vh; overflow: auto; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
#w-people[hidden] { display: none; }
/* the 3D top bar: one row of compact buttons that scrolls sideways on narrow phones, Exit always reachable */
.w-top > .row { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; gap: 6px; scrollbar-width: none; }
.w-top > .row::-webkit-scrollbar { display: none; }
.w-top > .row .btn { padding: 6px 10px; font-size: 12px; white-space: nowrap; flex: none; }
.w-top > .row .btn[data-act="wclose"], .w-top > .row .btn[data-act="wsearch"], .w-top > .row .btn[data-act="wview"] { order: -1; }
/* aiming in the 3D town */
#world #w-aim { position: absolute; right: 12px; bottom: 380px; min-height: 48px; min-width: 96px; background: rgba(20,26,22,0.72); color: #fff; border: 1px solid rgba(255,255,255,0.4); }
#world #w-aim[aria-pressed=true] { background: #5A1F1A; }
#world #w-fire { position: absolute; right: 16px; bottom: 278px; width: 92px; height: 92px; border-radius: 50%; background: #B3261E; color: #fff; font-size: 15px; font-weight: 700; border: 3px solid rgba(255,255,255,0.75); touch-action: none; padding: 0; }
#world #w-fire:active { transform: scale(0.94); background: #8F1E18; }
#w-cross { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); pointer-events: none; }
#w-cross::before, #w-cross::after { content: ''; position: absolute; background: #fff; box-shadow: 0 0 2px #000; }
#w-cross::before { left: 12px; top: 0; width: 2px; height: 26px; }
#w-cross::after { top: 12px; left: 0; height: 2px; width: 26px; }
#w-cross.hit::before, #w-cross.hit::after { background: #FFD25E; }
#w-cross.head::before, #w-cross.head::after { background: #FF3B30; }
#w-cross.hit, #w-cross.head { transform: translate(-50%, -50%) rotate(45deg) scale(1.2); }
#world.aiming #w-climb { display: none; }
#world.aiming canvas:first-child { touch-action: none; }
#world.shot::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 30px rgba(179,38,30,0.75); }
#world.editing #w-aim, #world.editing #w-fire, #world.editing #w-cross { display: none; }
/* the Terms and Privacy pages */
.legal { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; line-height: 1.55; }
.legal h1 { font-size: 24px; margin: 12px 0 4px; } .legal h2 { font-size: 18px; margin: 24px 0 6px; }
.legal ul { padding-left: 20px; } .legal li { margin: 6px 0; } .legal mark { background: #FFE9A8; color: #3A2A00; padding: 0 3px; border-radius: 3px; }
.center { text-align: center; }
/* the street-first game: big tap-to-do actions, a fade through doors */
#world::before { content: ''; position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.3s; z-index: 5; }
#world.fade::before { opacity: 1; }
#w-bar .w-opts button { font-size: 15px; font-weight: 600; min-height: 50px; }
#w-bar .w-opts button.do { background: #0A6B3B; border-color: #BFE3CD; }
#w-bar .w-opts button.do::before { content: '\25B6\00a0\00a0'; font-size: 11px; }
#w-bar .w-opts button.talk::before { content: '\201C'; opacity: 0.7; }
#w-bar .w-opts button.talk::after { content: '\201D'; opacity: 0.7; }
#w-bar .w-opts button:active { transform: scale(0.98); }
#w-bar .w-sayrow input { height: 38px; font-size: 13px; opacity: 0.9; }
#w-bar .w-sayrow .btn { min-height: 38px; }
#w-map[hidden], #w-compass[hidden] { display: none; }
.demobar .link { color: inherit; font-weight: 700; text-decoration: underline; min-height: 0; padding: 0 0 0 6px; font-size: inherit; }
/* the joystick: floats to wherever the left thumb lands */
#w-stick { position: absolute; left: 86px; top: auto; bottom: 250px; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; background: rgba(15,31,24,0.28); border: 2px solid rgba(255,255,255,0.35); pointer-events: none; opacity: 0.55; transition: opacity 0.15s; }
#w-stick:not(.on) { margin: 0 0 0 -56px; }
#w-stick.on { opacity: 1; bottom: auto; }
#w-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,0.85); box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
#world.editing #w-stick { display: none; }
@media (hover: hover) and (pointer: fine) { #w-stick { display: none; } }
#world #w-sit { position: absolute; right: 12px; bottom: 208px; min-height: 60px; min-width: 96px; border-radius: 30px; font-size: 16px; }
#world.editing #w-sit, #world.aiming #w-sit { display: none; }
/* the mission card, and the run button with its stamina bar */
#world #w-mission { position: absolute; left: 12px; top: 172px; max-width: 62%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid rgba(255,210,94,0.7); background: rgba(15,31,24,0.82); color: #fff; font-size: 14px; line-height: 1.25; }
#w-mission .w-mn { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #FFD25E; width: 100%; }
#w-mission .w-where { color: #FFD25E; font-weight: 700; white-space: nowrap; } #w-mission .w-arrow { display: inline-block; }
#w-mission[hidden] { display: none; }
#world #w-run { position: absolute; right: 12px; bottom: 284px; width: 72px; height: 72px; border-radius: 50%; padding: 0; background: rgba(20,26,22,0.6); color: #fff; border: 2px solid rgba(255,255,255,0.45); font-weight: 700; overflow: hidden; }
#world #w-run[aria-pressed=true] { background: #0A6B3B; border-color: #BFE3CD; }
#w-run i { position: absolute; left: 0; bottom: 0; height: 6px; background: #FFD25E; }
#world.aiming #w-run, #world.editing #w-run, #world.editing #w-mission { display: none; }
/* WhatsApp share */
#world #w-share { position: absolute; right: 12px; top: 172px; min-height: 40px; padding: 8px 14px; border-radius: 20px; background: #25D366; color: #06331A; font-weight: 700; border: 0; text-decoration: none; z-index: 4; }
#world #w-share[hidden] { display: none; }
a.wa { color: #128C3E; font-weight: 700; font-size: 12px; margin-left: 4px; }
/* radio and tick choices: the box beside its words */
label.choice { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; text-align: left; font-weight: 500; }
label.choice input { width: 20px !important; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; }
fieldset.choices { border: 1px solid var(--line, #D9DDD6); border-radius: 12px; padding: 10px 12px; margin: 0; }
fieldset.choices legend { padding: 0 4px; }

/* The guide: an offer from the town, taken or left. Never spoken by the character. */
#world #w-offer { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(92%, 380px); display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255,210,94,0.8); background: rgba(15,31,24,0.92); color: #fff; font-size: 15px; line-height: 1.3; z-index: 4; }
#world #w-offer[hidden] { display: none; }
#w-offer .w-mn { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: #FFD25E; }
#w-offer .row { gap: 8px; } #w-offer .btn { flex: 1; min-height: 42px; }
#world.editing #w-offer, #world.aiming #w-offer { display: none; }
/* Say or Do: two different things, clearly marked */
#w-bar .w-seg { display: inline-flex; border: 1px solid rgba(255,255,255,0.4); border-radius: 10px; overflow: hidden; flex: none; }
#w-bar .w-seg button { min-width: 44px; height: 38px; padding: 0 10px; border: 0; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 700; }
#w-bar .w-seg button[aria-pressed="true"] { background: #FFD25E; color: #0F1F18; }
#w-bar .w-opts.many { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#w-bar .w-opts.many button { min-height: 40px; font-size: 13px; padding: 6px 10px; }
/* places found for a typed pickup or drop-off */
.sugg { display: flex; flex-direction: column; gap: 4px; margin-top: -4px; } .sugg:empty { display: none; } .sugg p { margin: 0; }
.suggbtn { text-align: left; min-height: 40px; padding: 6px 10px; border-radius: 10px; border: 1px solid #C9D6CE; background: #fff; color: inherit; font: inherit; font-size: 14px; }
.suggbtn[aria-pressed="true"] { border-color: #0A6B3B; background: #E7F3EC; }
#world #w-offer:not([hidden]) ~ #w-mission { display: none; }

/* ---- Less text, out of the way: the game is the picture, not the words ---- */
#world { touch-action: manipulation; } #world canvas { touch-action: none; }
#w-hud { font-size: 11px; max-width: 62%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* messages: a small note in the top-left corner */
#world #w-msg { top: 104px; left: 8px; right: auto; max-width: min(62%, 280px); padding: 6px 9px; border-radius: 10px; font-size: 12px; line-height: 1.3; background: rgba(15,31,24,0.78); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
#world #w-msg[hidden] { display: none; }
/* mission and offer: compact, same corner */
#world #w-mission { top: auto; bottom: 46%; left: 8px; max-width: 46%; padding: 5px 8px; font-size: 12px; border-radius: 10px; background: rgba(15,31,24,0.7); }
#w-mission .w-mn { font-size: 9px; }
#world #w-offer { left: 8px; top: 104px; transform: none; width: min(64%, 270px); padding: 8px 9px; gap: 5px; font-size: 13px; line-height: 1.25; border-radius: 12px; }
#w-offer .w-mn { font-size: 10px; } #w-offer .btn { min-height: 36px; font-size: 13px; padding: 4px 8px; }
#world #w-offer:not([hidden]) ~ #w-msg { top: auto; bottom: 54%; }
/* the bottom bar: no dark slab; just the choices, small, and a chip for talking */
#world #w-bar { background: none; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); gap: 5px; align-items: flex-end; pointer-events: none; }
#world #w-bar > * { pointer-events: auto; }
#world #w-bar .w-title { font-size: 11px; font-weight: 600; max-width: 78%; padding: 3px 8px; border-radius: 8px; background: rgba(15,31,24,0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: flex-end; }
#world #w-bar.idle .w-title { display: none; }
#world #w-bar .w-opts { width: min(100%, 300px); align-self: flex-end; gap: 5px; }
#world #w-bar .w-opts button { min-height: 40px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: rgba(15,31,24,0.82); }
#world #w-bar .w-opts button.do { background: rgba(10,107,59,0.92); }
#world #w-bar .w-opts.many { width: 100%; }
#world #w-bar .w-talk { align-self: flex-end; height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid rgba(255,255,255,0.45); background: rgba(15,31,24,0.7); color: #fff; font: inherit; font-size: 12px; font-weight: 700; }
#world #w-bar .w-sayrow { width: 100%; padding: 6px; border-radius: 12px; background: rgba(15,31,24,0.94); box-sizing: border-box; }
#world #w-bar .w-sayrow[hidden] { display: none; }
#world #w-bar .w-sayrow input { font-size: 16px; height: 38px; min-width: 0; flex: 1; }   /* 16px: phones zoom the page for smaller text boxes */
#world #w-bar .w-court { width: 100%; background: rgba(15,31,24,0.9); border-radius: 12px; padding: 6px; box-sizing: border-box; font-size: 12px; }

#world #w-find { position: absolute; left: 12px; right: 12px; top: 96px; z-index: 6; display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 14px; background: rgba(15,31,24,0.92); border: 1px solid rgba(255,210,94,0.6); }
#world #w-find[hidden] { display: none; }
#world #w-find input { font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 0; width: 100%; box-sizing: border-box; }
#world #w-find .row { flex-wrap: wrap; gap: 6px; }

#dr-install { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 9999; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; background: #0F1F18; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,0.35); font-size: 14px; line-height: 1.35; }
#dr-install img { border-radius: 10px; flex: none; } #dr-install .dr-i-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; } #dr-install .dr-i-text span { color: #D6E2DB; }
#dr-install .dr-i-x { flex: none; width: 44px; height: 44px; border: 0; background: none; color: #fff; font-size: 26px; line-height: 1; }

#world #w-offer .w-home { display: flex; flex-direction: column; gap: 3px; padding: 6px 0; border-top: 1px solid rgba(255,255,255,0.14); }
#world #w-offer .w-home small { opacity: 0.8; }
#world #w-offer { max-height: 70vh; overflow-y: auto; }

/* MOVEMENT AT THE BOTTOM. Left thumb: the joystick in the bottom-left corner (touch anywhere on the left half and it
   follows your thumb). Right thumb: turn left / turn right, with Run just above. Actions and Say sit above them, on the left. */
#w-stick { left: 82px; bottom: calc(22px + env(safe-area-inset-bottom)); }
#w-turn { position: absolute; right: 10px; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
#w-turn button { width: 66px; height: 66px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.45); background: rgba(20,26,22,0.55); color: #fff; font-size: 30px; line-height: 1; padding: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#w-turn button.on { background: #0A6B3B; border-color: #BFE3CD; }
#world.editing #w-turn, #world.aiming #w-turn { display: none; }
@media (hover: hover) and (pointer: fine) { #w-turn { display: none; } }
#world #w-run { right: 10px; bottom: calc(96px + env(safe-area-inset-bottom)); width: 66px; height: 66px; }
#world #w-climb, #world #w-sit { right: 10px; bottom: calc(172px + env(safe-area-inset-bottom)); }
#world #w-fire { right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); }
#world #w-aim { right: 10px; bottom: calc(244px + env(safe-area-inset-bottom)); }
#world #w-bar { right: 96px; bottom: calc(150px + env(safe-area-inset-bottom)); padding-bottom: 0; align-items: flex-start; }
#world #w-bar .w-title, #world #w-bar .w-talk { align-self: flex-start; }
#world #w-bar .w-opts { align-self: flex-start; width: min(100%, 290px); }
@media (hover: hover) and (pointer: fine) { #world #w-bar { right: 0; bottom: 0; align-items: flex-end; } #world #w-bar .w-title, #world #w-bar .w-talk, #world #w-bar .w-opts { align-self: flex-end; } }

/* not enough Credits: in the middle of the screen, over the game */
#dr-credits { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,0.55); }
#dr-credits .dr-cw { display: flex; flex-direction: column; gap: 10px; width: min(100%, 360px); padding: 18px; border-radius: 18px; background: #1B0F0E; color: #fff; border: 2px solid #E0564A; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
#dr-credits strong { font-size: 20px; color: #FFB4A9; }
#dr-credits .dr-cw-n { font-size: 26px; font-weight: 800; }
#dr-credits .row { gap: 10px; } #dr-credits .btn { flex: 1; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
#world #w-offer .w-miss { display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.07); border-left: 5px solid var(--mc, #E0A100); }
#world #w-offer .w-miss .w-mtag { align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #111; background: var(--mc, #E0A100); padding: 2px 7px; border-radius: 8px; }
#world #w-offer .w-miss .w-mmeta { display: flex; gap: 10px; flex-wrap: wrap; opacity: .95; } #world #w-offer .w-miss .w-mmeta i { font-style: normal; }
#world #w-offer .w-miss .w-mpay { color: #FFD25E; font-weight: 800; }
/* while the 3D town is open the page behind it must not scroll or bounce into view (iPhone home-screen app) */
html:has(#world), html:has(#world) body { overflow: hidden; overscroll-behavior: none; height: 100%; }
#world { height: 100dvh; }
/* the voice panel */
#world #w-offer label.small { display: flex; flex-direction: column; gap: 4px; width: 100%; }
#world #w-offer label.small select, #world #w-offer label.small input:not([type=checkbox]):not([type=range]) { width: 100%; box-sizing: border-box; min-width: 0; font-size: 15px; padding: 8px 10px; border-radius: 10px; }
#world #w-offer label.small input[type=range] { width: 100%; }
#world #w-offer label.small.row { flex-direction: row; align-items: center; gap: 8px; }
#world #w-offer label.small input[type=checkbox] { width: 20px; height: 20px; flex: none; }
#world #w-offer .row > label.small + .btn { flex: none; width: 44px; padding: 8px 0; align-self: flex-end; }
#world .w-phrases { flex-wrap: nowrap; overflow-x: auto; }
#world .w-phrases .btn { flex: none; white-space: nowrap; }
/* fold the prompts away and bring them back */
#world .w-fold { position: absolute; top: 4px; right: 6px; width: 34px; height: 30px; padding: 0; border-radius: 10px; border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.12); color: #fff; font-size: 18px; line-height: 1; z-index: 2; }
#world #w-bar .w-title { position: relative; padding-right: 44px; min-height: 30px; }
#world #w-bar .w-title .w-fold { top: -2px; right: 0; }
#world #w-offer { position: absolute; }
#world #w-offer > .w-mn { padding-right: 40px; }
#world #w-offer.folded > *:not(.w-mn):not(.w-fold) { display: none !important; }
#world #w-offer.folded { width: auto; max-width: 70%; }
#world #w-zoom { position: absolute; right: 12px; top: 50%; z-index: 5; font-size: 13px; padding: 6px 10px; background: rgba(15,31,24,0.85); color: #fff; border-radius: 999px; }
#world #w-bar .w-opts[hidden] { display: none !important; }
/* the game-house table screen: the table fills 70%, the panel the rest */
#world #w-table { position: absolute; inset: 0; z-index: 40; background: #0B140F; display: flex; flex-direction: column; }
#world #w-table[hidden] { display: none; }
#world #w-table canvas#w-tcanvas { position: relative !important; inset: auto !important; width: 100% !important; height: 70% !important; flex: none; display: block; touch-action: none; }
#world #w-tpanel { position: relative; flex: 1; }
#world #w-tpanel { height: 30%; overflow-y: auto; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); color: #fff; display: flex; flex-direction: column; gap: 6px; background: rgba(15,31,24,0.98); }
#world #w-tpanel .w-tscore { display: flex; gap: 12px; align-items: center; font-size: 18px; } #world #w-tpanel .w-tscore span.on { color: #FFD25E; } #world #w-tpanel .w-tscore b { font-size: 22px; } #world #w-tpanel .w-tscore i { opacity: .6; font-style: normal; }
#world #w-tpanel input[type=range] { width: 100%; }
#world.tabling #w-bar, #world.tabling .w-top, #world.tabling #w-offer, #world.tabling #w-joy, #world.tabling #w-mission { visibility: hidden; }
/* the driver's seat: the wheel on the left, the pedals on the right, the gears between; the rest of the controls go away */
#world.cockpit #w-stick, #world.cockpit #w-turn, #world.cockpit #w-run, #world.cockpit #w-seat, #world.cockpit #w-map, #world.cockpit #w-bar, #world.cockpit #w-offer, #world.cockpit #w-climb, #world.cockpit #w-sit, #world.cockpit #w-zoom { display: none !important; }
#world #w-seat { position: absolute; right: 12px; top: calc(50% + 44px); z-index: 5; font-size: 13px; padding: 7px 12px; border-radius: 999px; }
#w-cock { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
#w-cock > * { pointer-events: auto; }
#world #w-cock #w-cockout { position: absolute; right: 12px; top: 176px; font-size: 13px; padding: 6px 12px; background: rgba(15,15,15,0.8) !important; color: #fff !important; border: 1px solid #666; border-radius: 999px; }
#world #w-cock #w-cockmanual { position: absolute; right: 12px; top: 218px; font-size: 13px; padding: 8px 13px; border-radius: 999px; box-shadow: 0 3px 14px rgba(0,0,0,.45); }
#w-cread { position: absolute; left: 12px; top: 128px; pointer-events: none !important; background: rgba(0,0,0,0.55); color: #fff; font: 700 14px system-ui; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
#w-cwheel { position: absolute; left: 14px; bottom: calc(24px + env(safe-area-inset-bottom)); width: 150px; height: 150px; touch-action: none; opacity: 0.88; }
.w-pad { position: absolute; bottom: calc(186px + env(safe-area-inset-bottom)); width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(160,166,170,0.92); color: #111; font: 800 22px system-ui; touch-action: none; }
#w-pdn { left: 18px; } #w-pup { left: 122px; }
#w-gears { position: absolute; right: 14px; bottom: calc(150px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 4px; background: rgba(0,0,0,0.55); padding: 5px; border-radius: 12px; }
#w-gears button { width: 38px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #bbb; font: 800 15px system-ui; }
#w-gears button[aria-pressed="true"] { background: #fff; color: #111; }
#w-pedals { position: absolute; right: 64px; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; gap: 12px; align-items: flex-end; }
.w-ped { position: relative; touch-action: none; border-radius: 12px; overflow: hidden; background: linear-gradient(#3a3a3a, #1c1c1c); border: 2px solid #555; display: flex; align-items: flex-end; justify-content: center; user-select: none; -webkit-user-select: none; }
.w-ped i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; pointer-events: none; }
.w-ped span { position: relative; color: #ddd; font: 800 11px system-ui; letter-spacing: .08em; margin-bottom: 8px; pointer-events: none; }
#w-brk { width: 74px; height: 86px; } #w-brk i { background: rgba(229,57,53,0.75); }
#w-acc { width: 54px; height: 120px; } #w-acc i { background: rgba(46,184,114,0.75); }
