/* ============ YAPLE — arena theme ============ */
:root {
  --bg: #0a0a0c;
  --bg-2: #121216;
  --bg-3: #1a1a21;
  --line: #2a2a33;
  --txt: #f2f0ec;
  --muted: #8d8d99;
  --red: #ff2e2e;
  --orange: #ff8a00;
  --gold: #ffd34d;
  --green: #4dff88;
  --grad: linear-gradient(95deg, var(--red), var(--orange));
  --display: 'Anton', sans-serif;
  --body: 'Space Grotesk', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255, 46, 46, .14), transparent 60%),
    radial-gradient(700px 400px at 85% 110%, rgba(255, 138, 0, .08), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: var(--body);
  letter-spacing: .01em;
}

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 80px; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
b { color: var(--orange); }

/* ---- demo banner ---- */
.demo-banner {
  background: #2a1500;
  border-bottom: 1px solid var(--orange);
  color: var(--gold);
  font-size: .8rem;
  text-align: center;
  padding: 7px 12px;
  font-family: var(--mono);
}
.demo-banner button {
  background: none; border: none; color: var(--orange);
  font: inherit; text-decoration: underline; cursor: pointer;
}

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 10, 12, .85);
  backdrop-filter: blur(8px);
}
.logo-btn {
  font-family: var(--display); font-size: 1.5rem; letter-spacing: .04em;
  background: none; border: none; color: var(--txt); cursor: pointer;
}
.logo-btn span, .hero-logo span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav-btn {
  background: none; border: 1px solid var(--line); color: var(--txt);
  font-family: var(--mono); font-size: .75rem; letter-spacing: .08em;
  padding: 8px 14px; border-radius: 6px; cursor: pointer; margin-left: 8px;
  transition: border-color .15s, color .15s;
}
.nav-btn:hover { border-color: var(--orange); color: var(--orange); }
.nav-gear { font-size: .95rem; }

/* ---- screens ---- */
.screen { display: none; animation: fadeUp .35s ease both; }
.screen.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.screen-title {
  font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .03em; margin: 26px 0 22px; text-align: center;
}

/* ---- landing ---- */
.hero { text-align: center; padding: 56px 0 40px; }
.hero-kicker {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .35em;
  color: var(--orange); margin-bottom: 10px;
}
.hero-logo {
  font-family: var(--display);
  font-size: clamp(4rem, 14vw, 9rem);
  line-height: .95; letter-spacing: .02em;
  text-shadow: 0 0 60px rgba(255, 46, 46, .35);
}
.hero-tag { color: var(--muted); margin: 14px 0 30px; font-size: 1.05rem; }

.btn-big {
  font-family: var(--display); font-size: 1.25rem; letter-spacing: .08em;
  color: #fff; background: var(--grad);
  border: none; border-radius: 10px; padding: 16px 44px; cursor: pointer;
  box-shadow: 0 0 28px rgba(255, 70, 20, .45);
  transition: transform .12s, box-shadow .12s;
}
.btn-big:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 42px rgba(255, 70, 20, .65); }
.btn-big:active { transform: scale(.98); }
.btn-big:disabled { opacity: .5; cursor: wait; transform: none; }
.btn-small { font-size: .95rem; padding: 12px 26px; }
.btn-ghost {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em;
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 12px 22px; cursor: pointer;
}
.btn-ghost:hover { border-color: var(--muted); color: var(--txt); }
.link-btn {
  background: none; border: none; color: var(--orange); cursor: pointer;
  font-family: var(--mono); font-size: .75rem; margin-top: 12px;
}

.landing-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px;
}

