:root {
  --bg: #07060c;
  --bg-2: #100e18;
  --card: rgba(16, 14, 26, 0.92);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f4f1ff;
  --muted: #9b93b3;
  --cyan: #22d3ee;
  --violet: #a855f7;
  --pink: #f472b6;
  --gold: #fbbf24;
  --danger: #fb7185;
  --ok: #34d399;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  --radius: 20px;
  --font: "Outfit", system-ui, sans-serif;
  --display: "Orbitron", sans-serif;
  --pad: max(12px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
video:not(.cam-feed):not(.cam-preview):not(.share-preview):not(.watch-video):not(.demo-cam), canvas:not(.fx) { max-width: 100%; height: auto; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(168, 85, 247, 0.22), transparent 50%),
    radial-gradient(900px 500px at 110% 10%, rgba(34, 211, 238, 0.16), transparent 46%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a { color: var(--cyan); text-decoration: none; }
h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: 0.04em;
  margin: 0 0 0.4em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
p { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }

.wrap {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  max-width: 100%;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 10px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700;
  min-width: 0;
}
.brand img { width: 32px; height: 32px; flex-shrink: 0; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }

.btn {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  max-width: 100%;
  min-width: 0;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--violet) 60%, var(--pink));
  border: none;
  color: #081018;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.35);
}
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); color: #fecdd3; }
.btn-ok { background: rgba(52, 211, 153, 0.14); border-color: rgba(52, 211, 153, 0.35); color: #bbf7d0; }
.btn-block { width: 100%; }

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  max-width: 100%;
  overflow: hidden;
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.hero h1 { font-size: clamp(1.45rem, 8vw, 4.4rem); line-height: 1.08; }
.hero .lead { font-size: 1.02rem; max-width: 38rem; }
.badge {
  display: inline-flex; gap: 8px; align-items: center;
  border: 1px solid var(--stroke); border-radius: 999px; padding: 6px 10px;
  color: var(--cyan); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  max-width: 100%;
}
.price { font-family: var(--display); font-size: clamp(1.6rem, 6vw, 2.4rem); color: var(--text); }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--gold); }
.err { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field label { font-size: 0.82rem; color: var(--muted); }
.field input, .field select, .field textarea {
  background: #0b0a12;
  border: 1px solid var(--stroke);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 12px;
  font: inherit;
  font-size: 16px;
  outline: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
}
.field input:focus, .field select:focus { border-color: rgba(34, 211, 238, 0.6); }

.page-center {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.page-center .card { width: min(420px, 100%); }

.notice {
  border-radius: 14px; padding: 10px 12px; margin: 10px 0;
  background: rgba(251, 113, 133, 0.1); color: #fecdd3; display: none;
  overflow-wrap: anywhere;
}
.notice.show { display: block; }
.notice.info { background: rgba(34, 211, 238, 0.1); color: #a5f3fc; }

.steps { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 28px 0; }
.step { padding: 16px; border-radius: 18px; border: 1px solid var(--stroke); background: rgba(255,255,255,0.03); }
.kicker { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }

.players { display: grid; gap: 8px; min-width: 0; }
.player-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

.live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 12px var(--danger); display: inline-block; flex-shrink: 0;
}
.live-dot.on { background: var(--ok); box-shadow: 0 0 12px var(--ok); }

body.battle-ended.ui-hidden,
body.battle-ended { cursor: auto; }
body.battle-ended .setup-gate {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.live-status.warn { color: #fde68a; }
.hist-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
}
.hist-video {
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  background: #000;
  margin-top: 6px;
}
.hist-actions { display: flex; gap: 8px; margin-top: 6px; }

.sticky-controls {
  position: sticky; bottom: max(8px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 10px;
  background: rgba(7,6,12,0.92);
  border: 1px solid var(--stroke); border-radius: 18px; backdrop-filter: blur(18px);
  z-index: 12;
}

/* -------- SCOREBOARD / CAMERA HUD -------- */
body.scoreboard {
  overflow: hidden;
  height: 100dvh;
  background: #05040a;
}
.cam-feed {
  position: fixed; inset: 0;
  width: 100vw !important; height: 100dvh !important;
  max-width: none !important; max-height: none !important;
  object-fit: cover; object-position: center;
  background: #05040a; z-index: 0;
  transform: scaleX(1);
}
body.cam-on[data-facing="user"] .cam-feed { transform: scaleX(-1); }
.cam-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,4,10,0.38) 0%, transparent 18%, transparent 82%, rgba(5,4,10,0.42) 100%);
}
body:not(.cam-on) .cam-feed,
body:not(.cam-on) .cam-scrim { display: none; }
.board {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  padding: max(10px, env(safe-area-inset-top)) 14px max(10px, env(safe-area-inset-bottom));
  position: relative;
  z-index: 2;
}
.board-bg { display: none; }
.vs-mark {
  display: grid; place-items: center;
  font-family: var(--display); font-size: clamp(3rem, 12vw, 7rem);
  letter-spacing: 0.12em; pointer-events: none; z-index: 3;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 0 18px rgba(168, 85, 247, 0.45));
  animation: pulse 1.8s ease-in-out infinite;
}
body.scoreboard:not(.cam-on) {
  background:
    radial-gradient(1000px 500px at 15% 0%, rgba(168, 85, 247, 0.22), transparent 50%),
    radial-gradient(900px 500px at 100% 80%, rgba(34, 211, 238, 0.14), transparent 46%),
    #05040a;
}
body:not(.cam-on) .hp { min-height: 18vh; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.board-head, .board-foot {
  position: relative; z-index: 4;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.logo-live {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display); letter-spacing: 0.1em;
  font-size: 0.72rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.round-chip {
  font-family: var(--display); padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.45); color: var(--gold);
  background: rgba(251, 191, 36, 0.12);
  backdrop-filter: blur(12px);
  font-size: 0.7rem; flex-shrink: 0;
}
.hud { display: grid; gap: 8px; z-index: 4; pointer-events: none; }
.hud-duel { grid-template-columns: 1fr 1fr; }
.hud-multi { grid-template-columns: 1fr; }
.hp {
  position: relative; overflow: hidden;
  padding: 10px 12px 12px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent);
  border-radius: 16px;
  background: rgba(5, 4, 10, 0.55);
  backdrop-filter: blur(14px);
  color: var(--c);
}
.hp-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 0.72rem; letter-spacing: 0.04em; min-width: 0; }
.hp-name, .hp-tag { font-family: var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hp-name { font-size: 0.82rem; }
.hp-track {
  height: 10px; border-radius: 999px; background: rgba(255,255,255,0.1);
  margin: 8px 0 6px; overflow: hidden;
}
.hp-fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--c), #fff);
  box-shadow: 0 0 16px var(--c);
  transition: width 380ms cubic-bezier(.2,1.2,.2,1);
}
.hp[data-side="right"] .hp-fill { margin-left: auto; }
.hp-score {
  font-family: var(--display); font-size: clamp(1.4rem, 5vw, 2.4rem);
  text-shadow: 0 0 18px currentColor;
  line-height: 1;
}
.hp.hit { animation: shake 400ms ease; }
.vs-stage, .tower, .tower-fill, .tower-meta, .vs-core, .multi { display: none; }

