/* ============================================================
   Golden Spin Casino — Social Slots
   Main Stylesheet
   © 2026 GoldenV Branch Entertainment
   ============================================================ */

/* ── Reset / Normalize ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: #1a0a2e;
  color: #ffffff;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 80px; /* space for bottom nav */
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── Design Tokens ── */
:root {
  --bg-primary: #1a0a2e;
  --bg-card: #2d1b4e;
  --bg-card-hover: #3a2460;
  --bg-surface: #231240;
  --gold: #ffd700;
  --gold-light: #ffe44d;
  --gold-dark: #f0a500;
  --text-primary: #ffffff;
  --text-secondary: #b8a9d4;
  --text-muted: #7e6b9e;
  --accent-green: #4caf50;
  --accent-red: #ef4444;
  --gradient-gold: linear-gradient(135deg, #ffd700 0%, #f0a500 100%);
  --gradient-gold-hover: linear-gradient(135deg, #ffe44d 0%, #ffd700 100%);
  --gradient-purple: linear-gradient(135deg, #2d1b4e 0%, #1a0a2e 100%);
  --shadow-gold: 0 4px 20px rgba(255, 215, 0, 0.25);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-nav: 0 -2px 20px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 68px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card);
  border-radius: 4px;
}

/* ============================================================
   AGE GATE
   ============================================================ */
.age-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 4, 20, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.age-gate-overlay.hidden {
  display: none;
}

.age-gate-box {
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 360px;
  width: 90%;
  animation: scaleIn 0.35s ease;
}

.age-gate-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.age-gate-box h2 {
  color: var(--gold);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.age-gate-box p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.age-gate-sub {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  margin-bottom: 1.5rem !important;
}

.age-gate-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.age-gate-actions button {
  padding: 0.7rem 1.6rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.age-gate-actions button:active {
  transform: scale(0.96);
}

.btn-confirm-age {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  box-shadow: var(--shadow-gold);
}

.btn-confirm-age:hover {
  background: var(--gradient-gold-hover);
}

.btn-deny-age {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid rgba(184, 169, 212, 0.2);
}

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, #1a0a2e 0%, rgba(26, 10, 46, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  padding: 0 1rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  font-size: 1.6rem;
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.5));
  animation: sparkle 2s ease-in-out infinite;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Chip Balance */
.chip-balance {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.chip-icon {
  font-size: 1.1rem;
}

.chip-count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

/* Section toggle */
.section {
  display: none;
}
.section.active {
  display: block;
  animation: fadeSlideUp 0.3s ease;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}

/* ============================================================
   WELCOME BANNER
   ============================================================ */
.welcome-banner {
  background: linear-gradient(135deg, #2d1b4e 0%, #3a1f6e 50%, #2d1b4e 100%);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.welcome-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.15rem;
}

.welcome-chips {
  font-size: 1.1rem;
  color: var(--gold);
}

.btn-daily-bonus {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.6rem 1.1rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-daily-bonus:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

.btn-daily-bonus:active {
  transform: scale(0.97);
}

.btn-daily-bonus.claimed {
  background: var(--bg-surface);
  color: var(--text-muted);
  pointer-events: auto;
}

/* Pulse glow */
.pulse-glow:not(.claimed) {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* ============================================================
   GAME GRID
   ============================================================ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.1);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.3);
}

.game-card:active {
  transform: scale(0.97);
}

.game-card-image {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-card-image--slots {
  background: linear-gradient(135deg, #4a1942 0%, #2d1b4e 50%, #1a0a2e 100%);
}

.game-card-image--blackjack {
  background: linear-gradient(135deg, #0d3b1e 0%, #1a4a2e 50%, #0d3b1e 100%);
}

.game-emoji {
  font-size: 3.5rem;
  z-index: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: transform var(--transition);
}

.game-card:hover .game-emoji {
  transform: scale(1.1) rotate(-3deg);
}

.game-card-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 215, 0, 0.06) 50%,
    transparent 60%
  );
  animation: shine 3s ease-in-out infinite;
}

.game-card-body {
  padding: 0.9rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.game-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.game-card-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.btn-play {
  display: inline-block;
  background: var(--gradient-gold);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  letter-spacing: 1px;
  margin-top: auto;
  transition: transform var(--transition), box-shadow var(--transition);
}

.game-card:hover .btn-play {
  box-shadow: var(--shadow-gold);
}

/* ============================================================
   DAILY BONUS SECTION
   ============================================================ */
.bonus-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 0.5rem;
}

.bonus-panel-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: bounce 1.5s ease infinite;
}

.bonus-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.btn-claim-bonus {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem 2.2rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-gold);
}

.btn-claim-bonus:hover:not(.disabled) {
  background: var(--gradient-gold-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.4);
}

.btn-claim-bonus:active:not(.disabled) {
  transform: scale(0.97);
}

.btn-claim-bonus.disabled {
  background: var(--bg-surface);
  color: var(--text-muted);
  box-shadow: none;
  cursor: default;
}

.bonus-timer {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 1.3em;
}

.bonus-streak {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.streak-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.streak-dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.streak-dot {
  font-size: 1.3rem;
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
}

.streak-dot.filled {
  color: var(--gold);
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6));
}

