:root {
  --cell: clamp(72px, 12.4vw, 124px);
  --reels: 5;
  --rows: 4;
  --gap: 6px;

  --em-green: #2bf5a0;
  --em-glow: #00ff9d;
  --gold: #ffcf5c;
  --gold-hi: #fff2ae;
  --gold-deep: #b8862b;
  --gold-shadow: #4a2706;
  --blood: #ff5277;
  --ink: #e8fff4;
  --ink-dim: #8fc7ab;
  --glass: rgba(6, 22, 15, 0.62);
  --glass-brd: rgba(43, 245, 160, 0.32);

  --font-display: "Cinzel", serif;
  --font-ui: "Rajdhani", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #02100a;
  color: var(--ink);
  font-family: var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body { display: grid; place-items: center; min-height: 100vh; padding: 12px; }

/* ---------- Фоновые слои ---------- */
.bg-cave {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("assets/web/background_emerald_abyss.jpg") center/cover no-repeat, radial-gradient(circle at 50% 18%, #06231a, #010a06 75%);
  transform: scale(1.03);
}
.bg-vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(80% 65% at 50% 42%, rgba(0, 255, 157, .08), transparent 45%, rgba(2, 12, 8, 0.62) 78%, rgba(1, 6, 4, 0.94) 100%),
    linear-gradient(180deg, rgba(1, 8, 5, 0.68), transparent 22%, transparent 68%, rgba(1, 8, 5, 0.82));
}
.bg-glow {
  position: fixed; inset: -20%; z-index: 1; pointer-events: none;
  background: radial-gradient(700px 700px at 50% 12%, rgba(0, 255, 157, 0.14), transparent 60%);
  filter: blur(8px); animation: glowPulse 9s ease-in-out infinite alternate;
}
@keyframes glowPulse { from { opacity: .5; } to { opacity: 1; } }
.fx-canvas { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* ---------- Корпус ---------- */
.machine {
  position: relative; z-index: 10;
  width: min(1040px, 100%);
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px clamp(16px, 2.8vw, 30px) 20px;
  background:
    linear-gradient(180deg, rgba(14, 48, 31, 0.72), rgba(2, 12, 8, 0.9)),
    radial-gradient(70% 100% at 50% 0%, rgba(0, 255, 157, .12), transparent 70%);
  border: 1px solid rgba(255, 207, 92, .22);
  border-radius: 26px;
  box-shadow:
    0 0 0 1px rgba(43, 245, 160, 0.18) inset,
    0 2px 0 rgba(255, 242, 174, .18) inset,
    0 32px 90px rgba(0, 0, 0, 0.78),
    0 0 80px rgba(0, 255, 157, 0.2);
  backdrop-filter: blur(8px);
}
.machine::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 20px;
  border: 1px solid rgba(43, 245, 160, .18);
  pointer-events: none;
}
.machine::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 242, 174, .75), transparent);
  pointer-events: none;
}

