/* اسم‌فامیل — Yalda-night theme.
   Palette: night indigo, pomegranate ruby, gold leaf, feyrouzeh turquoise, parchment. */

@font-face {
  font-family: 'Vazirmatn';
  src: url('/fonts/Vazirmatn.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --night-0: #0b0519; --night-1: #170a35; --night-2: #2a0f48;
  --wine: #4a0e2e; --wine-2: #701239;
  --ruby: #c8102e; --ruby-2: #e5243b; --ruby-dark: #8f0f2a;
  --gold: #f2c14e; --gold-2: #ffe29a; --gold-dark: #b8892b;
  --turq: #2bb5a6; --turq-2: #5ad6c8; --lapis: #26418f;
  --paper: #fbf1dc; --paper-2: #f3e3c3;
  --ink: #2a1233; --ink-2: #6a4a6e;
  --ok: #1f8a4c; --bad: #c8102e;
  --girih: none;
  --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 { margin: 0; min-height: 100%; }
body {
  font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  color: #fff;
  background: var(--night-0);
  direction: rtl;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 70% at 85% -5%, #43186f 0%, transparent 60%),
    radial-gradient(100% 60% at 0% 105%, #701239 0%, transparent 62%),
    linear-gradient(180deg, #0b0519 0%, #1b0b3a 55%, #2f0f3d 100%);
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--girih); background-size: 88px 88px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
button { font-family: inherit; }
.ico { width: 22px; height: 22px; flex: none; }

#app { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 14px calc(var(--safe-b) + 18px); }
.screen { width: 100%; max-width: 560px; margin: 0 auto; flex: 1; display: flex; flex-direction: column; gap: 14px; animation: screenIn .45s both; }
.screen.wide { max-width: 700px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.spacer { flex: 1; }
.center { text-align: center; }
.muted { color: rgba(255, 255, 255, .7); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------ buttons */
.btn {
  appearance: none; border: 0; cursor: pointer; font-weight: 700; font-size: 1rem; color: #fff;
  border-radius: 999px; padding: 13px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, filter .2s, box-shadow .2s; user-select: none; position: relative;
}
.btn:active:not([disabled]) { transform: translateY(2px) scale(.98); }
.btn[disabled] { filter: grayscale(.7) brightness(.8); cursor: not-allowed; opacity: .75; }
.btn-primary { background: linear-gradient(180deg, var(--ruby-2), var(--ruby-dark)); box-shadow: 0 0 0 2px var(--gold) inset, 0 6px 18px rgba(200, 16, 46, .45), 0 2px 0 #5d0716; }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3a1c0a; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35) inset, 0 6px 16px rgba(242, 193, 78, .35), 0 2px 0 var(--gold-dark); }
.btn-turq { background: linear-gradient(180deg, var(--turq-2), var(--turq)); color: #05302c; box-shadow: 0 0 0 2px rgba(255, 255, 255, .35) inset, 0 6px 16px rgba(43, 181, 166, .35), 0 2px 0 #167a70; }
.btn-ghost { background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1.5px rgba(242, 193, 78, .5) inset; }
.btn-lg { font-size: 1.2rem; padding: 16px 28px; }
.btn-sm { font-size: .85rem; padding: 8px 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(242, 193, 78, .4); color: #fff; cursor: pointer; flex: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.on { background: var(--turq); color: #05302c; border-color: #fff5; }
.icon-btn.warn { background: var(--ruby); }

/* ------------------------------------------------------------ cards, inputs */
.card { position: relative; border-radius: 18px; padding: 16px; background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04)); border: 1.5px solid rgba(242, 193, 78, .35); backdrop-filter: blur(6px); }
.paper {
  background: var(--paper); color: var(--ink); border: 2px solid var(--gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 0 0 5px var(--paper), inset 0 0 0 6.5px rgba(184, 137, 43, .55);
  backdrop-filter: none;
}
.h { font-size: 1.02rem; font-weight: 800; color: var(--gold-2); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.paper .h { color: var(--wine-2); }
.divider { width: 160px; height: 18px; margin: 0 auto; display: block; opacity: .9; }

.field {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--gold-dark);
  background: #fff9ea; color: var(--ink); outline: none; transition: box-shadow .2s, border-color .2s, background .2s;
}
.field:focus { border-color: var(--turq); box-shadow: 0 0 0 4px rgba(43, 181, 166, .25); }
.field::placeholder { color: #a58a9c; }
.field.dark { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(242, 193, 78, .7); }
.field.dark::placeholder { color: rgba(255, 255, 255, .5); }
.field.code { text-align: center; letter-spacing: .3em; font-weight: 800; font-size: 1.3rem; direction: ltr; }
select.sel { width: 100%; font: inherit; font-size: .95rem; padding: 9px 10px; border-radius: 12px; border: 1.5px solid rgba(242, 193, 78, .6); background: rgba(0, 0, 0, .3); color: #fff; outline: none; }
select.sel option { color: #2a1233; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1.5px solid rgba(242, 193, 78, .5); background: rgba(255, 255, 255, .06); color: #fff; font-size: .92rem; cursor: pointer; transition: all .15s; }
.chip.on { background: linear-gradient(180deg, var(--turq-2), var(--turq)); color: #06302c; border-color: rgba(255, 255, 255, .35); font-weight: 800; box-shadow: 0 4px 12px rgba(43, 181, 166, .35); }
.chip.static { cursor: default; }
.chip .x { margin-inline-start: 6px; opacity: .7; }
.seg { display: flex; background: rgba(0, 0, 0, .28); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; font-size: .9rem; padding: 9px 6px; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .7); cursor: pointer; transition: all .15s; }
.seg button.on { background: var(--gold); color: #3a1c0a; font-weight: 800; }
.set-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.set-label { font-size: .85rem; color: var(--gold-2); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
input[type=range] { width: 100%; accent-color: var(--gold); }

/* ------------------------------------------------------------ avatar */
.avatar { position: relative; display: inline-block; width: var(--s, 56px); height: var(--s, 56px); border-radius: 50%; flex: none; overflow: hidden; box-shadow: 0 0 0 2px var(--gold), 0 4px 10px rgba(0, 0, 0, .4); transition: box-shadow .2s, filter .3s; }
.avatar .av-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.avatar .av-art { position: absolute; inset: 14%; width: 72%; height: 72%; }
.avatar .av-wide { inset: 22% 8%; width: 84%; height: 56%; }
.avatar .av-tall { inset: 6% 24%; width: 52%; height: 88%; }
.avatar .av-spark { position: absolute; width: 26%; height: 26%; right: 14%; top: 12%; animation: twinkle 2s infinite; }
.avatar.speaking { box-shadow: 0 0 0 3px var(--turq-2), 0 0 0 7px rgba(90, 214, 200, .35); animation: speak .8s infinite; }
.avatar.off { filter: grayscale(1) opacity(.45); }
.av-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; justify-items: center; padding: 6px 0 10px; }
.av-pick::-webkit-scrollbar { display: none; }
.av-pick button { border: 0; background: none; padding: 3px; border-radius: 50%; cursor: pointer; transition: transform .15s; }
.av-pick button.on { transform: scale(1.14); background: radial-gradient(circle, rgba(242, 193, 78, .5), transparent 70%); }
.av-pick button:not(.on) { opacity: .65; }

/* ------------------------------------------------------------ top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.title-sm { font-weight: 800; font-size: 1.05rem; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: rgba(242, 193, 78, .2); border: 1px solid rgba(242, 193, 78, .6); color: var(--gold-2); }
.pill.prem { background: linear-gradient(90deg, var(--gold), var(--gold-2)); color: #3a1c0a; border-color: #fff6; }

/* ------------------------------------------------------------ home */
.hero { position: relative; height: 250px; margin: 0 -14px; }
.hero-svg { width: 100%; height: 100%; display: block; }
.logo { text-align: center; margin: -6px 0 0; }
.logo h1 {
  margin: 0; font-size: clamp(2.8rem, 12vw, 4rem); font-weight: 900; line-height: 1.25;
  background: linear-gradient(180deg, #fff6d0 0%, #f2c14e 55%, #b8892b 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 #5d0716) drop-shadow(0 10px 18px rgba(0, 0, 0, .5));
}
.logo p { margin: 2px 0 0; color: var(--gold-2); font-size: .98rem; }
.how { color: var(--gold-2); text-decoration: underline; text-underline-offset: 4px; background: none; border: 0; cursor: pointer; font-size: .9rem; }

/* ------------------------------------------------------------ lobby */
.code-card { text-align: center; }
.code-digits { font-size: 2.8rem; font-weight: 900; letter-spacing: .18em; color: var(--gold-2); text-shadow: 0 0 22px rgba(242, 193, 78, .55); direction: ltr; line-height: 1.3; }
.players { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.pl { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; position: relative; min-width: 0; animation: popIn .4s both; }
.pl .nm { font-size: .8rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl .crown-badge { position: absolute; top: -13px; left: 50%; width: 24px; transform: translateX(-50%) rotate(-8deg); z-index: 2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.pl .kick { position: absolute; top: -4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ruby); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; z-index: 2; }
.pl .kick .ico { width: 12px; height: 12px; }
.pl .mic-dot { position: absolute; bottom: 18px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--turq); color: #05302c; display: grid; place-items: center; z-index: 2; }
.pl .mic-dot .ico { width: 11px; height: 11px; }
.slot { width: 56px; height: 56px; border-radius: 50%; border: 2px dashed rgba(242, 193, 78, .4); display: grid; place-items: center; color: rgba(255, 255, 255, .4); }
.slot.locked { border-style: solid; border-color: rgba(242, 193, 78, .35); background: rgba(0, 0, 0, .25); color: var(--gold); cursor: pointer; }
.slot .ico { width: 20px; height: 20px; }
.upsell { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(90deg, rgba(242, 193, 78, .22), rgba(200, 16, 46, .18)); border: 1.5px solid var(--gold); cursor: pointer; }
.rb { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rb label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: rgba(255, 255, 255, .85); }
.pv { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pv .b { padding: 3px 11px; border-radius: 999px; font-size: .8rem; background: rgba(43, 181, 166, .2); border: 1px solid var(--turq); }
.pv .b.zero { background: rgba(200, 16, 46, .22); border-color: var(--ruby-2); color: #ffc0c9; }
.pv .b.unk { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .4); }
.level-hint { font-size: .8rem; color: rgba(255, 255, 255, .75); }
.cat-add { display: flex; gap: 8px; }
.cat-add .field { padding: 8px 12px; font-size: .95rem; }

.voicebar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1.5px solid rgba(242, 193, 78, .35); }
.voicebar .st { flex: 1; font-size: .82rem; color: rgba(255, 255, 255, .85); }

/* ------------------------------------------------------------ round */
.round-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rno { font-weight: 800; font-size: 1.1rem; }
.ring { position: relative; width: 78px; height: 78px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { stroke: rgba(255, 255, 255, .15); }
.ring .arc { stroke: var(--gold); transition: stroke-dashoffset .25s linear, stroke .3s; stroke-linecap: round; }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 1.35rem; }
.ring.low .arc { stroke: var(--ruby-2); }
.ring.low { animation: pulse .6s infinite; }
.rules { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: tileIn .6s both; animation-delay: calc(var(--i, 0) * .14s); }
.tile .art { position: relative; width: 86px; height: 86px; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)); }
.tile .art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile .gl { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.3rem; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.tile .cp { font-size: .74rem; color: #fff; background: rgba(0, 0, 0, .4); padding: 1px 10px; border-radius: 999px; }
.rule-text { text-align: center; color: var(--gold-2); font-weight: 600; font-size: .95rem; }
.ans { display: flex; flex-direction: column; gap: 12px; }
.ans-row { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; }
.ans-row .lb { font-weight: 800; color: var(--wine-2); font-size: .95rem; }
.inp { position: relative; }
.inp .field { padding-inline-end: 14px; padding-inline-start: 84px; }
.inp .st { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.inp .st .ico { width: 22px; height: 22px; }
.ans-row.ok .field { border-color: var(--ok); background: #f1fff4; }
.ans-row.ok .st { color: var(--ok); }
.ans-row.bad .field { border-color: var(--bad); background: #fff0f0; }
.ans-row.bad .st { color: var(--bad); }
.ans-row.off { opacity: .5; }
.ans-row.off .field, .ans-row.na .field { background: #e6dcc6; }
.ans-row.off .lb::after { content: ' 🚫'; }
.ans-msg { grid-column: 2; font-size: .75rem; color: var(--bad); margin-top: -4px; min-height: 0; }
.noans { font-size: .72rem; border: 1.5px dashed var(--ink-2); background: rgba(255, 249, 234, .9); color: var(--ink-2); border-radius: 999px; padding: 3px 9px; cursor: pointer; white-space: nowrap; }
.noans.on { background: var(--ink-2); color: #fff; border-style: solid; }
.stop-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 6px 0 2px; }
.stop {
  width: 150px; height: 150px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; font-weight: 900; font-size: 1.9rem; position: relative;
  background: radial-gradient(circle at 35% 28%, #ff7384, #d11a38 50%, #7d0a1f);
  box-shadow: 0 0 0 4px var(--gold), 0 0 0 9px rgba(242, 193, 78, .22), 0 14px 30px rgba(200, 16, 46, .5), inset 0 -8px 18px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; transition: transform .1s;
}
.stop svg { width: 46px; height: 32px; margin-bottom: -2px; }
.stop:active:not([disabled]) { transform: scale(.94); }
.stop[disabled] { filter: grayscale(.85) brightness(.5); box-shadow: 0 0 0 4px #6a5a3a; cursor: not-allowed; }
.stop:not([disabled]) { animation: stopPulse 1.1s infinite; }
.stop-hint { font-size: .88rem; color: rgba(255, 255, 255, .8); min-height: 1.4em; text-align: center; }
.strip { display: flex; gap: 12px; overflow-x: auto; padding: 6px 4px; justify-content: center; }
.pp { width: 58px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; flex: none; }
.pp .bar { width: 100%; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.pp .bar i { display: block; height: 100%; background: var(--turq-2); width: var(--p, 0%); transition: width .3s; }
.pp.done .bar i { background: var(--gold); }
.pp.stopper .avatar { box-shadow: 0 0 0 3px var(--ruby-2), 0 0 16px var(--ruby); }
.pp .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(11, 5, 25, .74); backdrop-filter: blur(5px); z-index: 50; text-align: center; }
.count-num { font-size: 9rem; font-weight: 900; line-height: 1; color: var(--gold-2); text-shadow: 0 0 40px rgba(242, 193, 78, .7); animation: pop 1s both; }
.count-label { font-size: 1.1rem; color: #fff; margin-top: 6px; }
.grace { position: sticky; top: calc(var(--safe-t) + 6px); z-index: 30; background: linear-gradient(180deg, var(--ruby-2), var(--ruby-dark)); border: 2px solid var(--gold); border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; animation: shake .5s; box-shadow: 0 10px 24px rgba(0, 0, 0, .4); }
.grace .ico { width: 28px; height: 28px; color: var(--gold-2); }
.grace b { font-size: 1.05rem; }
.lantern-spin { display: grid; place-items: center; padding: 30px 0; }
.lantern-big { width: 90px; height: 180px; transform-origin: 50% 0; filter: drop-shadow(0 0 24px rgba(255, 166, 61, .6)); }

/* ------------------------------------------------------------ voting */
.vbar { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.vbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--ruby-2)); width: 100%; transition: width .25s linear; }
.vrow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed rgba(106, 74, 110, .3); }
.vrow:last-child { border-bottom: 0; }
.vrow .who { font-size: .72rem; color: var(--ink-2); }
.vrow .vtext { flex: 1; font-weight: 800; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.vrow .why { font-size: .72rem; color: var(--bad); font-weight: 400; display: block; }
.vrow.invalid .vtext { text-decoration: line-through; opacity: .6; }
.bd { font-size: .72rem; padding: 3px 10px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.bd.ok { background: #d8f3e3; color: #12633a; }
.bd.no { background: #ffe0e4; color: #a50f27; }
.bd.wait { background: #fff0c9; color: #7a5a05; }
.bd.ai { background: #e6e0ff; color: #3a2a8a; }
.vbtns { display: flex; gap: 8px; }
.vbtn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid; display: grid; place-items: center; background: #fff; cursor: pointer; transition: transform .12s, background .15s; padding: 0; }
.vbtn:active { transform: scale(.9); }
.vbtn.yes { border-color: var(--ok); color: var(--ok); }
.vbtn.no { border-color: var(--bad); color: var(--bad); }
.vbtn.yes.on { background: var(--ok); color: #fff; }
.vbtn.no.on { background: var(--bad); color: #fff; }

/* ------------------------------------------------------------ results */
.rwin { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 12px; border-radius: 16px; background: linear-gradient(90deg, rgba(242, 193, 78, .22), rgba(200, 16, 46, .2)); border: 1.5px solid var(--gold); animation: glow 2s infinite; text-align: center; }
.rwin .crown-ico { width: 38px; animation: crownDrop .8s both; }
.rrow { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed rgba(106, 74, 110, .3); }
.rrow:last-child { border-bottom: 0; }
.rrow .tx { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.rrow .tx small { display: block; font-weight: 400; color: var(--ink-2); font-size: .72rem; }
.rrow.zero .tx b { text-decoration: line-through; opacity: .55; }
.pts { font-weight: 900; min-width: 52px; text-align: center; border-radius: 999px; padding: 3px 10px; background: #d8f3e3; color: #12633a; animation: pointPop .55s both; animation-delay: calc(var(--i, 0) * .05s); }
.pts.z { background: #eadfca; color: #8a7a60; }
.pts.dup { background: #fff0c9; color: #7a5a05; }
.pts.sole { background: linear-gradient(90deg, #ffe29a, #f2c14e); color: #5a3a05; }
.pts.bonus { background: #e6e0ff; color: #3a2a8a; }
.cat-title { display: flex; justify-content: space-between; align-items: center; }
.cat-title .tag { font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #eadfca; color: var(--ink-2); }
.sb-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); margin-bottom: 8px; animation: slideUp .5s both; animation-delay: calc(var(--i, 0) * .08s); }
.sb-row.leader { background: linear-gradient(90deg, rgba(242, 193, 78, .26), rgba(255, 255, 255, .07)); box-shadow: 0 0 0 1.5px var(--gold) inset; }
.sb-row.me { box-shadow: 0 0 0 1.5px var(--turq-2) inset; }
.rank { font-weight: 900; width: 26px; text-align: center; color: var(--gold); }
.sb-name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-score { font-weight: 900; font-size: 1.25rem; min-width: 44px; text-align: center; }
.delta { color: var(--turq-2); font-weight: 800; font-size: .85rem; min-width: 36px; }
.sugg { display: flex; gap: 12px; align-items: flex-start; }
.sugg svg { width: 38px; height: 76px; flex: none; }
.sugg ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sugg li b { color: var(--wine-2); }
.reacts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.reacts button { font-size: 1.5rem; background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(242, 193, 78, .3); border-radius: 50%; width: 46px; height: 46px; cursor: pointer; transition: transform .12s; }
.reacts button:active { transform: scale(1.25); }
.float-emoji { position: fixed; bottom: 90px; font-size: 2.2rem; pointer-events: none; animation: floatUp 2.4s ease-out forwards; z-index: 60; }
.float-emoji small { display: block; font-size: .65rem; text-align: center; color: #fff; text-shadow: 0 1px 3px #000; }

/* ------------------------------------------------------------ final */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; height: 270px; }
.pod { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 94px; gap: 4px; }
.pod .who { text-align: center; font-size: .82rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: popIn .5s both; animation-delay: var(--dl); }
.pod .col { width: 100%; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; align-items: center; padding-top: 8px; font-weight: 900; font-size: 1.1rem; transform-origin: bottom; animation: rise .9s cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: var(--dl); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35); color: #2a1233; }
.pod.p1 .col { height: 130px; background: linear-gradient(180deg, var(--gold-2), var(--gold-dark)); }
.pod.p2 .col { height: 96px; background: linear-gradient(180deg, #eef3f8, #8c9bb0); }
.pod.p3 .col { height: 72px; background: linear-gradient(180deg, #efc09a, #9a5a30); }
.pod .crown-top { width: 40px; animation: crownDrop .8s 1s both; margin-bottom: -2px; }
.scene { position: relative; height: 290px; display: grid; place-items: center; overflow: hidden; }
.scene.win .rays { position: absolute; width: 540px; height: 540px; border-radius: 50%; background: repeating-conic-gradient(from 0deg, rgba(242, 193, 78, .3) 0 8deg, transparent 8deg 20deg); animation: spin 24s linear infinite; -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 68%); mask-image: radial-gradient(circle, #000 20%, transparent 68%); }
.win-core { position: relative; width: 180px; height: 200px; }
.win-pom { position: absolute; bottom: 0; left: 50%; width: 156px; transform: translateX(-50%) scale(.15); animation: pomIn 1s .2s cubic-bezier(.2, 1.4, .4, 1) forwards; filter: drop-shadow(0 0 26px rgba(200, 16, 46, .6)); }
.win-crown { position: absolute; top: -14px; left: 50%; width: 92px; opacity: 0; transform: translateX(-50%) translateY(-140px) rotate(-14deg); animation: crownLand 1s .9s cubic-bezier(.3, 1.5, .5, 1) forwards; z-index: 2; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.seed { position: absolute; left: 50%; top: 62%; width: var(--s); height: var(--s); margin: -5px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9aa6, #c8102e); opacity: 0; animation: burst 1.7s var(--d) 1s cubic-bezier(.2, .7, .4, 1) forwards; }
.seed-glint { animation: glint 2.4s infinite; }
.spark { position: absolute; left: 50%; top: 50%; width: 26px; opacity: 0; animation: sparkOut 2.4s calc(var(--i) * .22s + 1s) infinite; }
.spark svg { width: 100%; }
.scene.lose .cloud { position: absolute; top: 8px; width: 210px; animation: floaty 4s ease-in-out infinite; }
.rain { position: absolute; top: 66px; width: 200px; height: 170px; overflow: hidden; }
.drop { position: absolute; top: -14px; left: var(--x); width: 3px; height: 14px; border-radius: 3px; background: linear-gradient(#b7dcff, #5aa4ff); animation: rain var(--d) var(--delay) linear infinite; }
.wilted { position: absolute; bottom: 0; width: 170px; }
.wilted .head { animation: droop 2.4s .4s ease-in forwards; }
.wilted .petal { opacity: 0; animation: petalFall 3.2s infinite; }
.wilted .p2 { animation-delay: 1.4s; }
.confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 45; }
.confetto { position: absolute; top: -20px; left: var(--x); width: var(--w); height: calc(var(--w) * 1.6); background: var(--c); border-radius: 50% 50% 50% 0; opacity: .95; animation: fall var(--d) var(--delay) linear forwards; }
.confetto.c1 { border-radius: 2px; height: calc(var(--w) * .7); }
.confetto.c2 { border-radius: 50%; height: var(--w); }
.banner-win { font-size: 1.7rem; font-weight: 900; text-align: center; color: var(--gold-2); text-shadow: 0 0 24px rgba(242, 193, 78, .6); }
.banner-lose { font-size: 1.5rem; font-weight: 800; text-align: center; color: #cfc8f2; }

/* ------------------------------------------------------------ overlays */
.toast { position: fixed; top: calc(var(--safe-t) + 12px); left: 50%; transform: translateX(-50%); background: var(--paper); color: var(--ink); padding: 10px 18px; border-radius: 14px; border: 2px solid var(--gold); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); z-index: 120; max-width: 90vw; text-align: center; font-weight: 600; animation: toastIn .3s both; }
.toast.bad { border-color: var(--ruby); }
.toast.good { border-color: var(--turq); }
.sheet-back { position: fixed; inset: 0; background: rgba(5, 2, 15, .72); z-index: 90; display: grid; align-items: end; animation: fadeIn .2s both; }
.sheet { background: var(--paper); color: var(--ink); border-radius: 26px 26px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); max-height: 92dvh; overflow: auto; animation: sheetUp .35s cubic-bezier(.2, .9, .3, 1) both; border-top: 3px solid var(--gold); width: 100%; max-width: 560px; margin: 0 auto; }
.sheet h2 { margin: 0 0 4px; font-size: 1.3rem; color: var(--wine-2); text-align: center; }
.sheet .sub { text-align: center; color: var(--ink-2); font-size: .9rem; margin-bottom: 12px; }
.sheet ul { padding-inline-start: 20px; margin: 8px 0; color: var(--ink); }
.sheet li { margin-bottom: 4px; }
.plans { display: grid; gap: 12px; margin: 14px 0; }
.plan { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-radius: 16px; border: 2px solid var(--gold-dark); background: #fff9ea; position: relative; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.plan.on { box-shadow: 0 0 0 4px rgba(43, 181, 166, .55); transform: scale(1.015); }
.plan .badge { position: absolute; top: -11px; left: 14px; background: var(--ruby); color: #fff; font-size: .7rem; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.plan b { font-size: 1.05rem; }
.plan .price { font-weight: 900; color: var(--wine-2); font-size: 1.1rem; }
.sheet .btn-ghost { background: rgba(42, 18, 51, .08); box-shadow: 0 0 0 1.5px var(--gold-dark) inset; color: var(--ink); }
.net { position: fixed; top: 0; left: 0; right: 0; z-index: 130; background: var(--ruby); color: #fff; text-align: center; padding: calc(var(--safe-t) + 6px) 10px 6px; font-weight: 700; font-size: .88rem; }
.a2hs { display: flex; gap: 10px; align-items: center; background: rgba(43, 181, 166, .18); border: 1.5px solid var(--turq); border-radius: 14px; padding: 10px 12px; font-size: .85rem; }

/* ------------------------------------------------------------ hero animations */
.sway { animation: sway 4.5s ease-in-out infinite; }
.sway.slow { animation-duration: 6.2s; animation-delay: -2s; }
.float { animation: floaty 5s ease-in-out infinite; }
.twinkle { animation: twinkle 2.6s ease-in-out infinite; }
.flame { animation: flame 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.steam { animation: steam 2.4s ease-in-out infinite; }

@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes twinkle { 0%, 100% { opacity: .3; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes flame { 0%, 100% { transform: scale(1, 1); opacity: .9; } 50% { transform: scale(.88, 1.2); opacity: 1; } }
@keyframes steam { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: .85; transform: translateY(-4px); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes speak { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes stopPulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--gold), 0 0 0 9px rgba(242, 193, 78, .22), 0 14px 30px rgba(200, 16, 46, .5), inset 0 -8px 18px rgba(0, 0, 0, .35); }
  50% { box-shadow: 0 0 0 4px var(--gold), 0 0 0 20px rgba(242, 193, 78, 0), 0 14px 44px rgba(255, 60, 90, .8), inset 0 -8px 18px rgba(0, 0, 0, .35); }
}
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 35% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(.9); opacity: .15; } }
@keyframes popIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes tileIn { from { opacity: 0; transform: translateY(-30px) rotate(-12deg) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pointPop { 0% { opacity: 0; transform: scale(.3) translateY(8px); } 60% { transform: scale(1.25); } 100% { opacity: 1; transform: scale(1); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 rgba(242, 193, 78, 0); } 50% { box-shadow: 0 0 26px rgba(242, 193, 78, .55); } }
@keyframes crownDrop { 0% { transform: translateY(-40px) rotate(-20deg); opacity: 0; } 70% { transform: translateY(4px) rotate(6deg); opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pomIn { 0% { transform: translateX(-50%) scale(.15) rotate(-30deg); } 100% { transform: translateX(-50%) scale(1) rotate(0); } }
@keyframes crownLand { 0% { opacity: 0; transform: translateX(-50%) translateY(-140px) rotate(-14deg); } 70% { opacity: 1; transform: translateX(-50%) translateY(6px) rotate(4deg); } 100% { opacity: 1; transform: translateX(-50%) translateY(0) rotate(0); } }
@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) scale(.4); }
  55% { opacity: 1; transform: translate(calc(var(--dx) * .75), calc(var(--dy) * .95)) rotate(calc(var(--r) * .5)) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 170px)) rotate(var(--r)) scale(1); }
}
@keyframes glint { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
@keyframes sparkOut { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.2); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.1) rotate(90deg); } }
@keyframes rain { to { transform: translateY(190px); opacity: .1; } }
@keyframes droop { from { transform: rotate(0); } to { transform: rotate(62deg); } }
@keyframes petalFall { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-16px, 56px) rotate(120deg); } }
@keyframes fall { 0% { transform: translate(0, -20px) rotate(0); } 100% { transform: translate(var(--sway), 112vh) rotate(var(--r)); } }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(0) scale(.6); } 15% { opacity: 1; transform: translateY(-30px) scale(1.1); } 100% { opacity: 0; transform: translateY(-260px) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 700px) {
  .sheet-back { align-items: center; justify-items: center; }
  .sheet { border-radius: 26px; }
  .hero { margin: 0; }
}
@media (max-width: 380px) {
  .players { grid-template-columns: repeat(3, 1fr); }
  .stop { width: 132px; height: 132px; font-size: 1.7rem; }
  .tile .art { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
