:root {
  --bg: #eef2f7;
  --ink: #16202e;
  --muted: #5d6b7c;
  --card: #ffffff;
  --card-2: #f4f6f9;
  --line: #e2e7ee;
  --red: #d0161b;
  --red-ink: #ffffff;
  --navy: #10239e;
  --green: #2f9e59;
  --gold: #f2b705;
  --shadow: 0 6px 24px rgba(22, 32, 46, 0.14), 0 1px 3px rgba(22, 32, 46, 0.1);
  --radius: 18px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
#app { position: fixed; inset: 0; touch-action: none; }
#app canvas { display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#ui > * { pointer-events: auto; }
#ui > .fadeout, #ui > .actpill, #ui > .tube-anim, #ui > .toasts, #ui > .feed, #ui > .banner { pointer-events: none; }

#boot { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; background: var(--bg); z-index: 50; transition: opacity .5s; }
#boot.gone { opacity: 0; pointer-events: none; }
.boot-logo { font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.boot-sub { color: var(--muted); margin-top: 6px; font-size: 14px; }

/* ---------- top bar ---------- */
.topbar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 20px));
  display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.94); backdrop-filter: blur(10px); border-radius: 16px; padding: 8px 10px 8px 14px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.brand .logo { font-size: 20px; }
.stat { font-size: 13px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.stat.live { color: var(--green); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; box-shadow: 0 0 0 3px rgba(47,158,89,0.18); }
.spacer { flex: 1; }
.btn { border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 14px; background: var(--card-2); transition: transform .08s, background .2s; white-space: nowrap; }
.btn:hover { background: #e8ecf2; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--red); color: var(--red-ink); }
.btn.primary:hover { background: #b51216; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 12px; background: var(--card-2); font-weight: 700; font-size: 14px; }
.me-chip .face { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; }

.pills { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 58px); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: min(640px, calc(100% - 20px)); }
.pill { background: rgba(255,255,255,0.94); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px rgba(22,32,46,.12); white-space: nowrap; }
.pill:hover { background: #fff; }
.pill.mayor { background: #fff7d6; }

.clock { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 4px); right: 12px; background: rgba(255,255,255,0.9); border-radius: 12px; padding: 6px 10px; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px rgba(22,32,46,.12); }
@media (max-width: 900px) { .clock { top: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 170px); right: 10px; } }

/* ---------- CTA for spectators ---------- */
.cta { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: rgba(255,255,255,0.96); border-radius: 20px; padding: 12px; box-shadow: var(--shadow); width: min(380px, calc(100% - 24px)); }
.cta .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0 4px 10px; }
.cta .who b { color: var(--ink); }
.faces { display: flex; }
.faces span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; margin-left: -6px; display: grid; place-items: center; font-size: 12px; }
.faces span:first-child { margin-left: 0; }
.cta .row { display: flex; gap: 8px; }
.cta .row .primary { flex: 1; padding: 14px; font-size: 15px; border-radius: 14px; }
.cta .row .btn:not(.primary) { padding: 14px 18px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }

/* ---------- HUD ---------- */
.hud { position: absolute; left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 250px; background: rgba(255,255,255,0.96); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.hud .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.hud .name { font-weight: 800; font-size: 15px; }
.hud .lvl { font-size: 12px; color: var(--muted); }
.money { font-weight: 800; font-size: 18px; color: var(--green); }
.money.neg { color: var(--red); }
.hud .jail { margin: -2px 0 8px; padding: 5px 8px; border-radius: 8px; background: #1b2a4a; color: #fff; font-size: 12px; font-weight: 700; }
.need { display: grid; grid-template-columns: 20px 1fr 30px; align-items: center; gap: 6px; font-size: 12px; margin-top: 5px; }
.bar { height: 8px; background: #e9edf2; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; transition: width .6s; }
.need .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.hud .tools { display: flex; gap: 6px; margin-top: 10px; }
.hud .tools .btn { flex: 1; padding: 7px 6px; font-size: 12px; }
.hud .collapse { position: absolute; top: 8px; right: 8px; font-size: 12px; color: var(--muted); padding: 4px 6px; }
.hud.min .needs, .hud.min .tools { display: none; }
.hud.min { width: auto; }

.chatbox { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); width: min(420px, calc(100% - 290px)); display: flex; gap: 6px; background: rgba(255,255,255,0.96); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.chatbox input { flex: 1; border: 0; outline: none; background: transparent; padding: 8px 10px; font-size: 14px; min-width: 0; }
.chatbox .emotes { display: flex; }
.chatbox .emotes button { font-size: 18px; padding: 2px 4px; border-radius: 8px; }
.chatbox .emotes button:hover { background: var(--card-2); }

.feed { position: absolute; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: 270px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.feed .item { background: rgba(255,255,255,0.93); border-radius: 12px; padding: 7px 10px; font-size: 12px; box-shadow: 0 2px 8px rgba(22,32,46,.1); animation: slidein .35s ease-out; line-height: 1.35; }
.feed .item b { font-weight: 700; }
.feed .item.chat { background: rgba(232, 240, 255, 0.95); }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.zoom { position: absolute; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 50px); display: flex; flex-direction: column; background: rgba(255,255,255,0.94); border-radius: 12px; box-shadow: 0 2px 8px rgba(22,32,46,.14); overflow: hidden; }
.zoom button { width: 36px; height: 36px; font-size: 20px; font-weight: 700; }
.zoom button:hover { background: var(--card-2); }
.zoom button + button { border-top: 1px solid var(--line); }
@media (max-width: 900px) { .zoom { top: 50%; transform: translateY(-50%); } }
.recenter {position: absolute; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 50px); }
@media (max-width: 900px) {
  .feed { width: 210px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 64px); }
  .chatbox { left: 12px; right: 12px; transform: none; width: auto; }
  .hud { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 64px); width: 200px; padding: 10px; }
  .feed .item:nth-child(n+4) { display: none; }
}
@media (max-width: 520px) {
  .brand .word { display: none; }
  .stat.visits { display: none; }
  .feed { display: none; }
  .hud { width: 180px; }
}

