/* Cosmic Forest — A mystical, dark theme with vibrant accents */
:root {
  --bg-dark: #0c0a14;
  --bg-med: #1a1825;
  --surface: #232033;
  --surface-light: #2c2940;
  --text-light: #e0ddeb;
  --text-med: #a8a2c5;
  --text-dark: #7b7599;
  --primary: #8b5cf6; /* Vibrant purple */
  --accent: #34d399;  /* Bright mint green */
  --glow: rgba(139, 92, 246, 0.4);
  --grad-primary: linear-gradient(135deg, var(--primary), #a78bfa);
  --grad-accent: linear-gradient(135deg, var(--accent), #6ee7b7);
  --shadow-sm: 0 4px 12px rgba(0,0,0,.2);
  --shadow-md: 0 10px 30px rgba(0,0,0,.3);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-body: 'Sora', sans-serif;
  --font-display: 'Sora', sans-serif;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-med);
  background: var(--bg-dark);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Background Effects */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 15% 25%, var(--glow) 0%, transparent 30%),
              radial-gradient(circle at 85% 75%, rgba(52, 211, 153, 0.2) 0%, transparent 30%);
  animation: background-pan 20s linear infinite;
  z-index: -1;
}
@keyframes background-pan {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Links & images */
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(1280px, 90%); margin-inline: auto; }

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px 0;
  background: rgba(12, 10, 20, 0.7);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 20px;
}
.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: 0 0 20px var(--glow);
}
.brand .name {
  color: var(--text-light);
}

/* Navigation */
.nav { display: flex; gap: 12px; }
.nav a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-med);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: color .2s;
}
.nav a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--grad-accent);
  transition: width .3s ease;
}
.nav a:hover, .nav a.active {
  color: var(--text-light);
}
.nav a:hover::before, .nav a.active::before {
  width: 100%;
}

/* Hamburger menu */
.hamburger { display: none; }
@media (max-width: 768px) {
  .nav {
    position: fixed;
    inset: 68px 16px auto;
    flex-direction: column;
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,.08);
    transform: translateY(-10px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: transform .3s ease, opacity .3s ease;
    z-index: 100;
  }
  .nav.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
  }
  .hamburger span {
    width: 24px;
    height: 3px;
    background: var(--text-light);
    border-radius: 3px;
    transition: .3s ease;
  }
  .hamburger.open span:first-child { transform: translateY(8px) rotate(45deg); }
  .hamburger.open span:nth-child(2) { opacity: 0; }
  .hamburger.open span:last-child { transform: translateY(-8px) rotate(-45deg); }
}

/* Hero section */
.hero {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 90px 0;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('aboutbg.jpg') center/cover no-repeat;
  opacity: 0.18;
  z-index: 0;
}
.hero-content {
  animation: fade-in-up 1s ease-out;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  margin: 0 0 24px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-subtitle {
  font-size: clamp(18px, 3vw, 22px);
  color: var(--text-med);
  max-width: 700px;
  margin: 0 auto 32px;
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hero section flex layout and floating image */
.hero-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px; /* reduced gap */
}
.hero-text {
  flex: 1;
  text-align: left;
}
.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.floating-img {
  width: 340px;
  max-width: 100%;
  animation: floatY 3.5s ease-in-out infinite;
  filter: drop-shadow(0 8px 32px rgba(139, 92, 246, 0.18));
  border: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  background: var(--surface-light);
  box-sizing: border-box;
}
@keyframes floatY {
  0% { transform: translateY(0); }
  50% { transform: translateY(-24px); }
  100% { transform: translateY(0); }
}
@media (max-width: 900px) {
  .hero-flex {
    flex-direction: column;
    gap: 24px;
  }
  .hero-image {
    justify-content: center;
  }
  .hero-text {
    text-align: center;
  }
}

/* Game Frame */
.game-container {
  padding: 60px 0;
}
.game-frame {
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  background: var(--bg-med);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Sections & Panels */
.section { padding: 60px 0; }
.section-title {
  text-align: center;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  margin: 0 0 48px;
  color: var(--text-light);
}
.panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}
.panel:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

/* Centered card style for legal pages */
.card-center {
  margin: 40px auto;
  max-width: 700px;
  box-shadow: 0 8px 32px rgba(44, 41, 64, 0.18);
  border-radius: var(--radius-lg);
  background: var(--surface-light);
  padding: 40px 32px;
  text-align: center;
}
.card-center h1, .card-center h2 {
  text-align: center;
}

/* Grid Layouts */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Cards */
.card {
  background: var(--surface-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}
.card-icon {
  font-size: 40px;
  margin-bottom: 16px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card h3 {
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--text-light);
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-light);
}
.input, .textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.1);
  background: var(--bg-med);
  color: var(--text-light);
  font-family: inherit;
  font-size: 16px;
  transition: .2s ease;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}
