/* ========================================
   MerryPlayValley — Global Styles
   Dark Casino Premium Theme
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0A0A0A;
  --bg-secondary: #111111;
  --bg-surface: #1A1A1A;
  --bg-surface-hover: #222222;
  --bg-card: #1E1E1E;
  --bg-glass: rgba(26, 26, 26, 0.85);

  --gold: #D4AF37;
  --gold-light: #F0D060;
  --gold-dark: #996515;
  --gold-glow: rgba(212, 175, 55, 0.3);
  --gold-gradient: linear-gradient(135deg, #BF953F, #FCF6B5, #B38728, #FBF5B7, #AA771C);

  --burgundy: #800020;
  --burgundy-light: #A00028;
  --burgundy-dark: #500014;

  --text-primary: #FFFFFF;
  --text-secondary: #D0D0D0;
  --text-muted: #888888;
  --text-inverse: #0A0A0A;

  --green: #4CAF50;
  --green-light: #66BB6A;
  --green-dark: #388E3C;
  --green-glow: rgba(76, 175, 80, 0.35);

  --red: #E53935;
  --red-dark: #C62828;

  --blue: #2196F3;
  --purple: #9C27B0;
  --orange: #FF9800;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 55, 0.3);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 20px var(--gold-glow);
  --shadow-green: 0 0 20px var(--green-glow);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-heading: 'Playfair Display', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --max-width: 1200px;
  --header-height: 72px;
  --topbar-height: 36px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(128, 0, 32, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(128, 0, 32, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold-light);
}

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: inherit;
}

input, select, textarea {
  font-family: var(--font-body);
  font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.2rem; }

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }

/* --- Top Bar --- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--topbar-height);
  background: var(--burgundy);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.top-bar .badge-18 {
  background: var(--text-primary);
  color: var(--burgundy);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.top-bar .ecogra-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  opacity: 0.9;
}

.top-bar .ecogra-badge svg {
  width: 16px;
  height: 16px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(10, 10, 10, 0.98);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.logo-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Desktop Navigation --- */
.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list a {
  display: block;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.nav-play-btn {
  background: var(--gold-gradient) !important;
  color: var(--text-inverse) !important;
  font-weight: 700 !important;
  padding: 8px 20px !important;
  margin-left: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast) !important;
}

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

/* --- Hamburger Menu --- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  height: 24px;
  justify-content: center;
  cursor: pointer;
  z-index: 1002;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- Mobile Nav Overlay --- */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999;
  padding: calc(var(--header-height) + var(--topbar-height) + 32px) 24px 32px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  display: block;
  padding: 14px 20px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.mobile-nav .nav-play-btn {
  margin-top: 12px;
  text-align: center;
  font-size: 18px;
  padding: 14px 20px;
}

/* --- 18+ Badge --- */
.badge-18-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid var(--text-primary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  min-height: 44px;
}

.btn-primary {
  background: var(--gold-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(212, 175, 55, 0.4);
  color: var(--text-inverse);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-light);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-burgundy {
  background: var(--burgundy);
  color: var(--text-primary);
}

.btn-burgundy:hover {
  background: var(--burgundy-light);
  color: var(--text-primary);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 17px;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Section --- */
.section {
  padding: 80px 0;
  position: relative;
  z-index: 1;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 48px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.card-icon svg {
  width: 28px;
  height: 28px;
  color: var(--text-inverse);
}

.card h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* --- Grid --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

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

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

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 64px 0 32px;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-compliance {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 20px;
  font-family: var(--font-body);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 6px 0;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom .footer-compliance-logos {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- Disclaimer Banner --- */
.disclaimer-banner {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 auto;
  max-width: var(--max-width);
}

.disclaimer-banner .badge-18-plus {
  flex-shrink: 0;
}

/* --- Age Gate Modal --- */
.age-gate-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.age-gate-overlay.active {
  display: flex;
}

.age-gate-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.age-gate-modal .gate-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-gradient);
  border-radius: 50%;
  font-size: 36px;
  font-weight: 900;
  color: var(--text-inverse);
}

.age-gate-modal h2 {
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.age-gate-modal p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

.age-gate-modal .gate-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  animation: slideInRight 0.3s ease;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}

.toast.toast-success {
  border-color: var(--green);
}

.toast.toast-error {
  border-color: var(--red);
}

.toast.toast-fadeout {
  animation: slideOutRight 0.3s ease forwards;
}

/* --- Page Header (inner pages) --- */
.page-header {
  padding: calc(var(--header-height) + var(--topbar-height) + 64px) 0 48px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}

.page-header h1 {
  margin-bottom: 12px;
}

.page-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Content Section (inner pages) --- */
.content-section {
  padding: 64px 0;
  position: relative;
  z-index: 1;
}

.content-section .container {
  max-width: 800px;
}

.content-section h2 {
  margin: 40px 0 16px;
  font-size: 1.5rem;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section h3 {
  margin: 32px 0 12px;
  font-size: 1.2rem;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.content-section ul,
.content-section ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-section ul {
  list-style: disc;
}

.content-section ol {
  list-style: decimal;
}

.content-section li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.6;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 8px var(--gold-glow); }
  50% { box-shadow: 0 0 24px var(--gold-glow); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.8); }
  70% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.shimmer-text {
  background: var(--gold-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* --- Balance Display --- */
.balance-display {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-weight: 700;
  color: var(--gold);
  font-size: 15px;
}

.balance-display .coin-icon {
  width: 20px;
  height: 20px;
}

.balance-display .amount {
  font-variant-numeric: tabular-nums;
}

/* --- Accent Separator --- */
.separator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--gold);
  opacity: 0.5;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-gold);
}

/* ========================================
   Media Queries
   ======================================== */

/* Tablet & Small Desktop */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }

  .container {
    padding: 0 16px;
  }

  .section {
    padding: 56px 0;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Mobile Navigation */
  .nav-list {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-nav {
    display: none;
  }

  .mobile-nav.open {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .age-gate-modal {
    padding: 32px 24px;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }

  .content-section {
    padding: 40px 0;
  }

  .content-section .container {
    max-width: 100%;
  }

  .card {
    padding: 24px;
  }
}

/* Small Mobile (375px) */
@media (max-width: 400px) {
  .container {
    padding: 0 12px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }

  .btn-lg {
    padding: 14px 28px;
    font-size: 15px;
  }

  .age-gate-modal {
    padding: 24px 16px;
  }
}
