/* ============================================
   Kids Game Pages - Clean, kid-friendly layout
   Matches design: mint green header, dark game block, mint footer
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');

/* Mint green accent */
:root {
  --kids-mint: #4ade80;
  --kids-mint-dark: #22c55e;
  --kids-mint-light: #86efac;
  --kids-navy: #1e293b;
  --kids-navy-dark: #0f172a;
}

/* Kids game page: header - matches main layout single-row */
body.kids-game-page .site-header {
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.kids-game-page .site-logo {
  color: var(--kids-mint-dark) !important;
  background: none !important;
  -webkit-text-fill-color: var(--kids-mint-dark) !important;
  background-clip: unset !important;
  font-size: 1.25rem;
  font-weight: 700;
}

body.kids-game-page .site-logo:hover {
  color: var(--kids-mint) !important;
  -webkit-text-fill-color: var(--kids-mint) !important;
}

/* Main content: white background, generous padding */
body.kids-game-page main {
  background: #fff;
  padding: 0;
}

body.kids-game-page .section {
  padding: 1rem 0.75rem 1.5rem;
  max-width: 100%;
}

body.kids-game-page .section .container {
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Kids footer - mint green bar */
.kids-game-footer {
  background: var(--kids-mint-dark) !important;
  padding: 1.5rem 1rem 2rem !important;
  margin-top: 2rem !important;
  border-top: none !important;
}

.kids-footer-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.kids-footer-brand {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  opacity: 1 !important;
}

.kids-footer-link {
  font-size: 0.95rem !important;
  color: rgba(255, 255, 255, 0.9) !important;
}

/* Back link - subtle, kid-friendly */
.kids-back-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 600;
  transition: color 0.2s ease;
}
.kids-back-link:hover {
  color: var(--kids-mint-dark) !important;
}

.kids-footer-content a:hover {
  color: #fff !important;
  opacity: 1 !important;
}

/* Game container wrapper - generous margins, dark block */
.kids-game-wrapper {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 0;
}

/* Desktop: larger game area for better visibility */
@media (min-width: 769px) {
  .kids-game-wrapper {
    max-width: 960px;
    padding: 1.25rem 0;
  }
}

body.kids-game-page .kids-game-container {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Woodland theme overrides - keep teal */
body.kids-game-page .kids-game-container[data-game-theme="woodland"] {
  background: linear-gradient(180deg, #5dade2 0%, #3498db 50%, #2e86de 100%) !important;
}

/* Loading text - light on dark background */
body.kids-game-page .kids-game-loading {
  color: rgba(255, 255, 255, 0.9) !important;
}
body.kids-game-page .kids-game-container[data-game-theme="woodland"] .kids-game-loading {
  color: #1e293b !important;
}

/* Fix: propagate flex chain so game elements fill the viewport below the navbar.
   layout.html wraps {% block body %} inside main > .section > .container.
   Game templates set body { display:flex; flex-direction:column } and rely on
   inner elements (e.g. #sky, #main) having flex:1 to fill remaining space — but
   that only works if every ancestor in between also participates in the flex chain. */
body.kids-game-page main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent !important;
}

body.kids-game-page main > .section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
}

body.kids-game-page main > .section > .container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Use dynamic viewport height on mobile to account for browser address bar */
@media (max-width: 768px) {
  body.kids-game-page {
    height: 100dvh !important;
  }
}
