/* Jungle Learning Games — shared styles */

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

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --jungle-dark: #1a4d2e;
  --jungle-mid: #2d6a4f;
  --jungle-light: #40916c;
  --jungle-bright: #52b788;
  --leaf-green: #74c69d;
  --sun-yellow: #ffd166;
  --flower-pink: #ff8fab;
  --flower-orange: #ff9f1c;
  --sky-blue: #90e0ef;
  --box-shadow: rgba(0, 0, 0, 0.25);
  --text-dark: #1b4332;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  font-family: 'Fredoka', 'Comic Sans MS', cursive, sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  background: linear-gradient(180deg, #87ceeb 0%, #52b788 35%, #2d6a4f 70%, #1a4d2e 100%);
  background-attachment: fixed;
}

/* Decorative jungle background elements */
.jungle-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.jungle-bg .sun {
  position: absolute;
  top: 2rem;
  right: 8%;
  width: 90px;
  height: 90px;
  background: radial-gradient(circle, #ffe066 0%, #ffd166 60%, #ffb703 100%);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(255, 209, 102, 0.6);
}

.jungle-bg .cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50px;
}

.jungle-bg .cloud::before,
.jungle-bg .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.jungle-bg .cloud-1 {
  top: 4rem;
  left: 5%;
  width: 80px;
  height: 30px;
}

.jungle-bg .cloud-1::before {
  width: 40px;
  height: 40px;
  top: -20px;
  left: 10px;
}

.jungle-bg .cloud-1::after {
  width: 50px;
  height: 35px;
  top: -15px;
  right: 5px;
}

.jungle-bg .cloud-2 {
  top: 6rem;
  left: 25%;
  width: 100px;
  height: 35px;
  opacity: 0.7;
}

.jungle-bg .cloud-2::before {
  width: 45px;
  height: 45px;
  top: -22px;
  left: 15px;
}

.jungle-bg .cloud-2::after {
  width: 55px;
  height: 40px;
  top: -18px;
  right: 10px;
}

.jungle-bg .vine {
  position: absolute;
  width: 8px;
  background: linear-gradient(180deg, #40916c, #2d6a4f);
  border-radius: 4px;
}

.jungle-bg .vine-left {
  top: 0;
  left: 3%;
  height: 45vh;
  transform: rotate(-5deg);
}

.jungle-bg .vine-right {
  top: 0;
  right: 4%;
  height: 50vh;
  transform: rotate(8deg);
}

.jungle-bg .leaf {
  position: absolute;
  font-size: 2.5rem;
  opacity: 0.7;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.jungle-bg .leaf-1 { top: 12%; left: 2%; transform: rotate(-30deg); }
.jungle-bg .leaf-2 { top: 25%; right: 3%; transform: rotate(45deg); }
.jungle-bg .leaf-3 { bottom: 30%; left: 5%; transform: rotate(15deg); }
.jungle-bg .leaf-4 { bottom: 15%; right: 6%; transform: rotate(-20deg); }
.jungle-bg .leaf-5 { top: 40%; left: 8%; transform: rotate(60deg); font-size: 2rem; }
.jungle-bg .leaf-6 { bottom: 40%; right: 10%; transform: rotate(-50deg); font-size: 2rem; }

.jungle-bg .animal {
  position: absolute;
  font-size: 3rem;
  opacity: 0.85;
  filter: drop-shadow(2px 3px 6px rgba(0, 0, 0, 0.25));
}

.jungle-bg .monkey { bottom: 8%; left: 4%; }
.jungle-bg .parrot { top: 18%; right: 5%; transform: scaleX(-1); }
.jungle-bg .frog { bottom: 12%; right: 8%; }

/* Main layout */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 3rem;
}

/* Header */
.site-header {
  text-align: center;
  margin-bottom: 1rem;
}

.site-header h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  color: #fff;
  text-shadow:
    3px 3px 0 var(--jungle-dark),
    -1px -1px 0 var(--jungle-mid),
    0 4px 12px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.site-header .subtitle {
  margin-top: 0.75rem;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 500;
  color: #d8f3dc;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.ad-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  min-height: 50px;
  text-align: center;
  overflow: hidden;
}

/* Game grid */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 900px;
}

.game-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.75rem 1.25rem;
  min-height: 160px;
  text-decoration: none;
  color: var(--text-dark);
  background: linear-gradient(145deg, #fff 0%, #f0fdf4 100%);
  border: 4px solid var(--jungle-bright);
  border-radius: 20px;
  box-shadow:
    0 6px 0 var(--jungle-mid),
    0 10px 25px var(--box-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.game-box:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 10px 0 var(--jungle-mid),
    0 16px 35px var(--box-shadow);
}

.game-box:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 var(--jungle-mid),
    0 6px 15px var(--box-shadow);
}

.game-box .icon {
  font-size: 2.75rem;
  line-height: 1;
}

.game-box .title {
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

/* Color accents per game */
.game-box.sight-words-1 { border-color: #ff6b6b; }
.game-box.sight-words-1:hover { border-color: #ee5a5a; }
.game-box.sight-words-2 { border-color: #ff9f43; }
.game-box.sight-words-2:hover { border-color: #f39c12; }
.game-box.case-matching { border-color: #a29bfe; }
.game-box.case-matching:hover { border-color: #6c5ce7; }
.game-box.addition { border-color: #00b894; }
.game-box.addition:hover { border-color: #00a085; }
.game-box.subtraction { border-color: #0984e3; }
.game-box.subtraction:hover { border-color: #0770c9; }

/* Game placeholder pages */
.game-page {
  width: 100%;
  max-width: 700px;
  text-align: center;
}

.game-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 2rem;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--jungle-dark);
  text-decoration: none;
  background: #fff;
  border: 3px solid var(--jungle-bright);
  border-radius: 12px;
  box-shadow: 0 4px 0 var(--jungle-mid);
  transition: transform 0.15s ease;
}

.game-page .back-link:hover {
  transform: translateY(-2px);
}

.game-page .back-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--jungle-mid);
}

.game-card {
  background: linear-gradient(145deg, #fff 0%, #f0fdf4 100%);
  border: 4px solid var(--jungle-bright);
  border-radius: 24px;
  padding: 3rem 2rem;
  box-shadow:
    0 8px 0 var(--jungle-mid),
    0 14px 30px var(--box-shadow);
}

.game-card .game-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.game-card h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--jungle-dark);
  margin-bottom: 1rem;
}

.game-card .coming-soon {
  font-size: 1.1rem;
  color: var(--jungle-mid);
  line-height: 1.6;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding-top: 2.5rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive tweaks */
@media (max-width: 500px) {
  .game-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }

  .jungle-bg .sun {
    width: 60px;
    height: 60px;
    top: 1rem;
    right: 5%;
  }

  .jungle-bg .animal {
    font-size: 2rem;
  }
}