/* ============================================================
   LEADERBOARD
   ============================================================ */
.leaderboard-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.lb-tab {
  flex: 1;
  padding: 0.6rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition), color var(--transition);
  border: 1px solid transparent;
}

.lb-tab.active {
  background: rgba(255, 215, 0, 0.1);
  color: var(--gold);
  border-color: rgba(255, 215, 0, 0.3);
}

.leaderboard-table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table thead th {
  background: var(--bg-surface);
  padding: 0.7rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-align: left;
}

.leaderboard-table thead th:last-child {
  text-align: right;
}

.leaderboard-table tbody td {
  padding: 0.65rem 0.8rem;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.leaderboard-table tbody td:first-child {
  width: 40px;
  font-weight: 600;
}

.leaderboard-table tbody td:last-child {
  text-align: right;
}

.rank-medal {
  font-size: 1.1rem;
}

.lb-chips {
  color: var(--gold) !important;
  font-weight: 600;
}

.lb-user-row {
  background: rgba(255, 215, 0, 0.08);
}

.lb-user-row td {
  color: var(--gold) !important;
  font-weight: 700;
  border-bottom: none;
}

.lb-your-rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.lb-your-rank strong {
  color: var(--gold);
  font-size: 1.1rem;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-list {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition);
}

.settings-link {
  cursor: pointer;
}

.settings-link:hover {
  background: var(--bg-card-hover);
}

.settings-label {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.settings-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.settings-reset .settings-label {
  color: var(--accent-red);
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-surface);
  border-radius: 50px;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: rgba(255, 215, 0, 0.25);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: var(--gold);
}

/* About Panel */
.about-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
  animation: fadeSlideUp 0.25s ease;
}

.about-panel.hidden {
  display: none;
}

.about-panel h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.about-panel p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.btn-close-about {
  margin-top: 1rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition);
}

.btn-close-about:hover {
  background: var(--bg-card-hover);
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
  background: var(--bg-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 2rem 1.25rem;
  padding-bottom: calc(var(--nav-height) + 2rem);
  text-align: center;
  max-width: 600px;
  margin: 2rem auto 0;
}

.footer-disclaimers p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.25rem;
}

.footer-links {
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-sep {
  color: var(--text-muted);
  margin: 0 0.5rem;
  font-size: 0.75rem;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-height);
  background: linear-gradient(180deg, rgba(26, 10, 46, 0.95) 0%, #1a0a2e 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 215, 0, 0.1);
  box-shadow: var(--shadow-nav);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), transform var(--transition);
  color: var(--text-muted);
  min-width: 60px;
}

.nav-btn:active {
  transform: scale(0.92);
}

.nav-btn.active {
  color: var(--gold);
}

.nav-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.nav-btn.active .nav-label {
  color: var(--gold);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--bg-card);
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 300;
  white-space: nowrap;
  animation: toastIn 0.3s ease;
  pointer-events: none;
}

.toast.hidden {
  display: none;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
}

@keyframes shine {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ============================================================
   RESPONSIVE — TABLET (480px+)
   ============================================================ */
@media (min-width: 480px) {
  .header-inner {
    height: 64px;
  }

  .brand-text h1 {
    font-size: 1.3rem;
  }

  .game-card-image {
    height: 140px;
  }

  .game-emoji {
    font-size: 4rem;
  }

  .welcome-banner {
    padding: 1.5rem;
  }
}

/* ============================================================
   RESPONSIVE — LARGER SCREENS (768px+)
   ============================================================ */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .main-content {
    max-width: 720px;
    padding: 1.5rem;
  }

  .bottom-nav {
    position: static;
    max-width: 720px;
    margin: 0 auto;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    box-shadow: none;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    height: auto;
    padding: 0.75rem 1rem;
    backdrop-filter: none;
  }

  .app-footer {
    padding-bottom: 2rem;
    max-width: 720px;
  }

  .game-card-image {
    height: 160px;
  }

  .game-emoji {
    font-size: 4.5rem;
  }

  .toast {
    bottom: 24px;
  }

  .nav-btn {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
  }

  .nav-label {
    font-size: 0.8rem;
  }
}

/* ============================================================
   ACCESSIBILITY — REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.hidden {
  display: none !important;
}