.watermark {
  position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 5;
  font-family: var(--display); font-size: clamp(3rem, 14vw, 9rem); letter-spacing: 0.2em;
  color: rgba(255,255,255,0.045); transform: rotate(-18deg);
}
.watermark[hidden],
body.scoreboard:not(.is-demo) .watermark { display: none !important; }
.gift-stack {
  position: fixed;
  top: max(128px, calc(env(safe-area-inset-top) + 112px));
  left: 10px;
  z-index: 8;
  width: min(78%, 360px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}
.gift-chip {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0,0,0,0.72), rgba(0,0,0,0.38));
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  animation: giftIn 2.4s cubic-bezier(.2,1.1,.3,1) forwards;
}
.gift-ava {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  color: #081018;
}
.gift-chip strong, .gift-chip span { display: block; line-height: 1.15; }
.gift-chip strong { font-size: 0.78rem; }
.gift-chip em { font-style: normal; font-size: 0.68rem; color: #c4b5fd; }
.gift-pts {
  font-family: var(--display);
  font-size: 0.92rem;
  color: #bbf7d0;
  text-shadow: 0 0 10px #34d399;
  white-space: nowrap;
}
.gift-chip.down .gift-pts { color: #fecdd3; text-shadow: 0 0 10px #fb7185; }
.ticker {
  z-index: 4; display: flex; flex-direction: column; gap: 4px;
  max-height: 7.2rem; overflow: hidden; pointer-events: none;
}
.ticker-row {
  font-size: 0.82rem; color: #e9e4ff;
  background: rgba(0,0,0,0.45); border-radius: 999px;
  padding: 4px 10px; width: fit-content; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.float-layer { position: relative; }
.float-dmg {
  position: absolute; right: 12px; top: 0;
  font-family: var(--display); font-size: 1.4rem; color: #bbf7d0;
  animation: floatUp 1.3s ease forwards; pointer-events: none; z-index: 7;
  text-shadow: 0 0 12px #34d399;
}
.hp .float-dmg { right: 10px; top: -6px; }
.float-dmg.down { color: #fecdd3; text-shadow: 0 0 12px #fb7185; }

.setup-gate {
  position: fixed; inset: 0; z-index: 30;
  display: grid; align-items: end; justify-items: center;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(5,4,10,0.55);
}
.setup-gate[hidden],
#dndSheet[hidden],
#shareSheet[hidden],
#recAsk[hidden],
#endSheet[hidden],
#liveDock[hidden] { display: none !important; }
.setup-card { width: min(460px, 100%); padding: 16px; }
.setup-card h1 { font-size: 1.25rem; }
.setup-steps { display: none; }
.live-dock {
  position: fixed;
  left: 8px; right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.8;
  pointer-events: auto;
}
.live-status {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: #fff;
  text-shadow: 0 1px 6px #000;
}
.live-actions {
  display: flex;
  gap: 8px;
}
.live-actions .btn { flex: 1; min-height: 46px; font-weight: 800; }
.cam-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cam-bar .btn { font-size: 0.78rem; padding: 10px 8px; min-height: 44px; flex: 1 1 22%; }
.cam-bar [hidden],
.live-actions [hidden] { display: none !important; }
.rec-fab {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 52px;
  border: 3px solid #fff; background: #ef4444; color: #fff;
  font: inherit; font-weight: 800; font-size: 0.62rem;
  letter-spacing: 0.04em; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.45);
}
.rec-fab.on {
  animation: recPulse 1s ease-in-out infinite;
  background: #991b1b;
}
@keyframes recPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.92); }
}
body.ui-hidden .live-dock,
body.ui-hidden .setup-gate { opacity: 0; pointer-events: none; }
body.scoreboard.ui-hidden { cursor: none; }
body.cam-on.ui-hidden .cam-feed { opacity: 1 !important; }

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(8px) scale(0.9); }
  100% { opacity: 0; transform: translateY(-48px) scale(1.1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(34,211,238,.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(244,114,182,.55)); }
}
@keyframes vsBeat {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(168,85,247,.55)); }
  50% { transform: scale(1.14); filter: drop-shadow(0 0 28px rgba(244,114,182,.85)); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0); }
}
@keyframes scorePop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  100% { transform: scale(1); }
}
@keyframes voteSlam {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.4); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(0.92); }
}
@keyframes giftIn {
  0% { opacity: 0; transform: translateX(-70%) scale(0.82); }
  12% { opacity: 1; transform: translateX(0) scale(1.05); }
  18% { transform: translateX(0) scale(1); }
  72% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(18%) translateY(-12px); }
}
@keyframes glovePunch {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -58%) scale(1.08); }
}
@keyframes bannerIn {
  0% { opacity: 0; transform: scale(0.6) rotate(-8deg); }
  18% { opacity: 1; transform: scale(1.12) rotate(0deg); }
  72% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}
