:root {
  --cabinet: #0d2818;
  --vault-gold: #d4af37;
  --emerald: #2ee6a8;
  --accent: #d4af37;
  --accent-2: #0f2418;
}

body {
  background:
    radial-gradient(circle at 50% 50%,
      transparent 0 110px, rgba(212, 175, 55, 0.06) 111px 114px,
      transparent 115px 170px, rgba(212, 175, 55, 0.05) 171px 174px,
      transparent 175px 230px, rgba(212, 175, 55, 0.04) 231px 234px,
      transparent 235px),
    radial-gradient(ellipse 60% 30% at 50% 0%, rgba(212, 175, 55, 0.12), transparent 70%),
    var(--bg-dark);
  background-attachment: fixed;
}

.cabinet {
  background:
    radial-gradient(circle 40px at 20px 20px, rgba(212, 175, 55, 0.3), transparent 70%),
    radial-gradient(circle 40px at calc(100% - 20px) 20px, rgba(212, 175, 55, 0.3), transparent 70%),
    radial-gradient(circle 40px at 20px calc(100% - 20px), rgba(212, 175, 55, 0.3), transparent 70%),
    radial-gradient(circle 40px at calc(100% - 20px) calc(100% - 20px), rgba(212, 175, 55, 0.3), transparent 70%),
    linear-gradient(160deg, var(--cabinet), #081a10);
  border: 4px solid var(--vault-gold);
  border-radius: 24px;
  padding: 24px 28px 30px;
  width: 620px;
  max-width: 95vw;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.25), inset 0 0 30px rgba(46, 230, 168, 0.12);
  text-align: center;
  position: relative;
}

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

.bonus-banner {
  background: linear-gradient(90deg, var(--vault-gold), var(--emerald));
  color: #081a10;
  font-weight: bold;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  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: #050f09;
  border: 3px solid #1f6b4a;
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 12px;
}

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

.cell {
  background: linear-gradient(145deg, #123420, #081a10);
  border: 2px solid #1f6b4a;
  border-radius: 10px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.2s, border-color 0.2s;
}

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

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

.cell.empty-slot {
  border-color: #2a4a3a;
  background: linear-gradient(145deg, #0c2016, #060f0a);
}

.cell.locked-coin {
  border-color: var(--vault-gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.5), inset 0 0 10px rgba(212, 175, 55, 0.4);
}

.symbol {
  font-size: 2.1rem;
  display: inline-block;
  will-change: transform;
}

.symbol.card-rank {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: bold;
  font-size: 1.7rem;
  color: var(--vault-gold);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--vault-gold);
  border-radius: 8px;
  padding: 4px 10px;
}

.symbol.coin-badge {
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 1.1rem;
  color: #081a10;
  background: linear-gradient(160deg, var(--vault-gold), #8a6d1f);
  border-radius: 50%;
  width: 78%;
  height: 78%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--vault-gold);
}

.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; }
}

.coin-pop {
  animation: coin-pop-in 0.4s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes coin-pop-in {
  0%   { transform: scale(0.2) rotate(-40deg); opacity: 0; }
  60%  { transform: scale(1.25) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.payline-overlay {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  pointer-events: none;
}

.payline-overlay polyline {
  stroke: var(--emerald);
  fill: none;
  stroke-width: 4;
  opacity: 0;
  filter: drop-shadow(0 0 4px var(--emerald));
}

.payline-overlay polyline.show {
  opacity: 0.95;
  animation: dash-move 0.5s linear infinite, line-glow-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes dash-move {
  from { stroke-dashoffset: 20; }
  to { stroke-dashoffset: 0; }
}

@keyframes line-glow-pulse {
  from { filter: drop-shadow(0 0 4px var(--emerald)); }
  to   { filter: drop-shadow(0 0 12px var(--emerald)); }
}

.message {
  min-height: 22px;
  font-size: 0.95rem;
  color: var(--emerald);
  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: #8fc9a8; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; }
.stat span { font-size: 1.1rem; font-weight: bold; color: var(--vault-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, #1f6b4a, #0d2818);
  color: var(--text);
  transition: transform 0.08s, box-shadow 0.15s;
}
.btn:hover { box-shadow: 0 0 10px var(--emerald); }
.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(--vault-gold), #8a6d1f);
  color: #081a10;
  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(--vault-gold);
  border-radius: 16px;
  padding: 20px 24px;
  width: 340px;
  max-width: 90vw;
}
.modal-content h2 { color: var(--vault-gold); margin-top: 0; }
.modal-content .hint { font-size: 0.8rem; color: #b9d8c6; }

.paytable-list { list-style: none; padding: 0; margin: 12px 0; }
.paytable-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dashed #1f6b4a;
  font-size: 0.95rem;
}
.paytable-list li span:last-child { color: var(--vault-gold); font-weight: bold; }

@keyframes flash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.6); }
}
.win-flash { animation: flash 0.3s ease-in-out 3; }