/* ---------- Шапка ---------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  position: relative;
  padding: 8px 10px 12px;
}
.brand {
  grid-column: 2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .86;
  min-width: 0;
  pointer-events: none;
  padding: 0 18px 4px;
}
.brand::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 16px;
  background:
    radial-gradient(closest-side, rgba(0, 255, 157, .7), transparent 70%) center/42px 100% no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 207, 92, .75), transparent);
  filter: drop-shadow(0 0 10px rgba(0, 255, 157, .45));
  opacity: .9;
}
.brand-logo-svg {
  width: clamp(360px, 54vw, 690px);
  max-width: 100%;
  height: auto;
  overflow: visible;
}
.logo-back {
  font-family: var(--font-display);
  font-size: 106px;
  font-weight: 900;
  letter-spacing: 11px;
  fill: transparent;
  stroke: #3e2205;
  stroke-width: 14px;
  stroke-linejoin: round;
  opacity: .98;
}
.logo-main {
  font-family: var(--font-display);
  font-size: 106px;
  font-weight: 900;
  letter-spacing: 11px;
  fill: url(#logoFill);
  stroke: #ffe07a;
  stroke-width: 2.4px;
  filter: url(#logoGlow);
}
.logo-sub {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 9px;
  fill: url(#subFill);
  filter: drop-shadow(0 2px 0 #000) drop-shadow(0 0 7px rgba(255, 207, 92, .75));
}
.logo-rule {
  fill: none;
  stroke: url(#subFill);
  stroke-width: 2px;
  filter: drop-shadow(0 0 6px rgba(0, 255, 157, .55));
}

.topbar-right {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
}
.ways-tag {
  font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 2px;
  color: var(--gold-hi); padding: 5px 15px; border-radius: 99px;
  border: 1px solid rgba(255, 207, 92, 0.55);
  background: linear-gradient(180deg, rgba(255, 207, 92, 0.16), rgba(0, 0, 0, .28));
  box-shadow: 0 0 14px rgba(255, 207, 92, 0.24), inset 0 1px 0 rgba(255,255,255,.18);
}

/* Шкала ярости */
.rage { display: flex; align-items: center; gap: 10px; }
.rage-label { font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: 2px; color: var(--em-green); text-shadow: 0 0 10px rgba(0,255,157,.5); }
.rage-track {
  width: clamp(130px, 24vw, 230px); height: 14px;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(43, 245, 160, 0.45);
  border-radius: 99px; overflow: hidden; box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.85);
}
.rage-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #0b8a55, var(--em-green), var(--gold));
  box-shadow: 0 0 16px rgba(0, 255, 157, 0.85); transition: width .4s cubic-bezier(.2, .8, .2, 1);
}
.rage-pct { font-weight: 700; font-size: 12px; color: var(--ink-dim); min-width: 34px; text-align: right; }
.rage.full .rage-fill { animation: ragePulse .6s ease-in-out infinite alternate; }
@keyframes ragePulse { to { filter: brightness(1.7); } }

/* ---------- HUD бонуса ---------- */
.bonus-hud {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 8px 16px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(0, 255, 157, 0.14), rgba(255, 207, 92, 0.12));
  border: 1px solid var(--glass-brd);
  font-family: var(--font-display); font-weight: 700; letter-spacing: 1px;
  font-size: clamp(12px, 2.4vw, 16px);
  box-shadow: 0 0 26px rgba(0, 255, 157, 0.2);
}
.hud-mode-icon { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--gold); box-shadow: 0 0 10px rgba(255,207,92,.5); }
.hud-mode { color: var(--gold); text-shadow: 0 0 10px rgba(255, 207, 92, 0.5); }
.hud-fs { color: var(--ink); }
.hud-fs b { color: var(--em-green); }
.hud-mult {
  display: grid; place-items: center; width: 56px; height: 56px;
  background: url("assets/web/multiplier_badge_emerald.jpg") center/contain no-repeat;
  color: #fff; font-size: 17px; text-shadow: 0 0 10px rgba(0, 255, 157, 0.9);
}
.hud-mult b { color: var(--gold); }

/* ---------- Баннер ---------- */
.banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  text-align: center; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(15px, 3.2vw, 25px); letter-spacing: 2px;
  padding: 8px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(0, 255, 157, 0.18), rgba(255, 207, 92, 0.18));
  border: 1px solid var(--glass-brd); color: var(--gold);
  text-shadow: 0 0 16px rgba(255, 207, 92, 0.65);
  animation: bannerIn .4s ease, bannerGlow 1.4s ease-in-out infinite alternate;
}
.banner-icon { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid var(--gold); box-shadow: 0 0 14px rgba(255,207,92,.6); }
@keyframes bannerIn { from { transform: translateY(-8px) scale(.96); opacity: 0; } }
@keyframes bannerGlow { to { filter: brightness(1.3); } }