@keyframes screenFlash {
  0% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
  30% { box-shadow: inset 0 0 80px 20px rgba(255,255,255,0.18); }
  100% { box-shadow: inset 0 0 0 0 rgba(255,255,255,0); }
}

body.dnd-on .live-dock { opacity: 0; pointer-events: none; }
body.dnd-on.ui-hidden { cursor: none; }

@media (orientation: portrait) {
  .hud-duel { grid-template-columns: 1fr 1fr; gap: 6px; }
  .hp { padding: 8px 10px 10px; min-height: 0; }
  .hp-score { font-size: clamp(1.05rem, 6vw, 1.7rem); }
  .hp-track { height: 8px; margin: 6px 0 4px; }
  .vs-mark { font-size: clamp(2.2rem, 16vw, 4rem); }
  .ticker { max-height: 4.2rem; }
  body:not(.cam-on) .hp { min-height: 12vh; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .hud-duel { grid-template-columns: 1fr 1fr; }
  .hp-score { font-size: 1.2rem; }
  .ticker { max-height: 3.2rem; }
  body:not(.cam-on) .hp { min-height: 0; }
  .setup-gate { align-items: center; }
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1.1fr 0.9fr; gap: 28px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .player-row { grid-template-columns: 1fr 1fr; }
  .history .row { flex-direction: row; justify-content: space-between; }
  .card { padding: 22px; }
}

/* TikTok PK HUD */
.pk {
  position: relative; z-index: 2; height: 100dvh;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  padding: max(8px, env(safe-area-inset-top)) 10px max(132px, calc(env(safe-area-inset-bottom) + 124px));
  pointer-events: none;
}
.pk-head {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  pointer-events: none;
}
.live-pill, .rec-pill {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.5);
}
.live-pill { animation: livePulse 1.6s ease-in-out infinite; }
.rec-pill { color: #fecdd3; background: rgba(251,113,133,0.35); }
.pk-fighters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.pk-card {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; align-items: center;
  padding: 8px; border-radius: 16px;
  background: rgba(5,4,10,0.62); border: 1px solid rgba(255,255,255,0.12);
  color: var(--c); min-width: 0;
}
.pk-card.hit { animation: shake 420ms ease; }
.pk-ava {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800;
  background: var(--c); color: #081018;
}
.pk-id { min-width: 0; }
.pk-id strong, .pk-id span {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pk-id span { font-size: 0.7rem; opacity: 0.75; color: #fff; }
.pk-score { font-family: var(--display); font-size: clamp(1.2rem, 5vw, 1.7rem); text-shadow: 0 0 12px currentColor; }
.pk-score.pop { animation: scorePop 420ms cubic-bezier(.2,1.5,.3,1); }
.pk-meter {
  position: relative;
  height: 16px; border-radius: 999px; overflow: visible;
  background: linear-gradient(90deg, #f472b6, #f472b6);
  margin: 10px 0 0;
  box-shadow: 0 0 18px rgba(244,114,182,.35);
}
.pk-meter i {
  display: block; height: 100%; width: 50%;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #22d3ee, #a5f3fc);
  box-shadow: 0 0 16px #22d3ee;
  transition: width 420ms cubic-bezier(.2,1.2,.2,1);
  overflow: hidden;
}
.pk-gloves {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0;
  pointer-events: none;
  z-index: 3;
  animation: glovePunch 0.9s ease-in-out infinite;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.55));
  transition: left 420ms cubic-bezier(.2,1.2,.2,1);
}
.glove { font-size: 1.35rem; line-height: 1; }
.glove-r { transform: scaleX(-1); }
.pk-stage {
  display: grid;
  place-items: center;
  position: relative;
  min-height: 0;
}
.pk-vs {
  position: relative;
  font-family: var(--display); font-size: clamp(3rem, 18vw, 5.2rem);
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: vsBeat 1.25s ease-in-out infinite;
  pointer-events: none;
  letter-spacing: 0.08em;
  line-height: 1;
}
.pk-foot { display: none; }
.pk-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
  padding-bottom: 4px;
  text-shadow: 0 1px 10px rgba(0,0,0,.85);
}
.pk-brand a {
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}
.pk-brand span {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.72);
}
.ticker,
.ticker-row { display: none !important; }
body.cam-on .cam-feed { display: block !important; opacity: 1 !important; z-index: 0; }
body.battle-ended .live-dock { display: none !important; }
.notice.ok { color: #bbf7d0; background: rgba(52, 211, 153, 0.12); }

/* App shell */
body.app { padding-bottom: 84px; }
.app-tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  background: rgba(7,6,12,0.94); border-top: 1px solid var(--stroke);
}
.app-tabs button {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700;
  padding: 10px 6px; min-height: 48px;
}
.app-tabs button.on { color: var(--cyan); }
.view[hidden] { display: none !important; }
.profile-card { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.avatar {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--pink)); color: #081018;
  font-weight: 800; font-size: 1.4rem;
}
.cam-preview {
  width: 100%; height: 220px; object-fit: cover; border-radius: 16px;
  background: #000; display: none; margin: 10px 0;
}
.cam-preview.on { display: block; }
.setting-row {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--stroke);
}
.cta-live {
  display: grid; gap: 8px; margin-top: 8px;
}
.howto {
  display: grid; gap: 8px; margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}
