/* ============================================================================
   THE REVISION ARCADE — shared styles for every page.

   Brand rules baked in here:
   - Level-Up Green  #33EE6E  → primary actions (play buttons, key highlights)
   - Cyan Ray        #2DE2FF  → secondary accent (chips, links, details)
   - Coin Yellow     #FFD447  → WIN/REWARD STATES ONLY (unlocked badge etc.)
   - Poppins for everything readable; "Press Start 2P" ONLY for the wordmark.
   ============================================================================ */

:root {
  /* display font for headlines; Poppins stays for body/UI,
     Press Start 2P stays reserved for the small logo wordmark */
  --font-display: "Unbounded", "Poppins", system-ui, sans-serif;
  --green: #33ee6e;
  --green-dark: #1ec757;
  --cyan: #2de2ff;
  --coin: #ffd447; /* win/reward accent ONLY — not general UI */
  --bg: #0a0e13;
  --panel: #111826;
  --panel-edge: #1d2941;
  --ink: #06130b; /* dark text used on green buttons */
  --text: #eaf2f5;
  --muted: #94a5b6;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Poppins", system-ui, sans-serif;
  line-height: 1.6;
  /* ambient stage lighting in the brand colours: a green key light up top
     (behind the mascot), cyan fills at the edges, and a vertical gradient
     base so the page is never flat black */
  background:
    radial-gradient(1100px 720px at 50% -12%, rgba(51, 238, 110, 0.26), transparent 62%),
    radial-gradient(900px 640px at 104% 18%, rgba(45, 226, 255, 0.17), transparent 65%),
    radial-gradient(1000px 780px at -6% 96%, rgba(45, 226, 255, 0.14), transparent 65%),
    linear-gradient(180deg, #111b2c 0%, #0a0e13 52%, #06090d 100%);
  background-attachment: fixed;
}

img { display: block; max-width: 100%; }
a { color: var(--cyan); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---- wordmark: the ONLY place Press Start 2P is allowed ----
   No glow — the pixel font carries the arcade feel on its own. */
.wordmark {
  font-family: "Press Start 2P", monospace;
  color: var(--green);
  letter-spacing: 1px;
  line-height: 1.6;
  text-decoration: none;
}
.wordmark .alt { color: var(--cyan); }

/* ---------------- header ---------------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 0;
}
.site-header .wordmark { font-size: 13px; display: flex; align-items: center; gap: 10px; }
.site-header .wordmark img { width: 30px; height: auto; image-rendering: pixelated; }
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px;
}
.site-nav a:hover { color: var(--green); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: "Poppins", system-ui, sans-serif; font-weight: 700;
  border-radius: 12px; padding: 13px 26px; font-size: 16px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary {
  background: var(--green); color: var(--ink);
  box-shadow: 0 0 22px rgba(51, 238, 110, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(51, 238, 110, 0.55); }
.btn-ghost {
  background: transparent; color: var(--cyan);
  border: 2px solid rgba(45, 226, 255, 0.5);
}
.btn-ghost:hover { border-color: var(--cyan); transform: translateY(-2px); }
.btn-small { padding: 9px 16px; font-size: 14px; border-radius: 10px; }

/* ---------------- hero ---------------- */
.hero {
  position: relative; text-align: center; padding: 72px 0 88px;
}
.hero .mascot {
  width: clamp(120px, 22vw, 180px); margin: 0 auto;
  image-rendering: pixelated;
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.5));
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
/* big hero title: this IS the wordmark, so it uses the same pixel font
   and colours as the header logo — just bigger. Clean, no neon. */
.hero-title {
  font-family: "Press Start 2P", monospace;
  font-size: clamp(16px, 3vw, 30px);
  font-weight: 400; /* Press Start 2P has one weight */
  letter-spacing: 1px;
  line-height: 1.55;
  margin: 26px 0 10px;
  color: var(--green);
}
.hero-title span { color: var(--cyan); }
/* supporting tagline: quiet, spaced, sits under the title */
.hero-eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 3px;
  text-transform: uppercase; color: var(--cyan);
  margin: 0 0 22px;
}
.hero .tagline {
  font-size: clamp(18px, 2.6vw, 24px); font-weight: 600;
  max-width: 640px; margin: 0 auto 8px;
}
.hero .tagline em { color: var(--green); font-style: normal; }
.hero .subline { color: var(--muted); margin: 0 auto 28px; max-width: 560px; }

/* ad-free trust line: a confident selling point under the CTA, not a footnote */
.trust-line {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  max-width: 560px; margin: 22px auto 0;
  font-size: 15px; color: var(--text); text-align: left;
}
.trust-line svg { color: var(--green); flex-shrink: 0; }
.trust-line strong { color: var(--green); }

