/* FunHaven - Light Purple & White Theme
 * Modern, clean, and Google Ads compliant styling
 */

/* Color variables */
:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #a78bfa;
  --accent: #c084fc;
  --accent-light: #e9d5ff;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #faf5ff;
  --bg-alt: #f3e8ff;
  --white: #ffffff;
  --border: rgba(124, 58, 237, 0.15);
  --header-height: 72px;
  --shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
  --shadow-small: 0 2px 8px rgba(124, 58, 237, 0.08);
}

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Arial', sans-serif;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--primary);
  line-height: 1.3;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 1.2rem;
}

h3 {
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  color: var(--primary-dark);
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* Layout */
.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* ensure main content clears the fixed header */
main {
  padding-top: calc(var(--header-height) + 24px);
}

.section {
  padding: 4rem 0;
}

/* Header */
.header {
  /* Floating card header: centered, with rounded corners and side gaps */
  position: fixed;
  top: 18px; /* gap from top */
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, calc(100% - 64px)); /* leave side gaps */
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  border: 1px solid rgba(124,58,237,0.06);
  box-shadow: 0 10px 30px rgba(2,6,23,0.12);
  z-index: 1100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 0.4rem;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  font-family: 'Poppins', 'Arial', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--primary);
  text-decoration: none;
  gap: 8px;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-links a {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a[aria-current="page"] {
  background: var(--primary);
  color: var(--white);
}

/* Mobile navigation */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle .bar {
  display: block;
  width: 28px;
  height: 3px;
  margin: 6px auto;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Hero section */
.hero {
  /* Background image with subtle darkening via overlay pseudo-element */
  background: linear-gradient(135deg, var(--white), var(--bg-alt));
  padding: 6rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  /* image placed under content */
  content: '';
  position: absolute;
  inset: 0;
  /* try to load bg.jpg; if missing fall back to a pleasant gradient */
  background: url('../assets/bg.jpg') center/cover no-repeat, linear-gradient(135deg, var(--bg-alt), var(--bg));
  z-index: 0;
  opacity: 1;
}

.hero::after {
  /* dark overlay so text stays legible */
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45); /* adjust opacity to taste */
  z-index: 1;
}

.hero-content {
  /* Center the hero content horizontally and vertically.
     Use a single-column layout so text is centered and sits nicely when the hero image is removed. */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  position: relative; /* sit above the pseudo-element overlay */
  z-index: 2;
}

.hero h1 {
  color: #ffffff;
  margin-bottom: 1.5rem;
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

.hero p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  /* Reduce iframe vertical footprint on mobile/tablet */
  .game-frame-container {
    padding: 0.4rem; /* less padding around iframe */
  }
  .game-frame {
    max-height: 50vh;
  }
  line-height: 1.8;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 4px 12px rgba(0,0,0,0.55);
}

.hero-image {
  width: 100%;
  max-width: 550px;
  height: auto;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* Button styles */
.btn {
  display: inline-block;
  background: var(--primary);
  color: var(--white);
  padding: 1rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Utility classes */
.centered-heading {
  text-align: center;
  margin-bottom: 2rem;
}

.btn--muted {
  background: #6b7280;
}

/* Warning Disclaimer */
.disclaimer-alert {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border: 2px solid #F59E0B;
  border-radius: 12px;
  padding: 2rem;
  margin: 3rem auto;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  max-width: 900px;
  box-shadow: var(--shadow);
}

.warning-icon {
  min-width: 50px;
  height: 50px;
  background: #F59E0B;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  flex-shrink: 0;
}

.disclaimer-content {
  flex: 1;
}

.disclaimer-content h3 {
  color: #B45309;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.disclaimer-content p {
  color: #92400E;
  margin-bottom: 0.8rem;
}

.disclaimer-content p:last-child {
  margin-bottom: 0;
}

/* Game section */
.games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.game-card {
  background: transparent;
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.3s ease;
}

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

.game-header {
  padding: 1.2rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
}

.game-frame-container {
  /* Limit the playable area and center it */
  /* box-shadow: var(--shadow); */
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 0.75rem; /* small padding around iframe */
}
.game-frame {
  width: 100%;
  max-width: 900px; /* enforce 900px maximum */
  aspect-ratio: 16 / 9; /* keep 16:9 ratio */
  /* remove fixed height so iframe can scale naturally
     use a viewport-based max-height to avoid huge gaps on short screens */
  height: 550px;
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin: 0 auto;
  display: block;
}

/* About section */
.about-section {
  background: var(--white);
  padding: 5rem 0;
}

/* Reviews / Testimonials */
.reviews-section {
  padding: 3.5rem 0;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.review-card {
  background: linear-gradient(180deg, var(--white), var(--bg-alt));
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-small);
  color: var(--text);
}

.review-card blockquote {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 1rem 0;
}

.review-card cite {
  display: block;
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 600;
}


.about-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.about-content h2 {
  margin-bottom: 1.5rem;
}

.about-content p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Features section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.feature-item {
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.feature-item:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.feature-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
}

.feature-item h3 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

.feature-item p {
  color: var(--text-light);
}

/* Contact form */
.contact-section {
  background: var(--bg-alt);
  padding: 5rem 0;
}

.contact-form {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 3rem;
  max-width: 700px;
  margin: 2rem auto;
}

.form-group {
  margin-bottom: 1.8rem;
}

.form-label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--primary-dark);
  font-weight: 600;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: var(--bg);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 160px;
}

/* Footer */
.footer {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  margin-top: auto;
  padding: 4rem 0 1.5rem;
}

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

.footer-about h3 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.footer-about p {
  color: var(--accent-light);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}

.footer-disclaimer {
  background: rgba(255,255,255,0.1);
  padding: 1.2rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--accent-light);
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  padding: 0;
  
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: 0.95rem;
 
}


