@font-face { font-family: 'Bungee'; src: url('../assets/fonts/bungee.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('../assets/fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../assets/fonts/dmmono.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Mono'; src: url('../assets/fonts/dmmono-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
:root {
  /* Night-market neon: deep indigo night, generator-amber light, coral and teal signage */
  --night: #120c24; --glass: rgba(18, 12, 36, .82); --glass2: rgba(36, 26, 70, .92); --line: #3a2f66; --line2: #5b4a9a;
  --amber: #ffc21a; --amber-d: #b07f00; --coral: #ff4f6d; --teal: #3fd6c4; --up: #35d47f; --down: #ff5d5d;
  --ink: #f6f0ff; --muted: #b3a8da; --faint: #7a6fa6; --dark: #1a1206;
  --f-display: 'Bungee', 'Arial Black', Impact, sans-serif;
  --f-body: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f-mono: 'DM Mono', ui-monospace, Menlo, monospace;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--night); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.4; overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-family: var(--f-display); font-weight: 400; letter-spacing: .01em; text-wrap: balance; }
.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }

/* Buttons */
.btn { min-height: 46px; padding: 10px 16px; border-radius: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--glass2); border: 1.5px solid var(--line2); color: var(--ink); transition: transform .08s; }
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.go { background: var(--amber); color: var(--dark); border: 0; font-family: var(--f-display); font-weight: 400; letter-spacing: .03em; box-shadow: 0 4px 0 var(--amber-d); }
.btn.go:active { box-shadow: 0 1px 0 var(--amber-d); transform: translateY(3px); }
.btn.hot { background: var(--coral); border: 0; color: #fff; box-shadow: 0 4px 0 #a5223b; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn.wide { width: 100%; }

/* HUD */
.hud { position: fixed; top: 0; left: 0; right: 0; z-index: 10; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.me { display: flex; align-items: center; gap: 9px; background: var(--glass); border: 1.5px solid var(--line); border-radius: 16px; padding: 5px 12px 5px 5px; backdrop-filter: blur(6px); max-width: 100%; min-width: 0; text-align: left; }
.me img { width: 44px; height: 44px; border-radius: 12px; background: #2a1f52; flex: none; }
.me .nm { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 150px; }
.cash { font-family: var(--f-display); font-size: 20px; line-height: 1; color: var(--amber); text-shadow: 0 2px 0 #00000066; white-space: nowrap; }
.cash.neg { color: var(--down); }
.hud-l { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; background: var(--glass); border: 1.5px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); white-space: nowrap; }
.pill b { font-family: var(--f-mono); font-weight: 500; }
.hud-r { display: grid; gap: 6px; justify-items: end; align-content: start; }
.date { background: var(--glass); border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 9px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; }
.energy { display: flex; gap: 3px; align-items: center; background: var(--glass); border: 1.5px solid var(--line); border-radius: 999px; padding: 5px 9px; }
.energy i { width: 7px; height: 13px; border-radius: 3px; background: var(--amber); display: block; box-shadow: 0 0 6px #ffc21a88; }
.energy i.off { background: #3a2f66; box-shadow: none; }
.energy span { font-size: 12px; margin-right: 3px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; background: var(--glass); border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 18px; }
.place { grid-column: 1 / -1; justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.place .loc { font-family: var(--f-display); font-size: 12px; letter-spacing: .08em; color: var(--ink); background: #00000055; padding: 3px 10px; border-radius: 6px; }
.goal { pointer-events: auto; display: flex; gap: 8px; align-items: center; background: var(--amber); color: var(--dark); border-radius: 999px; padding: 5px 12px 5px 6px; font-weight: 800; font-size: 13px; box-shadow: 0 3px 0 var(--amber-d); max-width: min(92vw, 420px); }
.goal i { width: 22px; height: 22px; border-radius: 50%; background: var(--dark); color: var(--amber); display: grid; place-items: center; font-style: normal; font-size: 12px; flex: none; }
.goal span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Dock */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 10px); pointer-events: none; }
.dock-in { max-width: 640px; margin: 0 auto; display: grid; gap: 8px; pointer-events: auto; }
.actions { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 8px; }
.tile { position: relative; background: var(--glass); border: 1.5px solid var(--line); border-radius: 14px; padding: 6px 4px 7px; display: grid; justify-items: center; gap: 2px; min-height: 66px; backdrop-filter: blur(6px); }
.tile img { width: 40px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 2px #0008); }
.tile span { font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.tile .badge { position: absolute; top: -6px; right: -4px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--night); }
.tile:hover { border-color: var(--line2); }
.tile.pulse { border-color: var(--amber); box-shadow: 0 0 0 3px #ffc21a44; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px #ffc21a00; } }
.next { width: 100%; min-height: 52px; font-size: 18px; }
.next small { font-family: var(--f-body); font-size: 12px; font-weight: 700; opacity: .75; }

/* Dialogue / choices box */
.talk { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 12px calc(env(safe-area-inset-bottom, 0px) + 12px); }
.talk-in { max-width: 640px; margin: 0 auto; background: var(--glass2); border: 2px solid var(--amber); border-radius: 18px; padding: 14px; display: grid; gap: 10px; box-shadow: 0 10px 40px #000a; backdrop-filter: blur(8px); animation: up .22s ease-out; max-height: 72vh; overflow-y: auto; }
.talk-head { display: flex; gap: 10px; align-items: center; }
.talk-head img { width: 52px; height: 52px; border-radius: 14px; background: #2a1f52; flex: none; object-fit: contain; }
.talk-head .who { font-family: var(--f-display); font-size: 15px; color: var(--amber); }
.talk-head .sub { font-size: 12px; color: var(--muted); }
.talk p { margin: 0; font-size: 16.5px; line-height: 1.45; }
.talk p b { color: var(--amber); }
.choices { display: grid; gap: 8px; }
.choice { text-align: left; background: #ffffff0d; border: 1.5px solid var(--line2); border-radius: 12px; padding: 11px 13px; display: grid; gap: 1px; width: 100%; min-height: 48px; }
.choice:hover:not(:disabled) { border-color: var(--amber); background: #ffc21a14; }
.choice .t { font-weight: 800; font-size: 15px; }
.choice .s { font-size: 12.5px; color: var(--muted); }
.choice:disabled { opacity: .4; }
.result { background: #00000033; border-left: 4px solid var(--amber); padding: 10px 12px; border-radius: 8px; font-size: 15px; }
.tap-hint { font-size: 12px; color: var(--muted); text-align: right; }

/* Show HUD */
.showhud { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 12px; right: 12px; z-index: 11; max-width: 520px; margin: 0 auto; background: var(--glass); border: 1.5px solid var(--line2); border-radius: 14px; padding: 8px 12px; display: grid; gap: 6px; backdrop-filter: blur(6px); }
.showhud .row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.showhud .vn { font-family: var(--f-display); font-size: 13px; }
.meter { height: 14px; border-radius: 7px; background: #2a1f52; overflow: hidden; position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--coral), var(--amber), var(--up)); border-radius: 7px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.meter b { position: absolute; right: 6px; top: -1px; font-size: 11px; font-family: var(--f-mono); color: #fff; text-shadow: 0 1px 2px #000; }

/* Sheets (management panels) */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: #07040fa0; animation: fade .2s; }
.sheet { position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; max-height: 86vh; background: var(--night); border-top: 2px solid var(--line2); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .25s ease-out; }
@media (min-width: 900px) { .sheet { left: auto; top: 0; width: 460px; max-height: none; border-radius: 0; border-top: 0; border-left: 2px solid var(--line2); animation: slide .25s ease-out; } }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { font-size: 19px; flex: 1; }
.sheet-h img { width: 34px; height: 34px; object-fit: contain; }
.sheet-b { overflow-y: auto; padding: 14px 16px calc(env(safe-area-inset-bottom, 0px) + 20px); display: grid; gap: 14px; }
.close { width: 40px; height: 40px; border-radius: 12px; background: #ffffff10; font-size: 20px; }
.sec { display: grid; gap: 8px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sec-h h3 { font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.card { background: #ffffff08; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; }
.row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.t { font-weight: 800; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s { font-size: 12.5px; color: var(--muted); }
.opt { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #ffffff08; cursor: pointer; min-height: 56px; }
.opt:has(input:checked) { border-color: var(--amber); background: #ffc21a14; }
.opt input { accent-color: var(--amber); width: 18px; height: 18px; margin: 0; }
.opt img { width: 46px; height: 40px; object-fit: contain; }
.opt4 { grid-template-columns: auto auto 1fr auto; }
.showline { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px); z-index: 19; max-width: 560px; margin: 0 auto; background: var(--glass2); border: 2px solid var(--line2); border-radius: 16px; padding: 16px 18px; font-size: 18px; font-weight: 800; line-height: 1.35; text-align: center; animation: up .25s ease-out; }
.showline.good { border-color: var(--amber); color: #ffe6a3; }
.showline.bad { border-color: var(--coral); color: #ffc4cf; }
.opt.locked { opacity: .5; cursor: not-allowed; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chipb { border: 1.5px solid var(--line); background: #ffffff08; border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; min-height: 36px; }
.chipb[aria-pressed="true"] { background: var(--amber); color: var(--dark); border-color: transparent; }
.q { font-family: var(--f-mono); font-size: 12px; padding: 2px 7px; border-radius: 5px; font-weight: 500; white-space: nowrap; }
.q.hi { background: #35d47f22; color: var(--up); } .q.mid { background: #ffc21a22; color: var(--amber); } .q.lo { background: #ff5d5d22; color: var(--down); }
.input { background: #ffffff0d; border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%; }
.input:focus { border-color: var(--amber); outline: none; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.app { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: #ffffff08; border: 1.5px solid var(--line); min-height: 98px; position: relative; }
.app img { width: 54px; height: 48px; object-fit: contain; filter: drop-shadow(0 3px 3px #0009); }
.app span { font-size: 12.5px; font-weight: 800; text-align: center; }
.app .badge { position: absolute; top: 6px; right: 6px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 800; border-radius: 8px; padding: 1px 6px; }
.tabs { display: flex; gap: 6px; background: #ffffff08; padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; min-height: 36px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--amber); color: var(--dark); }
.lines { display: grid; gap: 6px; font-size: 14px; }
.lines div { display: flex; justify-content: space-between; gap: 10px; }
.lines .pos { color: var(--up); } .lines .neg { color: var(--down); }
.bar { height: 8px; border-radius: 4px; background: #2a1f52; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; }
.sb { display: grid; grid-template-columns: 86px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }

/* Chart rows */
.ch { display: grid; grid-template-columns: 30px 26px 38px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 10px; background: #ffffff06; border: 1.5px solid transparent; min-width: 0; }
.ch.mine { border-color: var(--amber); background: linear-gradient(90deg, #ffc21a1f, #ffffff06 70%); }
.ch .p { font-family: var(--f-display); font-size: 17px; text-align: center; }
.ch img { width: 38px; height: 38px; border-radius: 10px; background: #2a1f52; }
.mv { font-size: 11px; text-align: center; font-family: var(--f-mono); }
.mv.up { color: var(--up); } .mv.down { color: var(--down); } .mv.new { color: var(--teal); }
.lb { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 2px 5px; border-radius: 4px; color: #120c24; white-space: nowrap; }
.sotw { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; background: linear-gradient(120deg, #3a1d5f, #5f1d4a); border: 1.5px solid #8a4fb0; border-radius: 14px; padding: 10px; }
.sotw img { width: 64px; height: 64px; border-radius: 12px; background: #2a1f52; }
.eyebrow { font-family: var(--f-display); font-size: 11px; letter-spacing: .1em; color: var(--amber); }

/* Overlay cards */
.ov-bg { position: fixed; inset: 0; z-index: 40; background: #07040fb0; display: grid; place-items: center; padding: 16px; animation: fade .2s; overflow-y: auto; }
.ov { width: 100%; max-width: 420px; background: linear-gradient(180deg, #24184a, #160f2e); border: 2px solid var(--amber); border-radius: 20px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 20px 60px #000c; animation: pop .28s cubic-bezier(.2,1.4,.4,1); text-align: center; }
.ov h2 { font-size: clamp(26px, 8vw, 38px); color: var(--amber); text-shadow: 0 3px 0 #7a4b00; line-height: 1; }
.ov .sub { font-family: var(--f-display); font-size: 12px; letter-spacing: .12em; color: var(--ink); }
.ov .big { font-family: var(--f-display); font-size: 44px; line-height: 1; }
.stars { font-size: 28px; letter-spacing: 4px; color: var(--amber); }
.stars .off { color: #3a2f66; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: #00000033; border-radius: 12px; padding: 10px 6px; min-width: 0; }
.kpi b { display: block; font-family: var(--f-display); font-size: clamp(13px, 4.4vw, 19px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.ov .lines { text-align: left; }
.ov img.item { width: 110px; height: 100px; object-fit: contain; justify-self: center; filter: drop-shadow(0 6px 10px #000a); }
.share-img { width: 100%; border-radius: 14px; display: block; }

/* Toasts as phone notifications */
.toasts { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 150px); left: 0; right: 0; z-index: 45; display: grid; justify-items: center; gap: 6px; pointer-events: none; padding-inline: 12px; }
.toast { background: var(--glass2); border: 1.5px solid var(--line2); padding: 9px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; max-width: 460px; animation: drop .25s ease-out; box-shadow: 0 8px 24px #0009; backdrop-filter: blur(8px); }
.toast.win { background: var(--amber); color: var(--dark); border-color: transparent; }
.toast.bad { background: var(--coral); color: #fff; border-color: transparent; }

/* Title & creator */
.title-ui { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 56px) 18px calc(env(safe-area-inset-bottom, 0px) + 22px); gap: 14px; max-width: 560px; margin: 0 auto; }
.logo { font-family: var(--f-display); font-size: clamp(46px, 14vw, 76px); line-height: .9; color: var(--amber); text-shadow: 0 5px 0 #8a4b00, 0 0 40px #ff9a4a55; margin: 0; }
.logo small { display: block; font-size: .3em; color: var(--ink); text-shadow: none; letter-spacing: .1em; margin-bottom: 10px; }
.tagline { font-size: 17px; max-width: 34ch; text-shadow: 0 1px 8px #000; margin: 0; }
.title-btns { margin-top: auto; display: grid; gap: 10px; }
.creator .swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; }
.sw[aria-pressed="true"] { border-color: var(--amber); box-shadow: 0 0 0 2px var(--night) inset; }
.field { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }

@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes drop { from { transform: translateY(-14px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
@media (max-width: 370px) { .tile span { font-size: 10.5px; } .cash { font-size: 17px; } .me .nm { max-width: 100px; } }

body:has(.ov-bg) .toasts, body:has(.sheet) .toasts { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); z-index: 50; }

/* v3 additions */
.scene-banner { display: block; width: 100%; max-height: 140px; object-fit: contain; margin: 0 auto 8px; filter: drop-shadow(0 4px 6px #0009); }
.opt-art { grid-template-columns: 52px 1fr auto; }
.opt-art img { width: 52px; height: 46px; }
.opt-art .grow { min-width: 0; }
.opt:hover:not(.locked) { border-color: var(--line2); background: #ffffff10; }
.tile { cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease; }
.tile:hover, .tile:focus-visible { border-color: var(--amber); background: #ffc21a1c; transform: translateY(-3px); box-shadow: 0 6px 16px #0008, 0 0 0 2px #ffc21a55; outline: none; }
.tile:hover img, .tile:focus-visible img { transform: scale(1.12); }
.tile img { transition: transform .12s ease; }
.tile:active { transform: translateY(0) scale(.96); background: #ffc21a30; }
.app { cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease; }
.app:hover:not(:disabled), .app:focus-visible { border-color: var(--amber); background: #ffc21a14; transform: translateY(-2px); outline: none; }
.app:active:not(:disabled) { transform: scale(.96); }
.app:disabled { opacity: .4; cursor: not-allowed; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.statbars .sb { display: grid; grid-template-columns: 110px 1fr 34px; gap: 8px; align-items: center; font-size: 13px; }

.sheet-b { align-content: start; grid-auto-rows: max-content; }
.card .row > img, .sec .row > img { width: 52px; height: 44px; object-fit: contain; flex: none; }

/* v4: navigation, music, HUD */
.sheet-h .back { width: 38px; height: 38px; border-radius: 12px; background: #ffffff10; border: 1.5px solid var(--line); font-size: 26px; line-height: 1; display: grid; place-items: center; color: var(--ink); flex: none; padding-bottom: 3px; }
.sheet-h .back:hover { border-color: var(--amber); }
.spark { width: 100%; height: 56px; display: block; }
.actgrid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)) !important; }
.actgrid .app { min-height: 92px; }
.actgrid .app img { width: 46px; height: 40px; }
.songrow img { width: 44px; height: 44px; }
@media (min-width: 760px) {
  .hud { grid-template-columns: 1fr auto 1fr; }
  .hud-l { grid-column: 1; grid-row: 1; }
  .place { grid-column: 2; grid-row: 1; align-self: start; padding-top: 2px; }
  .hud-r { grid-column: 3; grid-row: 1; justify-self: end; }
}
body:has(#sheetRoot .sheet) .toasts { top: calc(env(safe-area-inset-top, 0px) + 64px); bottom: auto; }
.toast { font-size: 13.5px; padding: 8px 12px; }
/* Go out map */
.lagmap { position: relative; width: 100%; aspect-ratio: 1 / 1.05; max-height: 56vh; border-radius: 16px; overflow: hidden; border: 1.5px solid var(--line); background: #123a5a; }
.lagmap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lagmap .pin { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; gap: 2px; background: none; border: 0; padding: 0; cursor: pointer; }
.lagmap .pin i { width: 16px; height: 16px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--amber); border: 2px solid var(--dark); box-shadow: 0 2px 6px #0008; }
.lagmap .pin span { font-size: 10.5px; font-weight: 800; background: #000a; color: var(--ink); padding: 1px 5px; border-radius: 5px; white-space: nowrap; }
.lagmap .pin.done i { background: #6a6390; }
.lagmap .pin:hover i, .lagmap .pin:focus-visible i { background: var(--coral); transform: rotate(-45deg) scale(1.2); }
.place .loc { pointer-events: auto; cursor: pointer; }

.place .loc:hover { background: #00000088; }

/* ---------- creator: step flow ---------- */
.sheet.cr { max-height: min(64vh, 560px); max-height: min(64dvh, 560px); }
.sheet.cr:has(.combo-open) { max-height: 86dvh; }
@media (min-width: 900px) { .sheet.cr, .sheet.cr:has(.combo-open) { max-height: none; } }
.cr-top { padding: 12px 16px 8px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.cr-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cr-dot { display: grid; gap: 5px; background: none; border: 0; padding: 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.cr-dot i { height: 5px; border-radius: 3px; background: #ffffff1c; display: block; }
.cr-dot.done i { background: var(--amber-d); }
.cr-dot.on i { background: var(--amber); box-shadow: 0 0 8px #ffc21a88; }
.cr-dot.on { color: var(--amber); }
.cr-dot.done { color: var(--ink); cursor: pointer; }
.cr-h { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.cr-h h2 { font-size: 21px; flex: 1; margin: 0; }
.cr-b { flex: 1 1 auto; min-height: 0; padding-bottom: 14px; }
.cr-foot { display: flex; gap: 10px; padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); border-top: 1px solid var(--line); background: var(--night); }
.cr-foot .grow { flex: 1; } .cr-foot .grow2 { flex: 2; }
.combo { position: relative; }
.combo-btn { width: 100%; min-height: 56px; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--amber); background: #ffc21a12; color: var(--ink); font-size: 18px; }
.combo-btn b, .combo-opt b { display: block; font-size: 16px; }
.combo-btn small, .combo-opt small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.combo-pop { margin-top: 8px; display: grid; gap: 8px; }
.combo-pop .input { font-size: 16px; }
.combo-list { max-height: 34dvh; overflow-y: auto; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: #00000026; overscroll-behavior: contain; }
.combo-opt { text-align: left; padding: 9px 12px; border-radius: 9px; background: none; border: 0; color: var(--ink); min-height: 48px; }
.combo-opt:hover, .combo-opt:focus-visible { background: #ffffff10; }
.combo-opt[aria-selected=true] { background: #ffc21a1c; box-shadow: inset 3px 0 0 var(--amber); }
.card.perk { border-color: #ffc21a55; }
.cr-b .combo-open ~ .card.perk, .cr-b.combo-open .card.perk { display: none; }
.input { font-size: 16px; } /* no iOS zoom on focus */
/* "More below" cue: only shown when the sheet body really overflows */
.sheet { position: fixed; }
.sheet .more-cue { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); transform: translate(-50%, 8px); opacity: 0; pointer-events: none; z-index: 2; background: var(--glass2); border: 1.5px solid var(--line2); color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 13px; transition: opacity .2s, transform .2s; box-shadow: 0 6px 18px #000a; }
.sheet .more-cue span { color: var(--amber); font-size: 16px; }
.sheet.has-more .more-cue { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.sheet.has-more::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; pointer-events: none; background: linear-gradient(#0000, var(--night) 85%); border-radius: 0 0 0 0; z-index: 1; }
.sheet.cr .more-cue, .sheet.cr::after { display: none; }
@media (prefers-reduced-motion: reduce) { .sheet .more-cue { transition: none; } }
.lagmap.mini { aspect-ratio: 16 / 9; max-height: 200px; }
.lagmap .pin.n { transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; background: var(--amber); border: 2px solid var(--dark); box-shadow: 0 2px 6px #0009; display: grid; place-items: center; }
.lagmap .pin.n b { font-size: 12px; color: var(--dark); font-weight: 900; }
.lagmap .pin.n.done { background: #6a6390; } .lagmap .pin.n.lock { background: #3a3360; } .lagmap .pin.n.lock b { color: var(--muted); }
.places { display: grid; gap: 6px; }
.place-row { width: 100%; text-align: left; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: #ffffff08; color: var(--ink); min-height: 60px; }
.place-row img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; background: #00000033; }
.place-row .pn { width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: var(--dark); display: grid; place-items: center; font-size: 11px; flex: none; }
.place-row.locked { opacity: .55; } .place-row.locked .pn { background: #3a3360; color: var(--muted); }
.selbar { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-height: 720px) and (max-width: 899px) {
  .sheet.cr { max-height: 68dvh; }
  .cr-top { padding: 8px 14px 6px; gap: 5px; } .cr-h h2 { font-size: 18px; } .cr-h { min-height: 30px; }
  .cr-b { gap: 9px; padding-top: 10px; } .cr-b .sw { width: 32px; height: 32px; } .cr-b .chipb { min-height: 34px; padding: 4px 11px; }
  .cr-foot { padding-top: 8px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); } .cr-foot .btn { min-height: 44px; }
}

/* awards night: the winner is hidden until the envelope opens */
.ov .nom { padding: 6px; border-radius: 10px; transition: background .4s, box-shadow .4s; }
.ov .nom .win-tag { color: var(--amber); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.ov.revealed .nom.win { background: #ffc21a22; box-shadow: inset 0 0 0 2px #ffc21a66; }
.ov.revealed .nom.win .win-tag { opacity: 1; transform: none; }
.ov.revealed .nom:not(.win) { opacity: .6; }
.ov .result.after { display: none; }
.ov.revealed .result.after { display: block; }
/* settings: sound sliders */
.vols { display: grid; gap: 10px; }
.vols input[type=range] { width: 100%; accent-color: var(--amber); height: 28px; }

/* iOS and Android: the game is an app, not a page. No long-press Copy / Look Up menu, no text selection, no image
   save sheet, no double-tap zoom. Anything you type into or copy from (inputs, save codes) still works normally. */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, label, .btn, .chipb, .opt, .app, [role=tab] { touch-action: manipulation; }
img, canvas { -webkit-user-drag: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* phones on their side: keep the HUD, dock and talk box clear of the notch */
.hud, .dock, .talk { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
/* trophy room */
.apps.ach .app { align-content: start; }
.apps.ach .app .s { font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.25; }
.apps.ach .app.locked img { filter: grayscale(1) brightness(.45); }
.apps.ach .app.locked > span:not(.s) { color: var(--faint); }
.apps.ach .secret { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 14px; background: #ffffff10; border: 1.5px dashed var(--line2); font-family: var(--f-display); font-size: 26px; color: var(--faint); }
.ach-list { display: grid; gap: 8px; text-align: left; }
.ach-list .row { gap: 12px; background: #00000026; border-radius: 12px; padding: 8px 10px; }
.ach-list img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.ach-list .t { font-family: var(--f-display); font-size: 16px; color: var(--amber); }
.goalrow { display: flex; align-items: center; gap: 4px; pointer-events: auto; max-width: 100%; }
.goalrow[hidden] { display: none; }
.goal-x { width: 32px; height: 32px; border-radius: 50%; background: #00000066; color: var(--ink); font-size: 18px; line-height: 1; display: grid; place-items: center; flex: none; }
/* where you are: a real button that opens Go out; while out, a big way back */
.place .loc { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line2); background: var(--glass); padding: 5px 6px 5px 10px; border-radius: 999px; max-width: calc(100vw - 32px); }
.place .loc .loc-go { font-family: var(--f-body); font-weight: 800; font-size: 10.5px; letter-spacing: .04em; color: var(--dark); background: var(--amber); border-radius: 999px; padding: 2px 8px; flex: none; }
.place .loc:active { transform: translateY(1px); }
.place .backhome { pointer-events: auto; min-height: 40px; padding: 6px 18px; font-size: 14px; border-radius: 999px; }
.place .loc .loc-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.stack { flex-direction: column; gap: 1px; line-height: 1.15; }
.btn.stack small { font-size: 11px; font-weight: 600; color: var(--muted); }
.btn.go.stack small { color: #1a1206aa; }

/* ---------- Froges magazine cover ---------- */
.froges { position: relative; width: min(260px, 70vw); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: 6px; overflow: hidden; background: linear-gradient(160deg, #0f3d2e, #1d6b47 55%, #0b2a1a); box-shadow: 0 14px 40px #000c, inset 0 0 0 2px #ffffff22; display: grid; grid-template-rows: auto 1fr auto auto; text-align: left; }
.froges .fr-top { display: flex; align-items: center; gap: 6px; padding: 10px 12px 0; color: #fff; }
.froges .fr-top b { font-family: var(--f-display); font-size: 30px; letter-spacing: .04em; line-height: 1; }
.froges .fr-top small { font-size: 10px; font-weight: 800; letter-spacing: .2em; color: var(--amber); align-self: flex-end; padding-bottom: 4px; }
.froges img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.froges .fr-h { font-family: var(--f-display); font-size: 24px; color: var(--amber); padding: 0 12px; text-shadow: 0 2px 0 #0008; }
.froges .fr-s { font-size: 13px; color: #fff; padding: 2px 12px 12px; font-weight: 700; }

/* ---------- reveals: a place, with the thing you got placed in it ---------- */
.reveal { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.reveal > img:first-child { width: 100%; height: auto; max-height: 46dvh; object-fit: contain; display: block; filter: drop-shadow(0 12px 24px #000a); }
.reveal .reveal-car { position: absolute; left: 50%; bottom: 24%; width: 52%; transform: translateX(-50%); animation: carIn .9s cubic-bezier(.2, .8, .2, 1) both; filter: drop-shadow(0 8px 10px #0009); }
.reveal .reveal-sign { position: absolute; left: 50%; top: 23%; transform: translateX(-50%); max-width: 46%; font-family: var(--f-display); font-size: clamp(12px, 3.6vw, 18px); color: #1a1206; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em; }
@keyframes carIn { from { opacity: 0; transform: translate(-50%, 12%) scale(.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@media (prefers-reduced-motion: reduce) { .reveal .reveal-car { animation: none; } }

.sheet-h h2 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* long names shrink to fit (extras.js), then ellipsis */

/* out of energy: NEXT WEEK glows (a steady glow with reduced motion) */
#btnNext.rest { box-shadow: 0 4px 0 var(--amber-d), 0 0 0 4px #ffc21a66, 0 0 26px #ffc21a99; animation: restglow 1.8s ease-in-out infinite; }
@keyframes restglow { 50% { box-shadow: 0 4px 0 var(--amber-d), 0 0 0 8px #ffc21a22, 0 0 40px #ffc21acc; } }
#btnNext.nudge { animation: nudge .45s 3; }
@keyframes nudge { 50% { transform: translateY(-6px); } }
/* freestyle battle */
.bt-label { font-family: var(--f-display); font-size: 20px; color: var(--amber); min-height: 26px; }
.bt-meter { height: 12px; border-radius: 999px; background: #00000055; overflow: hidden; }
.bt-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--coral), var(--amber), var(--up)); transition: width .15s; }
.bt-pad { justify-self: center; width: min(62vw, 230px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 40%, #3a2f66, #1d1440); border: 4px solid var(--line2); font-family: var(--f-display); font-size: 30px; color: var(--ink); touch-action: manipulation; transition: transform .08s, border-color .08s; }
.bt-pad.beat { transform: scale(1.06); border-color: var(--amber); }
.bt-pad.hit { border-color: var(--up); box-shadow: 0 0 30px #35d47f88; }
.bt-pad.miss { border-color: var(--down); }
@media (prefers-reduced-motion: reduce) { .bt-pad.beat { transform: none; } #btnNext.rest, #btnNext.nudge { animation: none; } }
/* ===== Fame has a price (October 2026) ===== */
/* softer presses everywhere */
.btn, .tile, .chipb, .opt, .tabs button, .choice { transition: transform .12s cubic-bezier(.2,.8,.2,1), background-color .18s, border-color .18s, box-shadow .18s; -webkit-tap-highlight-color: transparent; }
.tile:active, .chipb:active, .opt:active, .choice:active:not(:disabled) { transform: scale(.97); }
.tabs.tabs-scroll { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs.tabs-scroll::-webkit-scrollbar { display: none; }
.tabs.tabs-scroll button { flex: 0 0 auto; padding: 0 12px; scroll-snap-align: center; }
/* season pill */
.pill.season { font-size: 12px; padding: 2px 9px; cursor: pointer; pointer-events: auto; }
.pill.season[data-s="rainy"] { border-color: #6fa8ff88; }
.pill.season[data-s="detty"] { border-color: var(--amber); }
.pill.season[data-s="harmattan"] { border-color: #e6c99a88; }
/* fan army */
.army-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.army-moves .btn { flex-direction: column; align-items: flex-start; text-align: left; min-height: 54px; gap: 2px; }
.army-moves .btn small { font-weight: 600; font-size: 11px; opacity: .75; line-height: 1.25; }
.card .bar > i { background: linear-gradient(90deg, var(--coral), var(--amber), var(--up)); }
/* the weekly front page */
.frontpage { background: #f4efe6; color: #1a1430; border-radius: 10px; padding: 8px 12px 10px; text-align: left; box-shadow: 0 4px 14px #0006; transform: rotate(-.6deg); }
.fp-mast { font-family: var(--f-display); font-size: 11px; letter-spacing: .08em; border-bottom: 2px solid #1a1430; padding-bottom: 4px; margin-bottom: 6px; }
.fp-head { font-weight: 900; font-size: 16px; line-height: 1.2; }
/* pets, jail, show set list, skip */
.pet-ic { font-size: 34px; width: 56px; height: 48px; display: grid; place-items: center; flex: none; }
.jail-energy { display: flex; justify-content: center; gap: 10px; align-items: baseline; background: #ff5d5d22; border: 1.5px solid var(--down); border-radius: 12px; padding: 8px 12px; font-weight: 800; }
.jail-energy b { font-family: var(--f-display); font-size: 26px; color: var(--down); }
.setlist { display: grid; gap: 8px; text-align: left; }
.setlist .opt { cursor: pointer; }
#showSkip { justify-self: end; background: none; border: 0; color: var(--amber); font-weight: 800; font-size: 12px; padding: 2px 0 0; min-height: 28px; cursor: pointer; }
#showSkip:disabled { opacity: .5; }
/* big moments */
.flash { position: fixed; inset: 0; z-index: 90; pointer-events: none; animation: flashOut .7s ease-out forwards; }
.flash.gold { background: radial-gradient(circle at 50% 40%, #ffd86699, #ffc21a22 60%, transparent); }
.flash.red { background: radial-gradient(circle at 50% 40%, #ff4f6d66, transparent 70%); }
@keyframes flashOut { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tile:active, .chipb:active, .opt:active { transform: none; } }
/* Netlify's review drawer must never sit on top of the game */
netlify-drawer, #netlify-drawer, [id^="netlify-drawer"], iframe[src*="app.netlify.com"], iframe[title*="Netlify" i] { display: none !important; visibility: hidden !important; pointer-events: none !important; }

/* ===== Clarity pass (October 2026): one look for choices, switches and controls ===== */
/* a sheet redrawn in place (a purchase, a toggle) or reopened with Back does not slide in again */
.sheet.still, #sheetRoot.still .sheet-bg { animation: none; }
.sheet-b { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding-bottom: 72px; }
/* big choice cards: icon, title, one line of help, a chevron. Left aligned, always. */
.mode-card { grid-template-columns: 40px 1fr 18px; text-align: left; width: 100%; min-height: 64px; }
.mode-card .mc-ic { font-size: 24px; width: 40px; height: 40px; display: grid; place-items: center; background: #ffffff0d; border-radius: 12px; }
.mode-card .mc-go { color: var(--amber); font-size: 24px; font-weight: 800; line-height: 1; }
.mode-card .t { font-weight: 800; font-size: 16px; }
.mode-card .s { font-size: 13px; color: var(--muted); line-height: 1.35; }
.mode-card[data-mode] { border-color: var(--amber); background: #ffc21a12; }
.setlist { display: grid; gap: 8px; }
/* on/off switches look like switches */
.switch-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; min-height: 56px; border: 1.5px solid var(--line); border-radius: 12px; background: #ffffff08; }
.switch-row b { display: block; font-size: 15px; }
.switch-row small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.switch { flex: none; width: 50px; height: 30px; border-radius: 999px; background: #ffffff22; position: relative; transition: background .18s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px #0006; transition: transform .18s cubic-bezier(.2,.8,.2,1); }
.switch-row[aria-checked="true"] { border-color: var(--amber); }
.switch-row[aria-checked="true"] .switch { background: var(--up); }
.switch-row[aria-checked="true"] .switch i { transform: translateX(20px); }
.vid-auto { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: center; }
.vid-auto .switch-row { min-height: 44px; padding: 6px 10px; font-weight: 700; font-size: 14px; }
@media (max-width: 440px) { .vid-auto { grid-template-columns: 1fr; } }
/* show controls inside the crowd bar */
.show-ctl { display: flex; gap: 8px; justify-content: flex-end; }
.show-ctl .btn { min-height: 40px; padding: 6px 14px; }
/* the freestyle ring */
.bt-pad { position: relative; overflow: visible; }
.bt-ring { position: absolute; inset: -6px; border-radius: 50%; border: 4px solid var(--amber); pointer-events: none; opacity: 0; will-change: transform, opacity; }
.bt-txt { position: relative; }
.bt-help { text-align: center; }
.bt-label { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.bt-pad { width: min(52vw, 200px); margin: 18px 0; }
/* crypto summary */
.crypto-sum .t { font-size: 22px; font-family: var(--f-display); color: var(--amber); }
/* touch screens: every control at least 44px tall, chips and small buttons included */
@media (pointer: coarse) {
  .btn.sm, .chipb, .tabs button, .show-ctl .btn { min-height: 44px; }
  .close, .sheet-h .back { width: 44px; height: 44px; }
  .pill.season { min-height: 30px; }
  .chips { gap: 8px; }
}
/* hover is a desktop thing: phones never get stuck in a hover state */
@media (hover: none) {
  .choice:hover:not(:disabled) { border-color: var(--line2); background: #ffffff0d; }
  .opt:hover:not(.locked) { border-color: var(--line); background: #ffffff08; }
  .opt:has(input:checked):hover, .mode-card[data-mode]:hover { border-color: var(--amber); background: #ffc21a14; }
  .choice:active:not(:disabled), .opt:active:not(.locked) { border-color: var(--amber); background: #ffc21a14; }
}
/* phones held sideways: the dock and NEXT WEEK share one row and the HUD slims down, so the room has space */
@media (orientation: landscape) and (max-height: 540px) {
  .dock-in { max-width: 920px; grid-template-columns: 1fr minmax(150px, 200px); align-items: stretch; }
  .tile { min-height: 50px; padding: 3px 2px 4px; gap: 0; }
  .tile img { width: 28px; height: 24px; }
  .tile span { font-size: 10.5px; }
  .next { min-height: 50px; font-size: 15px; line-height: 1.1; flex-direction: column; gap: 1px; }
  .next small { display: block; font-size: 10px; }
  .hud { padding-top: calc(env(safe-area-inset-top, 0px) + 6px); }
  .me { padding: 3px 10px 3px 3px; }
  .me img { width: 34px; height: 34px; }
  .cash { font-size: 17px; }
  .pill { padding: 2px 8px; font-size: 12px; }
  .sheet { max-height: 94vh; max-height: 94dvh; }
}
@media (hover: none) {
  .tile:not(.pulse):hover { transform: none; border-color: var(--line); background: var(--glass); box-shadow: none; }
  .tile:hover img { transform: none; }
}
/* tall popups on short screens scroll from their top instead of being cut off by centring */
.ov-bg { display: flex; flex-direction: column; }
.ov-bg > .ov { margin: auto; flex: none; }
/* the title screen always fits: sideways phones put the buttons beside the logo, and it scrolls if it must */
.title-ui { overflow-y: auto; }
@media (orientation: landscape) and (max-height: 540px) {
  .title-ui { max-width: 900px; display: grid; grid-template-columns: 1.2fr 1fr; grid-template-rows: auto 1fr; column-gap: 28px; row-gap: 10px; align-items: end; padding-top: calc(env(safe-area-inset-top, 0px) + 18px); padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
  .title-ui .logo { font-size: clamp(36px, 9.5vh, 58px); grid-column: 1; grid-row: 1; align-self: end; }
  .title-ui .tagline { grid-column: 1; grid-row: 2; align-self: start; font-size: 15px; }
  .title-ui .title-btns { grid-column: 2; grid-row: 1 / 3; margin-top: 0; align-self: center; }
}
/* sideways phones: sheets open as a panel on the right, like desktop, so the scene stays in view */
@media (orientation: landscape) and (max-height: 540px) and (min-width: 560px) {
  .sheet, .sheet.cr, .sheet.cr:has(.combo-open) { left: auto; top: 0; width: min(460px, 60vw); max-height: none; border-radius: 0; border-top: 0; border-left: 2px solid var(--line2); animation: slide .25s ease-out; padding-right: env(safe-area-inset-right, 0px); }
  .sheet.still { animation: none; }
}

/* ---------- social: action grid and the conversation ---------- */
.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.act { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 10px; min-height: 56px; border: 1.5px solid var(--line); border-radius: 12px; background: #ffffff08; color: var(--ink); font: inherit; cursor: pointer; }
.act .e { grid-row: span 2; font-size: 22px; }
.act .t { font-weight: 700; font-size: 14px; line-height: 1.15; }
.act .s { font-size: 11px; color: var(--muted); line-height: 1.2; }
.act:active { transform: scale(.98); }
@media (hover: hover) { .act:hover { border-color: var(--line2); background: #ffffff10; } }
#thr { display: grid; gap: 8px; }
.bub { max-width: 88%; justify-self: start; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: #ffffff10; border: 1px solid var(--line); display: grid; gap: 4px; overflow-wrap: anywhere; }
.bub.me { justify-self: end; border-radius: 14px 14px 4px 14px; background: #7d5cff2e; border-color: #7d5cff55; }
.bub .bar { margin-top: 2px; }
@media (max-width: 360px) { .acts { grid-template-columns: 1fr; } }
.opt.note .t { font-size: 14px; font-weight: 500; line-height: 1.25; }
.opt.note.unread { border-color: var(--amber); background: #ffc21a12; }
.opt.note.unread .t { font-weight: 700; }
.opt .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); display: inline-block; }

/* launch: "#1 this month" on the start screen */
.title-top { justify-self: start; align-self: start; padding: 8px 14px; border-radius: 999px; background: rgba(255, 194, 26, .14); border: 1px solid rgba(255, 194, 26, .45); color: var(--ink, #fff7e8); font-size: 14px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Friends: activity rows */
.opt.note { align-items: center; }
.opt.note .note-ic { font-size: 22px; width: 32px; text-align: center; flex: none; }
.opt.note .t { font-size: 15px; line-height: 1.3; }
.opt.note .note-act { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--amber, #ffc21a); color: #1a1206; font-weight: 800; font-size: 13px; }
details.note-old > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
details.note-old > summary::-webkit-details-marker { display: none; }
details.note-old[open] > summary .s { opacity: .6; }

/* out of energy: a clear pointer to NEXT WEEK */
#dock .tile.spent { opacity: .45; filter: saturate(.4); }
#dock .tile.spent::after { content: '⚡0'; position: absolute; top: 4px; left: 6px; font-size: 11px; font-weight: 800; color: #ffc21a; }
#dock .tile { position: relative; }
.rest-coach { position: fixed; left: 50%; transform: translateX(-50%); z-index: 40; width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 18px; background: #1b1240; border: 2px solid #ffc21a; color: #fff7e8; box-shadow: 0 12px 30px rgba(0,0,0,.45); display: flex; gap: 12px; align-items: center; cursor: pointer; }
.rest-coach b { color: #ffc21a; }
.rest-coach .rc-x { margin-left: auto; background: none; border: 0; color: #a99ed0; font-size: 20px; min-width: 32px; min-height: 32px; cursor: pointer; }
.rest-coach::after { content: ''; position: absolute; left: 50%; bottom: -12px; margin-left: -10px; border: 10px solid transparent; border-top-color: #ffc21a; border-bottom: 0; }
.rest-coach .rc-arrow { font-size: 22px; animation: rcbob 1s ease-in-out infinite; }
@keyframes rcbob { 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .rest-coach .rc-arrow { animation: none; } }

/* a newer build is live */
.update-bar { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; transform: translateX(-50%); z-index: 60; width: min(480px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 16px; background: #1b1240; border: 2px solid #3fd6c4; color: #fff7e8; box-shadow: 0 12px 30px rgba(0,0,0,.45); font-size: 14px; }
.update-bar span { flex: 1; }
.update-bar .rc-x { background: none; border: 0; color: #a99ed0; font-size: 20px; min-width: 32px; min-height: 32px; cursor: pointer; }
/* final pass: calmer, more readable text */
body { line-height: 1.45; }
.s { font-size: 13px; line-height: 1.45; }
.t { font-size: 15px; line-height: 1.3; }
.sheet-h h2 { font-size: 20px; letter-spacing: .02em; }
.sec-h h3 { font-size: 12.5px; letter-spacing: .08em; }
.card { line-height: 1.5; }
.lines > div { padding: 3px 0; }
.ov p, .talk-text { line-height: 1.5; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 32px; width: 100%; }

/* ---------- label office: tabs, brand, logo studio, My PA ---------- */
.lab-head { display: grid; gap: 10px; padding: 12px; border: 1.5px solid var(--line2); border-radius: 16px; background: linear-gradient(135deg, #ffffff12, #ffffff04); }
.lab-brand { display: flex; gap: 12px; align-items: center; }
.lab-brand img, .lab-brandcard img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.lab-brand .ln { font-family: var(--f-display); font-size: 20px; line-height: 1.1; overflow-wrap: anywhere; }
.lab-brand .lm { color: var(--muted); font-size: 13px; margin-top: 2px; }
.lab-head .kpis { margin: 0; }
.lab-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lab-quick button { display: grid; justify-items: center; gap: 1px; padding: 8px 4px; min-height: 64px; border-radius: 12px; background: #ffffff0c; border: 1.5px solid var(--line); text-align: center; }
.lab-quick button:active { transform: translateY(2px); }
.lab-quick button span { font-size: 20px; line-height: 1.1; }
.lab-quick button b { font-size: 13px; }
.lab-quick button small { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.lab-nav { position: sticky; top: -1px; z-index: 6; background: var(--night); box-shadow: 0 8px 10px -8px #000; }
.lab-intro { margin: -6px 2px 0; color: var(--muted); }
.lab-zone { display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }
.lab-zone > .sec, .lab-zone > details.sec { border-left: 3px solid var(--amber); padding-left: 10px; }
.lab-zone > .sec > .sec-h h3, .lab-zone > details.sec > summary h3 { color: var(--ink); }
.lab-brandcard { display: flex; gap: 12px; align-items: center; }
.lg-prev { display: flex; gap: 12px; align-items: center; }
.lg-prev > img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.lg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lg-cell { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 1.5px solid var(--line); border-radius: 12px; background: #ffffff08; min-width: 0; }
.lg-cell img { width: 100%; max-width: 52px; aspect-ratio: 1; object-fit: contain; }
.lg-cell span { font-size: 9.5px; color: var(--muted); font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-cell[aria-pressed="true"] { border-color: var(--amber); background: #ffc21a1f; }
.lg-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-dot { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #ffffff55; }
.lg-dot[aria-pressed="true"] { outline: 3px solid var(--amber); outline-offset: 2px; }
.pa-hero { display: flex; gap: 12px; align-items: center; }
.pa-hero > img { width: 64px; height: 64px; border-radius: 16px; flex: none; }
.pa-need { display: grid; gap: 2px; text-align: left; border-color: var(--amber); width: 100%; }
.pa-lv[aria-pressed="true"] { border-color: var(--amber); background: #ffc21a1a; }
.pa-lv { width: 100%; text-align: left; }
.pa-dot { color: var(--amber); font-size: 18px; }
.pa-strip .chips { margin-top: 2px; }
