:root {
  --bg: #140a12;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.1);
  --text: #fff4f8;
  --muted: #c9a9b9;
  --pink: #ff0069;
  --pink-soft: #ff5c9a;
  --gold: #ffc94d;
  --win: #3ddc97;
  --lose: #ff4d6d;
  --radius: 22px;
  --tabbar-h: 68px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100%;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:disabled { cursor: default; opacity: 0.5; }
h2, h3 { margin: 0; }

.glow {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.glow-a { background: var(--pink); top: -160px; right: -140px; }
.glow-b { background: #7a2cff; bottom: 40px; left: -200px; opacity: 0.25; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, var(--pink-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }

.balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s;
}
.balance-pill.bump { transform: scale(1.12); }

/* ---------- layout ---------- */

main {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 4px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
}

.view { display: none; animation: fade-in 0.25s ease; }
.view.is-active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  margin: 6px 0 14px;
}
.eyebrow { margin: 4px 0 12px; font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); margin: 6px 0 12px; }
.rules-box { margin: 12px 0 14px; }
.rules-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-size: 13px; font-weight: 700;
  transition: background 0.2s, border-color 0.2s;
}
.rules-toggle[aria-expanded="true"] { background: rgba(255, 0, 105, 0.18); border-color: var(--pink-soft); }
.rules-panel {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--stroke);
  font-size: 14px;
  color: #f1dce6;
  animation: fade-in 0.2s ease;
}
.rules-panel p { margin: 0 0 8px; }
.rules-panel p:last-child { margin-bottom: 0; }

.chips-label { color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; margin: 4px 0 8px; }

.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  backdrop-filter: blur(12px);
}
.card h3 { font-family: var(--display); font-weight: 700; font-size: 16px; }
.bot-card {
  background: linear-gradient(160deg, rgba(122, 44, 255, 0.2), rgba(255, 0, 105, 0.12));
  border-color: rgba(170, 120, 255, 0.35);
}

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-head h3 { font-family: var(--display); font-weight: 700; font-size: 16px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-strong); border: 1px solid var(--stroke);
  font-size: 18px; font-weight: 800;
}

.list { display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

/* ---------- buttons & inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.12s, filter 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.big { padding: 16px; font-size: 17px; font-family: var(--display); font-weight: 700; }
.btn-pink {
  background: linear-gradient(135deg, var(--pink-soft), var(--pink));
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(255, 0, 105, 0.7);
}
.btn-ghost { background: var(--surface-strong); border: 1px solid var(--stroke); }
.btn-small { padding: 8px 12px; font-size: 13px; border-radius: 12px; }

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  margin-top: 12px;
  outline: none;
}
.input:focus { border-color: var(--pink-soft); }

.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.chip {
  min-width: 50px;
  padding: 9px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: background 0.2s, border-color 0.2s, transform 0.12s;
}
.chip.is-active { background: rgba(255, 0, 105, 0.22); border-color: var(--pink); color: #fff; }
.chip:active { transform: scale(0.94); }

/* ---------- home ---------- */

.hero {
  background:
    radial-gradient(circle at 85% 0%, rgba(255, 92, 154, 0.45), transparent 60%),
    linear-gradient(160deg, rgba(255, 0, 105, 0.22), rgba(122, 44, 255, 0.12));
  border-color: rgba(255, 92, 154, 0.35);
}
.hero-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-balance {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 800; font-size: 38px;
  letter-spacing: -0.02em; margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}
.hero-balance .coin { font-size: 0.8em; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.streak { font-weight: 700; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat {
  min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--stroke);
}
.stat-num {
  font-family: var(--display); font-weight: 700; font-size: 22px;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden;
}
.stat-label { color: var(--muted); font-size: 12px; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--stroke);
  font-size: 12px; font-weight: 700;
}
.quick span { font-size: 24px; }

.ref-row { display: flex; gap: 8px; align-items: center; }
.ref-row .input { margin-top: 0; font-size: 13px; }

/* ---------- casino ---------- */

.segmented {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 4px; gap: 4px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--stroke);
}
.segmented button {
  padding: 10px 2px; border-radius: 12px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  transition: background 0.2s;
}
.segmented button.is-active { background: linear-gradient(135deg, var(--pink-soft), var(--pink)); color: #fff; }

.stage {
  position: relative;
  height: 292px;
  margin-top: 14px;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 110%, rgba(255, 0, 105, 0.35), transparent 60%),
    var(--surface);
  border: 1px solid var(--stroke);
  overflow: hidden;
}
.stage-inner {
  position: absolute; inset: 0;
  padding-bottom: 74px; /* место под плашку результата снизу */
  display: flex; align-items: center; justify-content: center;
}