/* ---------- labels in the 3D world ---------- */
.lbl { font-family: var(--font); font-size: 12px; font-weight: 600; background: rgba(255,255,255,0.95); color: var(--ink); padding: 4px 9px; border-radius: 999px; box-shadow: 0 1px 4px rgba(22,32,46,.18); white-space: nowrap; pointer-events: auto; cursor: pointer; user-select: none; }
.lbl:hover { background: #fff; transform: scale(1.04); }
.lbl.place { font-size: 12.5px; }
.lbl.station { background: #10239e; color: #fff; font-size: 11px; padding: 3px 8px; }
.lbl.home { background: #3f9b55; color: #fff; font-size: 11px; padding: 3px 8px; }
.lbl.home.mine { background: var(--gold); color: #1a1a1a; }
.lbl.home.online::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #b8ffcf; margin-right: 5px; vertical-align: 1px; }
.lbl.player { font-size: 11px; padding: 3px 8px; pointer-events: auto; }
.lbl.player.me { background: var(--ink); color: #fff; }
.lbl.player .d { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 5px; vertical-align: 1px; }
.bubble { font-family: var(--font); font-size: 12.5px; background: #fff; color: var(--ink); padding: 6px 10px; border-radius: 14px; max-width: 200px; white-space: normal; box-shadow: 0 2px 8px rgba(22,32,46,.2); pointer-events: none; position: relative; animation: pop .25s ease-out; line-height: 1.3; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
.bubble.emote { font-size: 26px; background: transparent; box-shadow: none; padding: 0; }
.bubble.emote::after { display: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.hide-homes .lbl.home { display: none; }
.hide-stations .lbl.station { display: none; }
.hide-places .lbl.place { display: none; }

/* ---------- sheets / modals ---------- */
.scrim { position: absolute; inset: 0; background: rgba(15, 22, 35, 0.32); display: grid; place-items: center; animation: fade .2s; padding: 12px; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--card); border-radius: 22px; width: min(440px, 100%); max-height: min(86vh, 760px); overflow: auto; box-shadow: 0 20px 60px rgba(10,20,40,.3); animation: rise .25s ease-out; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } }
.sheet.wide { width: min(720px, 100%); }
.sheet header { position: sticky; top: 0; background: var(--card); padding: 18px 18px 10px; display: flex; align-items: flex-start; gap: 12px; z-index: 1; }
.sheet header .em { font-size: 30px; line-height: 1; }
.sheet header h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.sheet header p { margin: 3px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.sheet header .x { margin-left: auto; font-size: 20px; color: var(--muted); padding: 2px 8px; border-radius: 10px; }
.sheet header .x:hover { background: var(--card-2); }
.sheet .body { padding: 4px 18px 18px; }
.sheet .note { background: var(--card-2); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.45; }
.act { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 14px; border: 1.5px solid var(--line); margin-bottom: 8px; }
.act .e { font-size: 24px; text-align: center; }
.act .t { font-weight: 700; font-size: 14px; }
.act .fx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fx span { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--card-2); color: var(--muted); font-weight: 600; }
.fx span.up { background: #e3f6ea; color: #1f7a43; }
.fx span.down { background: #fde8e8; color: #b42318; }
.fx span.cash { background: #fff4d1; color: #8a6200; }
.fx span.risk { background: #1b2a4a; color: #fff; }
.note.dodge { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.act .go { min-width: 74px; }
.act .cd { font-size: 11px; color: var(--muted); text-align: center; margin-top: 3px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; outline: none; font-size: 15px; }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.35; }
.field input:focus, .field select:focus { border-color: var(--navy); }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.full { width: 100%; padding: 14px; font-size: 15px; border-radius: 14px; }

.creator { display: grid; grid-template-columns: 250px 1fr; gap: 16px; }
.creator .preview { background: radial-gradient(circle at 50% 35%, #ffffff, #dbe7f3 70%); border-radius: 18px; height: 360px; position: relative; overflow: hidden; }
.creator .preview canvas { width: 100% !important; height: 100% !important; }
.creator .preview .rand { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.opt > span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; min-width: 66px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--card-2); border-radius: 10px; padding: 2px; flex: 1; justify-content: space-between; }
.stepper b { font-size: 13px; font-weight: 700; }
.stepper button { width: 28px; height: 28px; border-radius: 8px; font-weight: 800; }
.stepper button:hover { background: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; justify-content: flex-end; }
.swatches button { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatches button.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
@media (max-width: 560px) { .creator { grid-template-columns: 1fr; } .creator .preview { height: 260px; } }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); margin-bottom: 8px; }
.list-row .rank { width: 22px; font-weight: 800; color: var(--muted); text-align: center; }
.list-row .nm { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-row .sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; padding: 8px; border-radius: 10px; background: var(--card-2); font-weight: 700; font-size: 13px; }
.tabs button.on { background: var(--ink); color: #fff; }
.stations { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stations button { text-align: left; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.stations button:hover { border-color: var(--navy); }
.stations button i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.stations button.here { opacity: .45; pointer-events: none; }
.votebar { height: 6px; background: #eef1f5; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.votebar i { display: block; height: 100%; background: var(--navy); }

.toasts { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 100px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); animation: rise .25s; max-width: min(420px, 90vw); text-align: center; }
.toast.bad { background: var(--red); }
.toast.good { background: var(--green); }
.banner { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 96px); left: 50%; transform: translateX(-50%); background: #fff4d1; color: #6b4d00; border-radius: 12px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.1); white-space: nowrap; }
.fadeout { position: absolute; inset: 0; background: #0b1020; opacity: 0; pointer-events: none; transition: opacity .14s ease-out; }
.fadeout.on { opacity: 1; }
.tube-anim { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .02em; pointer-events: none; opacity: 0; transition: opacity .3s; }
.tube-anim.on { opacity: 1; }

/* ---------- inside places & homes ---------- */
.in-room .lbl.place, .in-room .lbl.station, .in-room .lbl.home { display: none !important; }
#app.in-room ~ #ui .feed, #app.in-room ~ #ui .pills, #app.in-room ~ #ui .banner { display: none; }
#app.in-room ~ #ui .hud { bottom: auto; top: calc(max(10px, env(safe-area-inset-top)) + 62px); }
.roombar { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom)); width: min(680px, calc(100% - 300px)); background: rgba(255,255,255,0.96); border-radius: 22px; padding: 12px; box-shadow: var(--shadow); }
.rb-head { display: flex; align-items: center; gap: 10px; }
.rb-face { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; box-shadow: 0 0 0 3px #3fbf73; flex: none; }
.rb-text { flex: 1; min-width: 0; }
.rb-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-tag { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--card-2); font-size: 18px; flex: none; }
.rb-icon:hover { background: #e6eaf0; }
.rb-chat { display: flex; gap: 8px; margin: 10px 0 8px; }
.rb-chat input { flex: 1; min-width: 0; border: 0; outline: none; background: var(--card-2); border-radius: 14px; padding: 11px 14px; font-size: 14px; }
.rb-send { width: 42px; border-radius: 50%; background: #3fbf73; color: #fff; font-size: 16px; }
.rb-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rb-chips::-webkit-scrollbar { display: none; }
.rb-chip { flex: none; padding: 8px 12px; border-radius: 12px; background: var(--card-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.rb-chip:hover { background: #e6eaf0; }
.rb-chip.primary { background: var(--red); color: #fff; }
.rb-chip.cooling { opacity: .5; }
.rnotif { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 62px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); width: min(380px, calc(100% - 24px)); animation: rise .25s; }
.rn-ico { font-size: 20px; }
.rn-text { flex: 1; min-width: 0; font-size: 13px; }
.rn-text div { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-reply { background: var(--ink); color: #fff; }
.decor { position: absolute; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 62px); bottom: 190px; width: 320px; background: rgba(255,255,255,0.97); border-radius: 20px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; animation: rise .2s; }
.dc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dc-head b { font-size: 16px; flex: 1; }
.dc-money { font-weight: 800; color: var(--green); }
.decor .x { font-size: 20px; color: var(--muted); padding: 0 6px; }
.dc-body { overflow-y: auto; flex: 1; }
.dc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dc-item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 10px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; }
.dc-item:hover { border-color: var(--navy); }
.dc-item.poor { opacity: .5; }
.dc-emoji { grid-row: span 3; font-size: 26px; }
.dc-name { font-weight: 700; font-size: 13px; }
.dc-price { font-size: 12px; color: var(--green); font-weight: 700; }
.dc-size { font-size: 11px; color: var(--muted); }
.ghostbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 200px; display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 8px 10px 8px 14px; border-radius: 14px; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; white-space: nowrap; }
.ghostbar .btn { background: rgba(255,255,255,.14); color: #fff; }
.itempop { position: absolute; left: 50%; transform: translateX(-50%); bottom: 200px; display: flex; align-items: center; gap: 8px; background: #fff; padding: 10px 12px; border-radius: 16px; box-shadow: var(--shadow); animation: rise .2s; white-space: nowrap; }
.itempop .x { font-size: 18px; color: var(--muted); padding: 0 4px; }
@media (max-width: 900px) {
  .roombar { left: 8px; right: 8px; transform: none; width: auto; bottom: max(8px, env(safe-area-inset-bottom)); }
  .decor { left: 8px; right: 8px; width: auto; top: auto; bottom: 200px; max-height: 45vh; }
  .itempop { bottom: 210px; }
}

/* activity in progress */
.actpill { position: absolute; left: 50%; top: 150px; transform: translate(-50%, -8px); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  background: rgba(17,24,39,0.92); color: #fff; border-radius: 999px; padding: 8px 16px 10px; font-weight: 800; font-size: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 190px; }
.actpill.on { opacity: 1; transform: translate(-50%, 0); }
.actpill b { display: block; width: 100%; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.18); overflow: hidden; }
.actpill i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3fbf73, #ffd166); border-radius: 3px; }
/* staff name tags inside places */
.lbl.worker { background: rgba(30,34,44,0.82); color: #ffe7a8; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; pointer-events: none; letter-spacing: .2px; }

/* travel picker */
.act.travel .sub { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.act.travel .cd { text-align: left; margin-top: 2px; }
.act.travel.fastest { border-color: #3fbf73; background: #f2fbf5; }
.act.travel .tag { margin-left: 8px; font-size: 10.5px; font-weight: 800; color: #1f7a45; background: #d9f3e3; padding: 2px 7px; border-radius: 999px; vertical-align: 2px; }

/* character creator tabs */
.cr-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.cr-tabs button { padding: 6px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--card-2); color: var(--ink); }
.cr-tabs button.on { background: var(--ink); color: #fff; }
.cr-panel { min-height: 120px; }

/* creator chips (v6) */
.cr-sec { margin-bottom: 12px; }
.cr-h { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.chips2 { display: flex; flex-wrap: wrap; gap: 6px; }
.chips2 button { padding: 7px 12px; border-radius: 999px; background: var(--card-2); font-weight: 700; font-size: 13px; color: var(--ink); }
.chips2 button.on { background: var(--ink); color: #fff; }
.swatches.big { justify-content: flex-start; gap: 7px; }
.swatches.big button { width: 28px; height: 28px; }
.creator .cr-panel { max-height: 330px; overflow: auto; padding-right: 4px; }

/* ---------- v6: bottom nav (Home · Buy · Map · Phone) ---------- */
.botnav { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; gap: 4px; background: rgba(18, 24, 38, 0.94); backdrop-filter: blur(10px); border-radius: 22px; padding: 6px; box-shadow: 0 10px 30px rgba(10, 16, 30, .35); z-index: 5; }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 74px; padding: 6px 0 5px; border-radius: 16px; color: #dfe6f3; font-size: 11px; font-weight: 700; letter-spacing: .02em; transition: background .15s; }
.nav-btn:hover { background: rgba(255,255,255,.08); }
.nav-btn:active { transform: scale(.96); }
.nav-ico { position: relative; font-size: 22px; line-height: 1.1; }
.nav-badge { position: absolute; top: -4px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #ff3b30; color: #fff; font: 800 10.5px/17px var(--font); font-style: normal; text-align: center; box-shadow: 0 0 0 2px rgba(18,24,38,.94); }
.has-nav .hud { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 74px); }
.has-nav .chatbox { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 74px); }
.has-nav .roombar { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 74px); }
.has-nav .feed { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 74px); }
.has-nav .decor { bottom: 270px; }
.has-nav .ghostbar, .has-nav .itempop { bottom: 276px; }
@media (max-width: 900px) {
  .has-nav .hud { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 136px); }
  .has-nav .feed { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 136px); }
  .has-nav .roombar { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 70px); }
  .has-nav .decor { bottom: 280px; }
  .nav-btn { width: 66px; }
}

/* ---------- the phone ---------- */
.phone { position: absolute; right: 16px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); width: 340px; height: min(640px, calc(100vh - 110px)); background: #0d1117; border-radius: 42px; padding: 10px; box-shadow: 0 30px 60px rgba(8, 12, 24, .45), inset 0 0 0 2px #2b3240; display: flex; flex-direction: column; z-index: 8; animation: phoneup .25s cubic-bezier(.2,.9,.3,1.2); }
@keyframes phoneup { from { transform: translateY(30px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.ph-status { display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 18px 6px; }
.ph-notch { width: 90px; height: 22px; background: #000; border-radius: 12px; }
.ph-screen { flex: 1; background: #f4f6fa; border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; position: relative; }
.ph-home { height: 22px; margin: 6px auto 0; width: 120px; border-radius: 4px; position: relative; }
.ph-home::after { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 5px; border-radius: 3px; background: #9aa3b5; }
.ph-wall { flex: 1; overflow: auto; background: radial-gradient(circle at 20% 0%, #4a6cf7 0%, #1d2b64 55%, #0f1733 100%); color: #fff; padding: 16px 14px; }
.ph-greet { text-align: center; margin: 4px 0 18px; font-size: 13px; opacity: .9; }
.ph-big { font-size: 46px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.ph-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 6px; }
.ph-app { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #fff; }
.ph-app:active .ph-icon { transform: scale(.92); }
.ph-icon { position: relative; width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 27px; box-shadow: 0 4px 10px rgba(0,0,0,.25), inset 0 -3px 0 rgba(0,0,0,.12); transition: transform .1s; }
.ph-name { font-size: 11px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ph-dot { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font: 800 11px/18px var(--font); font-style: normal; text-align: center; }
.ph-icon .ph-dot { position: absolute; top: -5px; right: -5px; }
.ph-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.ph-bar b { font-size: 16px; }
.ph-back, .ph-act { width: 28px; height: 28px; border-radius: 50%; font-size: 22px; line-height: 1; color: var(--navy); }
.ph-act { font-size: 16px; }
.ph-list { flex: 1; overflow: auto; padding: 6px 8px 12px; }
.ph-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: 14px; text-align: left; background: #fff; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(22,32,46,.06); }
button.ph-row:hover { background: #fbfcff; }
.ph-row.col { flex-direction: column; align-items: stretch; }
.ph-mid { flex: 1; min-width: 0; }
.ph-mid b { font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-sub.strong { color: var(--ink); font-weight: 700; }
.ph-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11px; color: var(--muted); }
.ph-btns { display: flex; gap: 4px; align-items: center; }
.ph-btns .btn.small { padding: 6px 9px; }
.ph-face { border-radius: 50%; display: grid; place-items: center; font-size: 18px; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.ph-on { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; margin-left: 6px; vertical-align: 1px; }
.ph-emoji { width: 38px; height: 38px; display: grid; place-items: center; font-size: 22px; background: var(--card-2); border-radius: 12px; flex: none; }
.ph-chev { color: var(--muted); font-size: 20px; }
.ph-pay { font-weight: 800; color: var(--green); font-size: 13px; white-space: nowrap; }
.ph-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; }
.ph-note { font-size: 12.5px; color: var(--muted); padding: 10px 14px 4px; line-height: 1.4; }
.ph-pad { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ph-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 16px 0; }
.ph-search { width: 100%; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font: 500 14px var(--font); background: #fff; outline: none; }
.ph-search:focus { border-color: var(--navy); }
.ph-hero { margin: 12px; padding: 16px; border-radius: 18px; color: #fff; font-size: 13px; }
.ph-hero b { display: block; font-size: 20px; margin-bottom: 2px; }
.ph-card { margin: 12px; padding: 18px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #10239e, #4361ee); box-shadow: 0 8px 20px rgba(16,35,158,.3); }
.ph-balance { font-size: 32px; font-weight: 800; margin: 4px 0; letter-spacing: -.01em; }
.ph-meter { height: 8px; border-radius: 4px; background: var(--card-2); overflow: hidden; margin: 6px 0 4px; }
.ph-meter i { display: block; height: 100%; border-radius: 4px; }
.ph-link { font-size: 12px; background: #fff; border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px; word-break: break-all; color: var(--muted); }
.ph-thread { flex: 1; overflow: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px; background: #eef1f6; }
.ph-msg { max-width: 78%; padding: 8px 11px 6px; border-radius: 18px; font-size: 14px; line-height: 1.35; word-wrap: break-word; position: relative; }
.ph-msg.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.ph-msg.me { align-self: flex-end; background: #2fbf71; color: #fff; border-bottom-right-radius: 6px; }
.ph-msg.money { background: #fff4cc; color: #6b4e00; }
.ph-msg.me.money { background: #f2b705; color: #2a1d00; }
.ph-msg.knock { background: #e8ecff; color: #10239e; }
.ph-msg.me.knock { background: #10239e; color: #fff; }
.ph-time { display: block; font-size: 10px; opacity: .65; margin-top: 2px; text-align: right; }
.ph-compose { display: flex; gap: 6px; padding: 8px; background: #fff; border-top: 1px solid var(--line); }
.ph-compose input { flex: 1; border: 0; background: var(--card-2); border-radius: 18px; padding: 10px 14px; font: 500 14px var(--font); outline: none; min-width: 0; }
.ph-send { width: 40px; height: 40px; border-radius: 50%; background: #2fbf71; color: #fff; font-size: 17px; }
.toast.msg { pointer-events: auto; cursor: pointer; background: #fff; color: var(--ink); text-align: left; border-left: 4px solid #2fbf71; }
@media (max-width: 600px) {
  .phone { left: 8px; right: 8px; width: auto; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 72px); height: calc(100vh - 140px); border-radius: 34px; }
}

/* ---------- buy sheet ---------- */
.buygrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.buy-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 16px; background: var(--card-2); text-align: left; }
.buy-card span { font-size: 28px; }
.buy-card b { font-size: 15px; }
.buy-card small { color: var(--muted); font-size: 12px; }
.buy-card:hover { background: #e9edf4; }

/* ---------- towers, flats, knocking ---------- */
.lbl.place.tower { background: #1d3557; color: #fff; }
.lbl.place.tower.mine { background: var(--gold); color: #1a1a1a; }
.tower-list { max-height: 52vh; overflow: auto; padding-right: 2px; }
.floorhd { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 10px 2px 6px; }
.list-row.flat { padding: 8px 10px; }
.list-row.flat.mine { border-color: var(--gold); background: #fffbea; }
.flatno { width: 34px; height: 34px; border-radius: 10px; background: var(--card-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.list-row .nm .face.sm { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 6px; vertical-align: -2px; }
.list-row .nm.vacant { color: var(--muted); }
.knockcard { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 64px); left: 50%; transform: translateX(-50%); width: min(340px, calc(100% - 24px)); background: #fff; border-radius: 22px; padding: 14px; box-shadow: 0 20px 40px rgba(10,16,30,.3); z-index: 9; animation: rise .25s; }
.kc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.kc-top .face { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; }
.kc-top b { font-size: 16px; }
.kc-top .sub { color: var(--muted); font-size: 13px; }
.kc-btns { display: flex; gap: 8px; }
.kc-btns .btn { flex: 1; padding: 11px; }
.knockwait { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 64px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; padding: 8px 8px 8px 14px; border-radius: 16px; box-shadow: var(--shadow); font-size: 13.5px; font-weight: 600; z-index: 9; }
.knockwait .btn { background: rgba(255,255,255,.14); color: #fff; }
.kw-anim { display: inline-block; animation: knock .6s ease-in-out infinite; }
@keyframes knock { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-25deg) translateX(-2px); } }
.seg { display: flex; gap: 4px; background: var(--card-2); padding: 4px; border-radius: 12px; flex: 1; }
.seg button { flex: 1; padding: 8px 6px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg small { font-weight: 600; color: var(--red); }
.field textarea { width: 100%; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px; font: 500 14px var(--font); resize: vertical; }
.bedtag { display: inline-block; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: #e8ecff; color: #10239e; margin-right: 2px; }
.bedtag.b2 { background: #e3f6ea; color: #1f7a43; }
.bedtag.b3 { background: #fff4d1; color: #8a6200; }
/* events */
.lbl.place .evtag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; color: #fff; font-size: 10.5px; font-weight: 800; animation: evpulse 1.6s ease-in-out infinite; }
@keyframes evpulse { 50% { filter: brightness(1.25); transform: scale(1.05); } }
.onnow { display: inline-block; background: #E32017; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.act.event-act { border-color: #E32017; background: #fff6f6; }

/* =====================================================================================
   v6.3 – "London transport" identity (inspired by station signage, line diagrams and
   departure boards; deliberately not the TfL roundel or Johnston typeface)
   ===================================================================================== */
:root {
  --ink: #0d1a3a;
  --navy: #0019a8;
  --red: #dc241f;
  --board: #0b0f17;
  --amber: #ffb81c;
  --lines: linear-gradient(90deg, #E32017 0 14%, #FFD300 14% 28%, #00782A 28% 42%, #0098D4 42% 56%, #9B0056 56% 70%, #EE7C0E 70% 84%, #0019A8 84% 100%);
}
.dot, .board-time, .clock { font-family: "DotGothic16", ui-monospace, monospace; }
.sl-badge { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 6px; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .04em; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }

/* top bar: a station sign */
.topbar { background: var(--navy); color: #fff; border-radius: 14px; box-shadow: 0 6px 20px rgba(0,25,168,.35); }
.topbar::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -4px; height: 4px; border-radius: 0 0 4px 4px; background: var(--lines); }
.topbar .brand { color: #fff; text-transform: uppercase; letter-spacing: .05em; font-size: 15px; }
.topbar .stat { color: rgba(255,255,255,.75); }
.topbar .stat.live { color: #7cf0a8; }
.topbar .btn { background: rgba(255,255,255,.14); color: #fff; }
.topbar .me-chip { background: rgba(255,255,255,.14); color: #fff; }

/* pills: line-coloured stripes */
.pill { background: #fff; border-left: 5px solid var(--navy); border-radius: 8px; font-weight: 700; padding: 6px 12px 6px 9px; }
.pills .pill:nth-child(2) { border-color: #E32017; } .pills .pill:nth-child(3) { border-color: #00782A; }
.pills .pill:nth-child(4) { border-color: #0098D4; } .pills .pill:nth-child(5) { border-color: #9B0056; }
.pills .pill:nth-child(6) { border-color: #EE7C0E; }
.pill.mayor { background: #fff; border-color: #FFD300; }
.pill.whatson { border-color: #9B0056; }
.pill.whatson.live { background: var(--board); color: var(--amber); border-color: var(--amber); font-family: "DotGothic16", monospace; font-weight: 400; letter-spacing: .03em; animation: evpulse 2s ease-in-out infinite; }

/* clock: a departure board */
.clock { background: var(--board); color: var(--amber); border-radius: 8px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; box-shadow: inset 0 0 0 2px #1f2633, 0 3px 10px rgba(0,0,0,.25); text-shadow: 0 0 6px rgba(255,184,28,.45); }

/* toasts: platform announcements */
.toast { background: var(--board); border-left: 5px solid var(--amber); border-radius: 8px; text-align: left; }
.toast.good { background: var(--board); border-left-color: #2fbf71; }
.toast.bad { background: var(--board); border-left-color: var(--red); }
.toast.msg { background: #fff; color: var(--ink); border-left-color: #2fbf71; }

/* sheets: a line diagram header */
.sheet header { background: var(--navy); color: #fff; border-bottom: 0; box-shadow: 0 4px 0 -0px transparent; }
.sheet header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; background: var(--lines); }
.sheet header p { color: rgba(255,255,255,.78); }
.sheet header .x { color: #fff; }
.sheet header .x:hover { background: rgba(255,255,255,.15); }
.sheet .body { padding-top: 14px; }

/* HUD */
.hud { border-top: 5px solid var(--red); }

/* bottom nav: a tube line with four stations */
.botnav { background: var(--board); border-radius: 18px; padding: 8px 10px 6px; gap: 0; }
.botnav::before { content: ""; position: absolute; left: 49px; right: 49px; top: 24px; height: 6px; border-radius: 3px; background: var(--lines); }
.nav-btn { position: relative; width: 78px; color: #dfe6f3; }
.nav-ico { width: 38px; height: 38px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 19px; box-shadow: 0 0 0 4px var(--board), inset 0 0 0 3px var(--ink); }
.nav-btn:hover .nav-ico { box-shadow: 0 0 0 4px var(--board), inset 0 0 0 3px var(--red); }
.nav-btn:hover { background: transparent; }
.nav-lbl { margin-top: 3px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }

/* What's On board */
.board { background: var(--board); border-radius: 14px; padding: 6px; }
.board-row { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; padding: 10px 8px; border-bottom: 1px solid #1d2433; border-left: 5px solid var(--line, #888); border-radius: 6px; margin-bottom: 4px; }
.board-row:last-child { border-bottom: 0; }
.board-time { color: var(--amber); font-size: 15px; text-shadow: 0 0 6px rgba(255,184,28,.4); }
.board-row.on .board-time { color: #57f287; text-shadow: 0 0 8px rgba(87,242,135,.5); animation: evpulse 1.6s ease-in-out infinite; }
.board-main b { color: #fff; font-size: 14px; }
.board-main .sub { color: #9aa6bd !important; font-size: 12px; }

/* phone: a tube-map wallpaper */
.ph-wall { background:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='560' viewBox='0 0 320 560'%3E%3Cg fill='none' stroke-width='9' stroke-linecap='round' stroke-linejoin='round' opacity='.55'%3E%3Cpath d='M-10 120 H120 L200 200 V600' stroke='%23E32017'/%3E%3Cpath d='M330 60 H230 L150 140 V330 L60 420 H-10' stroke='%23FFD300'/%3E%3Cpath d='M40 -10 V250 L120 330 H330' stroke='%2300782A'/%3E%3Cpath d='M-10 470 H140 L230 380 V-10' stroke='%230098D4'/%3E%3Cpath d='M260 600 V470 L330 400' stroke='%239B0056'/%3E%3C/g%3E%3Cg fill='%23fff' stroke='%230d1a3a' stroke-width='4'%3E%3Ccircle cx='120' cy='120' r='9'/%3E%3Ccircle cx='150' cy='250' r='9'/%3E%3Ccircle cx='200' cy='330' r='9'/%3E%3Ccircle cx='40' cy='120' r='9'/%3E%3Ccircle cx='230' cy='380' r='9'/%3E%3C/g%3E%3C/svg%3E") center / cover,
  linear-gradient(160deg, #0d1a3a, #0019a8 120%); }
.ph-card { background: linear-gradient(135deg, #0098D4, #0019a8 70%); position: relative; overflow: hidden; }
.ph-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; border: 18px solid rgba(255,255,255,.12); }
.ph-cardtop { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .14em; opacity: .9; }
.ph-nfc { transform: rotate(90deg); display: inline-block; letter-spacing: -2px; }
.ph-bar { background: var(--navy); color: #fff; border-bottom: 4px solid transparent; border-image: var(--lines) 1; }
.ph-back, .ph-act { color: #fff; }

/* map labels: station-style tags */
.lbl.place { border-left: 4px solid var(--red); border-radius: 6px; }
.lbl.place.tower { border-left-color: #FFD300; }
.lbl.station { border-radius: 6px; }

/* boot: lines drawing in */
#boot { background: #0d1a3a; color: #fff; }
.boot-logo { display: flex; align-items: center; gap: 10px; justify-content: center; color: #fff; text-transform: uppercase; letter-spacing: .06em; }
.boot-sub { color: var(--amber) !important; font-family: "DotGothic16", monospace; }
.boot-lines { display: grid; gap: 7px; width: 220px; margin: 0 auto 22px; }
.boot-lines i { display: block; height: 6px; border-radius: 3px; background: var(--c); transform-origin: left; animation: drawline 1.1s cubic-bezier(.6,0,.2,1) var(--d, 0s) both infinite alternate; }
@keyframes drawline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.emo { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.scrim { z-index: 20; }
.knockcard, .knockwait { z-index: 21; }

/* ---------- advertising ---------- */
.pill.ad { background: #fff6d1; }
.buy-card.ad { background: #fff6d1; }
.ad-test { background: #fff3cd; color: #6b4e00; border-radius: 12px; padding: 8px 12px; font-size: 12.5px; margin-bottom: 12px; line-height: 1.4; }
.ad-test b { background: #f2b705; color: #16202e; padding: 1px 6px; border-radius: 5px; font-size: 11px; letter-spacing: .04em; }
.ad-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
.ad-steps i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); color: #fff; font-style: normal; font-size: 11px; margin-right: 5px; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.ad-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ad-thumb { width: 100%; max-height: 110px; margin: 0 auto; border-radius: 8px; background: linear-gradient(135deg, #0d1f5c, #10239e); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .06em; border-bottom: 4px solid #FFD300; }
.ad-card .ad-thumb { width: auto; height: 70px; max-width: 100%; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.ad-card.is-live { border-color: #1f7a43; }
.ad-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ad-area { margin: 14px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ad-info b { font-size: 14px; }
.ad-info .sub { font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.ad-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }
.ad-price { margin-right: auto; white-space: nowrap; } .ad-price b { font-size: 17px; } .ad-price small { color: var(--muted); font-size: 12px; }
.ad-more { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ad-more .sub, .ad-booked { font-size: 12px; color: var(--muted); }
.ad-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .ad-form { grid-template-columns: 1fr; } }
.ad-form h3, .sheet .body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--navy); margin: 4px 0 10px; }
.ad-col .chips2 small.ad-save { color: #1f7a43; font-weight: 800; }
.ad-col .chips2 button.on small.ad-save { color: #9ef0bd; }
.ad-booked { margin: -4px 0 14px; }
.ad-preview { width: 100%; max-height: 260px; border: 2px dashed #b8c2d1; border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-weight: 700; cursor: pointer; overflow: hidden; background: var(--card-2); margin: 0 auto; }
.ad-preview.drag { border-color: var(--navy); background: #eef1ff; }
.ad-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ad-hint { font-size: 12px; color: var(--muted); margin: 6px 0 8px; }
.ad-agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin: 4px 0 12px; line-height: 1.4; }
.ad-agree input { margin-top: 2px; }
.ad-summary { background: var(--card-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 13.5px; }
.ad-summary .sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ad-sline { display: flex; justify-content: space-between; padding: 2px 0; }
.ad-sline.save { color: #1f7a43; font-weight: 600; }
.ad-sline.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-size: 15px; }
.ad-clash { margin-top: 6px; color: #b42318; font-size: 12.5px; font-weight: 600; }
.linkish { color: var(--navy); text-decoration: underline; font-weight: 700; font-size: inherit; padding: 0; }
.ad-go { width: 100%; padding: 12px; font-size: 15px; margin-bottom: 6px; display: block; text-align: center; text-decoration: none; }
.co { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; }
.co-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.co-badge { background: #635bff; color: #fff; padding: 3px 8px; border-radius: 6px; font-size: 11px; letter-spacing: .03em; }
.co-badge.test { background: #f2b705; color: #16202e; }
.co-line { display: flex; justify-content: space-between; font-size: 14px; padding: 3px 0; }
.co-line.sub { font-size: 12px; color: var(--muted); }
.co-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin: 8px 0 12px; padding-top: 10px; font-weight: 700; }
.co-total b { font-size: 22px; }
.co-note { background: var(--card-2); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; line-height: 1.45; }
.ad-row { align-items: flex-start; }
.ad-row .nm { white-space: normal; }
.ad-row-r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ad-status { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.ad-status.live { background: #e3f6ea; color: #1f7a43; }
.ad-status.ok { background: #e6ecff; color: var(--navy); }
.ad-status.review { background: #fff3cd; color: #6b4e00; }
.ad-status.wait { background: #fde8e8; color: #b42318; }
.ad-status.bad { background: #fde8e8; color: #b42318; }
.ad-view-img { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; background: var(--card-2); display: block; margin-bottom: 10px; }
.ad-headline { font-size: 15px; font-weight: 600; margin: 0 0 12px; line-height: 1.4; }
.ad-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.ad-stats div { background: var(--card-2); border-radius: 12px; padding: 10px; text-align: center; }
.ad-stats b { display: block; font-size: 20px; } .ad-stats small { color: var(--muted); font-size: 12px; }
.am-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
@media (max-width: 560px) { .am-row { grid-template-columns: 1fr; } }
.am-img { width: 100%; max-height: 170px; border-radius: 8px; background: var(--card-2); display: grid; place-items: center; overflow: hidden; color: var(--muted); }
.am-img img { width: 100%; height: 100%; object-fit: contain; }
.am-info { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; min-width: 0; word-break: break-word; }
.am-info > b { font-size: 15px; } .am-info .ad-status { align-self: flex-start; }
.am-info .sub { font-size: 12px; color: var(--muted); }
.am-act { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.am-act input { flex: 1; min-width: 140px; padding: 6px 10px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13px; }

/* ---------- small-phone fixes (playtest v6.5) ---------- */
@media (max-width: 520px) {
  .pills { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: calc(100% - 20px); padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .pills::-webkit-scrollbar { display: none; }
  .pills .pill { flex: none; }
  .banner { top: calc(max(10px, env(safe-area-inset-top)) + 104px); white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 24px); font-size: 11.5px; }
  .hud .head { flex-wrap: wrap; gap: 2px 8px; }
  .hud .head > * { min-width: 0; }
  .hud .money { font-size: 15px; }
}

/* Jobs: info buttons and the how-it-works / job detail screens */
.ph-info { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 14px; color: #0b2545; cursor: pointer; flex: none; }
.ph-info:hover { background: #eef2f7; }
.ph-job-hero { text-align: center; padding: 18px 16px 6px; }
.ph-job-hero .ph-job-emoji { font-size: 44px; line-height: 1; }
.ph-job-hero h3 { margin: 8px 0 2px; font-size: 18px; }
.ph-job-hero .ph-sub { font-size: 13px; }
.ph-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px; }
.ph-fact { background: #f4f6fa; border-radius: 12px; padding: 9px 11px; }
.ph-fact b { display: block; font-size: 15px; }
.ph-fact span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.ph-prose { padding: 4px 16px 10px; font-size: 13.5px; line-height: 1.5; color: #24324a; }
.ph-prose h4 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ph-prose ul { margin: 4px 0; padding-left: 18px; }
.ph-prose li { margin: 3px 0; }

/* ---- cars (v7.8) */
.car-stage { position: relative; width: 100%; height: 190px; border-radius: 14px; background: linear-gradient(180deg, #eef2f7, #d9e0ea); overflow: hidden; margin-bottom: 10px; }
.car-stage canvas { display: block; width: 100%; height: 190px; }
.car-classes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.car-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 4px 0 4px; font-size: 17px; }
.car-title span { font-weight: 800; color: #1a7f4b; }
.car-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 8px 0; }
.car-spec { background: #f3f5f8; border-radius: 10px; padding: 7px 9px; }
.car-spec small { display: block; color: #6b7280; font-size: 11px; }
.car-spec b { font-size: 13px; }
.note.warn { color: #9a3412; background: #fff4e5; border-radius: 10px; padding: 6px 9px; }

/* ---- two cities (v8.0): the city badge */
.topbar .citybadge { background: rgba(255,255,255,.12); border: 0; border-radius: 999px; padding: 4px 10px; color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.topbar .citybadge:hover { background: rgba(255,255,255,.22); }

/* ✈️ in-flight panel */
.flightbar { position: absolute; left: 50%; transform: translateX(-50%); top: calc(max(10px, env(safe-area-inset-top)) + 58px); width: min(640px, calc(100vw - 24px)); background: rgba(16,35,94,0.94); color: #fff; border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); z-index: 6; }
.flightbar .fl-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; }
.flightbar .fl-status { font-size: 12px; opacity: .85; text-align: right; }
.flightbar .fl-track { height: 6px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.flightbar .fl-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #c8102e, #ffd400); }
.flightbar .fl-views { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.flightbar .fl-view { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 7px; border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font-size: 16px; min-width: 58px; }
.flightbar .fl-view small { font-size: 10px; opacity: .9; white-space: nowrap; }
.flightbar .fl-view.on { background: #fff; color: #10235e; }
/* while flying, the panel takes the top of the screen: tuck the money/needs card away where the two would overlap */
@media (max-width: 1180px) { #ui.flying .hud { display: none; } }
@media (max-width: 700px) {
  .flightbar { padding: 8px 9px; top: calc(max(8px, env(safe-area-inset-top)) + 54px); }
  .flightbar .fl-head { font-size: 12px; } .flightbar .fl-status { font-size: 11px; }
  .flightbar .fl-view { min-width: 52px; padding: 4px 5px; font-size: 15px; }
}
/* 🚆 the train's window view: a carriage window frame round the picture */
#ui.train-window::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  border: solid #e4e7eb; border-width: 18vh 7vw 30vh; border-radius: 0;
  box-shadow: inset 0 0 0 10px #c9ced3, inset 0 0 0 16px #8b9097, inset 0 0 40px 18px rgba(0,0,0,.35); }

/* ✈️ the plane's window view: an oval window in the cabin wall, with a blind pulled half way */
#ui.plane-window::before { content: ''; position: absolute; left: 50%; top: 54%; width: min(62vw, 58vh); height: min(88vw, 78vh); transform: translate(-50%, -50%);
  border-radius: 46% / 40%; pointer-events: none; z-index: 0;
  box-shadow: 0 0 0 200vmax #e4e7eb, inset 0 0 0 14px #cfd4da, inset 0 0 0 22px #b4bac2, inset 0 0 50px 24px rgba(0,0,0,.35); }
#ui.plane-window::after { content: ''; position: absolute; left: 50%; top: calc(54% - min(44vw, 39vh)); width: min(62vw, 58vh); height: min(14vw, 11vh); transform: translateX(-50%);
  border-radius: 46% 46% 0 0 / 100% 100% 0 0; background: linear-gradient(#eef0f2, #d9dde2); pointer-events: none; z-index: 0; }
