/* ============ MeowVegas — неоновое кошачье казино ============ */

:root {
  --bg-deep: #160a2e;
  --bg: #1f0f3d;
  --card: #2b1655;
  --card-2: #341a66;
  --line: rgba(255, 122, 217, .22);
  --neon-pink: #ff3ecd;
  --neon-purple: #9b4dff;
  --cyan: #3be0ff;
  --gold: #ffc94d;
  --gold-2: #f09c1c;
  --green: #2fd573;
  --red: #ff5470;
  --text: #fff6ff;
  --muted: #bda6e0;
  --cell: 78px;
  --radius: 18px;
  --tabbar-h: 62px;
  --font-display: 'Russo One', 'Rubik', sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: 'Rubik', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text);
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

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

/* фон: ночной город — глубокие градиенты + мерцающие «огни» */
#bg-glow {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 40% at 80% -5%, rgba(155, 77, 255, .35), transparent 70%),
    radial-gradient(50% 35% at 10% 0%, rgba(255, 62, 205, .22), transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(59, 224, 255, .12), transparent 70%),
    linear-gradient(180deg, #1d0d38 0%, #160a2e 45%, #120825 100%);
}
#bg-glow::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 20%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.6px 1.6px at 78% 12%, rgba(255,201,77,.7), transparent 60%),
    radial-gradient(1.8px 1.8px at 35% 6%, rgba(59,224,255,.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 62% 28%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(2px 2px at 90% 38%, rgba(255,62,205,.5), transparent 60%),
    radial-gradient(1.5px 1.5px at 22% 44%, rgba(255,255,255,.35), transparent 60%);
  animation: twinkle 4.5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .5; } to { opacity: 1; } }

#app {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  display: flex; flex-direction: column;
}