/* 3D dice */
.scene { width: 120px; height: 120px; perspective: 700px; }
.scene.small { width: 84px; height: 84px; }
.cube {
  --half: 60px;
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-18deg) rotateY(24deg);
  transition: transform 1.5s cubic-bezier(0.17, 0.84, 0.3, 1.04);
}
.scene.small .cube { --half: 42px; }
.face {
  position: absolute; inset: 0;
  border-radius: 24%;
  background: linear-gradient(145deg, #ffffff, #ffe0ec);
  box-shadow: inset 0 -6px 14px rgba(255, 0, 105, 0.16), inset 0 3px 8px rgba(255, 255, 255, 0.9);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 15%;
}
.face-1 { transform: rotateY(0deg) translateZ(var(--half)); }
.face-6 { transform: rotateY(180deg) translateZ(var(--half)); }
.face-3 { transform: rotateY(90deg) translateZ(var(--half)); }
.face-4 { transform: rotateY(-90deg) translateZ(var(--half)); }
.face-5 { transform: rotateX(90deg) translateZ(var(--half)); }
.face-2 { transform: rotateX(-90deg) translateZ(var(--half)); }
.pip {
  width: 70%; aspect-ratio: 1; border-radius: 50%; place-self: center;
  background: radial-gradient(circle at 35% 35%, var(--pink-soft), #b8004a);
}
.face-1 .pip { width: 95%; }

/* darts */
.board-wrap { position: relative; width: 180px; height: 180px; }
.board { width: 100%; height: 100%; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45)); }
.dart {
  position: absolute; left: 0; top: 0;
  width: 58px; height: 58px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transform-origin: 4.7% 95.3%; /* масштаб в полёте — вокруг острия */
}
.dart svg { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45)); }
/* ось качания после попадания — остриё дротика */
.dart svg { width: 100%; height: 100%; transform-origin: 4.7% 95.3%; }
.dart-shadow {
  position: absolute; width: 26px; height: 8px; margin: -2px 0 0 2px;
  border-radius: 50%;
  background: rgba(20, 0, 10, 0.45);
  filter: blur(2px);
  transform: rotate(-30deg);
  transform-origin: 0 50%;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
  z-index: 1;
}
.hit-ring {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); opacity: 0; pointer-events: none;
  z-index: 1;
}
.hit-ring.pop { animation: pop-ring 0.5s ease-out; }
@keyframes pop-ring { from { opacity: 0.9; transform: scale(0.4); } to { opacity: 0; transform: scale(2.6); } }

/* slot */
.slot-machine {
  position: relative;
  padding: 14px;
  border-radius: 26px;
  background: linear-gradient(160deg, #3a1230, #1c0a18);
  border: 2px solid rgba(255, 92, 154, 0.5);
  box-shadow: 0 16px 40px -12px rgba(255, 0, 105, 0.55), inset 0 0 24px rgba(255, 0, 105, 0.15);
}
.reels { display: flex; gap: 8px; }
.reel {
  --cell: 84px;
  width: 78px; height: var(--cell);
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(#fff, #ffeaf2 45%, #ffeaf2 55%, #fff);
  box-shadow: inset 0 8px 10px -6px rgba(0, 0, 0, 0.35), inset 0 -8px 10px -6px rgba(0, 0, 0, 0.35);
}
.strip { display: flex; flex-direction: column; will-change: transform; }
.sym {
  height: var(--cell);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
}
.sym-bar {
  font-family: var(--display); font-weight: 800; font-size: 17px;
  padding: 5px 7px; border-radius: 8px;
  background: #2a1020; color: #fff; letter-spacing: 0.04em;
}
.sym-seven {
  font-family: var(--display); font-weight: 800; font-size: 50px;
  color: var(--pink); text-shadow: 0 2px 0 #9e0041;
}
.payline {
  position: absolute; left: 6px; right: 6px; top: 50%; height: 2px;
  background: rgba(255, 0, 105, 0.45); pointer-events: none;
}

/* result banner */
.result {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  padding: 11px 14px;
  border-radius: 16px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.result.show { opacity: 1; transform: none; }
.result.win { background: rgba(61, 220, 151, 0.18); border: 1px solid rgba(61, 220, 151, 0.55); }
.result.lose { background: rgba(255, 77, 109, 0.16); border: 1px solid rgba(255, 77, 109, 0.5); }
.result.draw { background: var(--surface-strong); border: 1px solid var(--stroke); }
.result small { display: block; font-weight: 600; color: var(--muted); margin-top: 2px; }
.result.static { position: static; margin-top: 18px; }

/* ---------- duels / bets / top items ---------- */

.item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--stroke);
}
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 800; overflow-wrap: anywhere; }
.item-sub { color: var(--muted); font-size: 13px; }
.tag {
  display: inline-block; margin-left: 6px; padding: 2px 8px;
  border-radius: 999px; font-size: 11px; font-weight: 800;
  background: rgba(255, 0, 105, 0.2); color: var(--pink-soft);
  vertical-align: middle;
}
.bet-amount { font-family: var(--display); font-weight: 700; white-space: nowrap; }

