:root {
  --bg: #0e1116;
  --card: #171b22;
  --card2: #1f242d;
  --accent: #5b8cff;
  --accent2: #8f5bff;
  --text: #eef1f6;
  --muted: #8b94a5;
  --green: #3ddc84;
  --red: #ff5c5c;
  --gold: #ffc542;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  user-select: none;
}

#app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--card);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid #ffffff10;
}
.brand { font-size: 16px; }
.balance { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--gold); }
.balance select {
  background: var(--card2); color: var(--text); border: none;
  border-radius: 8px; padding: 6px 8px; font-size: 13px;
}

main { flex: 1; padding: 14px; }

.bottombar {
  display: flex; border-top: 1px solid #ffffff10;
  background: var(--card); position: sticky; bottom: 0;
}
.bottombar button {
  flex: 1; background: none; border: none; color: var(--muted);
  padding: 14px 0; font-size: 14px; font-weight: 600;
}
.bottombar button.active { color: var(--accent); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  background: linear-gradient(160deg, var(--card2), var(--card));
  border-radius: 16px; padding: 18px 12px; text-align: center;
  border: 1px solid #ffffff0d; transition: transform .1s;
}
.game-card:active { transform: scale(.97); }
.game-card .emoji { font-size: 34px; display: block; margin-bottom: 8px; }
.game-card .name { font-size: 13px; font-weight: 600; }
.game-card.folder-card { text-align: center; padding: 22px 12px; }
.game-card.folder-card .cnt { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }

.panel { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.title { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 13px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  background: var(--card2); border: 1px solid #ffffff0d; color: var(--text);
  padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
}
.chip.active { border-color: var(--accent); color: var(--accent); }
.chip-pick {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; min-width: 110px; text-align: center;
}
.chip-pick b { font-size: 15px; }
.chip-pick small { font-size: 11px; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.chip-pick.active small { color: var(--accent); }

/* ---- upgrader (rubup-стиль) ---- */
.upg-panel { --upg-gold: #ffc542; }

.upg-gauge { position: relative; width: 172px; height: 172px; margin: 4px auto 10px; }
.upg-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.upg-track { fill: none; stroke: #ffffff12; stroke-width: 7; }
.upg-progress {
  fill: none; stroke: var(--upg-gold); stroke-width: 7; stroke-linecap: round;
  stroke-dasharray: 263.9; stroke-dashoffset: 0;
  transform-box: fill-box; transform-origin: center;
  filter: drop-shadow(0 0 6px #ffc54266);
}
.upg-core {
  position: absolute; inset: 21px; border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #2a344699, #0f131b);
  border: 1px solid #ffffff0d;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; color: var(--text);
  transition: box-shadow .3s ease, color .3s ease;
}
.upg-pointer {
  position: absolute; left: 50%; bottom: 6px; margin-left: -8px;
  width: 0; height: 0; border-left: 8px solid transparent;
  border-right: 8px solid transparent; border-bottom: 13px solid var(--upg-gold);
  filter: drop-shadow(0 2px 3px #000a);
}
.upg-gauge.win .upg-core {
  box-shadow: 0 0 26px #3ddc8455 inset, 0 0 18px #3ddc8440;
  color: var(--green);
}
.upg-gauge.lose { animation: upgShake .5s ease; }
.upg-gauge.lose .upg-core { box-shadow: 0 0 26px #ff5c5c55 inset; }
@keyframes upgShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.upg-chance { text-align: center; margin-bottom: 14px; line-height: 1.15; }
.upg-chance span { display: block; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.upg-chance b { font-size: 30px; font-weight: 800; color: var(--upg-gold); }

.upg-cards { display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.upg-card {
  flex: 1; min-width: 0; background: #1a2130; border: 1px solid #ffffff0d;
  border-radius: 14px; padding: 10px;
}
.upg-card--win { border-color: #ffc54233; }
.upg-card-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.upg-card-value { font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upg-card--win .upg-card-value { color: var(--upg-gold); }
.upg-card-sub { font-size: 11px; color: var(--muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upg-arrow {
  flex: 0 0 auto; align-self: center; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #1a2130; border: 1px solid #ffffff14;
  color: var(--upg-gold); font-weight: 700;
}

.upg-slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.upg-pill {
  flex: 0 0 auto; background: var(--upg-gold); color: #17140a;
  font-weight: 800; font-size: 13px; padding: 6px 12px; border-radius: 20px;
}
.upg-range {
  flex: 1; min-width: 0; -webkit-appearance: none; appearance: none;
  height: 8px; border-radius: 8px; background: #2a3242; outline: none;
}
.upg-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px;
  border-radius: 50%; background: var(--upg-gold); border: 3px solid #14161c;
  box-shadow: 0 2px 6px #000a; cursor: pointer;
}
.upg-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--upg-gold); border: 3px solid #14161c;
}

.upg-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.upg-strip::-webkit-scrollbar { display: none; }
.upg-tile {
  flex: 0 0 auto; width: 60px; padding: 8px 4px; border-radius: 12px; text-align: center;
  background: #1a2130; border: 1px solid #ffffff0d;
  transition: border-color .15s ease, background .15s ease;
}
.upg-tile.active { border-color: var(--upg-gold); background: #2a2410; }
.upg-tile-mult { display: block; font-size: 13px; font-weight: 800; color: var(--upg-gold); }
.upg-tile-chance { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }

.upg-btn {
  background: linear-gradient(180deg, #ffd75e, #ffb020);
  color: #17140a; font-weight: 800; border: none;
}

.cur-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 7px 8px; flex: 1 1 42%; min-width: 74px;
}
.cur-chip b { font-size: 12px; font-weight: 700; }
.cur-chip small { font-size: 10px; color: var(--muted); font-weight: 600; }
.cur-chip.active small { color: var(--accent); }
.upg-panel .cur-chip.active { border-color: var(--upg-gold); color: var(--upg-gold); background: #2a2410; }
.upg-panel .cur-chip.active small { color: var(--upg-gold); opacity: .85; }

.app-toast {
  position: fixed; left: 50%; bottom: 86px; z-index: 60;
  max-width: 84%; padding: 10px 16px; border-radius: 14px;
  background: #171a21; border: 1px solid rgba(255,255,255,.1);
  color: #eef1f7; font-size: 14px; line-height: 1.35; text-align: center;
  opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

input[type=number], input[type=text] {
  width: 100%; padding: 12px; border-radius: 12px; border: 1px solid #ffffff14;
  background: var(--card2); color: var(--text); font-size: 16px; margin: 8px 0;
}

.btn {
  width: 100%; padding: 14px; border-radius: 14px; border: none;
  font-size: 16px; font-weight: 700; color: #fff; margin-top: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.btn:disabled { opacity: .5; }

.center { text-align: center; }
.reels { font-size: 44px; letter-spacing: 6px; margin: 14px 0; }
.result-win { color: var(--green); font-weight: 700; font-size: 18px; }
.result-lose { color: var(--red); font-weight: 700; font-size: 18px; }
.result-small { color: var(--yellow, #e0a53a); font-weight: 600; font-size: 16px; }
.boost-on { color: var(--green); font-weight: 600; }
.in-label { font-size: 12px; font-weight: 600; margin: 10px 0 4px; }

/* 🚀 Краш: полёт ракеты с альтушкой Ксюшей */
.crash-stage {
  position: relative; height: 205px; border-radius: 14px; overflow: hidden;
  margin: 10px 0 6px; background: radial-gradient(130% 110% at 15% 100%, #131b2e 0%, #0a0e18 72%);
}
.crash-stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 47px, rgba(255,255,255,.05) 47px 48px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(255,255,255,.05) 47px 48px);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.2));
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.2));
}
.crash-mult {
  position: absolute; top: 10px; left: 14px; z-index: 3; font-size: 30px; font-weight: 800;
  color: #ffd166; text-shadow: 0 0 14px rgba(255,209,102,.4); transition: color .25s;
}
.crash-mult.won { color: #7ee787; text-shadow: 0 0 14px rgba(126,231,135,.5); }
.crash-mult.bang { color: #ff6b6b; text-shadow: 0 0 14px rgba(255,107,107,.5); }
.crash-rocket {
  position: absolute; left: 0; top: 0; width: 205px; height: 160px; z-index: 2;
  will-change: transform; transform-origin: 50% 50%;
}
.cr-bob { animation: crbob 2s ease-in-out infinite alternate; }
@keyframes crbob { from { transform: translateY(-2px) } to { transform: translateY(2px) } }
.cr-rocket-art { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Форсаж на x10+: широкое горячее ядро, дополнительное свечение, искры и быстрые ножки */
.crash-rocket.boost10 .cr-fire { filter: drop-shadow(0 0 calc(var(--fire, .9) * 7px) rgba(255,112,40,.8)) drop-shadow(0 0 15px rgba(255,157,50,.65)); }
.crash-rocket.boost10 .cr-fire .fl1 { filter: blur(4px); animation-duration: .105s; background: linear-gradient(90deg, rgba(255,65,25,0) 0%, #ff542e 32%, #ff9b36 76%, #fff0a6 100%); }
.crash-rocket.boost10 .cr-fire .fl2 { width: 86%; height: 76%; filter: blur(2.5px); animation-duration: .09s; }
.crash-rocket.boost10 .cr-fire .fl3 { width: 64%; height: 42%; filter: blur(1.5px); }
.crash-rocket.boost10 .cr-fire b { width: 12px; height: 6px; animation-duration: .32s; box-shadow: 0 0 7px #ff9b36; }
.crash-rocket.boost10 .cr-bob { animation-duration: .7s; }
.crash-rocket.boost10 .cr-rocket-art { filter: drop-shadow(0 0 8px rgba(255,126,180,.45)); }
/* пламя: длина растёт через --fire (JS ставит по коэффициенту) */
.cr-fire {
  position: absolute; left: -48px; top: 94px; width: 78px; height: 24px; z-index: -1;
  transform-origin: 100% 50%; transform: scaleX(var(--fire, .9)); filter: drop-shadow(0 0 calc(var(--fire, .9) * 7px) rgba(255,112,40,.8));
}
.cr-fire i {
  position: absolute; right: 0; top: 50%;
  border-radius: 100px 6px 6px 100px / 50% 6px 6px 50%;
}
.cr-fire .fl1 {
  width: 100%; height: 100%; filter: blur(2.5px);
  background: linear-gradient(90deg, rgba(255,90,40,0) 0%, rgba(255,90,44,.85) 40%, #ff9e3d 100%);
  animation: crflick .16s infinite alternate;
}
.cr-fire .fl2 {
  width: 72%; height: 62%; filter: blur(2px);
  background: linear-gradient(90deg, rgba(255,190,70,0) 0%, #ffb84d 45%, #ffd166 100%);
  animation: crflick .13s infinite alternate-reverse;
}
.cr-fire .fl3 {
  width: 46%; height: 32%; filter: blur(1px); opacity: .95;
  background: linear-gradient(90deg, #fff8e0, #ffe9a8);
}
@keyframes crflick {
  from { transform: translateY(-50%) scaleX(.88) }
  to { transform: translateY(-50%) scaleX(1.15) }
}
.cr-fire b {
  position: absolute; right: 2px; top: 16%; width: 9px; height: 4px; border-radius: 50%;
  background: #ffb03d; opacity: 0; animation: crspark .55s linear infinite;
}
.cr-fire b.s2 { top: auto; bottom: 14%; animation-delay: .27s; }
@keyframes crspark {
  0% { transform: translate(4px, 0); opacity: .95 }
  100% { transform: translate(-54px, 7px); opacity: 0 }
}
.crash-rocket.dead { animation: crdead .6s ease forwards; }
@keyframes crdead { 0% { filter: brightness(2.2) } 100% { opacity: 0; filter: brightness(1) blur(2px) } }
.crash-rocket.exit { animation: crexit .55s ease-in forwards; }
@keyframes crexit { to { opacity: 0; filter: brightness(1.6) } }
.crash-boom {
  position: absolute; z-index: 4; font-size: 46px; opacity: 0; pointer-events: none;
  transform: translate(-50%, -50%) scale(.4);
}
.crash-boom.on { animation: crboom .75s ease-out forwards; }
@keyframes crboom {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.3) }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8) }
}
.big-emoji { font-size: 56px; }
.profile-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #ffffff0d; }

/* ------ mines ------ */
.mines-grid {
  display: grid; gap: 6px; margin: 10px 0;
}
.mine-cell {
  aspect-ratio: 1 / 1; border-radius: 10px; background: var(--card2);
  border: 1px solid #ffffff10; display: flex; align-items: center;
  justify-content: center; font-size: 20px; cursor: pointer;
  transition: transform .08s, background .15s;
}
.mine-cell:active { transform: scale(.94); }
.mine-cell.open { background: #1d3b2a; border-color: var(--green); }
.mine-cell.mine { background: #3b1d1d; border-color: var(--red); }
.mine-cell.boom { background: var(--red); animation: boom .4s; }
@keyframes boom { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ------ слоты: Пёсий Дом / Альтушки ------ */
.slot-panel .slot-grid {
  display: grid; gap: 6px; margin: 12px 0;
  border-radius: 14px; padding: 10px;
  background: linear-gradient(180deg, #12161d, #0d1015);
  border: 1px solid #ffffff12;
  box-shadow: inset 0 0 24px #00000080;
}
.slot-grid.dg5 { grid-template-columns: repeat(5, 1fr); }
.slot-grid.dg6 { grid-template-columns: repeat(6, 1fr); gap: 5px; }

.slot-cell {
  position: relative; aspect-ratio: 1 / 1; border-radius: 10px;
  background: var(--card2); border: 1px solid #ffffff12;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  transition: transform .15s, box-shadow .25s, background .25s;
}
.dg6 .slot-cell { font-size: 19px; border-radius: 8px; }
.slot-grid.spinning .slot-cell { animation: slotSpinBlur .5s linear infinite; }
@keyframes slotSpinBlur {
  0%   { transform: translateY(0);    filter: blur(0);   }
  50%  { transform: translateY(-6px); filter: blur(2px); }
  100% { transform: translateY(0);    filter: blur(0);   }
}
.slot-cell.win {
  background: #2f2a12; border-color: var(--gold);
  box-shadow: 0 0 12px #ffc54266, inset 0 0 8px #ffc54233;
  animation: slotWinPulse .7s ease-in-out infinite;
}
@keyframes slotWinPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}
.cell-badge {
  position: absolute; top: -6px; right: -4px;
  font-style: normal; font-size: 10px; font-weight: 800;
  background: var(--gold); color: #1b1405;
  padding: 1px 5px; border-radius: 8px;
  box-shadow: 0 2px 6px #00000066;
}

.slot-banner {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  background: radial-gradient(circle at 50% 40%, #2a2010ee, #0b0d12f5);
  animation: bannerIn .35s ease-out;
}
@keyframes bannerIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.slot-banner .sb-title {
  font-size: 30px; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 22px #ffc54288;
  animation: bannerPulse 1s ease-in-out infinite;
}
@keyframes bannerPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.slot-banner .sb-sub { font-size: 14px; color: var(--muted); max-width: 76%; }

.result-win.win-big { font-size: 22px; animation: winBig .5s ease-out; }
@keyframes winBig { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ------ plinko ------ */
.plinko-wrap { position: relative; margin: 14px auto; width: 100%; overflow: hidden; }
.plinko-board { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 auto; }
.plinko-row { display: flex; gap: 10px; justify-content: center; height: 16px; align-items: center; }
.plinko-peg { width: 8px; height: 8px; border-radius: 50%; background: #4a5266; }
.plinko-ball {
  position: absolute; font-size: 15px; line-height: 1; z-index: 2;
  transform: translateX(-50%);
  transition: left .13s linear, top .13s linear;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, .8));
  pointer-events: none;
}
.plinko-slots { display: grid; gap: 0; margin: 10px auto 0; }
.plinko-slot {
  font-size: 9px; font-weight: 700; padding: 0 1px;
  background: transparent; overflow: hidden; white-space: nowrap;
  display: flex; align-items: center; justify-content: center;
}
.plinko-slot > span, .plinko-slot {
  transition: box-shadow .15s, transform .15s;
}
.plinko-slot .plinko-pill {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 6px 0; border-radius: 6px;
  background: var(--card2); border: 1px solid #ffffff0d;
  transition: box-shadow .15s, transform .15s;
}
.plinko-slot.high .plinko-pill { background: #2a1d3b; color: #c9a0ff; }
.plinko-slot.mid .plinko-pill { background: #1d2f3b; color: #9fd0ff; }
.plinko-slot.low .plinko-pill { background: #2f1d1d; color: #ff9f9f; }
.plinko-slot.hit .plinko-pill { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; transform: translateY(-2px); }

/* ------ монетка ------ */
.coin-stage {
  perspective: 700px; height: 118px; display: flex;
  align-items: center; justify-content: center; margin: 8px 0 10px;
}
.coin { position: relative; width: 84px; height: 84px; transform-style: preserve-3d; }
.coin-face {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; backface-visibility: hidden;
}
.coin-front {
  background: radial-gradient(circle at 34% 28%, #ffe08a, #e2a92f 58%, #a8761a);
  box-shadow: 0 8px 20px #0009;
}
.coin-back {
  background: radial-gradient(circle at 34% 28%, #dde3ec, #99a1af 58%, #666d7a);
  box-shadow: 0 8px 20px #0009;
  transform: rotateY(180deg);
}
.coin.spin { animation: coinSpin .95s cubic-bezier(.22, .72, .25, 1) forwards; }
@keyframes coinSpin {
  0%   { transform: rotateY(0deg) translateY(0) scale(1); }
  45%  { transform: rotateY(calc(var(--end) * .45)) translateY(-62px) scale(1.12); }
  75%  { transform: rotateY(calc(var(--end) * .8)) translateY(-20px) scale(1.04); }
  90%  { transform: rotateY(var(--end)) translateY(5px) scale(.96); }
  100% { transform: rotateY(var(--end)) translateY(0) scale(1); }
}
.coin-stage.win { animation: stagePulse .5s ease-out; }
@keyframes stagePulse {
  0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); }
}

/* ------ кубик ------ */
.die-stage {
  perspective: 620px; height: 140px; display: flex;
  align-items: center; justify-content: center; margin: 10px 0;
}
.die-bounce { width: 86px; height: 86px; position: relative; transform-style: preserve-3d; }
.die-bounce.land { animation: dieLand .3s ease-out; }
@keyframes dieLand {
  0% { transform: translateY(-10px) scale(1.05); }
  60% { transform: translateY(0) scale(.96); }
  100% { transform: none; }
}
.die-tilt {
  width: 86px; height: 86px; transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(26deg);
}
.die-cube {
  position: relative; width: 86px; height: 86px;
  transform-style: preserve-3d; --half: 43px;
}
.die-face {
  position: absolute; inset: 0; border-radius: 16px; padding: 9px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  background: linear-gradient(160deg, #ffffff, #dedcd2);
  box-shadow: inset 0 0 0 2px #c9c7bb;
}
.die-face .pip { border-radius: 50%; }
.die-face .pip.on { background: #1a1c22; box-shadow: inset 0 -1px 2px #0007; }
.die-cube .f1 { transform: translateZ(var(--half)); }
.die-cube .f2 { transform: rotateY(90deg) translateZ(var(--half)); }
.die-cube .f3 { transform: rotateX(90deg) translateZ(var(--half)); }
.die-cube .f4 { transform: rotateY(-90deg) translateZ(var(--half)); }
.die-cube .f5 { transform: rotateY(180deg) translateZ(var(--half)); }
.die-cube .f6 { transform: rotateX(-90deg) translateZ(var(--half)); }
.die-cube.tumble { animation: dieTumble .45s linear infinite; }
@keyframes dieTumble {
  0%   { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0); }
  50%  { transform: rotateX(200deg) rotateY(160deg) rotateZ(120deg) translateY(-16px); }
  100% { transform: rotateX(400deg) rotateY(320deg) rotateZ(240deg) translateY(0); }
}
.die-cube.roll { animation: dieRoll 1.15s cubic-bezier(.2, .75, .3, 1) forwards; }
@keyframes dieRoll {
  0%   { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0); }
  25%  { transform: rotateX(-380deg) rotateY(520deg) rotateZ(200deg) translateY(-48px); }
  50%  { transform: rotateX(-760deg) rotateY(180deg) rotateZ(-340deg) translateY(-58px); }
  72%  { transform: rotateX(-1120deg) rotateY(900deg) rotateZ(520deg) translateY(-32px); }
  88%  { transform: rotateX(-1260deg) rotateY(1080deg) rotateZ(360deg) translateY(-10px); }
  100% { transform: var(--end); }
}

/* ------ дартс ------ */
.dart-board {
  position: relative; width: 210px; height: 210px; margin: 14px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, #2b3340 0 26%, #1d2430 26% 46%, #2f3846 46% 62%,
                    #1d2430 62% 78%, #333c4b 78% 88%, #1d2430 88%);
  border: 3px solid #39424f;
  box-shadow: inset 0 0 24px #0008, 0 6px 18px #0006;
}
.dart-num {
  position: absolute; left: 50%; top: 50%; width: 19px; height: 19px;
  line-height: 19px; text-align: center; font-size: 10px; font-weight: 700;
  color: #8fa0b8; border-radius: 50%;
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-88px) rotate(calc(-1 * var(--a)));
  transition: background .18s, color .18s, box-shadow .18s, transform .18s;
}
.dart-num.hit {
  background: var(--gold); color: #241a00; box-shadow: 0 0 12px var(--gold);
  transform: translate(-50%, -50%) rotate(var(--a)) translateY(-88px) rotate(calc(-1 * var(--a))) scale(1.3);
}
.dart {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 66px;
  margin: -66px 0 0 -6px; opacity: 0;
  transform-origin: 50% 100%; --r: 58px;
  transform: rotate(var(--a)) translateY(calc(-1 * var(--r)));
}
.dart.fly { animation: dartFly .85s cubic-bezier(.25, .7, .3, 1) forwards; }
@keyframes dartFly {
  0%   { transform: rotate(0deg) translateY(-235px) scale(.4); opacity: 0; }
  12%  { opacity: 1; }
  55%  { transform: rotate(var(--a)) translateY(calc(-1 * (var(--r) + 60px))) scale(1.02); }
  78%  { transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(1.06); }
  88%  { transform: rotate(var(--a)) translateY(calc(-1 * (var(--r) - 4px))) scale(.95); }
  100% { transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(1); opacity: 1; }
}
.dart-shaft {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 3px; height: 50px; border-radius: 2px;
  background: linear-gradient(#e2e7ef, #8d94a3);
}
.dart-flight {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-bottom: 12px solid var(--accent);
}
.dart-tip {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 9px solid #cfd6e2;
}
.dart-burst {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px;
  margin: -20px 0 0 -20px; border-radius: 50%;
  border: 2px solid var(--gold); opacity: 0; --r: 58px;
  transform: rotate(var(--a)) translateY(calc(-1 * var(--r)));
}
.dart-burst.go { animation: dartBurst .6s ease-out; }
@keyframes dartBurst {
  0%   { opacity: .95; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(.3); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) scale(1.8); }
}

/* ------ баскетбол ------ */
.bb-stage {
  position: relative; width: 300px; max-width: 100%; height: 170px;
  margin: 14px auto; border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, #1b2330 0 58%, #2a1f14 58% 74%, #17110b 74%);
  border: 1px solid #ffffff10;
}
.bb-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: linear-gradient(#3a2717, #241708);
}
.bb-hoop { position: absolute; right: 24px; top: 14px; width: 56px; height: 62px; }
.bb-board {
  position: absolute; right: 0; top: 0; width: 11px; height: 40px;
  border-radius: 2px; background: linear-gradient(#dbe2ec, #9aa3b2);
}
.bb-rim {
  position: absolute; left: -36px; top: 34px; width: 46px; height: 7px;
  border-radius: 4px; background: #ff7a3c; box-shadow: 0 0 12px #ff7a3c88;
}
.bb-net {
  position: absolute; left: -32px; top: 40px; width: 38px; height: 24px;
  transform-origin: top center; border-radius: 0 0 60% 60%;
  background:
    repeating-linear-gradient(90deg, #ffffff30 0 2px, transparent 2px 9px),
    repeating-linear-gradient(0deg, #ffffff22 0 2px, transparent 2px 9px);
}
.bb-net.swish { animation: netPull .55s ease-out; }
@keyframes netPull {
  0% { transform: scaleY(1); } 30% { transform: scaleY(1.45); } 100% { transform: scaleY(1); }
}
.bb-ball {
  position: absolute; left: 20px; top: 124px; font-size: 30px; line-height: 1;
  filter: drop-shadow(0 6px 8px #0008);
}
.bb-ball.swish { animation: bbSwish 1.15s cubic-bezier(.25, .7, .3, 1) forwards; }
.bb-ball.miss { animation: bbMiss 1.15s cubic-bezier(.25, .7, .3, 1) forwards; }
@keyframes bbSwish {
  0%   { transform: translate(0, 0) rotate(0deg); }
  35%  { transform: translate(70px, -100px) rotate(320deg); }
  68%  { transform: translate(152px, -118px) rotate(700deg); }
  86%  { transform: translate(164px, -88px) rotate(840deg); }
  100% { transform: translate(164px, -52px) rotate(900deg) scale(.82); }
}
@keyframes bbMiss {
  0%   { transform: translate(0, 0) rotate(0deg); }
  35%  { transform: translate(74px, -100px) rotate(320deg); }
  70%  { transform: translate(166px, -120px) rotate(720deg); }
  88%  { transform: translate(190px, -98px) rotate(830deg); }
  100% { transform: translate(186px, 30px) rotate(920deg) scale(.9); }
}
.bb-stage.hit { animation: bbGlow .7s ease-out; }
@keyframes bbGlow {
  0%   { box-shadow: inset 0 0 0 0 #ffc54200; }
  40%  { box-shadow: inset 0 0 26px 6px #ffc54255; }
  100% { box-shadow: inset 0 0 0 0 #ffc54200; }
}

/* ---- 🎱 Трубы (стиль «Ну, погоди!») ---- */
.pipes-stage {
  position: relative;
  background: linear-gradient(180deg, #ffe3b3 0%, #ffbe78 55%, #ff9e4f 100%);
  border: 4px solid #5b3a1e;
  border-radius: 14px;
  padding: 14px 12px 12px;
  margin: 10px 0 6px;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px #ffffff40;
}
/* верхняя входная труба (по центру) */
.pipes-source {
  width: 30px; height: 44px; margin: 0 auto -2px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #754a22 0 16%, #a9713a 16% 38%, #c08a4d 38% 54%, #a9713a 54% 84%, #754a22 84% 100%);
  border: 3px solid #4a2f16; border-bottom: none;
  box-shadow: inset 0 7px 9px #0005;
}
/* распределитель — горизонтальная труба, от него отходят 4 ветки */
.pipes-manifold {
  position: relative;
  height: 30px;
  border-radius: 14px;
  background: linear-gradient(180deg, #c08a4d 0 28%, #a9713a 28% 62%, #8b5a2b 62% 100%);
  border: 3px solid #4a2f16;
  box-shadow: inset 0 6px 8px #0004, 0 3px 0 #3d260f;
  margin-bottom: -2px;
}
.pipes-row { display: flex; gap: 10px; align-items: flex-start; }
.pipe-branch {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  cursor: pointer;
}
/* ветка трубы — узкая, от распределителя вниз к кольцу */
.pipe {
  width: 32px; height: 72px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #754a22 0 14%, #a9713a 14% 36%, #c08a4d 36% 52%, #a9713a 52% 86%, #754a22 86% 100%);
  border: 3px solid #4a2f16; border-top: none;
  box-shadow: inset 0 -6px 10px #0005;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6px;
  transition: transform .12s, box-shadow .2s;
}
.pipe span { font-size: 16px; font-weight: 800; color: #ffe9c7; text-shadow: 0 2px 0 #0006; }
/* баскетбольное кольцо с сеткой под каждой трубой */
.hoop { position: relative; width: 100%; height: 46px; display: flex; justify-content: center; }
.hoop-ring {
  width: 54px; height: 15px; margin-top: 4px;
  border: 5px solid #ff7a1a; border-radius: 50%;
  box-shadow: 0 2px 4px #0005, inset 0 2px 3px #0003;
  transition: box-shadow .2s, border-color .2s;
}
.hoop-net {
  position: absolute; top: 21px; left: 50%; margin-left: -20px;
  width: 40px; height: 24px;
  background:
    repeating-linear-gradient(90deg, #ffffffb0 0 1px, transparent 1px 7px),
    repeating-linear-gradient(0deg, #ffffffb0 0 1px, transparent 1px 7px);
  clip-path: polygon(0 0, 100% 0, 76% 100%, 24% 100%);
  transform-origin: top center;
}
/* выбор игрока */
.pipe-branch.sel .pipe {
  transform: translateY(-3px);
  outline: 3px dashed #fff3cf; outline-offset: 1px;
}
.pipe-branch.sel .hoop-ring { box-shadow: 0 0 14px #ffe9a8dd, 0 2px 4px #0005; }
/* попадание в кольцо */
.pipe-branch.score .pipe { box-shadow: inset 0 -6px 10px #0005, 0 0 16px #3ddc84aa; }
.pipe-branch.score .hoop-ring { border-color: #3ddc84; animation: hoopScore .7s ease; }
.pipe-branch.score .hoop-net { animation: netSwing .7s ease; }
@keyframes hoopScore {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(5px) scale(1.12); }
  60% { transform: translateY(2px) scale(1.04); }
}
@keyframes netSwing {
  0%, 100% { transform: scaleY(1); }
  35% { transform: scaleY(1.35); }
  70% { transform: scaleY(1.1); }
}
.pipes-ball {
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 9%, #e8483a 33%, #b02a1f 76%, #7c1a12 100%);
  box-shadow: 0 3px 6px #0006;
  z-index: 2; display: none;
  transition: left .16s linear, top .16s linear, opacity .35s;
}
.pipes-ball.miss { filter: grayscale(.9) brightness(.7); }




/* AltDrop Alt Girls — polished reel, cascade and win feedback */
.alt-slot-panel .slot-cell { will-change: transform, filter, box-shadow; }
.alt-slot-panel .slot-grid.spinning .slot-cell {
  animation: altReelBlur .34s ease-in-out infinite;
  filter: saturate(1.18) brightness(1.12);
}
@keyframes altReelBlur {
  0% { transform: translateY(-7px) scale(.985); filter: blur(1.6px) brightness(1.12); }
  50% { transform: translateY(7px) scale(1.015); filter: blur(3px) brightness(1.28); }
  100% { transform: translateY(-7px) scale(.985); filter: blur(1.6px) brightness(1.12); }
}
.alt-slot-panel .slot-cell.alt-land { animation: altSymbolLand .42s cubic-bezier(.18,.85,.28,1.22) both; }
@keyframes altSymbolLand {
  0% { opacity:.45; transform:translateY(-20px) scale(.86); filter:blur(3px); }
  68% { opacity:1; transform:translateY(4px) scale(1.035); filter:blur(0); }
  100% { transform:translateY(0) scale(1); filter:none; }
}
.alt-slot-panel .slot-grid.cascade-in .slot-cell { animation-name:altCascadeDrop; animation-duration:.48s; animation-timing-function:cubic-bezier(.2,.8,.25,1.18); }
@keyframes altCascadeDrop {
  0% { opacity:.25; transform:translateY(-16px) scale(.92); }
  72% { opacity:1; transform:translateY(3px) scale(1.025); }
  100% { transform:translateY(0) scale(1); }
}
.alt-slot-panel .slot-cell.win {
  border-color:#ffd6ff;
  box-shadow:0 0 10px #d14bffb0,0 0 25px #b23cff77,inset 0 0 16px #e85cff66;
  animation:altWinGlow .72s ease-in-out infinite;
}
@keyframes altWinGlow {
  0%,100% { transform:scale(1); filter:brightness(1); }
  50% { transform:scale(1.055); filter:brightness(1.35); }
}
.alt-slot-panel .slot-grid.win-celebrate .slot-cell.win { animation:altWinPop .62s ease-in-out infinite alternate; }
@keyframes altWinPop { from { transform:scale(1); } to { transform:scale(1.09); filter:brightness(1.5); } }
.alt-bar-spin:disabled { opacity:.72; filter:saturate(.75); cursor:wait; }
.alt-bar-spin:disabled span { display:inline-block; animation:altButtonPulse .8s ease-in-out infinite alternate; }
@keyframes altButtonPulse { to { transform:scale(1.06); text-shadow:0 0 12px #fff; } }
@media (prefers-reduced-motion: reduce) {
  .alt-slot-panel .slot-cell, .alt-slot-panel .slot-grid.spinning .slot-cell,
  .alt-slot-panel .slot-cell.win, .alt-bar-spin:disabled span { animation:none !important; transition:none !important; }
}

/* ---- AltDrop: Alt Girls slot — готическая витрина по эталону (оригинальный брендинг) ---- */
.alt-slot-panel {
  position: relative;
  background:
    radial-gradient(ellipse at 18% 30%, #3a1a5e55 0, transparent 55%),
    radial-gradient(ellipse at 85% 60%, #4a156055 0, transparent 55%),
    linear-gradient(165deg, #1a1130, #0e0a1c 75%);
  border: 1px solid #8d3fd055;
  box-shadow: 0 14px 44px #0009, inset 0 1px #ffffff0c;
  overflow: hidden;
}
/* боковые статуи-декорации (как на эталоне) */
.alt-deco {
  position: absolute; bottom: 150px; z-index: 0; opacity: .85; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent);
  mask-image: linear-gradient(180deg, #000 62%, transparent);
}
.alt-deco-left { left: -16px; width: 34%; max-width: 220px; }
.alt-deco-right { right: -16px; width: 28%; max-width: 190px; }
.alt-head { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.alt-logo { height: 56px; filter: drop-shadow(0 4px 14px #000a); }
.alt-badge {
  display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 14px;
  background: #150f26e6; border: 1px solid #a43cff44; box-shadow: 0 6px 18px #0007;
}
.alt-badge-star { width: 26px; height: 26px; flex: 0 0 26px; background: url(/static/img/altgirls/slot/star.png) center/contain no-repeat; }
.alt-badge-txt { font-size: 11px; color: #cfc3e6; font-weight: 700; line-height: 1.15; }
.alt-badge-txt b { display: block; font-size: 16px; color: #c47aff; font-weight: 900; text-shadow: 0 0 12px #b23cff88; }
.alt-slot-mult {
  margin-left: auto; min-width: 92px; padding: 9px 13px; text-align: center; border-radius: 14px;
  border: 1px solid #a43cff66; background: #160d25e6; color: #fff; font-size: 19px; font-weight: 900;
  box-shadow: 0 0 20px #a43cff22;
}
.alt-slot-mult small { display: block; margin-top: 2px; color: #a99ab9; font-size: 9px; letter-spacing: 1.3px; }
/* резная рамка сетки */
.alt-slot-frame {
  position: relative; z-index: 1; padding: 10px; border-radius: 18px;
  border: 1px solid #b44cff66;
  background: linear-gradient(160deg, #221638, #120d20 60%);
  box-shadow: 0 0 30px #7a1fd633, inset 0 0 26px #000a, inset 0 0 0 1px #ffffff0a;
}
.alt-slot-panel .slot-grid { margin: 0; padding: 8px; gap: 6px; border: 0; border-radius: 12px; background: #0b0814; }
.alt-slot-panel .slot-grid.dg6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.alt-slot-panel .slot-cell {
  min-width: 0; overflow: hidden; border-radius: 10px; aspect-ratio: 1 / 1;
  border: 1px solid #ffffff10; background: #0e0b18;
}
.alt-slot-panel .slot-cell.win {
  border: 2px solid #ffd166; box-shadow: 0 0 14px #ffb03db0, inset 0 0 12px #ffb03d44;
  background: #2b1c3d; z-index: 1;
}
.slot-symbol-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.alt-slot-panel .cell-badge {
  position: absolute; right: 2px; top: 2px; z-index: 2; padding: 2px 5px; border-radius: 7px;
  color: #fff; background: #8d28d9; border: 1px solid #e7b5ff; font-size: 10px; font-style: normal; font-weight: 900;
}
.alt-slot-status { position: relative; z-index: 1; padding: 10px 0 2px; }
/* нижняя панель управления как на эталоне */
.alt-bar {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
  margin-top: 10px; padding: 10px; border-radius: 18px;
  background: #0d0a18; border: 1px solid #ffffff0f;
}
.alt-bar button { cursor: pointer; color: #fff; font-family: inherit; }
.alt-bar-i {
  flex: 0 0 44px; width: 44px; border-radius: 50%; border: 1px solid #ffffff1f;
  background: #1b1430; font-size: 19px; font-weight: 900; font-style: italic; font-family: Georgia, serif;
}
.alt-bar-cell {
  display: flex; flex-direction: column; justify-content: center; padding: 6px 14px; border-radius: 13px;
  background: #1b1430; border: 1px solid #ffffff0f; min-width: 0;
}
.alt-bar-cell small { color: #a99ab9; font-size: 10px; font-weight: 800; letter-spacing: .6px; }
.alt-bar-cell b { font-size: 15px; font-weight: 900; white-space: nowrap; }
.alt-bar-bal { flex: 1 1 110px; }
.alt-bar-bet { flex: 1.4 1 175px; flex-direction: row; align-items: center; gap: 6px; }
.alt-bar-bet > div { flex: 1; text-align: center; display: flex; flex-direction: column; }
.alt-bar-bet button {
  flex: 0 0 36px; height: 36px; border-radius: 11px; border: 1px solid #ffffff1f;
  background: #2a2040; font-size: 20px; font-weight: 900; line-height: 1;
}
.alt-bar-auto {
  flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 0 16px; border-radius: 13px;
  border: 2px solid #7a3fd0; background: #160f28; color: #d9b8ff; font-size: 14px; font-weight: 900;
}
.alt-bar-auto.on { background: #38206b; color: #fff; box-shadow: 0 0 16px #a43cff66; animation: autoPulse 1s ease-in-out infinite alternate; }
@keyframes autoPulse { to { box-shadow: 0 0 26px #a43cffaa; } }
.alt-bar-spin {
  flex: 1.8 1 190px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border: 0; border-radius: 999px; color: #fff; font-size: 18px; font-weight: 900;
  background: linear-gradient(100deg, #8b2fe0, #b44bff); box-shadow: 0 8px 26px #a72cff66, inset 0 1px #ffffff33;
  letter-spacing: .3px;
}
.alt-bar-spin:active { transform: scale(.985); }
.alt-bar-max {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 8px 12px; border-radius: 13px; border: 1px solid #ffffff1f; background: #1b1430;
  font-size: 10px; font-weight: 900; line-height: 1.1; letter-spacing: .5px;
}
.alt-ic { width: 24px; height: 24px; flex: 0 0 auto; }
.alt-bar-max .alt-ic { width: 20px; height: 20px; color: #d9b8ff; }
.alt-slot-legend {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px 14px; margin: 10px 0 2px; color: #a99ab9; font-size: 11px;
}
@media (max-width: 520px) {
  .alt-bar-spin { flex-basis: 100%; }
  .alt-logo { height: 44px; }
  .alt-badge { padding: 5px 10px; }
  .alt-badge-star { width: 22px; height: 22px; flex-basis: 22px; }
  .alt-deco { opacity: .55; }
}
@media (max-width: 420px) {
  .alt-slot-panel { padding: 11px; }
  .alt-slot-panel .slot-grid { padding: 5px; gap: 4px; }
  .alt-slot-panel .slot-cell { border-radius: 7px; }
}
