:root {
  --bg: #0f1020;
  --panel: #1a1c33;
  --panel-2: #22254a;
  --text: #f2f2f7;
  --muted: #9a9cc0;
  --accent: #ffcc4d;
  --accent-2: #ff5e7e;
  --good: #4ade80;
  --bad: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; }

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

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

#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--panel), transparent);
  position: sticky;
  top: 0;
  z-index: 10;
}

#titleArea { flex: 1; }
#screenTitle { font-size: 18px; margin: 0; }

.icon-btn {
  background: var(--panel-2);
  border: none;
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
}

#balancePill {
  background: var(--panel-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  white-space: nowrap;
}

#content {
  flex: 1;
  padding: 8px 16px 28px;
}

.screen { animation: fadeIn 0.18s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hint {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 16px;
}

.bonus-box {
  margin-bottom: 14px;
}

.bonus-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  color: #06280f;
  font-weight: 800;
  font-size: 15px;
}

.bonus-timer {
  text-align: center;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.slot-list {
  display: grid;
  gap: 12px;
}

.slot-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}

.slot-card .emoji { font-size: 32px; }
.slot-card .info { flex: 1; }
.slot-card .name { font-weight: 700; font-size: 16px; }
.slot-card .desc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.slot-card .go { color: var(--accent); font-size: 22px; }

.lobby-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.ghost-btn {
  flex: 1;
  background: var(--panel-2);
  border: none;
  color: var(--text);
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
}

/* ---- Игровой экран ---- */

.jackpot-banner {
  text-align: center;
  background: linear-gradient(90deg, #ffcc4d, #ff9d4d);
  color: #241900;
  font-weight: 800;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.reels-wrap {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  justify-content: center;
  gap: 4px;
  min-height: 140px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.reel-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
  padding: 4px;
}

.reel-cell {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  transition: transform 0.15s ease, background 0.2s ease;
}

.reel-cell.win {
  background: rgba(255, 204, 77, 0.25);
  transform: scale(1.08);
}

.reel-cell .face-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  display: block;
}

.reel-cell.win .face-img {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(255, 204, 77, 0.7);
}

.reel-cell.spinning {
  animation: reelSpin 0.09s linear infinite;
}

@keyframes reelSpin {
  0% { transform: translateY(0); filter: blur(0); }
  50% { transform: translateY(-4px); filter: blur(1px); }
  100% { transform: translateY(0); filter: blur(0); }
}

.classic-row {
  display: flex;
  gap: 10px;
}
.classic-row .reel-cell { width: 64px; height: 64px; font-size: 36px; }

.result-line {
  text-align: center;
  min-height: 22px;
  margin: 10px 0;
  font-weight: 700;
}
.result-line.win { color: var(--good); }
.result-line.lose { color: var(--muted); font-weight: 400; }
.result-line.jackpot { color: var(--accent); font-size: 18px; }

.bet-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border-radius: var(--radius);
  padding: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.bet-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--panel-2);
  color: var(--text);
  font-size: 20px;
}

.bet-amount {
  flex: 1;
  text-align: center;
}
.bet-amount input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
}
.bet-amount input::-webkit-outer-spin-button,
.bet-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bet-label { display: block; font-size: 11px; color: var(--muted); }

.bet-quick {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: center;
}
.bet-quick button {
  background: var(--panel-2);
  border: none;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.spin-btn {
  width: 100%;
  margin-top: 12px;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #241900;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 1px;
}
.spin-btn:disabled { opacity: 0.5; }

/* ---- Рулетка ---- */

.roulette-wheel {
  display: flex;
  justify-content: center;
  padding: 24px 0 12px;
}

.roulette-number {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  color: #fff;
  background: var(--panel-2);
  border: 4px solid rgba(255,255,255,0.12);
  transition: background 0.15s ease;
}

.roulette-number.red { background: #c62828; border-color: rgba(255,255,255,0.25); }
.roulette-number.black { background: #1c1c1c; border-color: rgba(255,255,255,0.2); }
.roulette-number.green { background: #1b7a3c; border-color: rgba(255,255,255,0.25); }

.roulette-number.spinning {
  animation: rouletteSpin 0.09s linear infinite;
}

@keyframes rouletteSpin {
  0% { transform: scale(1); filter: blur(0); }
  50% { transform: scale(1.04); filter: blur(1px); }
  100% { transform: scale(1); filter: blur(0); }
}

.bet-types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0;
}

.bet-type-btn {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.bet-type-btn.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #241900;
  border-color: transparent;
}

.number-picker {
  text-align: center;
  margin-bottom: 10px;
}

.number-picker label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.number-picker input {
  width: 100px;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  padding: 8px;
}

body[data-slot="roulette"] { --accent: #e0483c; --accent-2: #1b7a3c; }

.top-list, .history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.top-list li, .history-list li {
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
.history-list .amt-pos { color: var(--good); }
.history-list .amt-neg { color: var(--bad); }

/* ---- Темы по слотам ---- */
body[data-slot="classic"] { --accent: #d4af37; --accent-2: #b8860b; }
body[data-slot="fruits_deluxe"] { --accent: #7ed957; --accent-2: #ffd23f; }
body[data-slot="egypt_gold"] { --accent: #f4c542; --accent-2: #b8722a; }
body[data-slot="mega_jackpot"] { --accent: #ff5e7e; --accent-2: #ffcc4d; }
body[data-slot="neon_cyber"] { --accent: #39ff8f; --accent-2: #ff2bd6; }

#confettiLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 999;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(540deg); opacity: 0.2; }
}