/* ============ шапка ============ */
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: rgba(22, 10, 46, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); font-size: 17px; letter-spacing: .4px; }
.brand b { color: var(--gold); }
.brand-coin { width: 22px; height: 22px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

#balance-chip {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #3a1d72, #2b1655);
  border: 1px solid rgba(255, 201, 77, .55);
  border-radius: 999px; padding: 6px 12px;
  font-weight: 700; font-size: 15px;
  box-shadow: 0 0 14px rgba(255, 201, 77, .25), inset 0 1px 0 rgba(255,255,255,.12);
}
.coin { width: 18px; height: 18px; }
#balance-delta {
  position: absolute; right: 8px; top: -16px;
  font-size: 13px; font-weight: 800; opacity: 0;
  pointer-events: none;
}
#balance-delta.pop-up { animation: delta-up 1.1s ease forwards; color: var(--green); }
#balance-delta.pop-down { animation: delta-up 1.1s ease forwards; color: var(--red); }
@keyframes delta-up { 0% { opacity: 0; transform: translateY(6px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

#sound-toggle { font-size: 17px; opacity: .85; padding: 4px; }
#sound-toggle.off { opacity: .4; filter: grayscale(1); }

/* ============ экраны ============ */
#screens { flex: 1; position: relative; }
.screen {
  display: none;
  padding: 14px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
  animation: screen-in .25s ease;
}
.screen.active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.screen-title { font-family: var(--font-display); font-size: 22px; margin: 6px 0 14px; }
.section-title {
  font-family: var(--font-display); font-size: 17px; margin: 20px 0 10px;
  background: linear-gradient(180deg, #fff0b0, #ffc94d 60%, #f09c1c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ главная ============ */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45), 0 0 24px rgba(255, 62, 205, .18);
}
.hero img { width: 100%; display: block; aspect-ratio: 16/10; object-fit: cover; object-position: 50% 18%; }
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,10,46,.05) 30%, rgba(22,10,46,.88) 92%);
}
.hero-content {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.hero-logo { width: min(74%, 300px); height: auto; }
.logo-text { font-family: var(--font-display); font-size: 44px; }
.hero-tag {
  font-size: 12.5px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase;
  color: #ffd9f4; text-shadow: 0 0 10px rgba(255, 62, 205, .9);
  margin-bottom: 6px;
}

/* бонусные карточки */
.bonus-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.bonus-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; text-align: left;
  transition: transform .12s ease;
}
.bonus-card:active { transform: scale(.97); }
.bonus-emoji { font-size: 24px; }
.bonus-name { font-weight: 700; font-size: 13.5px; }
.bonus-info { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bonus-card.ready {
  border-color: rgba(255, 201, 77, .8);
  box-shadow: 0 0 18px rgba(255, 201, 77, .35);
  animation: bonus-pulse 1.6s ease-in-out infinite;
}
.bonus-card.ready .bonus-info { color: var(--gold); font-weight: 700; }
@keyframes bonus-pulse { 50% { box-shadow: 0 0 26px rgba(255, 201, 77, .6); } }

/* карточки игр */
.games-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.game-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(170deg, #3b1d74 0%, #2b1655 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 10px 13px;
  transition: transform .12s ease, box-shadow .2s ease;
}
.game-card::before {
  content: ''; position: absolute; inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(closest-side, rgba(255, 62, 205, .25), transparent);
  pointer-events: none;
}
.game-card:active { transform: scale(.97); box-shadow: 0 0 22px rgba(255, 62, 205, .35); }
.game-card.wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 14px 18px; }
.game-card.wide .game-art { margin: 0; }
.game-card.wide .game-text { display: flex; flex-direction: column; align-items: flex-start; }
.game-art { display: flex; align-items: center; height: 56px; margin-bottom: 4px; }
.game-art img { width: 44px; height: 44px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.game-art img + img { margin-left: -10px; }
.game-art img.big { width: 56px; height: 56px; }
.game-art img.rocket { width: 40px; height: 60px; }
.game-name { font-family: var(--font-display); font-size: 15.5px; }
.game-sub { font-size: 11.5px; color: var(--muted); }
.game-card.disabled { opacity: .45; pointer-events: none; }

#fair-link {
  width: 100%; margin-top: 18px; padding: 11px;
  border: 1px dashed rgba(59, 224, 255, .45); border-radius: 14px;
  color: var(--cyan); font-size: 13px; font-weight: 600;
}
.disclaimer { margin-top: 12px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.45; opacity: .8; }

/* ============ заголовок игры ============ */
.game-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.game-head h1 { font-family: var(--font-display); font-size: 19px; flex: 1; text-align: center; }
.back-btn, .info-btn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  background: var(--card); border: 1px solid var(--line);
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.info-btn { font-size: 16px; }
.info-btn.ghost { background: none; border: none; }

/* ============ слоты ============ */
.slot-machine {
  background: linear-gradient(180deg, #43217f, #2b1655 60%, #241248);
  border: 2px solid rgba(255, 201, 77, .6);
  border-radius: 22px;
  padding: 12px 12px 14px;
  box-shadow: 0 10px 36px rgba(0,0,0,.5), 0 0 28px rgba(255, 62, 205, .15), inset 0 1px 0 rgba(255,255,255,.1);
}
.marquee { display: flex; justify-content: center; gap: 7px; padding: 2px 0 10px; }
.marquee i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  animation: bulb 1.2s linear infinite;
}
.marquee i:nth-child(2n) { animation-delay: .4s; background: var(--neon-pink); box-shadow: 0 0 8px var(--neon-pink); }
.marquee i:nth-child(3n) { animation-delay: .8s; }
@keyframes bulb { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.marquee.frenzy i { animation-duration: .35s; }

.slot-window {
  position: relative; display: flex; gap: 8px; justify-content: center;
  background: #170b30;
  border-radius: 14px; padding: 10px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: inset 0 6px 18px rgba(0,0,0,.65);
  overflow: hidden;
}
.reel {
  position: relative; width: var(--cell); height: calc(var(--cell) * 3);
  overflow: hidden; border-radius: 10px;
  background: linear-gradient(180deg, #241144, #2e1656 50%, #241144);
  border: 1px solid rgba(255,255,255,.06);
}
.reel-strip { position: absolute; left: 0; top: 0; width: 100%; will-change: transform; }
.reel-cell {
  width: var(--cell); height: var(--cell);
  display: flex; align-items: center; justify-content: center;
}
.reel-cell img { width: calc(var(--cell) - 18px); height: calc(var(--cell) - 18px); }
.reel-strip.blur img { filter: blur(2.5px); }
.reel-cell.win-cell { animation: cell-win .55s ease 3; }
@keyframes cell-win { 50% { transform: scale(1.18); filter: drop-shadow(0 0 12px var(--gold)); } }

.payline {
  position: absolute; left: 6px; right: 6px; top: 50%; height: calc(var(--cell) + 4px);
  transform: translateY(-50%);
  border: 2px solid rgba(255, 201, 77, .0);
  border-radius: 10px; pointer-events: none;
  transition: border-color .2s, box-shadow .2s;
}
.payline.lit { border-color: rgba(255, 201, 77, .85); box-shadow: 0 0 18px rgba(255, 201, 77, .5), inset 0 0 14px rgba(255, 201, 77, .15); }

.slots-result {
  text-align: center; margin-top: 10px; min-height: 24px;
  font-family: var(--font-display); font-size: 17px;
}
.slots-result.win { color: var(--gold); text-shadow: 0 0 14px rgba(255, 201, 77, .8); animation: result-pop .4s ease; }
.slots-result.lose { color: var(--muted); font-size: 14px; font-family: 'Rubik'; }
@keyframes result-pop { from { transform: scale(.6); } to { transform: none; } }

/* ============ панель ставки ============ */
.bet-panel { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.bet-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bet-stepper {
  display: flex; align-items: center; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
}
.bet-stepper button { width: 42px; height: 44px; font-size: 22px; font-weight: 700; color: var(--gold); }
.bet-stepper button:active { background: rgba(255,255,255,.08); }
.bet-value { display: flex; align-items: center; gap: 6px; min-width: 86px; justify-content: center; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.bet-presets { display: flex; gap: 6px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.bet-presets button {
  padding: 8px 11px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--muted);
}
.bet-presets button.sel { color: var(--gold); border-color: rgba(255,201,77,.6); background: rgba(255,201,77,.08); }

.spin-btn {
  position: relative;
  padding: 15px; border-radius: 16px;
  font-family: var(--font-display); font-size: 18px; letter-spacing: 1px;
  color: #4a2800;
  background: linear-gradient(180deg, #ffe289 0%, #ffc94d 45%, #f09c1c 100%);
  border: 1px solid #b36b00;
  box-shadow: 0 5px 0 #9c5500, 0 10px 24px rgba(240, 156, 28, .35);
  transition: transform .08s ease, box-shadow .08s ease, filter .2s;
}
.spin-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #9c5500, 0 4px 12px rgba(240, 156, 28, .3); }
.spin-btn:disabled { filter: grayscale(.6) brightness(.75); pointer-events: none; }
.spin-btn.small { padding: 12px 22px; font-size: 15px; }
.spin-btn.cashout { background: linear-gradient(180deg, #8effc1 0%, #2fd573 50%, #15a04e 100%); border-color: #0c7a39; box-shadow: 0 5px 0 #0a6630, 0 10px 24px rgba(47, 213, 115, .35); color: #03371a; }

/* ============ рулетка ============ */
.roulette-wheel-box { position: relative; width: 230px; margin: 0 auto; }
#roulette-wheel { width: 100%; height: auto; display: block; filter: drop-shadow(0 8px 24px rgba(0,0,0,.55)); }
.wheel-pointer {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 16px solid var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 201, 77, .9));
  z-index: 2;
}
.wheel-result {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 34px; opacity: 0; pointer-events: none;
  text-shadow: 0 0 18px rgba(0,0,0,.9);
}
.wheel-result.show { animation: wheel-res 2.2s ease; }
@keyframes wheel-res { 10% { opacity: 1; transform: scale(1.15); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }

.roulette-history { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; min-height: 26px; flex-wrap: wrap; }
.roulette-history span {
  min-width: 26px; height: 26px; padding: 0 4px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
}
.num-red { background: linear-gradient(180deg, #ff6b87, #d61f44); }
.num-black { background: linear-gradient(180deg, #3d3d55, #16162a); }
.num-green { background: linear-gradient(180deg, #34d175, #0f9d58); }

.chip-row { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.chip {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  border: 3px dashed rgba(255,255,255,.75);
  box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 0 0 3px rgba(0,0,0,.18);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chip[data-v="5"]    { background: radial-gradient(circle at 35% 30%, #7fc4ff, #1f6fd7); }
.chip[data-v="10"]   { background: radial-gradient(circle at 35% 30%, #ff9d7a, #d7541f); }
.chip[data-v="25"]   { background: radial-gradient(circle at 35% 30%, #8ee59a, #1f9d44); }
.chip[data-v="100"]  { background: radial-gradient(circle at 35% 30%, #c2a4ff, #6a2ee6); }
.chip[data-v="500"]  { background: radial-gradient(circle at 35% 30%, #ffd34e, #c97f10); color: #4a2800; }
.chip.sel { transform: translateY(-5px) scale(1.12); box-shadow: 0 0 0 3px var(--gold), 0 8px 16px rgba(0,0,0,.5); }

.roulette-board {
  display: grid;
  grid-template-columns: 30px repeat(12, 1fr) 34px;
  gap: 3px;
  background: #12351f;
  border: 2px solid rgba(255, 201, 77, .5);
  border-radius: 14px;
  padding: 7px;
  box-shadow: inset 0 4px 18px rgba(0,0,0,.5);
}
.bcell {
  position: relative;
  min-height: 34px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 800;
  border: 1px solid rgba(255,255,255,.14);
  transition: filter .1s;
}
.bcell:active { filter: brightness(1.4); }
.bcell.red { background: #c22443; }
.bcell.black { background: #1d1d33; }
.bcell.green { background: #0f9d58; grid-row: span 3; writing-mode: vertical-rl; }
.bcell.outside { background: rgba(255,255,255,.07); font-size: 11px; }
.bcell .placed {
  position: absolute; right: -4px; top: -7px; z-index: 3;
  min-width: 22px; height: 22px; padding: 0 3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd34e, #c97f10);
  border: 2px dashed rgba(255,255,255,.8);
  color: #4a2800; font-size: 9.5px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.bcell.hit { animation: cell-hit 1s ease 2; z-index: 2; }
@keyframes cell-hit { 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 22px var(--gold); } }

.roulette-actions {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
}
.roulette-total { flex: 1; font-size: 13px; color: var(--muted); }
.roulette-total b { color: var(--gold); font-size: 15px; }
.mini-btn {
  width: 42px; height: 42px; border-radius: 12px; font-size: 17px;
  background: var(--card); border: 1px solid var(--line);
}
.mini-btn:active { background: rgba(255,255,255,.1); }

/* ============ кот-ракета ============ */
.crash-box {
  position: relative; height: 260px;
  background: linear-gradient(180deg, #100a26 0%, #1d0f3a 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: inset 0 4px 24px rgba(0,0,0,.55);
}
#crash-canvas { width: 100%; height: 100%; display: block; }
.crash-mult {
  position: absolute; top: 12px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-display); font-size: 44px;
  text-shadow: 0 0 22px rgba(59, 224, 255, .65);
  pointer-events: none;
  transition: color .2s;
}
.crash-mult.flying { color: var(--cyan); }
.crash-mult.crashed { color: var(--red); text-shadow: 0 0 22px rgba(255, 84, 112, .8); }
.crash-mult.cashed { color: var(--green); text-shadow: 0 0 22px rgba(47, 213, 115, .8); }
.crash-msg {
  position: absolute; bottom: 14px; left: 0; right: 0;
  text-align: center; font-weight: 800; font-size: 15px;
  pointer-events: none; min-height: 20px;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.crash-box.boom { animation: boom-shake .5s ease; }
@keyframes boom-shake {
  20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); }
  60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 2px); }
}

.crash-history { display: flex; gap: 6px; margin: 10px 0 2px; flex-wrap: wrap; min-height: 24px; }
.crash-history span {
  padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800;
  background: rgba(255,255,255,.07); border: 1px solid transparent;
}
.crash-history .m-low { color: var(--red); border-color: rgba(255,84,112,.4); }
.crash-history .m-mid { color: #ffb14e; border-color: rgba(255,177,78,.4); }
.crash-history .m-high { color: var(--green); border-color: rgba(47,213,115,.4); }
.crash-history .m-epic { color: var(--gold); border-color: rgba(255,201,77,.6); text-shadow: 0 0 8px rgba(255,201,77,.6); }

.auto-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 12px; height: 44px; flex: 1; min-width: 150px;
  font-size: 12.5px; color: var(--muted);
}
.auto-field input {
  width: 64px; background: none; border: none; outline: none;
  color: var(--gold); font-size: 15px; font-weight: 800; text-align: right;
}
.auto-field input::placeholder { color: rgba(189, 166, 224, .55); font-weight: 600; }

/* ============ лидеры ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border-radius: 12px; font-weight: 700; font-size: 13.5px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.tab.active {
  color: var(--text);
  border-color: rgba(255, 62, 205, .65);
  box-shadow: 0 0 14px rgba(255, 62, 205, .25);
  background: linear-gradient(180deg, #3b1d74, #2b1655);
}
.leaders-list { display: flex; flex-direction: column; gap: 8px; }
.leader-row {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 9px 12px;
}
.leader-row.top1 { border-color: rgba(255, 201, 77, .75); box-shadow: 0 0 16px rgba(255, 201, 77, .22); }
.leader-row.me { border-color: rgba(59, 224, 255, .7); }
.leader-place { width: 28px; text-align: center; font-size: 16px; font-weight: 800; color: var(--muted); flex: none; }
.leader-name { flex: 1; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-value { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; color: var(--gold); font-variant-numeric: tabular-nums; }
.leaders-self { margin-top: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.leaders-empty { text-align: center; color: var(--muted); padding: 30px 0; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============ профиль ============ */
.profile-head { display: flex; align-items: center; gap: 13px; margin: 8px 0 16px; }
.profile-head .avatar { width: 58px; height: 58px; font-size: 22px; }
.profile-name { font-family: var(--font-display); font-size: 19px; }
.profile-username { color: var(--muted); font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 13px;
}
.stat-card .v { font-weight: 800; font-size: 17px; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat-card .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.share-btn {
  width: 100%; margin-top: 13px; padding: 13px;
  border-radius: 14px; font-weight: 700; font-size: 14px;
  background: linear-gradient(180deg, #4a2390, #36206b);
  border: 1px solid rgba(155, 77, 255, .55);
  box-shadow: 0 0 16px rgba(155, 77, 255, .25);
}
.history-list { display: flex; flex-direction: column; gap: 7px; }
.history-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; font-size: 13px;
}
.history-item .h-ico { font-size: 18px; flex: none; }
.history-item .h-text { flex: 1; }
.history-item .h-sub { color: var(--muted); font-size: 11px; margin-top: 1px; }
.history-item .h-amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.h-amount.plus { color: var(--green); }
.h-amount.minus { color: var(--red); }
.history-empty { color: var(--muted); text-align: center; padding: 24px 0; }

/* ============ таббар ============ */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 60;
  display: flex;
  background: rgba(22, 10, 46, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; padding: 8px 0 9px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600; color: var(--muted);
}
.tab-item span { font-size: 19px; filter: grayscale(.7); transition: filter .15s, transform .15s; }
.tab-item.active { color: var(--gold); }
.tab-item.active span { filter: none; transform: scale(1.12); }

/* ============ модалки ============ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: flex-end; justify-content: center;
  background: rgba(10, 4, 24, .72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal.open { display: flex; }
.modal-card {
  position: relative;
  width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: linear-gradient(180deg, #34196a, #241248);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
  animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1.05);
}
@keyframes sheet-up { from { transform: translateY(60%); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-card h2 { font-family: var(--font-display); font-size: 19px; margin-bottom: 14px; text-align: center; }
.modal-close {
  position: absolute; right: 12px; top: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.08); font-size: 14px;
}

/* колесо фортуны */
.fortune-box { position: relative; width: 250px; margin: 6px auto 12px; }
#fortune-wheel { width: 100%; display: block; filter: drop-shadow(0 8px 22px rgba(0,0,0,.5)); }
.fortune-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 11px solid transparent; border-right: 11px solid transparent;
  border-top: 20px solid var(--neon-pink);
  filter: drop-shadow(0 0 8px rgba(255, 62, 205, .9));
}
.fortune-info { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 12px; min-height: 18px; font-variant-numeric: tabular-nums; }
#modal-wheel .spin-btn { width: 100%; }

/* таблица выплат */
.pay-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.pay-row img { width: 34px; height: 34px; }
.pay-row .pname { flex: 1; font-size: 14px; }
.pay-row .pvals { display: flex; gap: 12px; font-variant-numeric: tabular-nums; }
.pay-row .pvals b { color: var(--gold); }
.pay-row .pvals span { color: var(--muted); font-size: 12px; }
.pay-note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* честная игра */
#fair-body { font-size: 13.5px; line-height: 1.55; color: #e8dcf8; }
#fair-body h3 { margin: 12px 0 4px; font-size: 14px; color: var(--gold); }
#fair-body .rtp-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.07); }
#fair-body .rtp-row b { color: var(--cyan); }

/* большой выигрыш */
.modal-card.bigwin {
  text-align: center; overflow: hidden;
  border-color: rgba(255, 201, 77, .7);
  background: radial-gradient(80% 60% at 50% 0%, #5b2d9e, #241248 75%);
}
.bigwin-rays {
  position: absolute; inset: -60%;
  background: repeating-conic-gradient(rgba(255, 201, 77, .14) 0 9deg, transparent 9deg 18deg);
  animation: rays-spin 9s linear infinite;
  pointer-events: none;
}
@keyframes rays-spin { to { transform: rotate(360deg); } }
.bigwin-title {
  position: relative;
  font-family: var(--font-display); font-size: 30px; margin-top: 8px;
  background: linear-gradient(180deg, #fff0b0, #ffc94d 55%, #f09c1c);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 201, 77, .5));
}
.bigwin-amount {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-display); font-size: 40px; color: var(--gold);
  margin: 10px 0 18px;
  font-variant-numeric: tabular-nums;
}
.bigwin-amount img { width: 34px; height: 34px; }
.modal-card.bigwin .spin-btn { position: relative; width: 100%; }

/* ============ тосты ============ */
#toasts {
  position: fixed; top: calc(54px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: 92vw;
}
.toast {
  padding: 10px 18px; border-radius: 999px;
  background: rgba(34, 16, 66, .95);
  border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
  animation: toast-in .25s ease, toast-out .3s ease 2.6s forwards;
}
.toast.err { border-color: rgba(255, 84, 112, .65); }
.toast.ok { border-color: rgba(47, 213, 115, .65); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px); } }

/* ============ конфетти ============ */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden; }
.cf {
  position: absolute; top: -4vh;
  width: 9px; height: 14px; border-radius: 2px;
  animation: cf-fall linear forwards;
}
@keyframes cf-fall {
  to { transform: translateY(110vh) rotate(var(--rot)) translateX(var(--sway)); opacity: .9; }
}

/* ============ загрузка и ошибки ============ */
#loader {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
}
#loader.done { display: none; }
.paw-loader { font-size: 44px; animation: paw-bounce 1s ease-in-out infinite; }
@keyframes paw-bounce { 50% { transform: translateY(-14px) rotate(-12deg); } }

#boot-error {
  position: fixed; inset: 0; z-index: 350;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep); padding: 24px;
}
.boot-card { text-align: center; max-width: 320px; }
.boot-card h2 { font-family: var(--font-display); margin: 10px 0; }
.boot-card p { color: var(--muted); font-size: 14px; line-height: 1.5; }

@media (max-width: 374px) {
  :root { --cell: 66px; }
  .logo-text { font-size: 40px; }
}