/* free/paid model strip: same raised surface as the cards */
.model-strip {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(180deg, #151e2e, #101724);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 22px 26px; margin: 0 0 40px;
}
.model-strip img { width: 56px; image-rendering: pixelated; flex-shrink: 0; }
.model-strip h2 {
  font-family: var(--font-display); font-size: 17px; margin: 0 0 8px; line-height: 1.4;
}
.model-strip h2 span { color: var(--green); }
.model-strip p { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.model-strip p:last-child { margin-bottom: 0; }
.model-strip ul { margin: 0 0 12px; padding-left: 20px; color: var(--muted); font-size: 15px; }
.model-strip li { margin: 5px 0; }
.model-strip li strong { color: var(--text); }

/* ---------------- game grid ---------------- */
.section-title {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; margin: 26px 0 6px; line-height: 1.35;
}
.section-title span { color: var(--green); }
.section-sub { color: var(--muted); margin: 0 0 22px; }

.game-grid {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  padding-bottom: 48px;
}

.game-card {
  /* a card is a raised surface: slightly lighter than the page, quiet
     border, real elevation shadow — no glow */
  background: linear-gradient(180deg, #151e2e, #101724);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column;
  height: 100%;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}
.game-card .thumb { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.game-card .card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chip {
  font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  color: var(--cyan); border: 1.5px solid rgba(45, 226, 255, 0.5);
  border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
.chip-free { color: var(--green); border-color: rgba(51, 238, 110, 0.5); }
/* quiet metadata chip (e.g. "Cambridge curriculum") */
.chip-meta { color: #b9c6d2; border-color: rgba(255, 255, 255, 0.22); }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.game-card h3 { font-family: var(--font-display); margin: 4px 0 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.game-card .topic { color: var(--muted); font-size: 13.5px; margin: 0; }
.game-card .tagline { font-size: 14.5px; margin: 2px 0 10px; }
.game-card .play-row { margin-top: auto; display: flex; align-items: center; gap: 12px; }
.game-card .play-row .mini-mascot { width: 34px; image-rendering: pixelated; }

/* ---------------- footer ---------------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 26px 0 40px; color: var(--muted); font-size: 14px; text-align: center;
}

/* ---------------- about page ---------------- */
.about-page { max-width: 720px; margin: 0 auto; padding: 36px 20px 80px; }
.about-page .mascot {
  display: block; width: 92px; margin: 18px auto 30px;
  image-rendering: pixelated;
  animation: bob 3s ease-in-out infinite;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.5));
}
.about-page h1 {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 26px); line-height: 1.55;
  text-align: center; margin: 0 0 20px;
}
.about-page h1 span { color: var(--green); }
.about-page h2 {
  font-family: var(--font-display);
  font-size: 18px; line-height: 1.5; margin: 60px 0 16px;
}
.about-page h2 span { color: var(--cyan); }
/* long-form body reads better slightly brighter than the UI muted grey */
.about-page p { color: #c3cfdc; margin: 0 0 18px; }
.about-page .lead { text-align: center; max-width: 620px; margin-left: auto; margin-right: auto; }
.about-cta { text-align: center; margin-top: 68px; }

/* ---------------- game page ---------------- */
.game-page-header { padding: 14px 0; }
.back-link {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px;
}
.back-link:hover { color: var(--green); }

.game-frame-shell {
  border: 1px solid rgba(255, 255, 255, 0.07); border-radius: var(--radius);
  overflow: hidden; background: #000;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
}
.game-frame-shell iframe {
  display: block; width: 100%; border: 0;
  height: min(78vh, 760px);
}
.frame-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 4px 26px;
}
.frame-bar .hint { color: var(--muted); font-size: 13.5px; }

.game-info { display: grid; gap: 22px; grid-template-columns: 1fr; padding-bottom: 40px; }
@media (min-width: 760px) { .game-info { grid-template-columns: 1.4fr 1fr; } }
.info-panel {
  background: linear-gradient(180deg, #151e2e, #101724);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.info-panel h2 { font-family: var(--font-display); margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.info-panel h2 span { color: var(--green); }
.info-panel ul { margin: 8px 0 0; padding-left: 20px; }
.info-panel li { margin: 5px 0; }
.info-panel .muted { color: var(--muted); }

/* premium/unlock panel (only rendered when a game has a paid tier) */
.premium-panel h2 span { color: var(--cyan); }
/* Coin Yellow is allowed here: "unlocked" is a reward state */
.unlocked-badge {
  display: inline-block; font-weight: 800; color: var(--coin);
  border: 2px solid rgba(255, 212, 71, 0.6); border-radius: 999px;
  padding: 4px 14px; font-size: 14px;
}

/* engagement nudge — slides up after real play, never a blocking modal */
.nudge {
  position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 140%);
  width: min(520px, calc(100vw - 28px));
  background: linear-gradient(180deg, #151e2e, #101724);
  border: 1px solid rgba(51, 238, 110, 0.35);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; gap: 14px; align-items: center;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1);
  z-index: 50;
}
.nudge.show { transform: translate(-50%, 0); }
.nudge[hidden] { display: none; } /* the hidden attribute must beat display:flex */
.nudge img { width: 46px; image-rendering: pixelated; flex-shrink: 0; }
.nudge p { margin: 0 0 8px; font-size: 14.5px; }
.nudge .close {
  background: none; border: 0; color: var(--muted); font-size: 20px;
  cursor: pointer; align-self: flex-start; padding: 0 2px;
}

/* PWA install pill — small, dismissible, out of the way */
.install-pill {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: none; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid rgba(45, 226, 255, 0.55);
  border-radius: 999px; padding: 8px 8px 8px 16px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.install-pill.show { display: flex; }
.install-pill button { white-space: nowrap; }
.install-pill .close {
  background: none; border: 0; color: var(--muted);
  font-size: 18px; cursor: pointer; padding: 0 6px 0 0;
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  /* Press Start 2P is a wide font — keep the header wordmark on one line */
  .site-header .wordmark { font-size: 9px; }
  .site-header .wordmark img { width: 24px; }
}

/* ultra-narrow (split-screen panels, tiny embeds) — keep it dignified */
@media (max-width: 380px) {
  .site-header .wordmark { font-size: 8px; gap: 6px; }
  .hero { padding: 40px 0 52px; }
  .hero-title { font-size: 14px; }
  .hero .tagline { font-size: 17px; }
  .hero .mascot { width: 104px; }
}
