:root {
  --bg: #07080d;
  --bg-2: #0e1018;
  --card: rgba(22, 25, 38, 0.78);
  --card-solid: #161926;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef0f7;
  --muted: #8a90a6;
  --accent: #ffb23f;
  --accent-2: #ff5d3a;
  --good: #3ddc97;
  --bad: #ff4d6d;
  --mid: #7c8cff;
  --radius: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: "Unbounded", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  overscroll-behavior: none;
}

body { padding-bottom: calc(84px + var(--safe-b)); overflow-x: hidden; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- фон ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; z-index: -1; width: 520px; height: 520px; left: 50%; top: -260px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255,178,63,.22), transparent 65%);
  filter: blur(10px);
  animation: glow 9s ease-in-out infinite alternate;
}
@keyframes glow { to { transform: translateX(-45%) scale(1.15); opacity: .7; } }

/* ---------- верхняя панель ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 10px;
}
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-info { min-width: 0; }
.me-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-league { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stats { display: flex; gap: 8px; flex-shrink: 0; }
.stat {
  display: flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-weight: 800; font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.stat-ico { font-size: 13px; }
.stat.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.15); border-color: var(--accent); } }

.league-bar { height: 3px; margin: 0 16px; background: var(--line); border-radius: 3px; overflow: hidden; }
.league-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s ease; }

/* ---------- аватары ---------- */
.avatar {
  --h: 30;
  width: 42px; height: 42px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 16px;
  background: linear-gradient(135deg, hsl(var(--h) 80% 58%), hsl(calc(var(--h) + 40) 75% 42%));
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.35);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.avatar.bot { background: linear-gradient(135deg, #3a3f55, #23263a); }

/* ---------- сцена ---------- */
.stage { padding: 18px 16px 8px; max-width: 560px; margin: 0 auto; }
.screen { animation: enter .45s cubic-bezier(.2,.8,.2,1); }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } }

.kicker {
  font-family: var(--display); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 8px;
}
.title { font-family: var(--display); font-weight: 900; font-size: 30px; line-height: 1.05; margin: 0 0 6px; }
.subtitle { color: var(--muted); margin: 0 0 20px; line-height: 1.45; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel + .panel { margin-top: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title { font-weight: 800; font-size: 15px; }
.chip {
  font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px;
  background: rgba(255,178,63,.12); color: var(--accent);
}

/* ---------- герой (нет игры) ---------- */
.hero { text-align: center; padding: 30px 6px 10px; }
.hero-emblem {
  width: 132px; height: 132px; margin: 0 auto 22px; border-radius: 40px; display: grid; place-items: center;
  font-size: 66px; background: radial-gradient(circle at 30% 25%, #2a2e44, #12141f);
  border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(255,178,63,.18), inset 0 0 40px rgba(255,178,63,.08);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* ---------- кнопки ---------- */
.btn {
  width: 100%; padding: 17px 18px; border-radius: 16px; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, filter .2s ease, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d00;
  box-shadow: 0 10px 30px rgba(255,120,50,.35);
}
.btn-ghost { background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.btn-danger { background: rgba(255,77,109,.14); color: var(--bad); border: 1px solid rgba(255,77,109,.3); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-stack > * + * { margin-top: 10px; }
.btn.small { padding: 12px 12px; font-size: 14px; border-radius: 14px; }

/* ---------- лобби ---------- */
.counter { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); }
.counter b { font-size: 40px; font-weight: 900; }
.counter span { color: var(--muted); font-size: 18px; }
.slots { display: flex; gap: 4px; margin: 10px 0 2px; }
.slot { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background .4s; }
.slot.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.players { display: grid; gap: 8px; }
.player {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px;
  background: rgba(255,255,255,.03); border: 1px solid transparent;
  animation: pop .4s cubic-bezier(.2,1.4,.4,1);
}
.player.me-row { border-color: rgba(255,178,63,.35); background: rgba(255,178,63,.06); }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
.player-name { font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.07); color: var(--muted); }
.tag.you { background: rgba(255,178,63,.15); color: var(--accent); }

.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; }
.dots span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--accent); animation: dot 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 40% { transform: translateY(-5px); opacity: .4; } }

/* ---------- карточка роли ---------- */
.card-wrap { perspective: 1200px; margin: 6px 0 16px; }
.role-card {
  position: relative; height: 300px; transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.3,1.3,.4,1); cursor: pointer;
}
.role-card.flipped { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center;
  border: 1px solid var(--line); overflow: hidden;
}
.face-back {
  background:
    repeating-linear-gradient(45deg, rgba(255,178,63,.06) 0 12px, transparent 12px 24px),
    radial-gradient(circle at 50% 35%, #262a40, #0f111a);
}
.face-back .stamp {
  font-family: var(--display); font-weight: 900; font-size: 13px; letter-spacing: .3em; color: var(--accent-2);
  border: 2px solid var(--accent-2); padding: 6px 14px; border-radius: 8px; transform: rotate(-8deg);
  margin-bottom: 18px; opacity: .85;
}
.face-back .big { font-size: 64px; margin-bottom: 12px; }
.face-back .hint { color: var(--muted); font-weight: 600; }
.face-front {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 0%, rgba(255,178,63,.25), transparent 60%), var(--card-solid);
}
.face-front .label { font-family: var(--display); font-size: 11px; letter-spacing: .25em; color: var(--muted); margin-bottom: 14px; }
.face-front .word {
  font-family: var(--display); font-weight: 900; font-size: clamp(30px, 10vw, 46px); line-height: 1.05;
  background: linear-gradient(180deg, #fff, #ffd28a); -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: break-word;
}
.face-front .note { margin-top: 18px; padding: 10px 14px; border-radius: 14px; background: rgba(255,93,58,.12); color: #ffb39f; font-weight: 700; font-size: 14px; white-space: pre-line; }
.face-front .shine {
  position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.12) 50%, transparent 60%);
  transform: translateX(-100%); animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine { 60%, 100% { transform: translateX(100%); } }

.order { counter-reset: n; display: flex; flex-wrap: wrap; gap: 8px; }
.order li { list-style: none; counter-increment: n; padding: 8px 12px 8px 8px; border-radius: 12px; background: rgba(255,255,255,.05); font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.order li::before { content: counter(n); width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; background: var(--accent); color: #1a0d00; font-weight: 900; }
.order-wrap { padding: 0; margin: 0; }

/* ---------- голосование ---------- */
.vote-panel { border-color: rgba(255,77,109,.35); box-shadow: 0 0 0 1px rgba(255,77,109,.15), 0 20px 60px rgba(255,77,109,.15); }
.vote-panel.mid { border-color: rgba(124,140,255,.4); box-shadow: 0 0 0 1px rgba(124,140,255,.15), 0 20px 60px rgba(124,140,255,.15); }
.vote-panel .kicker { color: var(--bad); }
.vote-panel.mid .kicker { color: var(--mid); }
.vote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vote-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 18px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); font-weight: 700; font-size: 14px;
  transition: transform .12s, background .2s, border-color .2s;
}
.vote-btn:active { transform: scale(.95); }
.vote-btn .avatar { width: 52px; height: 52px; border-radius: 18px; font-size: 20px; }
.vote-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-btn.picked { border-color: var(--bad); background: rgba(255,77,109,.12); }
.progress-line { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 12px; }
.progress-line div { height: 100%; background: var(--bad); transition: width .5s ease; }

/* ---------- результат ---------- */
.result-hero { text-align: center; padding: 18px 0 8px; }
.result-emoji { font-size: 84px; animation: drop .8s cubic-bezier(.2,1.6,.4,1); }
@keyframes drop { from { transform: translateY(-60px) scale(.4); opacity: 0; } }
.result-title { font-family: var(--display); font-weight: 900; font-size: 24px; line-height: 1.15; margin: 10px 0 8px; }
.delta { display: inline-block; font-family: var(--display); font-weight: 900; font-size: 30px; padding: 6px 16px; border-radius: 14px; margin: 8px 0 4px; }
.delta.up { color: var(--good); background: rgba(61,220,151,.1); }
.delta.down { color: var(--bad); background: rgba(255,77,109,.1); }
.delta.zero { color: var(--muted); background: rgba(255,255,255,.05); }
.reveal { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.reveal div { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); text-align: center; }
.reveal small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.reveal b { font-family: var(--display); font-size: 16px; }
.log-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log-row:last-child { border-bottom: 0; }
.log-row span:last-child { color: var(--muted); text-align: right; }

/* ---------- нижние вкладки ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-b));
  background: rgba(10,11,17,.92); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 700; transition: color .2s, background .2s; position: relative; }
.tab .ico { font-size: 21px; line-height: 1; transition: transform .2s; }
.tab.on { color: var(--text); background: rgba(255,178,63,.08); }
.tab.on .ico { transform: translateY(-2px) scale(1.08); }
.tab .badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 8px; height: 8px; border-radius: 4px; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

.fabs { position: fixed; right: 14px; bottom: calc(80px + var(--safe-b)); z-index: 21; display: flex; flex-direction: column; gap: 10px; }
.fab {
  width: 52px; height: 52px; border-radius: 18px; font-size: 22px; display: grid; place-items: center;
  background: rgba(22,25,38,.92); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45);
  transition: transform .12s, background .2s; position: relative;
}
.fab:active { transform: scale(.9); }
.fab.admin { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; }
.fab.voice-on { background: linear-gradient(135deg, #1fb57a, #128a5b); border: 0; }
.fab.voice-muted { background: linear-gradient(135deg, #6b2232, #3b1420); border: 0; }
.fab.talking { box-shadow: 0 0 0 4px rgba(61,220,151,.35), 0 0 30px rgba(61,220,151,.6); }
.fab .count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--good); color: #04140d; font-size: 11px; font-weight: 900; display: grid; place-items: center; }

.conn { position: fixed; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 8px var(--bad); transition: background .3s; z-index: 22; }
.conn.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }

/* ---------- админ-шторка ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 30; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 82vh; overflow-y: auto;
  background: var(--bg-2); border-top: 1px solid var(--line); border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(20px + var(--safe-b)); animation: up .32s cubic-bezier(.2,.9,.2,1);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet-handle { width: 42px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet-title { font-family: var(--display); font-size: 18px; margin: 0 0 14px; }
.sheet-section { margin-bottom: 18px; }
.sheet-label { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
.stepper { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,.04); border-radius: 16px; padding: 6px; }
.stepper button { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.07); font-size: 22px; font-weight: 800; }
.stepper b { font-family: var(--display); font-size: 22px; }

/* ---------- тосты ---------- */
.toast-wrap { position: fixed; top: 12px; left: 0; right: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  max-width: 420px; padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 14px;
  background: rgba(22,25,38,.95); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: toast .3s cubic-bezier(.2,1.3,.4,1);
}
.toast.bad { border-color: rgba(255,77,109,.4); }
.toast.good { border-color: rgba(61,220,151,.4); }
@keyframes toast { from { opacity: 0; transform: translateY(-14px) scale(.95); } }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =================== НОВОЕ: вкладки, мини-игры, магазин, голос =================== */
body { padding-bottom: calc(100px + var(--safe-b)); }
.section-title { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 22px 0 10px; }

/* ---------- мини-игры ---------- */
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-card {
  border-radius: 20px; padding: 16px 14px; text-align: left; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
  display: flex; flex-direction: column; gap: 6px; transition: transform .12s;
}
.mini-card:active { transform: scale(.97); }
.mini-card .ico { font-size: 34px; }
.mini-card b { font-size: 15px; }
.mini-card small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.mini-card[disabled] { opacity: .45; pointer-events: none; }

.bomb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.bomb-cell {
  aspect-ratio: 1; border-radius: 18px; font-size: 26px; font-weight: 900; display: grid; place-items: center;
  background: linear-gradient(160deg, #262a40, #171a28); border: 1px solid var(--line);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.35); transition: transform .12s;
}
.bomb-cell:active { transform: scale(.92); }
.bomb-cell.open { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.35); box-shadow: none; animation: pop .35s cubic-bezier(.2,1.6,.4,1); }
.bomb-cell.boom { background: rgba(255,77,109,.18); border-color: var(--bad); animation: shake .5s; }
.bomb-cell.ghost { opacity: .35; box-shadow: none; }
.bomb-cell .coin { font-size: 15px; display: block; color: var(--good); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.bank { display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.bank b { font-family: var(--display); font-size: 26px; color: var(--accent); }

.rocket-stage { position: relative; height: 230px; border-radius: 20px; overflow: hidden; margin: 12px 0; background: radial-gradient(circle at 50% 120%, rgba(255,93,58,.25), transparent 60%), linear-gradient(180deg, #05060a, #121528); }
.rocket-stage .stars { position: absolute; inset: -50% 0 0; background-image: radial-gradient(1px 1px at 20% 30%, #fff8, transparent), radial-gradient(1px 1px at 70% 60%, #fff6, transparent), radial-gradient(1.5px 1.5px at 40% 80%, #fff9, transparent), radial-gradient(1px 1px at 85% 20%, #fff7, transparent), radial-gradient(1px 1px at 10% 70%, #fff5, transparent); background-size: 160px 160px; }
.rocket-stage.flying .stars { animation: stars 1.2s linear infinite; }
@keyframes stars { to { transform: translateY(160px); } }
.rocket-ship { position: absolute; left: 50%; bottom: 18px; font-size: 56px; transform: translateX(-50%) rotate(-45deg); transition: bottom 1s ease; }
.rocket-stage.flying .rocket-ship { animation: wobble .4s ease-in-out infinite alternate; }
@keyframes wobble { to { transform: translateX(-48%) rotate(-42deg); } }
.rocket-stage.crash .rocket-ship { animation: crash .8s ease-in forwards; }
@keyframes crash { to { transform: translate(-50%, 160px) rotate(120deg); opacity: 0; } }
.rocket-mult { position: absolute; top: 16px; left: 0; right: 0; text-align: center; font-family: var(--display); font-weight: 900; font-size: 44px; text-shadow: 0 4px 30px rgba(255,178,63,.6); }
.rocket-mult small { display: block; font-family: var(--body); font-size: 13px; font-weight: 700; color: var(--muted); text-shadow: none; }
.bet-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.input {
  width: 100%; padding: 15px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05);
  color: var(--text); font: inherit; font-size: 16px; font-weight: 700; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 96px; resize: vertical; font-weight: 600; }
.quick-bets { display: flex; gap: 8px; margin-top: 8px; }
.quick-bets button { flex: 1; padding: 9px 0; border-radius: 12px; background: rgba(255,255,255,.06); font-weight: 800; font-size: 13px; }

/* ---------- магазин ---------- */
.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shop-item {
  border-radius: 20px; padding: 16px 12px 12px; text-align: center; border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255,255,255,.07), rgba(255,255,255,.015));
  display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; overflow: hidden;
}
.shop-item .preview { min-height: 64px; display: grid; place-items: center; font-size: 44px; line-height: 1.1; }
.shop-item .preview.text { font-size: 15px; font-weight: 800; padding: 0 4px; }
.shop-item .kind { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.shop-item.rare { border-color: rgba(255,178,63,.5); box-shadow: 0 0 30px rgba(255,178,63,.15); }
.shop-item.bought { opacity: .55; }
.price { font-weight: 900; }
.timer { text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; margin-top: 14px; }

/* ---------- инвентарь ---------- */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; border-radius: 16px; background: rgba(255,255,255,.04); margin-bottom: 14px; }
.seg button { padding: 10px 0; border-radius: 12px; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: rgba(255,178,63,.14); color: var(--accent); }
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.inv-grid.wide { grid-template-columns: 1fr; }
.inv-item { padding: 16px 8px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,.04); font-size: 32px; display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.inv-grid.wide .inv-item { font-size: 15px; font-weight: 800; flex-direction: row; justify-content: space-between; padding: 14px 16px; }
.inv-item.on { border-color: var(--good); background: rgba(61,220,151,.08); }
.inv-item .check { position: absolute; top: 6px; right: 8px; font-size: 13px; }
.inv-grid.wide .inv-item .check { position: static; }
.preview-name { text-align: center; font-weight: 800; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); margin-bottom: 14px; }
.shield-big { font-size: 64px; text-align: center; margin: 4px 0 8px; }
.kv { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.kv:last-of-type { border-bottom: 0; }

/* ---------- топ ---------- */
.top-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.03); margin-bottom: 8px; }
.top-row.me-row { border: 1px solid rgba(255,178,63,.35); background: rgba(255,178,63,.06); }
.place { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; background: rgba(255,255,255,.06); flex-shrink: 0; }
.place.p1 { background: linear-gradient(135deg, #ffd56a, #f0a020); color: #2a1800; }
.place.p2 { background: linear-gradient(135deg, #e8edf5, #9aa3b5); color: #1b2030; }
.place.p3 { background: linear-gradient(135deg, #f0a37a, #b0603a); color: #2a1206; }
.top-info { flex: 1; min-width: 0; }
.top-name { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-league { font-size: 12px; color: var(--muted); }
.top-score { font-family: var(--display); font-weight: 900; font-size: 16px; }

/* ---------- инфо ---------- */
details.info { border-radius: 18px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; overflow: hidden; }
details.info summary { padding: 16px; font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.info summary::-webkit-details-marker { display: none; }
details.info summary::after { content: "⌄"; color: var(--muted); transition: transform .2s; }
details.info[open] summary::after { transform: rotate(180deg); }
details.info .body { padding: 0 16px 16px; color: #c9cddc; line-height: 1.55; white-space: pre-line; font-size: 14px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.toggle-row:last-child { border-bottom: 0; }
.switch { width: 50px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.12); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(20px); }

/* ---------- оверлеи (кнопка ПОБЕДИТЬ, драма) ---------- */
.overlay { position: fixed; inset: 0; z-index: 45; background: rgba(5,6,10,.88); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; animation: fade .3s; }
.overlay p { font-size: 18px; font-weight: 700; line-height: 1.45; white-space: pre-line; max-width: 420px; }
.secret-btn {
  margin-top: 20px; padding: 22px 26px; border-radius: 24px; font-family: var(--display); font-weight: 900; font-size: 20px;
  background: linear-gradient(135deg, #ff3d7f, #ffb23f); color: #fff; box-shadow: 0 0 60px rgba(255,61,127,.55);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 0 90px rgba(255,61,127,.8); } }
.countdown { margin-top: 16px; font-family: var(--display); font-size: 40px; font-weight: 900; color: var(--accent); }
.drama { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.bubble { padding: 12px 16px; border-radius: 18px 18px 18px 6px; background: var(--card-solid); border: 1px solid var(--line); font-weight: 700; text-align: left; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }

/* ---------- баннер "ЦАРЬ заходит в игру" ---------- */
.banner {
  position: fixed; left: 16px; right: 16px; top: 30%; z-index: 46; text-align: center; padding: 22px 18px; border-radius: 24px;
  font-family: var(--display); font-weight: 900; font-size: 20px; line-height: 1.3;
  background: linear-gradient(135deg, rgba(255,178,63,.95), rgba(255,93,58,.95)); color: #1a0d00;
  box-shadow: 0 30px 80px rgba(255,120,50,.5); animation: banner 3.2s cubic-bezier(.2,1.2,.3,1) forwards; pointer-events: none;
}
@keyframes banner { 0% { opacity: 0; transform: scale(.6) rotate(-4deg); } 12% { opacity: 1; transform: scale(1.05) rotate(1deg); } 20% { transform: scale(1) rotate(0); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px); } }
.toast.coin { border-color: rgba(255,178,63,.5); }
.toast.warn { border-color: rgba(255,178,63,.5); }

/* ---------- голос ---------- */
.voice-list { display: grid; gap: 8px; margin-bottom: 14px; }
.voice-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.voice-row.talking { border-color: var(--good); box-shadow: 0 0 20px rgba(61,220,151,.25); }
.voice-row .state { margin-left: auto; font-size: 13px; color: var(--muted); }
.ptt {
  width: 100%; padding: 26px 0; border-radius: 24px; font-weight: 900; font-size: 17px; margin-top: 10px;
  background: rgba(61,220,151,.1); border: 2px dashed rgba(61,220,151,.4); color: var(--good); user-select: none; -webkit-user-select: none; touch-action: none;
}
.ptt.held { background: rgba(61,220,151,.25); border-style: solid; transform: scale(.98); }
.hint-box { font-size: 13px; color: var(--muted); line-height: 1.5; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.03); margin-top: 12px; }

/* ---------- правки: кнопки в шапке, строка статов ---------- */
.head-btns { display: flex; gap: 8px; flex-shrink: 0; }
.head-btns .fab { width: 44px; height: 44px; border-radius: 15px; font-size: 20px; box-shadow: none; }
.stats-row { display: flex; align-items: center; gap: 8px; padding: 0 16px; }
.stats-row .league-bar { flex: 1; margin: 0; height: 6px; border-radius: 3px; }
.seg button { font-size: 20px; padding: 8px 0; }
.bank b { font-size: 22px; white-space: nowrap; }

/* =================== очередь в голосе, громкость, Таро, админка =================== */
.seg { grid-template-columns: repeat(7, 1fr); gap: 4px; }
.seg button { font-size: 18px; padding: 8px 0; position: relative; }
.seg sup { position: absolute; top: 2px; right: 4px; font-size: 10px; font-weight: 900; color: var(--accent); }

.turn-panel { border-color: rgba(124,140,255,.35); }
.turn-panel.mine { border-color: rgba(61,220,151,.5); box-shadow: 0 0 40px rgba(61,220,151,.12); }
.turn-panel .kicker { color: var(--mid); }
.speaker-now { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.speaker-now .avatar { width: 54px; height: 54px; border-radius: 18px; font-size: 22px; transition: box-shadow .15s; }
.speaker-now small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.speaker-now b { font-family: var(--display); font-size: 20px; }
.avatar.talking { box-shadow: 0 0 0 3px var(--good), 0 0 24px rgba(61,220,151,.6); }
.turn-order { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 14px 0 0; list-style: none; }
.turn-order li { font-size: 12px; font-weight: 800; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.05); color: var(--muted); }
.turn-order li.now { background: rgba(124,140,255,.18); color: var(--text); }
.turn-order li.ask::after { content: " ✋"; }
.transcript { display: grid; gap: 8px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.transcript .line { padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); overflow-wrap: anywhere; }
.transcript .line small { display: block; font-size: 11px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.transcript .line.bot { background: rgba(124,140,255,.08); border-color: rgba(124,140,255,.25); }
.transcript .line.ask { border-style: dashed; }
.transcript .line.vote { border-color: rgba(255,170,60,.4); }
.transcript .line.think { background: none; border-style: dashed; font-style: italic; color: var(--muted); padding: 6px 12px; }
.transcript .line.sys { background: none; border: none; padding: 2px 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.voice-prompt { border-color: rgba(61,220,151,.4); }
.voice-prompt .kicker { color: var(--good); }

.voice-row { flex-direction: column; align-items: stretch; gap: 8px; }
.voice-head { display: flex; align-items: center; gap: 12px; }
.voice-row.silenced { opacity: .6; }
.vol { display: flex; align-items: center; gap: 10px; padding-left: 54px; }
.vol input[type=range] { flex: 1; accent-color: var(--good); height: 28px; }
.vol-val { width: 44px; text-align: right; font-size: 12px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }

.ability-list { display: grid; gap: 10px; }
.ability { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; text-align: left; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.ability.dim { opacity: .5; }
.ab-ico { font-size: 30px; }
.ab-text { flex: 1; min-width: 0; }
.ab-text b { display: block; font-size: 15px; }
.ab-text small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.ab-count { font-family: var(--display); font-weight: 900; color: var(--accent); }

.tarot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tarot-card {
  aspect-ratio: 2 / 3; border-radius: 16px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px;
  background: radial-gradient(circle at 50% 30%, rgba(124,140,255,.35), transparent 60%), linear-gradient(170deg, #22264a, #121427);
  border: 1px solid rgba(255,214,140,.35); box-shadow: inset 0 0 0 4px rgba(0,0,0,.25), inset 0 0 0 5px rgba(255,214,140,.25);
}
.tarot-card.dim { filter: grayscale(.85) brightness(.6); }
.t-num { position: absolute; top: 8px; left: 0; right: 0; text-align: center; font-family: var(--display); font-size: 11px; color: #ffd68c; letter-spacing: .15em; }
.t-emoji { font-size: 34px; }
.t-name { font-size: 11px; font-weight: 800; text-align: center; line-height: 1.2; color: #e9e3ff; }
.t-count { position: absolute; bottom: 6px; right: 8px; font-size: 12px; font-weight: 900; color: var(--accent); }
.card-sheet { text-align: center; }
.card-sheet .t-big { position: relative; width: 120px; aspect-ratio: 2/3; margin: 0 auto 14px; display: grid; place-items: center; font-size: 56px; border-radius: 18px; background: linear-gradient(170deg, #22264a, #121427); border: 1px solid rgba(255,214,140,.4); animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
.card-sheet:not(.is-tarot) .t-big { aspect-ratio: 1; background: rgba(255,255,255,.05); border-color: var(--line); }
.card-desc { color: #c9cddc; line-height: 1.5; text-align: left; margin: 0 0 12px; }
.card-sheet .kv { text-align: left; margin-bottom: 12px; }
.effect-row { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.effect-row:last-child { border-bottom: 0; }
.effect-row small { color: var(--muted); text-align: right; }

.shop-item .desc { font-size: 11px; color: var(--muted); line-height: 1.35; min-height: 30px; }
.shop-item.tarot { background: radial-gradient(circle at 50% 20%, rgba(124,140,255,.25), transparent 60%), linear-gradient(170deg, rgba(255,255,255,.07), rgba(255,255,255,.015)); }
.price s.old { color: var(--muted); font-weight: 700; font-size: 12px; margin-left: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip-btn { padding: 8px 12px; border-radius: 12px; font-size: 13px; font-weight: 800; background: rgba(255,255,255,.06); color: var(--muted); }
.chip-btn.on { background: rgba(255,178,63,.15); color: var(--accent); }
.chip-own { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-radius: 12px; background: rgba(255,255,255,.06); font-weight: 700; font-size: 14px; }
.chip-own.on { outline: 1px solid var(--good); }
.chip-own button { width: 22px; height: 22px; border-radius: 8px; background: rgba(255,77,109,.18); color: var(--bad); font-size: 12px; font-weight: 900; }
.mini-step { display: inline-flex; align-items: center; gap: 6px; }
.mini-step button { min-width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.08); font-size: 18px; font-weight: 900; }
.mini-step b { min-width: 26px; text-align: center; }
.adm-row { width: 100%; text-align: left; }
.adm-row .avatar { width: 38px; height: 38px; font-size: 14px; border-radius: 12px; }
.adm-nums { text-align: right; }
.adm-nums b { display: block; font-size: 14px; }
.adm-nums small { color: var(--muted); font-size: 12px; font-weight: 700; }
.adm-head { display: flex; align-items: center; gap: 12px; }
.adm-cosm + .adm-cosm { margin-top: 14px; }
select.input { appearance: none; -webkit-appearance: none; }

/* =================== музыка =================== */
.now-playing { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; background: linear-gradient(135deg, rgba(124,140,255,.18), rgba(255,178,63,.08)); }
.np-art { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: rgba(0,0,0,.3); flex-shrink: 0; }
.np-info { min-width: 0; }
.np-info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-info small { color: var(--muted); font-size: 13px; }
.np-bar { height: 6px; border-radius: 3px; background: var(--line); margin: 12px 0 4px; cursor: pointer; overflow: hidden; }
.np-bar div { height: 100%; background: linear-gradient(90deg, var(--mid), var(--accent)); transition: width .25s linear; }
.np-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.np-controls { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 10px 0; }
.np-controls button { width: 48px; height: 48px; border-radius: 16px; background: rgba(255,255,255,.06); font-size: 20px; }
.np-controls button.big { width: 62px; height: 62px; border-radius: 22px; font-size: 26px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.np-controls button.on { background: rgba(124,140,255,.25); }
.track, .pl { padding: 8px 10px; border-radius: 14px; background: rgba(255,255,255,.03); margin-bottom: 6px; }
.track.on { background: rgba(124,140,255,.14); }
.track-row { display: flex; align-items: center; gap: 10px; }
.track-play { width: 36px; height: 36px; border-radius: 12px; background: rgba(255,255,255,.07); flex-shrink: 0; }
.track-info { flex: 1; min-width: 0; cursor: pointer; }
.track-info b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-info small { color: var(--muted); font-size: 12px; }
.file-pick { display: block; padding: 18px; border-radius: 16px; border: 2px dashed rgba(124,140,255,.4); text-align: center; font-weight: 800; cursor: pointer; color: #c9cddc; }
.sugg { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); margin-bottom: 8px; }
.sugg small { display: block; color: var(--muted); margin-top: 4px; }
.sugg .link { word-break: break-all; }
.sugg.added, .sugg.rejected { opacity: .55; }
.head-btns .fab.voice-on { background: linear-gradient(135deg, #3f4fd8, #2a338c); }
