:root {
  --bg: #14121a;
  --card: #1d1a26;
  --line: #2e2940;
  --ink: #f2f0f8;
  --muted: #9a94ab;
  --accent: #ff4e7d;
  --accent2: #2ed4ce;
  --good: #3ecb8e;
  --bad: #ff6076;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  user-select: none;
}
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---- Auth overlay ---- */
.overlay {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(80% 80% at 50% 20%, #241f33, #100e16);
  padding: 20px;
}
.auth-card {
  width: 100%; max-width: 360px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px;
}
h1 { font-size: 22px; margin: 0 0 2px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { flex: 1; padding: 9px; border-radius: 9px; border: 1px solid var(--line); background: #16131f; color: var(--muted); }
.tab.active { color: var(--ink); border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
input, select {
  width: 100%; margin-top: 4px; padding: 10px 12px;
  background: #16131f; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 15px;
}
.primary {
  width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; font-size: 15px;
}
.secondary { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #16131f; color: var(--ink); font-size: 14px; margin-top: 10px; }
.link { background: none; border: none; color: var(--accent2); font-size: 13px; }
.msg { color: var(--bad); font-size: 13px; min-height: 18px; margin: 8px 0 0; }

/* ---- Character creator ---- */
.creator-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-align: center; }
.creator-card h1 { font-size: 20px; }
#creator-canvas { width: 220px; height: 250px; display: block; margin: 10px auto 14px; border-radius: 16px; background: radial-gradient(70% 70% at 50% 35%, #33294d, #14101f); }
.creator-row { display: flex; gap: 10px; margin-bottom: 14px; }
.gbtn { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: #16131f; color: var(--ink); font-size: 15px; }
.gbtn.active { border-color: var(--accent); color: #fff; background: linear-gradient(135deg, rgba(255,78,125,.28), rgba(46,212,206,.22)); }
.creator-label { color: var(--muted); font-size: 13px; margin-bottom: 8px; text-align: left; }
.creator-variants { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
.vbtn { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: #16131f; color: var(--ink); font-weight: 700; font-size: 15px; }
.vbtn.active { border-color: var(--accent2); color: var(--accent2); box-shadow: 0 0 0 2px rgba(46,212,206,.25); }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; gap: 8px; align-items: center; padding: 10px;
  background: linear-gradient(#000a, transparent); flex-wrap: wrap;
}
.hud-chip {
  background: #1d1a26cc; border: 1px solid var(--line); border-radius: 10px;
  padding: 5px 10px; display: flex; flex-direction: column; line-height: 1.2;
  backdrop-filter: blur(6px);
}
.hud-chip .k { color: var(--muted); font-size: 10px; }
.hud-chip b { font-size: 14px; }
#logout { margin-left: auto; }

#hud-meters { position: absolute; top: 62px; left: 10px; display: flex; flex-direction: column; gap: 5px; width: 160px; }
.meter { background: #1d1a26cc; border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; backdrop-filter: blur(6px); }
.meter-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 3px; }
.bar { height: 7px; background: #0f0d15; border-radius: 5px; overflow: hidden; }
.fill { height: 100%; background: var(--good); transition: width .2s; }
.meter.low .fill { background: var(--bad); }
.meter.low .meter-top { color: var(--bad); }

#hud-help {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--muted); background: #0c0a12aa; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); text-align: center; max-width: 92%;
}

#prompt {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%); z-index: 12;
  background: #0c0a12; border: 1px solid var(--accent); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap;
}

/* ---- Touch controls ---- */
#joy {
  position: fixed; left: 22px; bottom: 26px; z-index: 14;
  width: 120px; height: 120px; border-radius: 50%;
  background: #ffffff14; border: 1px solid #ffffff33; touch-action: none;
}
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: #ffffff40; border: 1px solid #ffffff66;
}
#act-btn {
  position: fixed; right: 26px; bottom: 40px; z-index: 14;
  width: 82px; height: 82px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none;
}

/* ---- Modal panels ---- */
.modal {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: #000a; padding: 0;
}
.modal-card {
  width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 18px;
}
@media (min-width: 560px) { .modal { align-items: center; } .modal-card { border-radius: 16px; } }
.modal-x { position: absolute; right: 14px; top: 10px; background: none; border: none; color: var(--muted); font-size: 20px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: 1fr; } }

.trend { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.trend:last-child { border-bottom: none; }
.fire { letter-spacing: -2px; }

.buy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.buy-label { color: var(--muted); font-size: 13px; min-width: 42px; }
.chip { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: #16131f; color: var(--ink); font-size: 13px; }
.chip.up { border-color: var(--accent2); color: var(--accent2); }
.equip { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.equip:last-child { border-bottom: none; }
.maxed { color: var(--good); font-size: 12px; font-weight: 700; }
.logrow { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.logrow:last-child { border-bottom: none; }

.result-big { text-align: center; padding: 6px 0 4px; }
.result-big .lbl { font-size: 22px; font-weight: 800; }
.result-big .nums { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---- Phone (9:16 iOS-style mockup) ---- */
#phone-modal {
  position: fixed; inset: 0; z-index: 22; display: flex; align-items: center; justify-content: center;
  background: #000b; padding: 10px;
}
.phone {
  position: relative; height: min(90vh, 800px); aspect-ratio: 9 / 16; max-width: 96vw;
  background: linear-gradient(165deg, #2a2142, #15111f 55%, #0e0a17);
  border-radius: 44px; border: 2px solid #000;
  box-shadow: 0 24px 70px #000b, inset 0 0 0 7px #05040a;
  overflow: hidden; display: flex; flex-direction: column;
}
.phone-notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 40%; height: 26px; background: #000; border-radius: 0 0 16px 16px; z-index: 4; }
.phone-status { display: flex; justify-content: space-between; align-items: center; padding: 13px 24px 6px; font-size: 13px; font-weight: 700; color: #fff; z-index: 2; }
.ph-status-r { font-size: 12px; letter-spacing: .2px; }
#phone-body { flex: 1; overflow-y: auto; position: relative; }
.phone-home { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); width: 38%; height: 5px; border-radius: 3px; background: #ffffff99; z-index: 4; cursor: pointer; }
/* Always-visible close button — on a real phone the backdrop and the 5px home bar
   are far too small to hit, which left players stuck inside the phone screen. */
#phone-close {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 30;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid #ffffff33;
  background: #1b1726ee; color: #fff; font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 0 6px 18px #0009;
}
#phone-close:active { transform: scale(0.93); }

.ph-home { padding: 22px 20px 90px; min-height: 100%; }
.ph-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 10px; }
.ph-app { background: none; border: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; }
.ph-icon { width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; font-size: 27px; box-shadow: 0 5px 14px #0007; }
.ph-app span:not(.ph-icon) { font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
.ph-dock { position: absolute; bottom: 22px; left: 14px; right: 14px; background: #ffffff1f; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 28px; padding: 11px; display: flex; justify-content: space-around; }
.ph-dock .ph-icon { width: 52px; height: 52px; }

.ph-appbar { position: sticky; top: 0; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #16121fee; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 2; }
.ph-back { background: none; border: none; color: var(--accent2); font-size: 14px; font-weight: 700; padding: 0; }
.ph-appbar h3 { font-size: 15px; margin: 0; color: var(--ink); }
.ph-content { padding: 14px 16px 44px; }
.prech916 { aspect-ratio: 9 / 16; max-height: 190px; margin: 0 auto 14px; border: 2px dashed var(--line-strong, #3a3452); border-radius: 14px; display: grid; place-items: center; color: var(--muted); font-size: 13px; font-family: "IBM Plex Mono", monospace; background: #0f0b18; }

.ph-badge { position: absolute; top: -5px; right: -5px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; box-shadow: 0 1px 4px #0007; }
.mail-item { display: block; width: 100%; text-align: left; background: #241f30; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; color: var(--ink); }
button.mail-item { cursor: pointer; }
.mail-item.unread { border-left: 3px solid var(--accent); }
.mail-top { display: flex; align-items: center; gap: 8px; }
.mail-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; background: rgba(255,78,125,.16); color: var(--accent); padding: 2px 7px; border-radius: 999px; }
.mail-tag.spam { background: #55555f; color: #cfcfd6; }
.mail-sub { font-size: 14px; font-weight: 600; margin-top: 3px; }
.mail-prev { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

#phone-btn {
  position: fixed; right: 18px; bottom: 22px; z-index: 16;
  width: 66px; height: 66px; border-radius: 20px; border: none; font-size: 30px; line-height: 1;
  background: linear-gradient(140deg, var(--accent), var(--accent2)); color: #fff;
  box-shadow: 0 6px 20px #0008;
}
#phone-btn:active { transform: scale(0.94); }

/* Colour grade over the 3D scene: vignette + grain. Sits under the HUD (z-index 10). */
#grade { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#grade .g-vig {
  position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 50% 42%, transparent 45%, rgba(8, 6, 16, 0.55) 100%);
}
#grade .g-grain {
  position: absolute; inset: 0;
  background-image: var(--grain); background-size: 128px 128px;
  opacity: 0.035; mix-blend-mode: overlay;
}

/* ---- Live broadcast ---- */
.live-list { display: flex; flex-direction: column; gap: 10px; }
.live-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 13px; border-radius: 16px; border: 1px solid #ffffff1a;
  background: linear-gradient(120deg, #ff2d5520, #ff7a3d12); color: var(--ink); cursor: pointer;
}
.live-opt:disabled { opacity: .5; }
.lo-emoji { font-size: 26px; }
.lo-txt { flex: 1; display: flex; flex-direction: column; }
.lo-txt b { font-size: 15px; }
.lo-go { font-size: 11px; font-weight: 800; letter-spacing: .05em; color: #fff; background: #ff2d55; padding: 6px 10px; border-radius: 999px; }

#live-ui { position: fixed; inset: 0; z-index: 19; pointer-events: none; }
#live-ui.hidden { display: none; }
.lv-top {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.5); padding: 7px 14px; border-radius: 999px; color: #fff; font-size: 14px;
}
.lv-badge { color: #ff2d55; font-weight: 800; letter-spacing: .06em; animation: rec-blink 1.2s steps(2,start) infinite; }
.lv-viewers b, .lv-money b { font-variant-numeric: tabular-nums; }
.lv-chat { position: absolute; left: 14px; bottom: 100px; width: min(62vw, 330px); display: flex; flex-direction: column; gap: 6px; }
.lv-cm {
  font-size: 13px; color: #fff; background: rgba(0,0,0,.45); border-radius: 12px; padding: 6px 11px;
  opacity: 0; transform: translateY(12px); animation: cm-in .3s ease forwards; align-self: flex-start;
}
.lv-cm b { color: #7fd6ff; }
.lv-gifts { position: absolute; right: 18px; bottom: 120px; width: 190px; display: flex; flex-direction: column-reverse; gap: 8px; align-items: flex-end; }
.lv-gift {
  display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 999px; color: #fff;
  background: linear-gradient(120deg, #ff2d55, #ff9a3d); box-shadow: 0 6px 18px #0007;
  font-size: 13px; font-weight: 600;
  animation: gift-in .45s cubic-bezier(.2,1.4,.35,1);
}
@keyframes gift-in { from { transform: translateX(40px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-gift .g-em { font-size: 20px; }
.lv-status {
  position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 15px; font-weight: 700; text-shadow: 0 2px 10px #000a;
  background: rgba(0,0,0,.42); padding: 8px 16px; border-radius: 999px; white-space: nowrap;
}

#lv-stop {
  position: absolute; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); left: 50%; transform: translateX(-50%);
  pointer-events: auto; cursor: pointer;
  border: none; border-radius: 999px; padding: 13px 26px;
  background: #fff; color: #12101a; font-size: 15px; font-weight: 800;
  box-shadow: 0 8px 24px #000a;
}
#lv-stop:active { transform: translateX(-50%) scale(.95); }

/* Mukbang: eat/drink while on air to stay live longer */
.lv-actions {
  position: absolute; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); right: 18px;
  display: flex; gap: 10px; pointer-events: auto;
}
.lv-actions button {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid #ffffff30;
  background: #1b1726dd; color: #fff; font-size: 23px; cursor: pointer;
  box-shadow: 0 6px 18px #0009;
}
.lv-actions button:disabled { opacity: .35; cursor: not-allowed; }
.lv-actions button:active { transform: scale(.92); }

/* KitTok create bar (video + live live inside the app, like the real thing) */
.kt-create { display: flex; gap: 9px; margin: 0 0 14px; }
.kt-plus, .kt-golive {
  flex: 1; border: none; border-radius: 13px; padding: 12px 10px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: #fff;
}
.kt-plus { background: linear-gradient(135deg, #ff4e7d, #ff8f5a); }
.kt-golive { background: linear-gradient(135deg, #ff2d55, #ff7a3d); }
.kt-golive:disabled { background: #ffffff14; color: var(--muted); cursor: not-allowed; }
.kt-plus:active, .kt-golive:active { transform: scale(.97); }

/* ---- KitTok: your own profile + video feed ---- */
.kt-profile { text-align: center; padding: 6px 0 16px; }
.kt-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
  display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff;
}
.kt-handle { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.kt-numbers { display: flex; justify-content: center; gap: 26px; }
.kt-numbers div { display: flex; flex-direction: column; align-items: center; }
.kt-numbers b { font-size: 17px; }
.kt-numbers span { font-size: 11px; color: var(--muted); }
.kt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.kt-cell { position: relative; border: none; padding: 0; background: none; cursor: pointer; }
.kt-thumb { display: grid; place-items: center; aspect-ratio: 9/16; border-radius: 4px; overflow: hidden; position: relative; }
.kt-emoji { font-size: 26px; filter: drop-shadow(0 2px 5px #0006); }
.kt-views { position: absolute; left: 5px; bottom: 5px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }
.kt-spons { position: absolute; top: 4px; right: 4px; font-size: 8px; background: #000a; color: #fff; padding: 1px 4px; border-radius: 4px; }
.kt-live { position: absolute; top: 4px; left: 4px; font-size: 8px; background: #ff2d55; color: #fff; padding: 1px 5px; border-radius: 4px; }
.kt-detail { display: flex; gap: 13px; margin-bottom: 14px; }
.kt-big { width: 96px; aspect-ratio: 9/16; border-radius: 10px; display: grid; place-items: center; font-size: 34px; flex: none; }
.kt-meta { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.kt-title { font-weight: 700; font-size: 15px; }
.kt-verdict { font-size: 14px; font-weight: 600; margin-top: 4px; }
.kt-stats { display: flex; justify-content: space-between; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kt-stats div { display: flex; flex-direction: column; align-items: center; flex: 1; }
.kt-stats b { font-size: 17px; }
.kt-stats span { font-size: 10px; color: var(--muted); }
.kt-cm-head { font-size: 14px; margin: 14px 0 8px; }
.kt-comments { display: flex; flex-direction: column; gap: 7px; }
.kt-cm { font-size: 13px; background: #ffffff0e; border-radius: 11px; padding: 8px 11px; }
.kt-cm.neg { background: #ff6b7d18; }
.kt-cm b { color: var(--accent2); }

/* ---- Colour swatches in the shop ---- */
.swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.swatch {
  display: flex; align-items: center; gap: 9px; text-align: left;
  padding: 9px 10px; border-radius: 13px; border: 2px solid transparent;
  background: #ffffff0e; color: var(--ink); cursor: pointer;
}
.swatch:disabled { opacity: .45; cursor: not-allowed; }
.swatch.active { border-color: var(--accent); background: #ffffff18; }
.swatch .sw-dot { width: 26px; height: 26px; border-radius: 9px; flex: none; box-shadow: inset 0 0 0 1px #0004, 0 2px 6px #0006; }
.swatch .sw-name { font-size: 13px; font-weight: 600; line-height: 1.15; flex: 1; }
.swatch .sw-price { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---- Post card: the payoff after uploading ---- */
#post-card {
  position: fixed; inset: 0; z-index: 26; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 5, 12, 0.62); backdrop-filter: blur(3px);
}
#post-card.hidden { display: none; }
#post-card .pc-sheet {
  width: min(92vw, 420px); border-radius: 22px; padding: 20px;
  background: linear-gradient(170deg, #221d33, #17131f);
  border: 1px solid #ffffff1c; box-shadow: 0 24px 60px #000b;
  animation: pc-in .42s cubic-bezier(.2, 1.3, .35, 1);
}
@keyframes pc-in { from { transform: translateY(26px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
#post-card .pc-head { font-size: 20px; font-weight: 800; margin-bottom: 14px; color: #6ef2c0; }
#post-card .pc-body { display: flex; gap: 16px; }
#post-card .pc-thumb {
  position: relative; width: 86px; height: 153px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  background: linear-gradient(150deg, var(--pc-c1, #ff4e7d), var(--pc-c2, #6b7bff));
  box-shadow: 0 8px 22px #0007;
}
#post-card .pc-badge {
  position: absolute; bottom: 6px; left: 6px; right: 6px; font-size: 10px; text-align: center;
  color: #fff; background: #0009; border-radius: 6px; padding: 2px 0;
}
#post-card .pc-stats { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
#post-card .pc-stat { display: flex; justify-content: space-between; align-items: baseline; }
#post-card .pc-k { font-size: 13px; color: var(--muted); }
#post-card .pc-stat b { font-size: 21px; font-variant-numeric: tabular-nums; }
#post-card .pc-verdict { margin-top: 14px; font-size: 15px; font-weight: 700; text-align: center; }
#post-card .pc-comments { margin-top: 12px; display: flex; flex-direction: column; gap: 7px; max-height: 170px; overflow-y: auto; }
#post-card .pc-cm {
  font-size: 13px; color: var(--ink); background: #ffffff0e; border-radius: 12px; padding: 8px 11px;
  opacity: 0; transform: translateY(10px); animation: cm-in .34s cubic-bezier(.2, 1.3, .35, 1) forwards;
}
@keyframes cm-in { to { opacity: 1; transform: none; } }
#post-card .pc-ok { margin-top: 16px; }

/* While shooting, hide the game chrome so only the "recording" is visible */
body.shooting #hud, body.shooting #phone-btn, body.shooting #build-btn,
body.shooting #hud-help, body.shooting #notif-stack { opacity: 0; transition: opacity .25s; pointer-events: none; }

/* ---- Shooting mode: 9:16 viewfinder over the live scene ---- */
#viewfinder { position: fixed; inset: 0; z-index: 18; pointer-events: none; }
#viewfinder.hidden { display: none; }
#viewfinder .vf-bar { position: absolute; top: 0; bottom: 0; background: rgba(6, 5, 12, 0.82); }
#viewfinder .vf-left { left: 0; right: calc(50% + 25.3vh); }
#viewfinder .vf-right { right: 0; left: calc(50% + 25.3vh); }
#viewfinder .vf-frame {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 50.6vh; transform: translateX(-50%);
}
#viewfinder .vf-c { position: absolute; width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.85); }
#viewfinder .vf-c.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
#viewfinder .vf-c.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
#viewfinder .vf-c.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
#viewfinder .vf-c.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
#viewfinder .vf-grid { position: absolute; inset: 14px; }
#viewfinder .vf-grid i { position: absolute; background: rgba(255,255,255,.18); }
#viewfinder .vf-grid i:nth-child(1) { left: 0; right: 0; top: 33.33%; height: 1px; }
#viewfinder .vf-grid i:nth-child(2) { left: 0; right: 0; top: 66.66%; height: 1px; }
#viewfinder .vf-grid i:nth-child(3) { top: 0; bottom: 0; left: 33.33%; width: 1px; }
#viewfinder .vf-grid i:nth-child(4) { top: 0; bottom: 0; left: 66.66%; width: 1px; }
#viewfinder .vf-top {
  position: absolute; top: 26px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  font: 600 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: #fff; letter-spacing: .08em;
  background: rgba(0,0,0,.45); padding: 5px 12px; border-radius: 999px;
}
#viewfinder .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff2d55; animation: rec-blink 1s steps(2, start) infinite; }
@keyframes rec-blink { 50% { opacity: .15; } }
#viewfinder .vf-step {
  position: absolute; bottom: 42px; left: 50%; transform: translateX(-50%);
  font-size: 16px; font-weight: 700; color: #fff; text-shadow: 0 2px 10px #000a;
  background: rgba(0,0,0,.42); padding: 7px 16px; border-radius: 999px; white-space: nowrap;
}
#viewfinder .vf-count {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22vh; font-weight: 800; color: #fff; text-shadow: 0 6px 40px #000c;
}
#viewfinder.no-rec .vf-top, #viewfinder.no-rec .vf-step { display: none; }

/* HUD counters pop when they grow */
@keyframes hud-bump {
  0%   { transform: scale(1);    color: inherit; }
  35%  { transform: scale(1.28); color: #6ef2c0; }
  100% { transform: scale(1);    color: inherit; }
}
#hud-followers.bump, #hud-money.bump {
  display: inline-block;
  animation: hud-bump 0.55s cubic-bezier(.2,1.4,.4,1);
}

#build-btn {
  position: fixed; right: 92px; bottom: 22px; z-index: 16;
  width: 66px; height: 66px; border-radius: 20px; border: none; font-size: 28px; line-height: 1;
  background: linear-gradient(140deg, #6b7bff, #3aa0c8); color: #fff;
  box-shadow: 0 6px 20px #0008;
}
#build-btn:active { transform: scale(0.94); }
#build-btn.active { outline: 3px solid #fff; }

#build-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 10px 14px; border-radius: 16px;
  background: rgba(18,16,26,0.92); border: 1px solid #ffffff22; box-shadow: 0 8px 26px #0009;
  color: #fff; max-width: 94vw;
}
#build-bar .bb-hint { font-size: 14px; color: #d8d4e4; }
#build-bar button {
  border: none; border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 600;
  background: #2c2838; color: #fff; cursor: pointer;
}
#build-bar button:active { transform: scale(0.96); }
#build-bar .bb-primary { background: linear-gradient(140deg, var(--accent), var(--accent2)); }

#notif-stack {
  position: fixed; top: 150px; right: 12px; z-index: 15;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none; max-width: 80vw;
}
.notif {
  background: #0c0a12ee; border: 1px solid var(--line); border-left: 3px solid var(--accent2);
  color: var(--ink); padding: 8px 12px; border-radius: 10px; font-size: 13px; max-width: 320px;
  opacity: 0; transform: translateX(24px); transition: opacity .3s, transform .3s;
}
.notif.show { opacity: 1; transform: none; }
.notif-hl { border-left-color: var(--accent); font-weight: 600; }

#work-overlay {
  position: fixed; z-index: 12; width: 190px;
  transform: translate(-50%, -100%); pointer-events: none; text-align: center;
}
.work-text {
  display: inline-block; font-size: 13px; font-weight: 600; color: #fff;
  background: #0c0a12dd; border: 1px solid var(--line); padding: 4px 11px;
  border-radius: 999px; margin-bottom: 6px; white-space: nowrap;
}
.work-bar { height: 9px; background: #0c0a12dd; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.work-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .12s linear; }

.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); z-index: 25;
  background: #0c0a12; border: 1px solid var(--accent); color: var(--ink);
  padding: 11px 16px; border-radius: 12px; font-size: 14px; max-width: 90%; text-align: center;
}
