:root {
  --cabinet: #1a0e3d;
  --pink: #ff7ac6;
  --lavender: #b48cff;
  --star-gold: #ffe28a;
}

body {
  background: radial-gradient(circle at 50% 15%, #3a1a6b 0%, var(--bg-dark) 75%);
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 1.6px at 20px 30px, #fff, transparent),
    radial-gradient(1.6px 1.6px at 130px 80px, #fff, transparent),
    radial-gradient(1px 1px at 90px 160px, #fff, transparent),
    radial-gradient(2px 2px at 200px 40px, #ffe28a, transparent),
    radial-gradient(1px 1px at 250px 190px, #fff, transparent),
    radial-gradient(1.4px 1.4px at 60px 220px, #fff, transparent);
  background-repeat: repeat;
  background-size: 280px 260px;
  opacity: 0.55;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.3; }
  to   { opacity: 0.7; }
}

.cabinet {
  background: linear-gradient(160deg, var(--cabinet), #0f0726);
  border: 4px solid var(--lavender);
  border-radius: 24px;
  padding: 24px 28px 30px;
  width: 680px;
  max-width: 95vw;
  box-shadow: 0 0 40px rgba(180, 140, 255, 0.3), inset 0 0 30px rgba(255, 122, 198, 0.15);
  text-align: center;
  position: relative;
}

.title {
  margin: 0 0 12px;
  font-size: 1.5rem;
  letter-spacing: 2px;
  color: var(--star-gold);
  text-shadow: 0 0 8px var(--star-gold), 0 0 20px var(--pink);
  animation: title-pulse 2.4s ease-in-out infinite;
}

.bonus-banner {
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  color: #1a0e3d;
  font-weight: bold;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 12px;
  animation: pulse 1s infinite alternate;
}
.bonus-banner.hidden { display: none; }

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.02); }
}

.screen {
  position: relative;
  background: #08041a;
  border: 3px solid #4a3480;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
}

.cell {
  background: linear-gradient(145deg, #2a1a52, #12082b);
  border: 2px solid #4a3480;
  border-radius: 8px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.cell.win {
  animation: cell-win-glow 0.6s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes cell-win-glow {
  from { border-color: var(--star-gold); box-shadow: 0 0 10px var(--star-gold), inset 0 0 8px var(--star-gold); }
  to   { border-color: #fff2c0; box-shadow: 0 0 22px var(--star-gold), inset 0 0 16px var(--star-gold); }
}

.cell.win .symbol {
  animation: symbol-win-pop 0.4s ease-in-out infinite alternate;
}
@keyframes symbol-win-pop {
  from { transform: scale(1); }
  to   { transform: scale(1.2); }
}

.symbol {
  font-size: 1.6rem;
  display: inline-block;
}

.symbol.mult-badge {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 1.15rem;
  color: #1a0e3d;
  background: linear-gradient(160deg, var(--star-gold), #d99a2b);
  border-radius: 50%;
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--star-gold);
}

.mult-badge-inline {
  display: inline-block;
  font-weight: bold;
  color: #1a0e3d;
  background: linear-gradient(160deg, var(--star-gold), #d99a2b);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.8rem;
}

.cell.spinning .symbol {
  animation: spin-blur 0.12s linear infinite;
}

@keyframes spin-blur {
  0%   { transform: translateY(-40%); filter: blur(2px); opacity: 0.6; }
  50%  { transform: translateY(0%); filter: blur(0.5px); opacity: 1; }
  100% { transform: translateY(40%); filter: blur(2px); opacity: 0.6; }
}

.cell.drop-in .symbol {
  animation: drop-in 0.32s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes drop-in {
  0%   { transform: translateY(-28px) scale(0.9); opacity: 0; }
  70%  { transform: translateY(2px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.cell.drop-in .symbol.mult-badge {
  animation: mult-drop-in 0.45s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes mult-drop-in {
  0%   { transform: translateY(-28px) scale(0.3) rotate(-30deg); opacity: 0; }
  60%  { transform: translateY(0) scale(1.25) rotate(10deg); opacity: 1; }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; }
}

.message {
  min-height: 22px;
  font-size: 0.95rem;
  color: var(--pink);
  margin-bottom: 10px;
}

.hud {
  display: flex;
  justify-content: space-between;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 14px;
}

.stat { display: flex; flex-direction: column; font-size: 0.85rem; }
.stat label { color: #c9b8f5; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }
.stat span { font-size: 1.1rem; font-weight: bold; color: var(--star-gold); }

.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.btn {
  font-family: inherit;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  background: linear-gradient(160deg, #3a2a66, #1c1240);
  color: var(--text);
  transition: transform 0.08s, box-shadow 0.15s;
}
.btn:hover { box-shadow: 0 0 10px var(--pink); }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn.spin {
  grid-column: span 4;
  background: linear-gradient(160deg, var(--pink), #a4308a);
  color: #1a0e3d;
  font-size: 1.2rem;
  letter-spacing: 2px;
  padding: 14px;
  order: -1;
}

.btn.small { font-size: 0.85rem; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal.hidden { display: none; }

.modal-content {
  background: var(--cabinet);
  border: 3px solid var(--lavender);
  border-radius: 16px;
  padding: 20px 24px;
  width: 360px;
  max-width: 90vw;
}
.modal-content h2 { color: var(--star-gold); margin-top: 0; }
.modal-content .hint { font-size: 0.8rem; color: #d3c6f7; }

.paytable-list { list-style: none; padding: 0; margin: 12px 0; }
.paytable-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed #4a3480;
  font-size: 0.9rem;
}
.paytable-list li span:last-child { color: var(--star-gold); font-weight: bold; white-space: nowrap; }