.howto ol { margin: 0; padding-left: 1.15rem; color: var(--muted); }
.howto li { margin: 4px 0; }
.howto strong { color: var(--text); }
.sim-box { margin-top: 12px; }
.sim-box summary {
  cursor: pointer; color: var(--muted); font-size: 0.88rem; font-weight: 650;
}
.expire-chip {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.12); color: #a5f3fc; font-size: 0.82rem;
}
.cam-pip {
  position: fixed;
  right: 12px;
  bottom: max(168px, calc(env(safe-area-inset-bottom) + 160px));
  width: min(34vw, 148px);
  height: min(46vw, 198px);
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid #fff;
  z-index: 8;
  background: #000;
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
  transform: scaleX(-1);
}
.cam-pip[hidden],
body:not(.cam-dual) .cam-pip { display: none !important; }
body.cam-dual .cam-pip { display: block !important; }
body.cam-on[data-pip="environment"] .cam-pip { transform: none; }
body.ui-hidden .cam-pip { opacity: 1; }
.rules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 10px;
}
.check-row {
  display: flex; gap: 10px; align-items: center;
  margin: 8px 0; color: var(--text); font-size: 0.92rem;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--cyan); }
.rules-hint { font-size: 0.82rem; color: var(--muted); margin: 6px 0 0; }
@media (min-width: 640px) {
  .rules-grid { grid-template-columns: 1fr 1fr; }
}

