/* HotTake — Hot Charcoal theme. Moody late-night fireside lounge.
   Deep charcoal, glowing flame-orange + soft gold. Strict RTL. Zero emojis. */
:root {
  --bg: #09090b;
  --bg-2: #0d0d10;
  --panel: #141417;
  --panel-2: #1b1b20;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #f4f4f5;
  --mut: #a1a1aa;
  --mut-2: #71717a;
  --flame: #ff4500;
  --flame-2: #ff7a3c;
  --gold: #d4af37;
  --gold-2: #f2d675;
  --cold: #56a8ff;
  --ok: #46e0ac;
  --disp: 'Suez One', system-ui, serif;
  --ui: 'Rubik', system-ui, sans-serif;
  --r: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body {
  color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.45;
  background:
    radial-gradient(900px 600px at 82% -8%, rgba(255, 69, 0, .16), transparent 60%),
    radial-gradient(700px 520px at 8% 108%, rgba(212, 175, 55, .10), transparent 62%),
    var(--bg);
  -webkit-user-select: none; user-select: none;
}
#app { height: 100dvh; }
h1, h2, h3 { margin: 0; font-family: var(--disp); font-weight: 400; letter-spacing: -.01em; }
button, input, textarea { font-family: inherit; color: inherit; }
.ic { display: inline-block; vertical-align: -.14em; }

/* ---- buttons + fields ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px 20px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--panel-2); color: var(--ink); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform .12s, filter .15s, background .15s; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(145deg, var(--flame), #e03e00); border-color: transparent; color: #fff; box-shadow: 0 10px 30px rgba(255, 69, 0, .35); }
.btn.gold { background: linear-gradient(145deg, var(--gold-2), var(--gold)); border-color: transparent; color: #2a2205; box-shadow: 0 10px 28px rgba(212, 175, 55, .3); }
.btn.ghost { background: transparent; }
.btn.big { padding: 18px 24px; font-size: 18px; border-radius: 16px; width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.wide { width: 100%; }
.field {
  width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line-2);
  background: #0f0f12; color: var(--ink); font-size: 17px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--flame); box-shadow: 0 0 0 3px rgba(255, 69, 0, .18); }
textarea.field { resize: none; min-height: 84px; line-height: 1.5; }
.mut { color: var(--mut); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--mut); }

/* ---- generic mobile screen ---- */
.wrap { max-width: 460px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: calc(20px + var(--safe-t)) 18px calc(22px + var(--safe-b)); }
.grow { flex: 1; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }

/* ---- landing ---- */
.landing { align-items: center; text-align: center; gap: 6px; }
.landing .brandmark { filter: drop-shadow(0 8px 24px rgba(255, 69, 0, .4)); animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.landing h1 { font-size: 2.6rem; margin-top: 8px; }
.landing .sub { color: var(--gold-2); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; }
.landing .tag { color: var(--mut); max-width: 300px; margin: 6px auto 22px; }
.landing .actions { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--mut-2); font-size: 13px; margin: 6px 0; }
.divider::before, .divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.linkbtn { background: none; border: none; color: var(--gold-2); font-weight: 700; font-size: 15px; cursor: pointer; padding: 8px; }

/* ---- host / TV screen ---- */
.host { height: 100dvh; display: flex; flex-direction: column; padding: 3.2vh 3.6vw; overflow: hidden; }
.host-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.host-brand { display: flex; align-items: center; gap: 12px; }
.host-brand b { font-family: var(--disp); font-size: clamp(1.3rem, 2.4vw, 2rem); }
.host-brand .sub { color: var(--gold-2); font-size: .8rem; font-weight: 700; }
.host-code { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px 18px; }
.host-code .lbl { color: var(--mut); font-size: .8rem; font-weight: 700; }
.host-code .code { font-family: var(--disp); font-size: clamp(1.6rem, 3vw, 2.6rem); letter-spacing: .18em; color: var(--gold-2); }

/* host lobby */
.lobby-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4vw; align-items: center; }
.lobby-join { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.qr-card { background: #fff; padding: 16px; border-radius: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.qr-card svg { display: block; width: clamp(180px, 20vw, 300px); height: auto; }
.qr-hint { color: var(--mut); font-size: 1rem; text-align: center; }
.qr-hint b { color: var(--ink); }
.lobby-players h2 { font-size: clamp(1.2rem, 2vw, 1.8rem); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.plist { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; max-height: 62vh; overflow: auto; }
.pchip { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); animation: pop .3s cubic-bezier(.2, 1.3, .4, 1) both; }
.pchip .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #0b0b0d; font-size: 1rem; }
.pchip .nm { font-weight: 700; }
.pchip .lv { color: var(--gold-2); font-size: .75rem; font-weight: 800; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
.host-foot { display: flex; justify-content: center; padding-top: 2vh; }
.host-foot .btn { padding: 18px 44px; font-size: 1.2rem; }
.empty-hint { color: var(--mut); font-size: 1.1rem; padding: 30px; text-align: center; }

/* host round — take card + spectrum */
.round { flex: 1; display: flex; flex-direction: column; }
.take-card { text-align: center; padding: 2.2vh 4vw; margin: 1vh auto 2vh; max-width: 1100px; }
.take-cat { display: inline-block; color: var(--flame-2); font-weight: 800; letter-spacing: .08em; font-size: 1rem; margin-bottom: 10px; text-transform: uppercase; }
.take-text { font-family: var(--disp); font-size: clamp(1.8rem, 4.4vw, 3.8rem); line-height: 1.15; text-wrap: balance; }
.spectrum-wrap { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.spectrum { width: 100%; height: auto; display: block; }
.spectrum .vnode { transition: transform .42s cubic-bezier(.16, 1, .3, 1); }
.spectrum .vnode text { font-family: var(--ui); font-weight: 900; fill: #0b0b0d; text-anchor: middle; dominant-baseline: central; font-size: 19px; }
.spectrum .vnode circle { transition: r .2s; }
.spectrum .vnode.lockd circle { stroke: var(--gold-2); stroke-width: 4; }
.axis-labels { display: flex; justify-content: space-between; padding: 0 2%; margin-top: 6px; }
.axis-labels .lo { color: var(--flame-2); font-weight: 800; }
.axis-labels .hi { color: var(--ok); font-weight: 800; }
.axis-labels span { font-size: clamp(.9rem, 1.6vw, 1.3rem); }
.round-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 1.4vh; }
.votecount { color: var(--mut); font-weight: 700; font-size: 1.1rem; }
.votecount b { color: var(--ink); }

/* host showdown */
.showdown { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; }
.duel-timer { font-family: var(--disp); font-size: clamp(3rem, 9vw, 7rem); line-height: 1; color: var(--gold-2); text-shadow: 0 0 40px rgba(212, 175, 55, .5); }
.duel-timer.low { color: var(--flame); text-shadow: 0 0 40px rgba(255, 69, 0, .6); animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 3vw; align-items: center; width: 100%; max-width: 1100px; }
.debater { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 3vh 2vw; border-radius: 24px; background: var(--panel); border: 2px solid var(--line-2); animation: pop .4s both; }
.debater.cold { border-color: rgba(86, 168, 255, .5); box-shadow: 0 0 50px rgba(86, 168, 255, .18); }
.debater.hot { border-color: rgba(255, 69, 0, .55); box-shadow: 0 0 50px rgba(255, 69, 0, .2); }
.debater .av { width: clamp(64px, 8vw, 110px); height: clamp(64px, 8vw, 110px); border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #0b0b0d; font-size: clamp(1.8rem, 4vw, 3rem); }
.debater .nm { font-family: var(--disp); font-size: clamp(1.3rem, 2.6vw, 2.2rem); }
.debater .score { font-size: clamp(1rem, 1.8vw, 1.4rem); font-weight: 800; }
.debater.cold .score { color: var(--cold); }
.debater.hot .score { color: var(--flame-2); }
.duel-vs { font-family: var(--disp); font-size: clamp(1.4rem, 3vw, 2.6rem); color: var(--mut); }

/* thrown reaction badges layer */
.fx-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.fx { position: absolute; bottom: -10vh; will-change: transform, opacity; }
.fx .ic { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
@keyframes fxrise { 0% { transform: translateY(0) rotate(0) scale(.5); opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-118vh) rotate(var(--spin, 40deg)) scale(1.1); opacity: 0; } }

/* host results */
.results { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.results h2 { font-size: clamp(1.6rem, 3.4vw, 2.8rem); }
.board { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 10px; }
.board-row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.board-row .rk { font-family: var(--disp); font-size: 1.4rem; color: var(--gold-2); width: 34px; text-align: center; }
.board-row .nm { flex: 1; font-weight: 700; font-size: 1.15rem; }
.board-row .cr { color: var(--gold-2); font-weight: 800; display: flex; align-items: center; gap: 6px; }
.board-row.win { border-color: var(--gold); box-shadow: 0 0 26px rgba(212, 175, 55, .18); }

/* ---- player controller ---- */
.player { height: 100dvh; display: flex; flex-direction: column; }
.p-head { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 18px 12px; border-bottom: 1px solid var(--line); }
.p-head .me { display: flex; align-items: center; gap: 10px; }
.p-head .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #0b0b0d; }
.p-head .nm { font-weight: 800; }
.p-head .title { color: var(--gold-2); font-size: .72rem; font-weight: 800; }
.wallet { display: flex; align-items: center; gap: 6px; color: var(--gold-2); font-weight: 800; }
.p-body { flex: 1; overflow-y: auto; padding: 20px 18px calc(24px + var(--safe-b)); display: flex; flex-direction: column; }
.waiting { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.waiting .spin { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--line-2); border-top-color: var(--flame); animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* slider stage */
.take-mini { text-align: center; margin-bottom: 8px; }
.take-mini .cat { color: var(--flame-2); font-weight: 800; font-size: .8rem; letter-spacing: .06em; }
.take-mini .txt { font-family: var(--disp); font-size: 1.5rem; line-height: 1.2; margin-top: 6px; text-wrap: balance; }
.slider-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.bigval { text-align: center; }
.bigval .n { font-family: var(--disp); font-size: 5.2rem; line-height: 1; background: linear-gradient(180deg, var(--gold-2), var(--flame)); -webkit-background-clip: text; background-clip: text; color: transparent; transition: transform .12s; }
.bigval .cap { color: var(--mut); font-weight: 700; margin-top: 2px; min-height: 1.4em; }
.hslider { position: relative; padding: 6px 4px; }
.hslider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; border-radius: 999px; outline: none;
  background: linear-gradient(90deg, var(--ok), var(--gold) 50%, var(--flame)); }
.hslider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 46px; height: 46px; border-radius: 50%; cursor: grab;
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 55%, var(--flame)); border: 3px solid #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .5), 0 0 0 6px rgba(255, 69, 0, .12); display: grid; place-items: center; }
.hslider input[type=range]::-moz-range-thumb { width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 55%, var(--flame)); border: 3px solid #fff; box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.hslider .knob-ic { position: absolute; top: 50%; pointer-events: none; transform: translate(50%, -50%); color: var(--flame); z-index: 3; transition: right .05s linear; }
.ends { display: flex; justify-content: space-between; margin-top: 4px; }
.ends .end { max-width: 44%; }
.ends .lo { color: var(--flame-2); text-align: right; }
.ends .hi { color: var(--ok); text-align: left; }
.ends .n { font-family: var(--disp); font-size: 1.2rem; }
.ends .t { font-size: .82rem; font-weight: 700; color: var(--mut); }
.locked-badge { text-align: center; color: var(--ok); font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* debate on phone */
.debate-you { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.debate-you .big { font-family: var(--disp); font-size: 2rem; }
.debate-you .side { padding: 8px 18px; border-radius: 999px; font-weight: 800; }
.debate-you .side.cold { background: rgba(86, 168, 255, .16); color: var(--cold); }
.debate-you .side.hot { background: rgba(255, 69, 0, .16); color: var(--flame-2); }
.react-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.react-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px 12px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel); font-weight: 800; cursor: pointer; transition: transform .1s, background .15s; }
.react-btn:active { transform: scale(.93); background: var(--panel-2); }
.react-btn .ic { color: var(--flame); }
.react-btn.gold .ic { color: var(--gold-2); }
.react-btn span { font-size: .95rem; }
.react-head { text-align: center; margin-bottom: 16px; }
.react-head .txt { font-weight: 700; color: var(--mut); }

/* custom take submit */
.submit-take { margin-top: auto; padding-top: 16px; }
.submit-take .lbl { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--mut); margin-bottom: 8px; font-size: .95rem; }

/* profile + shop */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head .av { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #0b0b0d; font-size: 1.6rem; }
.profile-head .nm { font-family: var(--disp); font-size: 1.5rem; }
.xpbar { height: 10px; border-radius: 999px; background: var(--panel-2); overflow: hidden; margin: 4px 0 3px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--flame)); border-radius: 999px; transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.wallet-big { display: flex; align-items: center; gap: 8px; color: var(--gold-2); font-weight: 800; font-size: 1.2rem; }
.tabs { display: flex; gap: 8px; margin: 18px 0 14px; }
.tab { flex: 1; padding: 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-weight: 700; color: var(--mut); cursor: pointer; text-align: center; }
.tab.on { background: var(--panel-2); border-color: var(--flame); color: var(--ink); }
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shop-card { padding: 16px 12px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.shop-card.equipped { border-color: var(--gold); box-shadow: 0 0 20px rgba(212, 175, 55, .18); }
.shop-card .preview { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: #0f0f12; color: var(--gold-2); }
.shop-card .cname { font-weight: 800; font-size: .95rem; }
.shop-card .titletag { font-family: var(--disp); color: var(--gold-2); font-size: 1.1rem; }
.shop-card .buy { width: 100%; padding: 9px; border-radius: 10px; border: none; font-weight: 800; cursor: pointer; background: var(--panel-2); color: var(--gold-2); }
.shop-card .buy.own { background: transparent; color: var(--ok); border: 1px solid var(--line-2); }
.shop-card .buy.eq { background: linear-gradient(145deg, var(--gold-2), var(--gold)); color: #2a2205; }
.shop-card .buy[disabled] { opacity: .45; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translate(-50%, 20px); z-index: 90;
  background: #000; border: 1px solid var(--line-2); color: var(--ink); padding: 12px 20px; border-radius: 14px; font-weight: 700;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6); opacity: 0; transition: opacity .22s, transform .22s; max-width: 88vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--flame); }

/* small gained flash */
.gain-flash { position: fixed; inset: 0; display: grid; place-items: center; z-index: 95; pointer-events: none; }
.gain-flash .card { background: var(--panel); border: 1px solid var(--gold); border-radius: 22px; padding: 26px 34px; text-align: center; animation: gpop .5s cubic-bezier(.2, 1.3, .4, 1) both; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.gain-flash .g { font-family: var(--disp); font-size: 2rem; color: var(--gold-2); }
@keyframes gpop { from { opacity: 0; transform: scale(.7); } }

@media (max-width: 720px) {
  .lobby-body { grid-template-columns: 1fr; gap: 20px; }
  .lobby-players { display: none; }
  .duel { grid-template-columns: 1fr; }
  .duel-vs { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; } }
