/* Star Learner portal — shared styles
   Light default; dark when prefers-color-scheme: dark.
   Paths assume pages at / or /games/<slug>/ */

:root {
  color-scheme: light dark;

  --bg: #e8f0f7;
  --bg-deep: #d5e4f0;
  --ink: #1a2433;
  --muted: #4a5a6e;
  --panel: #f7fafc;
  --stroke: #b8c9d9;
  --gold: #c9922a;
  --gold-soft: #f3e2b8;
  --teal: #2a7a7a;
  --btn-fg: #ffffff;
  --media-bg: #0f1720;
  --glow-warm: #fff8e8;
  --glow-cool: #cfe6f5;
  --header-bg: rgba(247, 250, 252, 0.88);
  --tile-shadow: 0 10px 28px rgba(26, 36, 51, 0.12);
  --radius: 18px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --max: 960px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131a;
    --bg-deep: #080b10;
    --ink: #e8eef6;
    --muted: #9aabbd;
    --panel: #161d28;
    --stroke: #2c3a4e;
    --gold: #e0b045;
    --gold-soft: #3a3018;
    --teal: #5eb8b8;
    --btn-fg: #0e131a;
    --media-bg: #05070b;
    --glow-warm: rgba(224, 176, 69, 0.12);
    --glow-cool: rgba(94, 184, 184, 0.10);
    --header-bg: rgba(14, 19, 26, 0.90);
    --tile-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  background:
    radial-gradient(900px 420px at 10% -5%, var(--glow-warm) 0%, transparent 55%),
    radial-gradient(800px 500px at 95% 5%, var(--glow-cool) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--stroke);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
}
.nav-brand {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-right: 0.4rem;
}
.nav-brand span { color: var(--gold); }
.nav-links {
  display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.2rem 0;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink); }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.1rem 4rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 650;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 2.85rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin: 2.2rem 0 0.7rem; }
h3 { font-size: 1.15rem; margin: 1.4rem 0 0.45rem; }
.lede {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 48rem;
  margin: 0 0 1.25rem;
}
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 0 0 0.45rem;
}

.kiosk-hero {
  display: grid;
  gap: 1.25rem;
  margin: 1.25rem 0 1.75rem;
}
@media (min-width: 720px) {
  .kiosk-hero { grid-template-columns: 1.05fr 0.95fr; align-items: center; }
}
.kiosk-hero img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: var(--tile-shadow);
  background: var(--panel);
}
.kiosk-hero .copy p { margin: 0 0 0.85rem; color: var(--muted); }

/* Kiosk tiles are square on-device (see MainActivity TILE_IMG_DP).
   Force square here — HTML width/height attrs must not pin a tall box. */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1rem 1.1rem;
  margin: 1.5rem 0 2rem;
  align-items: start;
}
@media (max-width: 720px) {
  .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tile-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease;
  min-width: 0;
}
.tile-link:hover { transform: translateY(-3px); color: var(--ink); }
.tile-link img {
  display: block;
  width: 100%;
  max-width: 168px; /* matches on-device tile art size */
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 22px;
  border: 3px solid var(--stroke);
  box-shadow: var(--tile-shadow);
  background: var(--panel);
}
.tile-link:hover img { border-color: var(--gold); }
.tile-link .label {
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  line-height: 1.25;
}

.media-block { margin: 1.1rem 0 1.6rem; }
.media-block video,
.media-block img.shot {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: var(--media-bg);
  box-shadow: var(--tile-shadow);
  display: block;
}
.media-block img.shot { background: var(--panel); }
.cap {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Gameplay shots are landscape (~16:9). Never let HTML height attrs stretch them tall. */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 0.8rem 0 1.5rem;
}
.shot-grid figure { margin: 0; min-width: 0; }
.shot-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  display: block;
  background: var(--panel);
}
.shot-grid figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.clip-catalog {
  display: grid;
  gap: 1.25rem;
  margin: 1rem 0 2rem;
}
.clip-card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 0.9rem;
  box-shadow: var(--tile-shadow);
}
.clip-card h3 { margin-top: 0; }
.clip-card video {
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--media-bg);
  margin: 0.4rem 0;
}

.prose p { margin: 0 0 0.9rem; max-width: 48rem; color: var(--muted); }
.prose p strong { color: var(--ink); }
.prose ul { margin: 0 0 1rem; padding-left: 1.2rem; color: var(--ink); max-width: 48rem; }
.prose li { margin: 0.25rem 0; color: var(--muted); }
.prose li strong { color: var(--ink); }

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.1rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--stroke);
}
.footer a { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--btn-fg);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.btn:hover { background: var(--teal); color: var(--btn-fg); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--stroke);
}
.btn.ghost:hover { border-color: var(--gold); color: var(--ink); background: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
