/* ========== CSS Reset & Core Tokens ========== */
:root {
  --bg-soft: #0e0f13; /* soft black */
  --fg: #f7f7fb;
  --muted: #c9c9d6;
  --accent-1: #3a78ff; /* blue */
  --accent-2: #7b3cff; /* purple */
  --accent-3: #ff4fd8; /* pink */
  --ring: #9aa8ff;
  --card-bg: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.2);
  --border: rgba(255, 255, 255, 0.12);
  --error: #ff6b6b;
  --success: #51cf66;
  --warning: #ffd93d;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-soft);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', system-ui, sans-serif;
  line-height: 1.2;
  margin: 0 0 1rem 0;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

a {
  color: var(--accent-1);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-2);
}

a:focus {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ========== Layout Utilities ========== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

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

/* ========== Buttons ========== */
.btn {
  border: 0;
  border-radius: 1rem;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.btn-gradient {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  box-shadow: var(--shadow);
  color: #fff;
}

.btn-gradient:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

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

.btn-ghost:hover {
  background: var(--glass);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-wide {
  width: 100%;
}

.btn-play {
  margin-top: 1rem;
  width: 100%;
}

/* ========== Age Gate Banner ========== */
.age-gate-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  z-index: 2000;
  padding: 1rem;
  box-shadow: var(--shadow);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.age-gate-banner.show {
  transform: translateY(0);
}

.age-gate-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.age-icon {
  font-size: 1.5rem;
}

.age-gate-content p {
  margin: 0;
  font-weight: 600;
  color: white;
}

/* ========== Header ========== */
.site-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: 'Poppins', system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--fg);
}

/* ========== Main Content Areas ========== */
.stratum-mainflow {
  min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero {
  padding: 4rem clamp(1rem, 4vw, 2rem);
  text-align: center;
  background: radial-gradient(circle at center, rgba(58, 120, 255, 0.1) 0%, transparent 50%);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.disclaimer {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* Sections */
.games-section,
.features-section {
  padding: 4rem clamp(1rem, 4vw, 2rem);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.game-card {
  background: var(--card-bg);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border-radius: 1.2rem;
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.game-image {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.game-title {
  margin-bottom: 1rem;
}

.game-desc {
  color: var(--muted);
  margin: 0;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature {
  text-align: center;
  padding: 2rem;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature h3 {
  margin-bottom: 1rem;
}

.feature p {
  color: var(--muted);
  margin: 0;
}

/* ========== Modal System ========== */
.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-shell[hidden] {
  display: none;
}

.modal-card {
  background: var(--card-bg);
  backdrop-filter: saturate(120%) blur(15px);
  -webkit-backdrop-filter: saturate(120%) blur(15px);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  max-width: 520px;
  width: min(92vw, 520px);
  padding: 2rem;
  position: relative;
  border: 1px solid var(--border);
}

.modal-title {
  font-family: 'Poppins', system-ui, sans-serif;
  margin: 0 0 0.5rem 0;
  color: var(--fg);
}

.modal-sub {
  margin: 0.5rem 0 2rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal-close {
  appearance: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border-radius: 0.8rem;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--fg);
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.05);
}

.modal-close:focus {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* ========== Forms ========== */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 1rem 0;
}

.checkbox-field input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.checkbox-field label {
  font-weight: 400;
  font-size: 0.95rem;
  line-height: 1.4;
}

label {
  font-weight: 600;
  color: var(--fg);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  color: var(--fg);
  font-size: 1rem;
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-color: var(--accent-1);
  background: rgba(255, 255, 255, 0.1);
}

input[type="checkbox"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent-1);
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.err {
  display: block;
  min-height: 1.2em;
  color: var(--error);
  font-size: 0.9rem;
  font-weight: 500;
}

.actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.small {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 1rem;
}

/* ========== Toast Notifications ========== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  background: var(--card-bg);
  backdrop-filter: saturate(120%) blur(10px);
  -webkit-backdrop-filter: saturate(120%) blur(10px);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  color: var(--fg);
  box-shadow: var(--shadow);
  max-width: 350px;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

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

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

/* ========== Cookie Consent Banner ========== */
.cookie-consent {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--card-bg);
  backdrop-filter: saturate(120%) blur(15px);
  -webkit-backdrop-filter: saturate(120%) blur(15px);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 2rem;
  max-width: 400px;
  width: calc(100vw - 4rem);
  box-shadow: var(--shadow);
  z-index: 1500;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-content h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: var(--fg);
}

.cookie-content p {
  margin: 0 0 1.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.cookie-controls {
  margin-bottom: 1.5rem;
}

.cookie-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  position: relative;
}

.cookie-toggle label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
}

.cookie-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 50px;
  height: 24px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: all 0.2s ease;
}

.cookie-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.cookie-toggle input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.toggle-slider.essential {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  opacity: 0.7;
  cursor: not-allowed;
}

.toggle-slider.essential:before {
  transform: translateX(26px);
}

.cookie-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cookie-actions .btn {
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
}

/* ========== Footer ========== */
.box-pastel {
  background: linear-gradient(135deg, 
    rgba(58, 120, 255, 0.12), 
    rgba(123, 60, 255, 0.12), 
    rgba(255, 79, 216, 0.12)
  );
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 2rem;
  margin: 3rem clamp(1rem, 4vw, 2rem);
}

.site-foot {
  background: rgba(0, 0, 0, 0.3);
  color: var(--fg);
  padding: 3rem 0 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--fg);
}

.footer-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-section ul li a:hover {
  color: var(--fg);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom p {
  margin: 0.5rem 0;
  color: var(--muted);
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
  .site-nav {
    gap: 1rem;
  }
  
  .nav-link {
    display: none;
  }
  
  .hero {
    padding: 2rem clamp(1rem, 4vw, 2rem);
  }
  
  .games-section,
  .features-section {
    padding: 2rem clamp(1rem, 4vw, 2rem);
  }
  
  .games-grid {
    grid-template-columns: 1fr;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .age-gate-content {
    flex-direction: column;
    text-align: center;
  }
  
  .toast-container {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
  
  .toast {
    max-width: none;
  }
  
  .cookie-consent {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }
  
  .cookie-actions {
    flex-direction: column;
  }
}

/* ========== Animations ========== */
@media (prefers-reduced-motion: no-preference) {
  .modal-card {
    animation: modalPop 0.2s ease-out;
  }
  
  @keyframes modalPop {
    from {
      transform: scale(0.95);
      opacity: 0.8;
    }
    to {
      transform: scale(1);
      opacity: 1;
    }
  }
  
  .game-card,
  .btn {
    transition: transform 0.2s ease;
  }
}

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