.footer-bottom p a {
  color: white;
  text-decoration: underline;
}
.footer-bottom p a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-bottom p{
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  text-align: center;
  font-size: 0.9rem;
  color: white;
}

/* Modal dialog for age verification */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: min(550px, 92%);
  position: relative;
  overflow: hidden;
  padding: 2.5rem;
}

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.modal h2 {
  margin-top: 0.5rem;
  margin-bottom: 1.2rem;
  color: var(--primary-dark);
}

.modal p {
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  justify-content: center;
}

.modal-note {
  display: block;
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Content pages */
.content {
  max-width: 850px;
  margin: 0 auto;
  padding: 3rem;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.content h1 {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--accent);
}

.content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.content ul, .content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
}

.content li {
  margin-bottom: 0.7rem;
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 999;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
}

/* Responsive design */
@media (max-width: 992px) {
  .hero-content {
    /* keep centered single-column flex layout on narrower screens */
    flex-direction: column;
    text-align: center;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .footer-about {
    grid-column: 1 / -1;
  }

  .reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    /* remove the desktop-centered transform so header stays within the viewport on small screens */
    transform: none;
    position: static;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    border-radius: 0;
    height: 56px;
    min-height: 0;
    box-shadow: none;
    background: #fff;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    padding: 0 0.5rem;
    border: none;
    position: relative;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: visible;
  }
  .nav {
    height: 56px;
    padding: 0 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .logo {
    font-size: 1.25rem;
    gap: 4px;
    margin: 0 auto;
  }
  .nav-toggle {
    display: block;
    font-size: 1.5rem;
    padding: 0.4rem 0.6rem;
    margin-left: 0.5rem;
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1300;
  }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
  /* Further reduce iframe space on small phones */
  .game-frame-container {
    padding: 0.25rem;
  }
  .game-frame {
    max-height: 44vh;
  }
    padding-top: 0.5rem;
    background: rgba(255,255,255,0.98);
    position: absolute;
    top: 100%;
    left: 0;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(2,6,23,0.10);
    z-index: 1200;
  }
  .nav-links.show {
    display: flex;
  }
  .nav-links a {
    display: block;
    text-align: center;
    padding: 0.9rem 0.5rem;
    font-size: 1rem;
  }
  .hero {
    padding: 3rem 0 2rem;
  }

  .game-frame{
    height: 220px;
  }

  .section {
    padding: 2.2rem 0;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  .disclaimer-alert {
    flex-direction: column;
    text-align: center;
  }
  .warning-icon {
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .header {
    /* ensure no leftover transform shifts header off-screen on very small devices */
    transform: none;
    left: 4px;
    right: 4px;
    width: auto;
    top: 4px;
    border-radius: 6px;
    height: 44px;
    min-height: 0;
    box-shadow: 0 2px 8px rgba(2,6,23,0.13);
    padding: 0 0.2rem;
    display: flex;
    justify-content: center;
  }
  .nav {
    height: 44px;
    padding: 0 0.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .logo {
    font-size: 1rem;
    gap: 2px;
    margin: 0 auto;
  }
  .nav-toggle {
    font-size: 1.2rem;
    padding: 0.2rem 0.4rem;
    margin-left: 0.2rem;
    right: 0.6rem;
  }
  .nav-links a {
    font-size: 0.98rem;
    padding: 0.7rem 0.2rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 2rem 0;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .contact-form {
    padding: 2rem;
  }
  
  .scroll-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
  }
}