/* ---------- Поле ---------- */
.board { position: relative; display: flex; justify-content: center; }
.board-frame {
  position: relative; width: max-content; max-width: 100%; padding: 16px; border-radius: 22px;
  background:
    radial-gradient(80% 70% at 50% 40%, rgba(0, 255, 157, .13), transparent 60%),
    linear-gradient(rgba(2, 12, 8, 0.62), rgba(2, 12, 8, 0.78)),
    url("assets/web/reel_background_dark_ruins.jpg") center/cover no-repeat;
  border: 1px solid rgba(255, 207, 92, .78);
  box-shadow:
    inset 0 0 55px rgba(0, 0, 0, 0.86),
    inset 0 0 0 1px rgba(255, 242, 174, .2),
    0 0 34px rgba(0, 255, 157, 0.22),
    0 18px 38px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.board-frame::before {
  content: ""; position: absolute; inset: 7px; border-radius: 16px;
  border: 1px solid rgba(43, 245, 160, 0.24); pointer-events: none; z-index: 5;
  box-shadow:
    inset 0 0 26px rgba(0, 255, 157, 0.16),
    0 0 0 1px rgba(0, 0, 0, .48);
}
.board-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background:
    radial-gradient(18px 18px at 18px 18px, var(--gold-hi), var(--gold) 35%, transparent 38%),
    radial-gradient(18px 18px at calc(100% - 18px) 18px, var(--gold-hi), var(--gold) 35%, transparent 38%),
    radial-gradient(18px 18px at 18px calc(100% - 18px), var(--gold-hi), var(--gold) 35%, transparent 38%),
    radial-gradient(18px 18px at calc(100% - 18px) calc(100% - 18px), var(--gold-hi), var(--gold) 35%, transparent 38%);
  opacity: .72;
}
.reels {
  position: relative; display: grid;
  grid-template-columns: repeat(var(--reels), var(--cell));
  gap: var(--gap); justify-content: center;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 0 28px rgba(0,255,157,.12);
}
.reel {
  position: relative; width: var(--cell);
  height: calc(var(--cell) * var(--rows) + var(--gap) * (var(--rows) - 1));
  overflow: hidden; border-radius: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(0, 0, 0, 0.48));
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.82),
    inset 1px 0 0 rgba(255, 207, 92, .18),
    inset -1px 0 0 rgba(0, 0, 0, .72);
  contain: paint;
}
.reel::before,
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  z-index: 4;
  pointer-events: none;
}
.reel::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent);
}
.reel::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .72), transparent);
}
.reel.spinning::before {
  background: linear-gradient(180deg, rgba(0, 0, 0, .82), transparent);
}
.reel.spinning .strip {
  filter: blur(2px) brightness(.75) saturate(1.1) drop-shadow(0 0 8px rgba(0, 255, 157, .22));
}
.reel.thud { animation: thud .26s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes thud { 0% { transform: translateY(-8px); } 52% { transform: translateY(4px); } 100% { transform: none; } }

/* Антиципация скаттеров — золотое напряжение на ещё крутящемся барабане */
.reel.anticipate {
  animation: anticipatePulse .45s ease-in-out infinite alternate;
}
.reel.anticipate::before {
  background: linear-gradient(180deg, rgba(64, 44, 0, .55), transparent);
}
@keyframes anticipatePulse {
  from { box-shadow: inset 0 0 26px rgba(255, 207, 92, .45), 0 0 18px rgba(255, 207, 92, .35); }
  to   { box-shadow: inset 0 0 42px rgba(255, 207, 92, .8),  0 0 32px rgba(255, 207, 92, .6); }
}

/* Расширенный Wild на весь барабан */
.reel.wild-full::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: url("assets/web/expanding_wild_reel.jpg") center/cover no-repeat;
  animation: wildReelIn .4s ease, wildReelGlow 1.8s ease-in-out infinite alternate;
}
@keyframes wildReelIn { from { opacity: 0; transform: scaleY(.6); } }
@keyframes wildReelGlow { to { filter: brightness(1.3) drop-shadow(0 0 16px rgba(0, 255, 157, 0.8)); } }
.reel.locked::before {
  content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  height: auto;
  background: none;
  border-radius: 10px; border: 2px solid var(--gold);
  box-shadow: inset 0 0 26px rgba(255, 207, 92, 0.4), 0 0 18px rgba(255, 207, 92, 0.6);
}
.reel.locked .strip::after {
  content: ""; position: absolute; top: 4px; right: 4px; z-index: 6; width: 34%; height: 24%;
  background: url("assets/web/abyss_lock_overlay.jpg") center/contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 207, 92, 0.8));
}