.prediction h3 { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.options { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 12px; }
.option {
  text-align: left;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.option.is-active { border-color: var(--pink); background: rgba(255, 0, 105, 0.2); }
.my-bet { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 201, 77, 0.12); color: var(--gold); font-weight: 700; }

.place { font-family: var(--display); font-weight: 800; width: 34px; text-align: center; font-size: 18px; }
.item.me { border-color: var(--pink); background: rgba(255, 0, 105, 0.14); }

/* ---------- quiz ---------- */

.progress { height: 6px; border-radius: 99px; background: var(--surface-strong); overflow: hidden; margin: 10px 0 18px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink-soft), var(--pink)); transition: width 0.3s; }
.quiz-step { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.quiz-question { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.3; margin: 4px 0 4px; }
.quiz-result { text-align: center; }
.quiz-result .big-emoji { font-size: 56px; }
.quiz-result h3 { font-size: 22px; margin: 6px 0 8px; }

/* ---------- tab bar ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding: 6px 6px env(safe-area-inset-bottom);
  background: rgba(20, 10, 18, 0.88);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--stroke);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  border-radius: 14px;
  transition: color 0.2s, background 0.2s;
}
.tab span { font-size: 20px; filter: grayscale(0.6); transition: filter 0.2s, transform 0.2s; }
.tab.is-active { color: #fff; background: rgba(255, 0, 105, 0.16); }
.tab.is-active span { filter: none; transform: translateY(-1px) scale(1.08); }

/* ---------- modal, toast, confetti ---------- */

.modal {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(10, 4, 9, 0.72);
  backdrop-filter: blur(6px);
}
.modal-card {
  width: 100%; max-width: 380px;
  padding: 22px 18px 18px;
  border-radius: 26px;
  background: linear-gradient(160deg, #2a1024, #170914);
  border: 1px solid rgba(255, 92, 154, 0.4);
  text-align: center;
}
.modal-card h3 { font-family: var(--display); font-size: 22px; }
.duel-arena { display: flex; align-items: center; justify-content: space-around; margin-top: 22px; }
.fighter { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 42%; }
.fighter-name { font-weight: 800; font-size: 13px; overflow-wrap: anywhere; }
.vs { font-family: var(--display); font-weight: 800; color: var(--pink-soft); font-size: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); z-index: 30;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 14px;
  background: #2a1020;
  border: 1px solid rgba(255, 92, 154, 0.5);
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 25; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px;
  width: 8px; height: 12px; border-radius: 2px;
  animation: fall 1.6s cubic-bezier(0.3, 0.6, 0.5, 1) forwards;
}
@keyframes fall {
  to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
  .cube { transition-duration: 0.4s; }
  .view { animation: none; }
  .confetti { display: none; }
}

/* ---------- раздел «Игры» (arcade.js) ---------- */

.arcade-menu { display: flex; flex-direction: column; gap: 10px; }
.arcade-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  text-align: left;
  transition: transform 0.12s, border-color 0.2s;
}
.arcade-card:active { transform: scale(0.98); border-color: var(--pink-soft); }
.arcade-icon {
  flex: none;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px;
  font-size: 30px;
  background: linear-gradient(145deg, rgba(255, 92, 154, 0.35), rgba(122, 44, 255, 0.3));
}
.arcade-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.arcade-name { font-family: var(--display); font-weight: 700; font-size: 16px; }
.arcade-tagline { color: var(--muted); font-size: 13px; }
.arcade-best { color: var(--gold); font-size: 12px; font-weight: 700; margin-top: 2px; }
.arcade-note { color: var(--muted); font-size: 12px; text-align: center; margin-top: 14px; }

.game-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.back-btn {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.hud { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }
.hud-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-size: 12px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hud-best { color: var(--gold); }
.game-title { font-family: var(--display); font-weight: 700; font-size: 20px; margin: 4px 0 10px; }

.game-stage {
  position: relative;
  display: flex; justify-content: center;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--stroke);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.game-canvas { display: block; border-radius: 14px; background: rgba(0, 0, 0, 0.28); touch-action: none; }

.game-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(20, 10, 18, 0.82);
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}
.overlay-title { font-family: var(--display); font-weight: 800; font-size: 22px; }
.overlay-text { margin: 0; color: #f1dce6; white-space: pre-line; max-width: 300px; }

.game-flash {
  position: absolute; left: 50%; top: 16px; z-index: 4;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 0, 105, 0.9);
  color: #fff;
  font-weight: 800; font-size: 14px;
  white-space: nowrap;
  pointer-events: none;
  animation: flash-up 1.1s ease forwards;
}
@keyframes flash-up {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.9); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -14px); }
}