.round-banner {
  position: fixed; inset: 0; z-index: 18;
  display: grid; place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(168,85,247,.28), transparent 55%);
}
.round-banner[hidden] { display: none !important; }
.round-banner b {
  font-family: var(--display);
  font-size: clamp(2.2rem, 12vw, 4.4rem);
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 24px rgba(244,114,182,.9), 0 0 48px rgba(34,211,238,.6);
  animation: bannerIn 1.35s cubic-bezier(.2,1.4,.3,1) forwards;
}
body.score-flash { animation: screenFlash 380ms ease; }
body.round-on .round-chip {
  border-color: rgba(52,211,153,.7);
  color: #bbf7d0;
  background: rgba(52,211,153,.18);
}
.share-preview {
  width: 100%; height: 180px; object-fit: cover; border-radius: 14px;
  background: #000; margin: 8px 0 12px;
}
.watch-page { padding-bottom: 40px; }
.watch-wrap { padding-bottom: 48px; }
.watch-video {
  width: 100%;
  max-height: 78vh;
  border-radius: 18px;
  background: #000;
  margin: 12px 0;
  object-fit: contain;
}
.demo-live {
  margin: 8px 0 56px;
}
.demo-live h2 { margin-top: 8px; }
.demo-phone {
  position: relative;
  width: min(360px, 100%);
  margin: 18px auto 0;
  aspect-ratio: 9 / 16;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: var(--shadow);
  background: #05040a;
}
.demo-cam {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background:
    radial-gradient(circle at 30% 40%, rgba(244,114,182,0.28), transparent 42%),
    radial-gradient(circle at 80% 70%, rgba(34,211,238,0.22), transparent 46%),
    linear-gradient(180deg, #1c1630 0%, #0b1220 45%, #141018 100%);
}
.demo-cam::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.08) 48%, transparent 62%);
  animation: demoSweep 5s linear infinite;
}
@keyframes demoSweep {
  0% { transform: translateX(-40%); opacity: .35; }
  100% { transform: translateX(40%); opacity: .2; }
}
.demo-street {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,4,10,0.2) 0%, transparent 22%, transparent 70%, rgba(5,4,10,0.55) 100%),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255,255,255,0.03) 18px 19px);
  pointer-events: none;
}
.demo-hud {
  position: absolute; inset: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  padding: 12px 10px 14px;
  pointer-events: none;
}
.demo-phone .pk {
  height: 100%;
  padding: 12px 10px 14px;
}
.demo-phone .gift-stack {
  position: absolute;
  top: 118px;
  left: 10px;
  width: 72%;
}
.pro-invite {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}
.pro-invite a,
button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--cyan);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.badge-cta {
  cursor: pointer;
  color: var(--gold);
}
.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 0 40px;
  color: var(--muted);
  font-size: 0.82rem;
}