.strip {
  position: absolute; left: 0; top: 0; width: 100%;
  display: flex; flex-direction: column; gap: var(--gap); will-change: transform; z-index: 2;
}
.cell {
  width: var(--cell); height: var(--cell);
  border-radius: 0; position: relative; overflow: hidden;
  background: #04130c; user-select: none;
  box-shadow: inset 0 0 0 1px rgba(255, 207, 92, .18);
}
.cell .glyph {
  width: 100%; height: 100%; object-fit: cover; display: block;
  -webkit-user-drag: none;
  transform: scale(1.12);
}
.cell .glyph-fb {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  font-family: "Cinzel", serif; font-weight: 900; line-height: 1;
  font-size: calc(var(--cell) * 0.46);
  color: #f4ffe9;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .85), 0 0 16px rgba(0, 255, 157, .55);
  background: radial-gradient(circle at 50% 34%, rgba(12, 74, 46, .95), #04130c 72%);
}
.cell.noimg .glyph { display: none; }
.cell.noimg .glyph-fb { display: flex; }
.cell.noimg.s-wild .glyph-fb { background: radial-gradient(circle at 50% 34%, rgba(0, 168, 100, .95), #041a10 72%); color: #eafff2; }
.cell.noimg.s-scatter .glyph-fb { background: radial-gradient(circle at 50% 34%, rgba(150, 110, 16, .95), #150f02 72%); color: #ffe6a0; text-shadow: 0 2px 6px rgba(0,0,0,.85), 0 0 16px rgba(255, 207, 92, .6); }
.cell.noimg.low .glyph-fb { font-family: "Rajdhani", sans-serif; color: #c7edd6; text-shadow: 0 2px 5px rgba(0, 0, 0, .8); background: radial-gradient(circle at 50% 40%, rgba(9, 46, 30, .92), #04130c 74%); }
.img-broken { display: none !important; }
.cell.s-wild { box-shadow: inset 0 0 22px rgba(0, 255, 157, 0.4); animation: wildPulse 1.7s ease-in-out infinite alternate; }
@keyframes wildPulse { to { box-shadow: inset 0 0 32px rgba(0, 255, 157, 0.7); } }

.cell.s-scatter { box-shadow: inset 0 0 20px rgba(255, 207, 92, 0.35); animation: scatterPulse 1.4s ease-in-out infinite alternate; }
@keyframes scatterPulse { to { box-shadow: inset 0 0 30px rgba(255, 207, 92, 0.65); } }

.cell.win { z-index: 5; animation: cellWin .7s ease-in-out infinite alternate; }
@keyframes cellWin {
  from { transform: scale(1); }
  to { transform: scale(1.07); filter: brightness(1.35) drop-shadow(0 0 14px rgba(0, 255, 157, 0.9)); }
}
.cell.win::after {
  content: ""; position: absolute; inset: 0; border-radius: 9px;
  border: 2px solid var(--gold); box-shadow: inset 0 0 18px rgba(255, 207, 92, 0.5);
}
.cell.dim { opacity: 0.32; transition: opacity .2s; }
.cell.convert { animation: convert .6s ease; }
@keyframes convert {
  0% { transform: scale(1); }
  40% { transform: scale(1.28) rotate(5deg); filter: brightness(2) drop-shadow(0 0 22px var(--em-glow)); }
  100% { transform: scale(1); }
}

/* ---------- Кинематографика INSANE DESIRE ---------- */
.cinematic {
  position: absolute; inset: 0; z-index: 30;
  display: grid; place-items: center; overflow: hidden; border-radius: 16px;
  background: #000; animation: cineIn .35s ease;
}
@keyframes cineIn { from { opacity: 0; } }
.cinematic-eye {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  animation: eyeZoom 1.3s ease-out both;
}
@keyframes eyeZoom { from { transform: scale(1.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cinematic-text {
  position: relative; z-index: 2; margin-top: 6%;
  font-family: var(--font-display); font-weight: 900; letter-spacing: 8px;
  font-size: clamp(26px, 7vw, 64px);
  background: linear-gradient(180deg, #eafff5, var(--em-green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(0, 255, 157, 0.9);
  filter: drop-shadow(0 0 28px rgba(0, 255, 157, 0.8));
  animation: cineText .6s ease both;
}
@keyframes cineText { from { opacity: 0; transform: translateY(14px); letter-spacing: 22px; } }

/* ---------- Win pop ---------- */
.win-pop { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; text-align: center; pointer-events: none; }
.win-pop-title {
  font-family: var(--font-display); font-weight: 900; letter-spacing: 4px;
  font-size: clamp(18px, 4.6vw, 40px); color: var(--em-green);
  text-shadow: 0 0 22px rgba(0, 255, 157, 0.95);
}
.win-pop-amount {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(32px, 8.5vw, 78px);
  background: linear-gradient(90deg, var(--gold), var(--em-green));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(255, 207, 92, 0.85));
}
.win-pop.show { animation: winPop .5s cubic-bezier(.2, 1.6, .3, 1); }
@keyframes winPop { from { transform: scale(.4); opacity: 0; } }

/* ---------- Управление ---------- */
.controls { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: clamp(8px, 2vw, 18px); }
.stat {
  background:
    linear-gradient(180deg, rgba(15, 55, 36, .72), rgba(2, 13, 8, .84));
  border: 1px solid rgba(43, 245, 160, .28);
  border-radius: 14px;
  padding: 9px 16px;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 174, .12),
    inset 0 0 18px rgba(0,0,0,.45),
    0 0 16px rgba(0, 255, 157, .08);
}
.stat-label { font-size: 10px; letter-spacing: 2px; color: var(--ink-dim); font-weight: 700; }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: clamp(14px, 2.8vw, 21px); color: var(--ink); text-shadow: 0 0 12px rgba(0, 255, 157, 0.4); }
.win-stat .stat-value { color: var(--gold); text-shadow: 0 0 12px rgba(255, 207, 92, 0.6); }
.win-stat.flash { animation: statFlash .5s ease; }
@keyframes statFlash { 50% { transform: scale(1.12); } }

.bet-box { display: flex; align-items: center; gap: 8px; }
.bet-stat { min-width: 76px; }
.bet-btn {
  width: 38px; height: 38px; border-radius: 12px; cursor: pointer;
  font-size: 22px; font-weight: 700; line-height: 1; color: var(--ink);
  background: var(--glass); border: 1px solid var(--glass-brd); transition: transform .1s, box-shadow .2s;
}
.bet-btn:hover { box-shadow: 0 0 16px rgba(0, 255, 157, 0.5); }
.bet-btn:active { transform: scale(0.92); }
.bet-btn:disabled { opacity: .4; cursor: not-allowed; }

.spin-btn {
  position: relative; width: clamp(86px, 17vw, 124px); height: clamp(86px, 17vw, 124px);
  border-radius: 50%; cursor: pointer; border: none; background: transparent; padding: 0;
  filter: drop-shadow(0 8px 22px rgba(0, 255, 157, 0.56)) drop-shadow(0 9px 0 rgba(0,0,0,.58));
  transition: transform .12s, filter .2s;
}
.spin-btn::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: url("assets/web/spin_button_emerald.jpg") center/contain no-repeat, radial-gradient(circle at 50% 38%, #0bbf6e, #044f2c 70%);
}
.spin-btn:hover { filter: drop-shadow(0 10px 30px rgba(0, 255, 157, 0.85)); }
.spin-btn:active { transform: scale(0.94); }
.spin-btn:disabled { filter: grayscale(.3) brightness(.75); cursor: not-allowed; }
.spin-btn-ring { position: absolute; inset: 12%; border-radius: 50%; border: 2px dashed rgba(255, 255, 255, 0.35); }
.spin-btn.spinning .spin-btn-ring { animation: ringSpin .8s linear infinite; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
.spin-btn-text {
  position: relative; z-index: 1; font-family: var(--font-display); font-weight: 900;
  font-size: clamp(13px, 3vw, 20px); color: #052015; text-shadow: 0 1px 3px rgba(255, 255, 255, 0.5);
  display: grid; place-items: center; width: 100%; height: 100%;
}

.side-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-buttons .span-2 { grid-column: span 2; }
.invite-btn {
  color: var(--gold);
  border-color: rgba(255, 207, 92, .5);
}
.invite-btn:hover { box-shadow: 0 0 14px rgba(255, 207, 92, 0.45); }
.ghost-btn {
  cursor: pointer; padding: 7px 12px; border-radius: 10px;
  font-family: var(--font-ui); font-weight: 700; letter-spacing: 1px; font-size: 12px;
  color: var(--ink-dim);
  background: linear-gradient(180deg, rgba(16, 56, 37, .58), rgba(0, 0, 0, 0.34));
  border: 1px solid rgba(43, 245, 160, .28);
  transition: color .2s, box-shadow .2s, border-color .2s;
}
.ghost-btn:hover { color: var(--ink); box-shadow: 0 0 14px rgba(0, 255, 157, 0.35); }
.ghost-btn.active { color: var(--em-green); border-color: var(--em-green); box-shadow: 0 0 14px rgba(0, 255, 157, 0.6); }

/* ---------- Режимы оформления ---------- */
body.desire .machine { box-shadow: 0 0 0 1px rgba(255,207,92,.12) inset, 0 30px 90px rgba(0,0,0,.75), 0 0 100px rgba(0, 255, 157, 0.6); }
body.bonus .board-frame { box-shadow: inset 0 0 60px rgba(0,0,0,.8), 0 0 50px rgba(255, 207, 92, 0.5), 0 0 0 1px rgba(255,207,92,.5); }
body.madness .machine { animation: madShake .5s ease-in-out infinite; }
@keyframes madShake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-1px, 1px); } 75% { transform: translate(1px, -1px); } }

/* ---------- Модалка ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(2, 8, 5, 0.82); backdrop-filter: blur(6px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-card {
  position: relative; width: min(660px, 92vw); max-height: 88vh; overflow-y: auto; padding: 26px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 38, 25, 0.97), rgba(3, 14, 9, 0.98));
  border: 1px solid var(--glass-brd); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.78), 0 0 50px rgba(0, 255, 157, 0.25);
}
.modal-card h2 {
  font-family: var(--font-display); letter-spacing: 1px; margin-bottom: 6px;
  background: linear-gradient(90deg, var(--em-green), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal-note { color: var(--ink-dim); font-size: 13px; margin-bottom: 18px; line-height: 1.5; }
.modal-note b { color: var(--ink); }
.modal-close {
  position: absolute; top: 14px; right: 16px; width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--ink); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-brd);
}
.paytable-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(43, 245, 160, 0.05); border: 1px solid rgba(43, 245, 160, 0.12); }
.pt-sym { width: 50px; height: 50px; border-radius: 8px; object-fit: cover; border: 1px solid var(--glass-brd); flex-shrink: 0; }
.pt-pay { font-size: 13px; color: var(--ink-dim); line-height: 1.5; }
.pt-pay b { color: var(--ink); }
.rules { margin-top: 20px; }
.rules h3 { font-family: var(--font-display); color: var(--gold); margin-bottom: 8px; letter-spacing: 1px; }
.rules ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rules li { font-size: 13px; color: var(--ink-dim); line-height: 1.5; padding-left: 16px; position: relative; }
.rules li::before { content: "◆"; position: absolute; left: 0; color: var(--em-green); font-size: 10px; top: 3px; }
.rules b { color: var(--ink); }

[hidden] { display: none !important; }

/* ---------- Адаптив ---------- */
@media (max-width: 600px) {
  .controls { grid-template-columns: 1fr 1fr; grid-template-areas: "bal win" "bet bet" "spin spin" "side side"; }
  .controls > .stat:first-child { grid-area: bal; }
  .win-stat { grid-area: win; }
  .bet-box { grid-area: bet; justify-content: center; }
  .spin-btn { grid-area: spin; justify-self: center; }
  .side-buttons { grid-area: side; grid-template-columns: repeat(4, auto); justify-content: center; }
  .side-buttons .span-2 { grid-column: span 2; }
  .topbar { grid-template-columns: 1fr; justify-items: center; gap: 10px; }
  .brand { grid-column: 1; padding-inline: 8px; }
  .brand-logo-svg { width: min(92vw, 500px); }
  .topbar-right { grid-column: 1; justify-self: center; align-items: center; }
  .rage { justify-content: center; }
  .bonus-hud { flex-wrap: wrap; gap: 10px; }
}