.textarea { min-height: 140px; resize: vertical; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: .3s ease;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 15px var(--glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--glow);
}
.btn-secondary {
  background: var(--surface-light);
  color: var(--text-light);
  border: 1px solid rgba(255,255,255,.1);
}
.btn-secondary:hover {
  background: var(--surface);
  border-color: var(--primary);
}

/* Footer */
.footer {
  margin-top: 60px;
  padding: 48px 0 0 0;
  background: var(--bg-med);
  border-top: 1px solid rgba(255,255,255,.05);
  text-align: center;
  position: relative;
  box-shadow: 0 -8px 32px rgba(44, 41, 64, 0.18);
}
.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
}
.footer-content::before {
  content: '';
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 8px;
  opacity: 0.7;
  z-index: 0;
}
.footer-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(44, 41, 64, 0.18);
  padding: 12px 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}
.footer-nav a {
  color: var(--text-med);
  font-weight: 500;
  transition: color 0.2s, text-shadow 0.2s;
  text-shadow: 0 1px 4px rgba(44, 41, 64, 0.12);
}
.footer-nav a:hover {
  color: var(--accent);
  text-shadow: 0 2px 8px var(--accent);
}
.footer-socials {
  display: flex;
  gap: 20px;
  font-size: 24px;
  background: rgba(44, 41, 64, 0.12);
  padding: 8px 16px;
  border-radius: 8px;
}
.footer-socials a {
  color: var(--text-dark);
  transition: color 0.2s, transform 0.2s;
}
.footer-socials a:hover {
  color: var(--primary);
  transform: scale(1.1);
}
.footer-copy {
  color: var(--text-dark);
  font-size: 15px;
  margin-top: 12px;
  background: rgba(251, 191, 36, 0.08);
  padding: 10px 18px;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(251, 191, 36, 0.08);
  display: inline-block;
  border-left: 4px solid #fbbf24;
  font-weight: 500;
}
.footer-copy .warning {
  color: #7c4700;
  font-weight: 700;
  background: linear-gradient(90deg, #fbbf24 0%, #f59e42 100%);
  padding: 4px 10px;
  border-radius: 6px;
  margin-right: 8px;
  display: inline-block;
  border: 1px solid #f59e42;
  box-shadow: 0 1px 6px rgba(251, 191, 36, 0.12);
}

/* Popup */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(12, 10, 20, 0.8);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.popup.show { display: flex; }
.popup-content {
  width: min(500px, 90%);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.popup-content h3 {
  font-size: 24px;
  margin: 0 0 16px;
  color: var(--text-light);
}
.popup-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
}

/* Scroll to top */
#toTop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--text-light);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: .3s ease;
  z-index: 40;
  font-size: 24px;
}
#toTop.show { opacity: 1; transform: none; }
#toTop:hover { background: var(--primary); color: white; transform: scale(1.1); }

/* Legal/Terms Pages */
.legal-content {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 40px;
  max-width: 900px;
  margin: 0 auto;
}
.legal-content h1, .legal-content h2 {
  color: var(--text-light);
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding-bottom: 12px;
  margin-bottom: 24px;
}
.legal-content h1 { font-size: 36px; }
.legal-content h2 { font-size: 28px; margin-top: 40px; }
.legal-content p, .legal-content ul {
  line-height: 1.8;
  color: var(--text-med);
}
.legal-content ul {
  list-style: none;
  padding-left: 0;
}
.legal-content li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 12px;
}
.legal-content li::before {
  content: '✧';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}
.legal-content .last-updated {
  margin-top: 40px;
  text-align: center;
  color: var(--text-dark);
  font-style: italic;
}

/* Disclaimer Section */
.disclaimer-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
  background: var(--surface-light);
}

.disclaimer-section .container {
  background: linear-gradient(90deg, #9c871a 0%, #fff8db 100%);
  border: 2px solid #fbbf24;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.25);
  padding: 2rem 1.5rem;
  max-width: 700px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.disclaimer-section .container:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(251, 191, 36, 0.35);
}

/* Disclaimer text */
.disclaimer-text {
  color: #7c4700;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  letter-spacing: 0.5px;
}

/* Button */
.btn-secondary {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: #f0c906;
  color: #7c4700;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.btn-secondary:hover {
  background: #fbbf24;
  color: #fff;
  transform: translateY(-2px);
}
.disclaimer-section .container {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* About Section */
.about-section {
  padding: 60px 0;
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.about-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('aboutbg.jpg') center/cover no-repeat;
  opacity: 0.18;
  z-index: 0;
}
.about-section > .container {
  position: relative;
  z-index: 1;
}
.about-section p {
  color: var(--text-med);
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.lead { font-size: 1.1em; color: var(--text-med); }
.mute { color: var(--text-dark); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-block { display: block; }
.m-auto { margin: auto; }
.max-w-300 { max-width: 300px; }
.align-items-center { align-items: center; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.border-0 { border: 0; }

.play-lead {
  max-width: 800px;
  margin: -32px auto 48px auto;
}

.contact-lead {
  max-width: 600px;
  margin: -32px auto 48px auto;
}

.contact-panel {
  max-width: 700px;
  margin: auto;
}

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