.game-controls { margin-top: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.pad-btn {
  height: 56px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-size: 20px; font-weight: 800;
  transition: transform 0.08s, background 0.15s;
}
.pad-btn:active { transform: scale(0.92); background: rgba(255, 0, 105, 0.25); }
.dpad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-areas: ". up ." "left down right";
  gap: 8px;
  justify-content: center;
}
.dpad .up { grid-area: up; }
.dpad .left { grid-area: left; }
.dpad .down { grid-area: down; }
.dpad .right { grid-area: right; }
.tetris-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }

.tetris-wrap { display: flex; gap: 12px; align-items: flex-start; }
.tetris-side { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; }
.tetris-side b { font-family: var(--display); font-size: 18px; margin-bottom: 8px; }
.side-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.m3-board { position: relative; overflow: hidden; border-radius: 14px; background: rgba(0, 0, 0, 0.28); touch-action: none; }
.m3-tile {
  position: absolute; left: 0; top: 0;
  width: var(--tile); height: var(--tile);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.26s cubic-bezier(0.3, 0.7, 0.4, 1);
}
.m3-face {
  width: 88%; height: 88%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  font-size: calc(var(--tile) * 0.56);
  transition: transform 0.2s, opacity 0.2s, background 0.2s;
}
.m3-tile.selected .m3-face { transform: scale(1.12); background: rgba(255, 0, 105, 0.32); box-shadow: 0 0 0 2px var(--pink-soft); }
/* совпадение: эмодзи вспыхивает, раздувается и лопается */
.m3-tile.pop .m3-face { animation: m3-pop 0.26s ease-in forwards; }
@keyframes m3-pop {
  0% { transform: scale(1); }
  35% {
    transform: scale(1.38);
    background: rgba(255, 255, 255, 0.4);
    filter: brightness(1.5) drop-shadow(0 0 10px rgba(255, 255, 255, 0.9));
  }
  100% { transform: scale(0.1); opacity: 0; }
}
.spark {
  position: absolute;
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  pointer-events: none;
  z-index: 3;
}
.float-score {
  position: absolute; z-index: 4;
  font-family: var(--display); font-weight: 800; font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(255, 0, 105, 0.9);
  pointer-events: none;
  animation: float-score 0.9s ease-out forwards;
}
@keyframes float-score {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(1); }
}
.hud-chip.urgent {
  color: #fff;
  background: rgba(255, 77, 109, 0.35);
  border-color: var(--lose);
  animation: urgent-pulse 1s ease;
}
@keyframes urgent-pulse { 0% { transform: scale(1.15); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .m3-tile, .m3-face { transition-duration: 0.05s; }
}

/* ---------- колесо фортуны ---------- */

.wheel-wrap { position: relative; width: 210px; height: 210px; }
.wheel {
  width: 100%; height: 100%;
  transition: transform 4.8s cubic-bezier(0.12, 0.8, 0.1, 1);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}
.wheel-svg { display: block; width: 100%; height: 100%; }
.wheel-pointer {
  position: absolute; top: -8px; left: 50%; z-index: 2;
  width: 0; height: 0;
  transform: translateX(-50%);
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 26px solid #fff;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}
.wheel-emoji { font-size: 15px; }
.wheel-label { font-family: var(--display); font-weight: 800; font-size: 11px; fill: #fff; }
.wheel-label.real { fill: #2a1020; }
.wheel-hub { font-size: 15px; }
.wheel-light { fill: #fff6c2; }
.wheel-light.alt { fill: #ff5c9a; }
.wheel.spinning .wheel-light { animation: wheel-blink 0.3s steps(2) infinite; }
.wheel.spinning .wheel-light.alt { animation-delay: 0.15s; }
@keyframes wheel-blink { 50% { opacity: 0.2; } }

.prize-list { list-style: none; padding: 0; margin: 6px 0 10px; }
.prize-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.prize-list li span { color: var(--gold); font-weight: 800; white-space: nowrap; }
.prize-card .prize-emoji { font-size: 60px; line-height: 1.1; }
.prize-card h3 { margin-top: 8px; }

/* ---------- призы месяца (вкладка «Топ») ---------- */

.prizes-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(255, 201, 77, 0.28), transparent 55%),
    linear-gradient(160deg, rgba(255, 0, 105, 0.2), rgba(122, 44, 255, 0.14));
  border-color: rgba(255, 201, 77, 0.4);
}
.month-prizes { list-style: none; margin: 12px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.month-prizes li {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.month-prizes li:first-child { background: rgba(255, 201, 77, 0.16); color: var(--gold); }
.prizes-note { margin: 0; color: var(--muted); font-size: 12px; }

/* ---------- кнопка звука в шапке ---------- */

.topbar-right { display: flex; align-items: center; gap: 8px; }
.sound-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.12s;
}
.sound-btn:active { transform: scale(0.9); }
