/* ==========================================================================
   CalmRiverNest — Crown & Gems slot styles
   ========================================================================== */

.game-section {
  padding: 36px 0 56px;
}

.slot-shell {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

/* ---------- Top bar ---------- */
.slot-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.12), rgba(212, 175, 55, 0.03));
  border-bottom: 1px solid var(--line);
}

.slot-topbar h1 {
  font-size: 1.25rem;
  margin: 0 auto 0 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  color: var(--gold-light);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--gold);
  background: var(--glass-strong);
}

/* ---------- Message bar ---------- */
.slot-message {
  text-align: center;
  padding: 12px 16px;
  min-height: 46px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.slot-message.win {
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(212, 175, 55, 0.5);
}

/* ---------- Reels ---------- */
.reels-frame {
  padding: 16px;
  background:
    radial-gradient(ellipse 90% 100% at 50% 0%, rgba(212, 175, 55, 0.08), transparent 70%),
    var(--bg);
}

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

.reel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg-raised);
  height: calc(var(--cell, 86px) * 3);
}

.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.cell {
  height: var(--cell, 86px);
  display: grid;
  place-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.cell svg {
  width: 62%;
  height: 62%;
}

.cell.win-cell {
  animation: cellGlow 0.7s ease-in-out 3;
  background: radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.22), transparent 75%);
}

@keyframes cellGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.55) drop-shadow(0 0 14px rgba(245, 215, 110, 0.8)); }
}

/* ---------- Controls ---------- */
.slot-controls {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.bet-stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px;
}

.bet-stepper button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--glass-strong);
  color: var(--gold-light);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.bet-stepper button:hover:not([disabled]) {
  background: rgba(212, 175, 55, 0.2);
}

.bet-stepper button[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.bet-value {
  min-width: 86px;
  text-align: center;
  font-weight: 700;
}

.bet-value small {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.spin-btn {
  font-size: 1.1rem;
  padding: 18px 52px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spin-btn[disabled] {
  opacity: 0.55;
}

.slot-balance-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.refill-btn {
  display: none;
}

.refill-btn.visible {
  display: inline-flex;
}

/* ---------- Paytable modal ---------- */
.paytable-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 5, 8, 0.88);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.paytable-overlay.visible {
  display: flex;
}

.paytable-card {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
}

.paytable-card h2 {
  font-size: 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.paytable-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.paytable-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.paytable-row svg {
  width: 40px;
  height: 40px;
}

.paytable-row .pt-name {
  font-weight: 600;
}

.paytable-row .pt-name small {
  display: block;
  font-weight: 400;
  color: var(--text-faint);
}

.paytable-row .pt-pays {
  text-align: right;
  color: var(--gold-light);
  font-weight: 600;
  white-space: nowrap;
}

.paytable-note {
  font-size: 0.82rem;
  color: var(--text-faint);
  margin: 14px 0 0;
}

/* ---------- History ---------- */
.history-card {
  max-width: 720px;
  margin: 28px auto 0;
}

.history-card .card {
  padding: 22px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.history-head h2 {
  font-size: 1.25rem;
  margin: 0;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th,
.history-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.history-table th {
  color: var(--gold);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.history-table td {
  color: var(--text-muted);
}

.history-table .h-win {
  color: var(--gold-light);
  font-weight: 600;
}

.history-empty {
  color: var(--text-faint);
  font-size: 0.9rem;
  text-align: center;
  padding: 18px 0;
  margin: 0;
}

/* ---------- Game info sections ---------- */
.game-info {
  max-width: 720px;
  margin: 28px auto 0;
  display: grid;
  gap: 16px;
}

.rg-reminder {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(212, 175, 55, 0.05);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.rg-reminder p {
  margin: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 560px) {
  .reel {
    --cell: 64px;
  }

  .slot-topbar h1 {
    font-size: 1.05rem;
  }

  .spin-btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .reel {
    --cell: 56px;
  }
}