.panel-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 22px;
}
.panel-title {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .2em;
  color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  display: inline-block; animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

.mini-board .row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.mini-board .row:last-child { border-bottom: none; }
.mini-board .pos { font-family: var(--mono); color: var(--muted); width: 22px; }
.mini-board .tag { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-board .elo { font-family: var(--mono); color: var(--gold); }
.mini-board .row.is-you { background: rgba(255,138,0,.08); border-radius: 6px; }

.ranks-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.rank-badge {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid;
  display: inline-block; white-space: nowrap;
}
.rank-0 { color: #7c7c88; border-color: #44444f; }          /* Mute */
.rank-1 { color: #b9b9c6; border-color: #6a6a78; }          /* Yapper */
.rank-2 { color: #6fd2ff; border-color: #2c7ea3; }          /* Debater */
.rank-3 { color: #d7e3ef; border-color: #93a7bd; }          /* Silver Tongue */
.rank-4 { color: #ffb04d; border-color: #b06a14; }          /* Menace */
.rank-5 { color: #ff5e5e; border-color: #a32525; }          /* Courtroom Demon */
.rank-6 { color: #ffd34d; border-color: #b8901c; box-shadow: 0 0 12px rgba(255,211,77,.35); } /* Debate Slayer */

/* ---- lobby ---- */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 18px; text-align: center; cursor: pointer; color: var(--txt);
  font-family: var(--body);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.mode-card:hover:not(.disabled) { transform: translateY(-3px); border-color: var(--orange); }
.mode-card.selected { border-color: var(--red); box-shadow: 0 0 22px rgba(255,46,46,.3); }
.mode-card.disabled { opacity: .4; cursor: not-allowed; }
.mode-icon { font-size: 2rem; margin-bottom: 8px; }
.mode-name { font-family: var(--display); font-size: 1.2rem; letter-spacing: .05em; }
.mode-desc { color: var(--muted); font-size: .82rem; margin-top: 6px; }

.name-entry {
  display: flex; gap: 16px; justify-content: center; margin: 26px 0;
  flex-wrap: wrap;
}
.name-entry label {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .15em; color: var(--muted);
  display: flex; flex-direction: column; gap: 6px;
}
.name-entry input {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  color: var(--txt); font-family: var(--body); font-size: 1rem;
  padding: 12px 14px; min-width: 220px; outline: none;
}
.name-entry input:focus { border-color: var(--orange); }
#screen-lobby { text-align: center; }

/* ---- match ---- */
.topic-banner {
  background: var(--grad); color: #16060a;
  font-family: var(--display); font-size: clamp(1rem, 2.6vw, 1.45rem);
  letter-spacing: .02em; text-align: center;
  border-radius: 12px; padding: 16px 22px; margin: 18px 0 14px;
  box-shadow: 0 0 30px rgba(255, 70, 20, .35);
}
.match-hud { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 16px; }
.round-label { font-family: var(--mono); font-size: .78rem; letter-spacing: .3em; color: var(--muted); }
.match-timer {
  font-family: var(--display); font-size: 3.4rem; line-height: 1;
  color: var(--txt); text-shadow: 0 0 24px rgba(255,138,0,.4);
}
.match-timer.danger { color: var(--red); animation: pulse .6s infinite; }

.arena {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch;
}
.player-panel {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.player-panel.turn-active { border-color: var(--orange); box-shadow: 0 0 24px rgba(255,138,0,.25); }
.p-cam {
  aspect-ratio: 16/10; background: #000; border-radius: 10px;
  display: grid; place-items: center; border: 1px solid var(--line);
}
.cam-ph { color: #3c3c46; font-family: var(--mono); font-size: .75rem; letter-spacing: .15em; }
.p-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.p-name { font-family: var(--display); font-size: 1.15rem; letter-spacing: .03em; flex: 1; }
.p-side {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em;
  padding: 4px 10px; border-radius: 6px; font-weight: 700;
}
.p-side.for { background: rgba(77,255,136,.12); color: var(--green); border: 1px solid rgba(77,255,136,.4); }
.p-side.against { background: rgba(255,46,46,.12); color: var(--red); border: 1px solid rgba(255,46,46,.4); }
.p-transcript {
  border-top: 1px dashed var(--line); padding-top: 8px; min-height: 40px;
  white-space: pre-wrap; max-height: 130px; overflow-y: auto;
}
.vs-wrap { display: grid; place-items: center; }
.vs-graphic {
  font-family: var(--display); font-size: 2.6rem;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transform: skew(-8deg);
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(255,46,46,.5));
}

.input-dock {
  margin-top: 16px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
}
.input-owner { font-family: var(--mono); font-size: .72rem; letter-spacing: .2em; color: var(--orange); margin-bottom: 8px; }
#arg-input {
  width: 100%; background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  color: var(--txt); font-family: var(--body); font-size: 1rem; padding: 12px; resize: vertical;
  outline: none;
}
#arg-input:focus { border-color: var(--orange); }
.dock-actions { display: flex; gap: 10px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.btn-mic {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  font-size: 1.2rem; padding: 10px 16px; cursor: pointer; color: var(--txt);
}
.btn-mic.recording { border-color: var(--red); background: rgba(255,46,46,.15); animation: pulse 1s infinite; }
.ai-thinking {
  margin-top: 16px; text-align: center; font-family: var(--mono);
  letter-spacing: .2em; color: var(--orange); padding: 18px;
}

.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---- overlays ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 6, 8, .92); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
}
.overlay-inner { text-align: center; max-width: 640px; animation: fadeUp .3s ease both; }
.overlay-kicker {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .4em;
  color: var(--orange); margin-bottom: 18px;
}
.topic-spin {
  font-family: var(--display); font-size: clamp(1.3rem, 4vw, 2rem);
  min-height: 3em; color: var(--muted);
  animation: spinFlash .12s infinite;
}
@keyframes spinFlash { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.topic-final {
  font-family: var(--display); font-size: clamp(1.4rem, 4.5vw, 2.3rem);
  line-height: 1.2; animation: slamIn .4s cubic-bezier(.2, 2, .4, 1) both;
  text-shadow: 0 0 40px rgba(255,46,46,.4);
}
@keyframes slamIn { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: scale(1); } }
.sides-reveal { margin-top: 22px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.side-chip {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 18px; font-family: var(--mono); font-size: .85rem;
  animation: fadeUp .4s ease both .25s;
}
.side-chip b { font-size: 1rem; }
#btn-topic-go { margin-top: 26px; }
.pass-name { font-family: var(--display); font-size: 2.4rem; margin-bottom: 24px; }
.judge-gavel { font-size: 3.4rem; margin-bottom: 14px; animation: gavel 1s ease infinite; }
@keyframes gavel { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-20deg); } 45% { transform: rotate(8deg); } }

.modal-box {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; text-align: left; width: min(480px, 92vw);
}
.modal-box .panel-title { margin-bottom: 8px; }
.modal-box p { margin-bottom: 14px; }

/* ---- verdict ---- */
#screen-verdict { text-align: center; }
.verdict-line {
  font-family: var(--display); font-size: clamp(1.5rem, 5vw, 2.6rem);
  margin: 30px 0 24px; line-height: 1.15;
}
.verdict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.verdict-card {
  border-radius: 16px; padding: 26px 18px; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.verdict-card.winner {
  background: linear-gradient(180deg, rgba(255,211,77,.1), var(--bg-2));
  border-color: var(--gold); box-shadow: 0 0 34px rgba(255,211,77,.25);
  animation: slamIn .45s cubic-bezier(.2,2,.4,1) both;
}
.verdict-card.loser {
  background: linear-gradient(180deg, rgba(255,46,46,.08), var(--bg-2));
  border-color: #5b1d1d; filter: saturate(.8);
  animation: fadeUp .5s ease both .2s;
}
.v-label { font-family: var(--display); font-size: 1.5rem; letter-spacing: .12em; }
.winner .v-label { color: var(--gold); }
.loser .v-label { color: var(--red); }
.v-name { font-family: var(--display); font-size: 1.7rem; }
.v-elo { font-family: var(--mono); font-size: .95rem; }
.elo-up { color: var(--green); }
.elo-down { color: var(--red); }

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; text-align: left; }
.score-col h3 { font-family: var(--display); font-size: 1.05rem; margin-bottom: 10px; letter-spacing: .04em; }
.score-row { margin-bottom: 10px; }
.score-row .lbl {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; color: var(--muted);
  margin-bottom: 4px;
}
.bar { height: 8px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.bar i {
  display: block; height: 100%; background: var(--grad); border-radius: 99px;
  width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1);
}
.score-total { font-family: var(--mono); color: var(--gold); margin-top: 6px; font-size: .85rem; }

.roast-card { margin-top: 16px; border-color: #4a2410; }
.roast-text { font-size: 1.08rem; line-height: 1.55; font-style: italic; color: #ffd9b0; }
.verdict-actions { display: flex; gap: 14px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* ---- glitch effect ---- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none;
}
.glitch::before {
  color: var(--red); z-index: -1;
  animation: glitchA 2.4s steps(2) infinite;
}
.glitch::after {
  color: #4db8ff; z-index: -2;
  animation: glitchB 3.1s steps(2) infinite;
}
@keyframes glitchA {
  0%, 92% { transform: none; clip-path: inset(0 0 0 0); opacity: 0; }
  93% { transform: translate(-4px, 2px); clip-path: inset(10% 0 55% 0); opacity: .9; }
  95% { transform: translate(3px, -1px); clip-path: inset(60% 0 8% 0); opacity: .9; }
  97% { transform: translate(-2px, 1px); clip-path: inset(30% 0 35% 0); opacity: .9; }
  98%, 100% { transform: none; opacity: 0; }
}
@keyframes glitchB {
  0%, 90% { transform: none; opacity: 0; }
  91% { transform: translate(4px, -2px); clip-path: inset(45% 0 20% 0); opacity: .8; }
  94% { transform: translate(-3px, 2px); clip-path: inset(5% 0 70% 0); opacity: .8; }
  96%, 100% { transform: none; opacity: 0; }
}

/* ---- leaderboard ---- */
.board-table { width: 100%; border-collapse: collapse; }
.board-table th {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; color: var(--muted);
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
.board-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.board-table tr:last-child td { border-bottom: none; }
.board-table .elo-cell { font-family: var(--mono); color: var(--gold); }
.board-table tr.is-you td { background: rgba(255,138,0,.08); }
.board-table tr.top-1 td:first-child { color: var(--gold); font-weight: 700; }
#screen-leaderboard .btn-ghost { margin-top: 18px; }
#screen-leaderboard { text-align: center; }
#screen-leaderboard .panel-card { text-align: left; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .landing-grid, .verdict-grid, .score-grid { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .arena { grid-template-columns: 1fr; }
  .vs-wrap { padding: 4px 0; }
  .vs-graphic { font-size: 1.8rem; }
  .p-cam { aspect-ratio: 16/6; }
  .hero { padding: 36px 0 28px; }
  main { padding: 16px 12px 60px; }
}

/* ============================================================
   MONETIZATION — tiers, shop, upgrade, cosmetics
   ============================================================ */

/* ---- tier chip (nav) ---- */
.tier-chip {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .14em;
  padding: 4px 10px; border-radius: 999px; border: 1px solid;
  font-weight: 700; cursor: pointer; transition: box-shadow .15s;
}
.tier-chip:hover { box-shadow: 0 0 10px currentColor; }
.tier-free     { color: #8d8d99; border-color: #44444f; }
.tier-pro      { color: #ff8a00; border-color: #a05800; background: rgba(255,138,0,.08); }
.tier-streamer { color: #ffd34d; border-color: #a08018;
                 background: rgba(255,211,77,.08); box-shadow: 0 0 8px rgba(255,211,77,.2); }

/* ---- debate counter (lobby) ---- */
.debate-counter {
  margin-top: 14px;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .12em;
  color: var(--muted); text-align: center;
}
.debate-counter b { color: var(--orange); }
.debate-counter.depleted b { color: var(--red); }

/* ---- streamer tools (lobby) ---- */
.streamer-tools {
  margin-top: 26px;
  background: var(--bg-2); border: 1px solid rgba(255,211,77,.25);
  border-radius: 14px; padding: 18px 22px; text-align: left;
  max-width: 600px; margin-left: auto; margin-right: auto;
}
.streamer-tools .panel-title { color: var(--gold); }
.streamer-link-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.streamer-link-val {
  flex: 1; min-width: 200px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  color: var(--muted); font-family: var(--mono); font-size: .78rem;
  padding: 8px 12px; outline: none; cursor: text;
}

/* ---- verdict watermark (free tier) ---- */
.verdict-watermark {
  display: flex; justify-content: flex-end;
  padding: 4px 6px 0; margin-bottom: -8px;
}
.verdict-watermark span {
  font-family: var(--mono); font-size: .65rem; letter-spacing: .2em;
  color: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px; padding: 2px 8px;
  user-select: none; pointer-events: none;
}

/* ---- stripe toast ---- */
.stripe-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--orange);
  border-radius: 12px; padding: 14px 24px;
  font-family: var(--mono); font-size: .82rem; letter-spacing: .08em;
  color: var(--txt); z-index: 100;
  box-shadow: 0 0 30px rgba(255,138,0,.25);
  animation: toastIn .4s cubic-bezier(.2,1,.4,1) both;
  white-space: nowrap;
}
.stripe-toast.success { border-color: var(--green); box-shadow: 0 0 30px rgba(77,255,136,.2); }
.stripe-toast.error   { border-color: var(--red); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- shop screen ---- */
#screen-shop { text-align: center; }

.shop-tier-banner {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 22px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; text-align: left;
}
.shop-tier-banner .stb-left { display: flex; flex-direction: column; gap: 3px; }
.shop-tier-banner .stb-name {
  font-family: var(--display); font-size: 1.3rem; letter-spacing: .05em;
}
.shop-tier-banner .stb-desc { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

.shop-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 4px;
}
.shop-tab {
  flex: 1; font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  background: none; border: none; border-radius: 8px; color: var(--muted);
  padding: 10px 6px; cursor: pointer; transition: all .15s;
}
.shop-tab.active, .shop-tab:hover {
  background: var(--bg-3); color: var(--txt);
}
.shop-tab.active { color: var(--orange); }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 8px; text-align: left;
}
.shop-item {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
  position: relative; transition: border-color .15s, box-shadow .15s;
}
.shop-item.equipped { border-color: var(--orange); box-shadow: 0 0 16px rgba(255,138,0,.2); }
.shop-item.locked   { opacity: .6; }
.shop-item-preview {
  height: 48px; border-radius: 8px; border: 1px solid var(--line);
  display: grid; place-items: center;
}
.shop-item-swatch {
  width: 100%; height: 100%; border-radius: 7px;
}
.shop-item-name  { font-family: var(--display); font-size: .95rem; letter-spacing: .04em; }
.shop-item-desc  { font-family: var(--mono); font-size: .65rem; color: var(--muted); line-height: 1.4; flex: 1; }
.shop-item-tier  {
  font-family: var(--mono); font-size: .58rem; letter-spacing: .12em;
  padding: 2px 8px; border-radius: 4px; border: 1px solid;
  align-self: flex-start;
}
.shop-item-tier.tier-free     { color: #8d8d99; border-color: #44444f; }
.shop-item-tier.tier-pro      { color: var(--orange); border-color: #a05800; }
.shop-item-tier.tier-streamer { color: var(--gold);   border-color: #a08018; }
.shop-item-action {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  padding: 7px 12px; border-radius: 7px; border: 1px solid; cursor: pointer;
  background: none; color: var(--txt); transition: all .15s;
}
.shop-item-action.equip-btn { border-color: var(--orange); color: var(--orange); }
.shop-item-action.equip-btn:hover { background: rgba(255,138,0,.12); }
.shop-item-action.equipped-btn { border-color: var(--green); color: var(--green); cursor: default; }
.shop-item-action.locked-btn { border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.shop-lock-icon {
  position: absolute; top: 10px; right: 10px;
  font-size: .8rem; color: var(--muted);
}

/* ---- upgrade overlay ---- */
.upgrade-box {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px;
  padding: 32px 28px; width: min(720px, 96vw); text-align: center;
  position: relative; max-height: 90vh; overflow-y: auto;
}
.upgrade-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--muted); font-size: 1.1rem;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.upgrade-close:hover { color: var(--txt); }
.upgrade-reason {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .2em;
  color: var(--orange); margin-bottom: 8px;
}
.upgrade-title {
  font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.2rem);
  letter-spacing: .04em; margin-bottom: 22px;
}
.upgrade-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 14px;
}
.upgrade-tier-card {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 18px; text-align: left; display: flex; flex-direction: column; gap: 14px;
  position: relative;
}
.upgrade-tier-featured {
  border-color: var(--gold); box-shadow: 0 0 24px rgba(255,211,77,.15);
}
.utc-featured-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--grad); color: #16060a;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .15em;
  padding: 3px 12px; border-radius: 999px; white-space: nowrap;
}
.utc-header { display: flex; align-items: baseline; justify-content: space-between; }
.utc-badge {
  font-family: var(--display); font-size: 1.4rem; letter-spacing: .08em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.utc-price {
  font-family: var(--display); font-size: 1.5rem; color: var(--txt);
}
.utc-price span { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.utc-features {
  list-style: none; display: flex; flex-direction: column; gap: 7px; flex: 1;
}
.utc-features li {
  font-size: .85rem; color: var(--muted); padding-left: 16px; position: relative;
}
.utc-features li::before {
  content: '✓'; position: absolute; left: 0; color: var(--green);
  font-size: .75rem;
}

/* ---- arena skins (applied to body, scoped to match screen) ---- */
body.skin-cyber #screen-match {
  --red: #00c8ff; --orange: #0090ff;
  --grad: linear-gradient(95deg, #00c8ff, #0090ff);
  --bg-2: #0a0f1c; --bg-3: #0e1528; --line: #182848;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(0,200,255,.12), transparent 60%),
    radial-gradient(700px 400px at 85% 110%, rgba(0,144,255,.08), transparent 60%),
    #07090f;
  border-radius: 0;
}
body.skin-toxic #screen-match {
  --red: #4dff88; --orange: #7fff00;
  --grad: linear-gradient(95deg, #4dff88, #7fff00);
  --bg-2: #0a140d; --bg-3: #0d1e10; --line: #1a3020;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(77,255,136,.1), transparent 60%),
    radial-gradient(700px 400px at 85% 110%, rgba(127,255,0,.07), transparent 60%),
    #07100a;
  border-radius: 0;
}
body.skin-royal #screen-match {
  --red: #b060ff; --orange: #8030e0;
  --grad: linear-gradient(95deg, #b060ff, #8030e0);
  --bg-2: #0e0b18; --bg-3: #141020; --line: #2c1a50;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(176,96,255,.12), transparent 60%),
    radial-gradient(700px 400px at 85% 110%, rgba(128,48,224,.08), transparent 60%),
    #0a080f;
  border-radius: 0;
}
body.skin-chrome #screen-match {
  --red: #c0c0d0; --orange: #909099;
  --grad: linear-gradient(95deg, #d0d0e0, #888890);
  --bg-2: #0f0f11; --bg-3: #141416; --line: #303035;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(192,192,208,.08), transparent 60%),
    radial-gradient(700px 400px at 85% 110%, rgba(144,144,153,.06), transparent 60%),
    #0a0a0b;
  border-radius: 0;
}
body.skin-broadcast #screen-match {
  --red: #ffd34d; --orange: #ff8a00;
  --grad: linear-gradient(95deg, #ffd34d, #ff8a00);
  --bg-2: #0e0a06; --bg-3: #160f07; --line: #3a2a10;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(255,211,77,.1), transparent 60%),
    radial-gradient(700px 400px at 85% 110%, rgba(255,138,0,.08), transparent 60%),
    #0a0806;
  border-radius: 0;
}

/* ---- badge variants (applied to body, scoped to .rank-badge) ---- */
body.badge-animated .rank-badge {
  animation: badgePulse 2.2s ease infinite;
}
@keyframes badgePulse {
  0%,100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px currentColor; }
}
body.badge-fire .rank-badge {
  text-shadow: 0 0 6px currentColor;
  border-style: solid;
  animation: badgeFlicker 1.8s ease infinite;
}
@keyframes badgeFlicker {
  0%,100% { filter: brightness(1); }
  40% { filter: brightness(1.4); }
  60% { filter: brightness(.9); }
}
body.badge-ice .rank-badge {
  filter: hue-rotate(160deg) saturate(1.4);
  text-shadow: 0 0 8px rgba(100,200,255,.6);
}
body.badge-hologram .rank-badge {
  animation: hologram 3s linear infinite;
}
@keyframes hologram {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ---- verdict themes (applied to body, scoped to screen-verdict) ---- */
body.vtheme-fire #screen-verdict {
  --gold: #ff6a2e; --green: #ff8a00;
}
body.vtheme-fire #screen-verdict .verdict-card.winner {
  background: linear-gradient(180deg, rgba(255,70,20,.18), var(--bg-2));
  border-color: #ff4500; box-shadow: 0 0 40px rgba(255,69,0,.3);
}
body.vtheme-fire #screen-verdict .verdict-line {
  color: #ff6030;
}

body.vtheme-ice #screen-verdict {
  --gold: #a0d8ef; --green: #64c8ff;
}
body.vtheme-ice #screen-verdict .verdict-card.winner {
  background: linear-gradient(180deg, rgba(0,160,255,.14), var(--bg-2));
  border-color: #0090cc; box-shadow: 0 0 40px rgba(0,144,255,.25);
}
body.vtheme-ice #screen-verdict .verdict-line {
  color: #64c8ff;
}

body.vtheme-gold #screen-verdict .verdict-card.winner {
  background: linear-gradient(180deg, rgba(255,211,77,.2), var(--bg-2));
  border-color: var(--gold); box-shadow: 0 0 50px rgba(255,211,77,.35);
}
body.vtheme-gold #screen-verdict .score-grid .bar i {
  background: linear-gradient(90deg, var(--gold), #ff8a00);
}

body.vtheme-branded #screen-verdict .verdict-watermark span {
  color: var(--orange); border-color: rgba(255,138,0,.3);
  font-weight: 700; letter-spacing: .25em;
}

/* ---- responsive additions ---- */
@media (max-width: 760px) {
  .upgrade-grid { grid-template-columns: 1fr; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .streamer-tools { padding: 14px; }
}

/* ============ XP / LEVEL SYSTEM ============ */

/* Level badge — inline chip next to rank */
.lv-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid currentColor;
  opacity: .92;
  margin-top: 2px;
}
.lv-badge:empty { display: none; }

/* Tier colours */
.lv-t1 { color: #a0a0b0; border-color: #a0a0b030; background: #a0a0b012; }
.lv-t2 { color: #7ecf7e; border-color: #7ecf7e40; background: #7ecf7e14; }
.lv-t3 { color: #4db8ff; border-color: #4db8ff40; background: #4db8ff14; }
.lv-t4 { color: var(--gold); border-color: #ffd34d50; background: #ffd34d12; }
.lv-t5 { color: var(--orange); border-color: #ff8a0050; background: #ff8a0014; }
.lv-t6 {
  color: var(--red);
  border-color: #ff2e2e60;
  background: linear-gradient(90deg, #ff2e2e1a, #ff8a001a);
  text-shadow: 0 0 8px #ff2e2e80;
  animation: lvGlow 1.6s ease infinite;
}
@keyframes lvGlow {
  0%,100% { opacity: .9; }
  50% { opacity: 1; text-shadow: 0 0 14px #ff2e2ebb; }
}

/* XP panel on verdict screen */
.verdict-xp {
  width: 100%;
  max-width: 700px;
  margin: 16px auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.xp-row {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
}
.xp-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
}
.xp-row-header .xp-player { color: var(--txt); font-size: .85rem; }
.xp-earned {
  color: var(--gold);
  font-family: var(--mono);
  font-size: .75rem;
}
.xp-breakdown {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.xp-chip {
  font-size: .7rem;
  font-family: var(--mono);
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--muted);
}
.xp-chip.bonus { color: var(--gold); border-color: #ffd34d40; }
.xp-bar-wrap {
  background: var(--bg-3);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  position: relative;
}
.xp-bar-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 6px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  width: 0;
}
.xp-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: .65rem;
  color: var(--muted);
  margin-top: 5px;
}

/* Level-up overlay */
.levelup-box {
  text-align: center;
  gap: 20px;
}
.levelup-kicker {
  font-family: var(--display);
  font-size: clamp(1.2rem, 4vw, 2rem);
  letter-spacing: .15em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: levelupPop .5s ease;
}
.levelup-num {
  font-family: var(--display);
  font-size: clamp(3rem, 12vw, 6rem);
  line-height: 1;
  animation: levelupPop .5s .1s ease both;
}
.levelup-name {
  font-family: var(--mono);
  font-size: clamp(.9rem, 3vw, 1.4rem);
  color: var(--gold);
  letter-spacing: .1em;
  animation: levelupPop .5s .2s ease both;
}
@keyframes levelupPop {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* Profile screen */
.profile-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px;
}
.profile-hero {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.profile-name {
  font-family: var(--display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.profile-level-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.profile-xp-bar-wrap {
  background: var(--bg-3);
  border-radius: 8px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 6px;
}
.profile-xp-bar-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 8px;
  transition: width .7s cubic-bezier(.4,0,.2,1);
}
.profile-xp-label {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.profile-stat {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.profile-stat-val {
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 4px;
}
.profile-stat-lbl {
  font-size: .7rem;
  font-family: var(--mono);
  color: var(--muted);
  letter-spacing: .08em;
}

/* ============ FIRE UPGRADE PROMPT ============ */

.upgrade-fire-mode .upgrade-box {
  border-color: var(--orange);
  box-shadow: 0 0 40px rgba(255,138,0,.22), 0 0 80px rgba(255,46,46,.10);
}
.upgrade-fire-mode .upgrade-title {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.upgrade-fire-header {
  font-size: 2rem;
  letter-spacing: .1em;
  margin-bottom: 4px;
  animation: fireShake .35s ease infinite alternate;
}
@keyframes fireShake {
  from { transform: rotate(-3deg) scale(1.05); }
  to   { transform: rotate(3deg)  scale(1.1);  }
}
.upgrade-fire-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  letter-spacing: .1em;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}
.upgrade-fire-sub {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .06em;
  margin-bottom: 4px;
}

/* ============ CHALLENGE QUEUE ============ */

.challenge-queue-wrap {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.challenge-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.challenge-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}
.challenge-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
}
.challenge-name {
  flex: 1;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--txt);
}

/* overlay-link input in streamer tools */
.streamer-link-row { display: flex; gap: 8px; align-items: center; }
.streamer-link-val { flex: 1; min-width: 0; }

/* ============ CAMERA ============ */

.p-cam { position: relative; overflow: hidden; }

.p-cam-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: none;
  transform: scaleX(-1); /* selfie mirror */
}
.p-cam.cam-active .p-cam-video { display: block; }
.p-cam.cam-active .cam-ph { display: none; }

/* cam toggle button in match HUD */
.match-hud {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-cam-toggle {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .1em;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-cam-toggle:hover { color: var(--txt); border-color: var(--muted); }
.btn-cam-toggle.cam-on {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 10px rgba(77,255,136,.15);
}

/* ============ RESTORE SUBSCRIPTION ============ */

.restore-section {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}
.restore-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.restore-input {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--txt);
  font-family: var(--body);
  font-size: .85rem;
  padding: 9px 12px;
  border-radius: 8px;
  outline: none;
}
.restore-input:focus { border-color: var(--orange); }
.restore-status {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .08em;
  margin-top: 8px;
  min-height: 18px;
}
.restore-status.success { color: var(--green); }
.restore-status.error   { color: var(--red); }
