: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;
}
.sso-btn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; }
.sso-btn:hover { filter: brightness(1.1); }
.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; }

/* Needs: one compact pill row instead of four stacked cards */
#hud-meters {
  position: absolute; top: 60px; left: 10px;
  display: flex; gap: 4px; align-items: stretch;
  background: #1d1a26cc; border: 1px solid var(--line); border-radius: 12px;
  padding: 5px 7px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.meter { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 30px; }
.m-ico { font-size: 13px; line-height: 1; }
.m-col { width: 6px; height: 26px; border-radius: 4px; background: #0f0d15; overflow: hidden; display: flex; flex-direction: column-reverse; }
.m-fill { display: block; width: 100%; background: var(--good); transition: height .25s; border-radius: 4px; }
.m-val { font-size: 8.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter.low .m-fill { background: var(--bad); }
.meter.low .m-ico { animation: rec-blink 1.2s steps(2, start) infinite; }
.meter.low .m-val { color: var(--bad); font-weight: 700; }

#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; }
/* PK battle bar: blue (you) vs red (them), like the real thing */
.pk-wrap {
  position: absolute; top: max(64px, calc(env(safe-area-inset-top) + 52px)); left: 50%; transform: translateX(-50%);
  width: min(88vw, 460px);
}
.pk-wrap.hidden { display: none; }
.pk-names { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 4px #000; }
.pk-vs { font-size: 11px; font-weight: 800; background: #000a; border-radius: 999px; padding: 2px 8px; letter-spacing: .08em; }
.pk-bar { position: relative; height: 18px; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, #ff2d55, #ff5d55); box-shadow: 0 4px 14px #0008; }
.pk-fill { position: absolute; inset: 0 auto 0 0; width: 50%; background: linear-gradient(90deg, #2d8cff, #4db8ff); transition: width .8s cubic-bezier(.3,1,.4,1); }
.pk-marker { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 3px; background: #fff; box-shadow: 0 0 8px #fff; transition: left .8s cubic-bezier(.3,1,.4,1); }
.pk-scores { display: flex; justify-content: space-between; margin-top: 4px; color: #fff; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px #000; }

.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; }

/* --- Real TikTok gifts (phase 2): louder than the simulated ones --- */
.lv-gift-real { border-color: var(--accent2); box-shadow: 0 0 0 2px rgba(46,212,206,.28); }
.lv-real {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-top: 4px;
  border-radius: 12px; font-size: 13px; line-height: 1.3;
  background: rgba(62,203,142,.16); border: 1px solid var(--good);
  animation: lvRealPop .32s ease-out;
}
.lv-real-prank { background: rgba(255,96,118,.16); border-color: var(--bad); }
.lv-real-hype  { background: rgba(46,212,206,.18); border-color: var(--accent2); }
.lv-real-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.lv-real-noav { display: grid; place-items: center; font-size: 17px; background: #16131f; }
@keyframes lvRealPop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.fx-shake { animation: fxShake .55s ease-in-out; }
@keyframes fxShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
.tt-ok { color: var(--good); font-size: 13px; margin: 4px 0 10px; }
.tt-wait { color: var(--accent2); font-size: 13px; margin: 4px 0 10px; }
.tt-test { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.tt-test .creator-row { flex-wrap: wrap; gap: 8px; }
/* Rule editor */
.rule-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rule-row select, .rule-row input { width: auto; flex: 1 1 90px; min-width: 84px; margin-top: 0; padding: 7px 8px; font-size: 13px; }
.rule-row .rule-x { flex: none; padding: 6px 10px; }
.rule-hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.rule-wrap { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.rule-wrap .rule-row { border-bottom: none; }
.rule-desc { font-size: 12px; color: var(--muted); margin: 0 0 6px; line-height: 1.35; }
/* Effect help sheet */
#fx-guide { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.fxg-group { margin-bottom: 12px; }
.fxg-title { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.fxg-item { display: flex; flex-direction: column; gap: 1px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fxg-item:last-child { border-bottom: none; }
.fxg-item b { font-size: 13px; }
.fxg-item span { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---- First-run guided tour ---- */
#tut {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 70; width: min(460px, calc(100vw - 24px));
}
.tut-card {
  background: var(--card); border: 1px solid var(--accent2); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: tutIn .25s ease-out;
}
@keyframes tutIn { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.tut-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tut-step { font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.tut-card h3 { margin: 0 0 6px; font-size: 16px; }
.tut-card p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.45; color: var(--ink); }
.tut-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tut-actions .chip { padding: 9px 14px; }
/* The element a step is talking about pulses instead of being masked out, so
   the player can still look at (and use) the rest of the screen. */
.tut-glow {
  outline: 2px solid var(--accent2) !important;
  outline-offset: 3px; border-radius: 12px;
  animation: tutGlow 1.4s ease-in-out infinite;
}
@keyframes tutGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,212,206,.55); }
  50% { box-shadow: 0 0 0 9px rgba(46,212,206,0); }
}
#tut.tut-live { bottom: auto; top: 84px; }
@media (max-width: 620px) {
  #tut { bottom: 92px; }
  .tut-card p { font-size: 13px; }
}



.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); }

/* Thought bubble above the character's head */
#thought {
  position: fixed; z-index: 13; transform: translate(-50%, -100%); pointer-events: none;
  max-width: 240px; padding: 9px 13px; border-radius: 16px; border-bottom-left-radius: 4px;
  background: #fdfcf7; color: #221d2e; font-size: 13.5px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 6px 20px #0007;
  animation: thought-in .35s cubic-bezier(.2,1.35,.4,1);
}
#thought::after {
  content: ''; position: absolute; left: 14px; bottom: -7px;
  border: 8px solid transparent; border-top-color: #fdfcf7; border-bottom: 0; border-left: 0;
}
#thought.hidden { display: none; }
@keyframes thought-in { from { transform: translate(-50%, -100%) scale(.7); opacity: 0; } to { transform: translate(-50%, -100%) scale(1); opacity: 1; } }

/* ---- Recording timing minigame ---- */
.sg-wrap { position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); width: min(76vw, 340px); text-align: center; }
.sg-wrap.hidden { display: none; }
.sg-label { font-size: 12.5px; font-weight: 700; color: #fff; text-shadow: 0 2px 8px #000; margin-bottom: 7px; }
.sg-track { position: relative; height: 16px; border-radius: 999px; background: #000a; border: 1px solid #ffffff30; overflow: hidden; }
.sg-zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, #4edb8c, #2eb86e); border-radius: 999px; opacity: .9; }
.sg-marker { position: absolute; top: -2px; bottom: -2px; width: 5px; margin-left: -2px; background: #fff; box-shadow: 0 0 9px #fff; border-radius: 3px; }
.sg-taps { margin-top: 6px; font-size: 13px; letter-spacing: 3px; }
.sg-fb { height: 20px; font-size: 14px; font-weight: 800; color: #6ef2c0; text-shadow: 0 2px 8px #000; }
#shoot-tap { position: fixed; inset: 0; z-index: 21; }
#shoot-tap.hidden { display: none; }

/* ---- Live thank-you bubbles ---- */
.lv-bubbles { position: absolute; inset: 0; pointer-events: none; }
.lv-bub {
  position: absolute; pointer-events: auto; cursor: pointer;
  width: 58px; height: 58px; border-radius: 50%; border: none;
  background: radial-gradient(60% 60% at 40% 35%, #ffffff30, #ffffff10);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  font-size: 30px; display: grid; place-items: center;
  box-shadow: 0 6px 18px #0007, inset 0 0 0 2px #ffffff45;
  animation: bub-in .3s cubic-bezier(.2,1.4,.4,1), bub-pulse 1.1s ease-in-out .3s infinite;
}
@keyframes bub-in { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes bub-pulse { 50% { transform: scale(1.12); } }
.lv-bub.hit { animation: bub-hit .35s ease forwards; pointer-events: none; }
@keyframes bub-hit { to { transform: scale(1.9); opacity: 0; } }
.lv-thx {
  position: absolute; pointer-events: none; color: #ffb14e; font-weight: 800; font-size: 15px;
  text-shadow: 0 2px 8px #000; animation: thx-up 1s ease forwards;
}
@keyframes thx-up { to { transform: translateY(-46px); opacity: 0; } }

/* ---- Beülős guest boxes (TikTok multi-guest) ---- */
.guest-grid {
  position: absolute; top: max(64px, calc(env(safe-area-inset-top) + 52px)); left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; pointer-events: none;
}
.guest-box {
  width: 78px; border-radius: 12px; overflow: hidden; text-align: center;
  background: #16121fd9; border: 1px solid #ffffff26; padding: 8px 4px 6px;
  animation: pc-in .4s cubic-bezier(.2,1.3,.35,1);
}
.gb-avatar {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 5px;
  display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff;
  background: linear-gradient(140deg, var(--accent), var(--accent2));
}
.gb-name { font-size: 9.5px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.gb-mic { font-size: 10px; margin-top: 2px; opacity: .4; }
.guest-box.talking .gb-mic { opacity: 1; animation: rec-blink 0.9s steps(2,start) infinite; }
.guest-box.talking .gb-avatar { box-shadow: 0 0 0 2.5px #4edb8c; }

/* Online / leaderboard rows in the Live app */
.ol-row { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid #ffffff0d; font-size: 13px; }
.ol-dot { width: 8px; height: 8px; border-radius: 50%; background: #4edb8c; box-shadow: 0 0 6px #4edb8c; flex: none; }

/* ================= ZAMAZOR — the webshop that looks like a webshop ============ */
.shop-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 10px; }
.shop-brand { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 6px; }
.shop-prime { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: #0b0a12; background: linear-gradient(120deg, #ffd76a, #ffb14e); border-radius: 5px; padding: 2px 6px; text-transform: uppercase; }
.shop-cash { font-size: 14px; font-weight: 700; background: #ffffff12; border-radius: 999px; padding: 6px 12px; }
.shop-search {
  width: 100%; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: #ffffff10; color: var(--ink); padding: 0 14px; font: inherit; font-size: 14px;
  margin-bottom: 10px;
}
.shop-search::placeholder { color: var(--muted); }
.shop-cats {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.shop-cats::-webkit-scrollbar { display: none; }
.scat {
  flex: none; border: 1px solid var(--line); background: #ffffff0c; color: var(--ink);
  border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.scat.active { background: linear-gradient(120deg, var(--accent), var(--accent2)); border-color: transparent; color: #fff; }
.shop-note { font-size: 11.5px; color: var(--muted); padding: 0 2px 10px; }

.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-bottom: 8px; }
.pcard {
  position: relative; display: flex; flex-direction: column;
  background: #241f30; border: 1px solid var(--line); border-radius: 14px; padding: 8px;
}
.pcard-badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: #e5484d; color: #fff; font-size: 11px; font-weight: 800;
  border-radius: 6px; padding: 2px 6px;
}
.pcard-media {
  aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; margin-bottom: 8px;
  display: grid; place-items: center;
  background: radial-gradient(65% 60% at 50% 38%, #3b3450, #1a1626);
}
.pcard-media img { width: 100%; height: 100%; object-fit: contain; padding: 6%; opacity: 0; transition: opacity .3s; }
.pcard-media img.loaded { opacity: 1; }
.pcard-emoji { font-size: 52px; filter: drop-shadow(0 6px 12px #0008); }
.pcard-name {
  font-size: 13px; font-weight: 600; line-height: 1.25; min-height: 33px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard-rating { font-size: 11px; margin: 3px 0 1px; }
.pstars { color: #ffb14e; letter-spacing: 1px; }
.pnum { color: var(--muted); }
.pcard-sub { font-size: 11px; color: var(--muted); min-height: 14px; margin-bottom: 5px; line-height: 1.3; }
.pcard-price { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.pcard-price s { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-left: 5px; }
.pcard-price .pfree { color: #6ef2c0; font-size: 13px; }
.pcard-cta {
  height: 36px; border: none; border-radius: 9px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #fff; margin-top: auto;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
}
.pcard-cta:disabled { opacity: .55; cursor: not-allowed; }
.pcard-cta.done { background: #2c3a33; color: #6ef2c0; opacity: 1; }
.pcard-cta.transit { background: #34304a; color: #cfc8e8; opacity: 1; }
.pcard-cta.wear { background: #3a3550; }
.pcard-cta:not(:disabled):active { transform: scale(.96); }

.shop-empty { text-align: center; padding: 34px 10px; font-size: 15px; line-height: 1.7; }
.order-row {
  display: flex; align-items: center; gap: 11px;
  background: #ffffff0c; border-radius: 13px; padding: 11px 13px; margin-bottom: 8px;
}
.or-emoji { font-size: 24px; }
.or-txt { font-size: 13.5px; line-height: 1.4; }

/* Daily shared trend + streak chips */
.daily-trend {
  background: linear-gradient(120deg, #ff2d5526, #ff7a3d1c); border: 1px solid #ff2d5540;
  border-radius: 12px; padding: 9px 12px; font-size: 13px; margin-bottom: 8px;
}
.dt-mult { font-size: 11px; font-weight: 800; color: #ffb14e; margin-left: 4px; }
.kt-streak { font-size: 12px; font-weight: 700; color: #ffb14e; margin: 6px 0 2px; }
.kt-daily { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.live-opt.hot { border-color: #ff2d5570; box-shadow: 0 0 14px #ff2d5530; }

/* Rows that used to wrap and "fall apart": never let the button drop to its own line */
.equip { flex-wrap: nowrap; gap: 10px; }
.equip > div { min-width: 0; }
.equip .chip { flex: none; white-space: nowrap; }

/* Comfortable close target on the shared modal (phone thumbs need 40px+) */
.modal-x { width: 42px; height: 42px; font-size: 19px; display: grid; place-items: center; }

/* ---- 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;
}
