/* ═══════════════════════════════════════════════════════════
   CSEC Study BootCamp — Web App Stylesheet
   Ported from the iOS camp theme (Theme.swift)
   ═══════════════════════════════════════════════════════════ */

/* ── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Bangers';
  src: url('assets/fonts/bangers.ttf') format('truetype');
  font-weight: normal;
}
@font-face {
  font-family: 'BowlbyOneSC';
  src: url('assets/fonts/bowlby-one-sc.ttf') format('truetype');
  font-weight: normal;
}

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --ink:       #090806;
  --lime:      #a8e600;
  --orange:    #ff7a00;
  --gold:      #ffd20a;
  --cream:     #fff6c8;
  --wood:      #79380d;
  --wood-dark: #522307;
  --wood-light:#8e4611;
  --sky:       #0669c9;
  --correct:   #27b45e;
  --wrong:     #dd3d34;

  --font-display: 'Bangers', cursive;
  --font-poster:  'BowlbyOneSC', cursive;
  --font-body:    system-ui, -apple-system, sans-serif;

  --radius: 16px;
  --nav-h: 52px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: #07090e;
  color: #fff;
  font-family: var(--font-body);
  min-height: 100dvh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
a { color: inherit; }
input, textarea { font: inherit; }

/* ── Utilities ─────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.max-readable { max-width: 760px; margin-left: auto; margin-right: auto; }

/* ── Top Nav ───────────────────────────────────────────── */
#topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-back-btn {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-display); font-size: 20px; letter-spacing: 0.5px;
  color: #fff;
  padding: 6px 12px; min-height: 44px;
  background: rgba(32,60,48,0.85);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.15s, transform 0.1s;
}
.nav-back-btn:hover { background: rgba(32,60,48,1); }
.nav-back-btn:active { transform: scale(0.96); }
.back-arrow { font-size: 24px; line-height: 1; }
.nav-title {
  font-family: var(--font-display); font-size: 22px; letter-spacing: 1px;
  color: #fff; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 50%;
}
.mute-btn {
  font-size: 20px; padding: 6px; min-height: 44px; min-width: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.mute-btn:hover { background: rgba(255,255,255,0.1); }

/* ── Main app area ─────────────────────────────────────── */
#app {
  min-height: 100dvh;
}
#app.with-nav {
  padding-top: var(--nav-h);
}

/* ══════════════════════════════════════════════════════════
   HOME SCREEN
   ══════════════════════════════════════════════════════════ */
.screen-home {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
}
.home-sky {
  position: fixed; inset: 0;
  background-size: cover; background-position: center top;
  z-index: 0;
}
.home-sky::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    transparent 60%,
    rgba(60,152,50,0.38) 78%,
    rgba(18,80,30,0.72) 100%);
}
.home-scroll {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding-bottom: 32px;
}
/* Centred column that holds everything on the home screen */
.home-inner {
  width: 100%; max-width: 1100px;
  padding: 0 20px;
  display: flex; flex-direction: column; align-items: center;
}
/* Lower area: scene + menu — stacked on mobile, side-by-side on desktop */
.home-lower {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
}

/* Clouds */
.camp-sky-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  overflow: hidden;
}
.camp-cloud {
  position: absolute;
  animation: cloud-drift linear infinite;
  opacity: 0.88;
}
.camp-cloud:nth-child(1) { width: 270px; top: 13%; animation-duration: 34s; animation-delay: 0s; }
.camp-cloud:nth-child(2) { width: 190px; top: 27%; opacity: 0.7; animation-duration: 45s; animation-delay: -12s; }
@keyframes cloud-drift {
  from { transform: translateX(-350px); }
  to   { transform: translateX(100vw); }
}

/* Sun */
.camp-sun {
  position: fixed; top: 14px; left: -6px;
  width: 62px; height: 62px;
  pointer-events: none; z-index: 2;
}
.sun-circle {
  position: absolute; top: 50%; left: 50%;
  width: 46px; height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fffbd0, #ffd21b, #ff9400);
  box-shadow: 0 0 28px 8px rgba(255,212,0,0.84);
  animation: sun-pulse 3.8s ease-in-out infinite alternate;
}
.sun-rays {
  position: absolute; inset: 0;
  animation: sun-spin 22s linear infinite;
}
.sun-ray {
  position: absolute; top: 50%; left: 50%;
  width: 5px; height: 74px;
  margin-left: -2.5px; margin-top: -37px;
  background: rgba(255,235,0,0.92);
  border-radius: 3px;
  transform-origin: center;
}
@keyframes sun-spin { to { transform: rotate(360deg); } }
@keyframes sun-pulse { from { transform: translate(-50%,-50%) scale(1); } to { transform: translate(-50%,-50%) scale(1.08); } }

/* Banner */
.camp-banner {
  width: min(calc(100vw - 48px), 340px);
  margin-top: max(12px, 2vh);
  animation: banner-drop 0.72s cubic-bezier(0.34,1.56,0.64,1) both;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45));
}
@keyframes banner-drop {
  from { opacity: 0; transform: translateY(-42px) scale(0.88) rotate(-5deg); }
  to   { opacity: 1; transform: none; }
}

/* Stage (tent, horizon, ground) */
.camp-stage {
  position: relative;
  width: 100%; max-width: 580px;
  height: clamp(140px, 30vw, 220px);
  overflow: visible;
  flex-shrink: 0;
}
.stage-horizon { position: absolute; width: 145%; bottom: 47%; left: -22.5%; opacity: 0.92; }
.stage-ground  { position: absolute; width: 155%; bottom: -12%; left: -27.5%; }
.stage-tent    {
  position: absolute; width: 92%; max-width: 540px;
  bottom: 5%;  left: 4%;
  filter: drop-shadow(6px 10px 10px rgba(0,0,0,0.38));
}
.stage-embers {
  position: absolute; bottom: 14%; left: 14%;
  display: flex; gap: 16px;
}
.ember {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 7px var(--orange);
  animation: ember-rise 2.8s ease-in-out infinite;
}
.ember:nth-child(2) { width: 6px; height: 6px; animation-delay: 0.6s; }
.ember:nth-child(3) { width: 5px; height: 5px; animation-delay: 1.2s; }
@keyframes ember-rise {
  0%   { opacity: 1; transform: translate(0, 0); }
  100% { opacity: 0; transform: translate(18px, -70px); }
}

/* Menu */
.camp-menu {
  width: 100%;
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 14px;
  padding: 0 0 4px;
}

/* Camp button (primary = gold, secondary = dark green) */
.camp-btn {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 18px;
  min-height: 56px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.25);
  font-family: inherit;
  text-align: left;
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
  position: relative; overflow: hidden;
}
.camp-btn.primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(0,0,0,0.22), 0 6px 18px rgba(255,210,10,0.32);
}
.camp-btn.secondary {
  background: #203c30;
  color: #fff;
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 4px 0 rgba(0,0,0,0.28);
}
.camp-btn.ghost {
  background: rgba(0,0,0,0.42);
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.22);
  border-radius: 100px;
  min-height: 44px;
}
.camp-btn:hover  { filter: brightness(1.06); transform: translateY(-1px); }
.camp-btn:active { transform: translateY(1px) scale(0.985); filter: brightness(0.96); }
.camp-btn .btn-icon { font-size: 22px; flex-shrink: 0; width: 30px; text-align: center; }
.camp-btn .btn-body { flex: 1; }
.camp-btn .btn-title {
  font-family: var(--font-display); font-size: 22px; letter-spacing: 1px;
  text-transform: uppercase; display: block; line-height: 1.2;
}
.camp-btn .btn-sub {
  font-size: 12px; opacity: 0.8; margin-top: 2px; display: block;
}
.camp-btn .btn-arrow { font-size: 14px; font-weight: 700; opacity: 0.7; }

/* ══════════════════════════════════════════════════════════
   GAME HUB
   ══════════════════════════════════════════════════════════ */
.screen-gamehub {
  min-height: 100dvh;
  background-size: cover; background-position: center;
  position: relative;
}
.screen-gamehub::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(198,244,39,0.08) 0%,
    rgba(19,82,14,0.30) 100%);
}
.gamehub-scroll {
  position: relative; z-index: 1;
  padding: 20px 20px 32px;
  min-height: 100dvh;
}
.gamehub-title-card {
  max-width: 480px; margin: 0 auto 24px;
  padding: 24px;
  background: rgba(20,45,36,0.96);
  border-radius: 24px;
  border: 2px solid rgba(255,210,10,0.65);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  text-align: center;
}
.gamehub-eyebrow {
  font-size: 11px; font-weight: 900; letter-spacing: 2px;
  color: var(--cream); text-transform: uppercase; margin-bottom: 10px;
}
.gamehub-poster-title {
  font-family: var(--font-poster);
  line-height: 1;
}
.gamehub-poster-title .line1 { font-size: clamp(42px,10vw,58px); color: var(--gold); display: block; }
.gamehub-poster-title .line2 { font-size: clamp(38px,9vw,54px); color: #fff; display: block; }
.gamehub-divider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 12px 0;
  color: var(--gold);
}
.gamehub-divider span { height: 2px; width: 32px; background: var(--gold); display: block; }
.gamehub-tagline {
  font-size: 15px; font-weight: 600; color: var(--cream); line-height: 1.4;
}
.game-cards { display: grid; gap: 20px; max-width: 920px; margin: 0 auto; }
@media (min-width: 640px) {
  .game-cards { grid-template-columns: repeat(2, 1fr); }
}
.game-card {
  background: #203c30; border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  min-height: 170px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
  transition: transform 0.14s, box-shadow 0.14s;
  cursor: pointer; text-align: left;
}
.game-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,0.38); }
.game-card:active { transform: scale(0.975); }
.game-card-art {
  width: 125px; flex-shrink: 0;
  animation: float 4.2s ease-in-out infinite alternate;
}
@keyframes float {
  from { transform: translateY(0); }
  to   { transform: translateY(-7px); }
}
.game-card-body { flex: 1; padding: 12px 8px 12px 4px; }
.game-card-name {
  font-family: var(--font-display); font-size: 29px; letter-spacing: 1.2px;
  color: #fff; display: block; margin-bottom: 8px; line-height: 1.1;
}
.game-card-blurb { font-size: 13px; color: var(--cream); opacity: 0.9; margin-bottom: 10px; }
.game-card-cta {
  font-family: var(--font-display); font-size: 18px; letter-spacing: 0.8px;
  color: var(--gold); display: flex; align-items: center; gap: 5px;
}

/* ══════════════════════════════════════════════════════════
   SUBJECT PICKER (Quiz Quest)
   ══════════════════════════════════════════════════════════ */
.screen-subjects {
  min-height: 100dvh;
  background-size: cover; background-position: center;
}
.screen-subjects::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(to bottom,
    rgba(7,29,23,0.78) 0%,
    rgba(16,40,34,0.88) 50%,
    rgba(6,21,17,0.96) 100%);
}
.subjects-scroll {
  position: relative; z-index: 1;
  padding: 20px 18px 40px;
}
.subjects-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 14px;
}
.subjects-title-block { flex: 1; }
.subjects-eyebrow {
  font-size: 10px; font-weight: 900; letter-spacing: 2px;
  color: var(--lime); text-transform: uppercase; display: block; margin-bottom: 4px;
}
.subjects-title {
  font-family: var(--font-display); letter-spacing: 2px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.subjects-title .white { color: #fff; font-size: clamp(34px,8vw,46px); }
.subjects-title .gold  { color: var(--gold); font-size: clamp(34px,8vw,46px); }
.subjects-art { width: 88px; flex-shrink: 0; }
.subjects-lead { font-size: 15px; color: rgba(255,255,255,0.84); margin-bottom: 20px; line-height: 1.5; }

/* Mode Picker */
.mode-section { margin-bottom: 24px; }
.mode-label {
  font-family: var(--font-display); font-size: 16px; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.78); text-transform: uppercase; display: block; margin-bottom: 10px;
}
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card {
  padding: 12px 12px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(23,55,46,0.88);
  cursor: pointer;
  min-height: 72px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex; flex-direction: column; gap: 5px;
}
.mode-card.selected {
  background: var(--cream);
  border-color: var(--lime);
  border-width: 2.5px;
  color: #153528;
}
.mode-card:not(.selected):hover { background: rgba(23,55,46,1); }
.mode-card:active { transform: scale(0.97); }
.mode-card-title {
  font-family: var(--font-display); font-size: 18px; letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px;
}
.mode-card-detail { font-size: 12px; line-height: 1.4; }

/* Subject cards */
.subject-grid { display: grid; gap: 18px; }
@media (min-width: 680px) { .subject-grid { grid-template-columns: 1fr 1fr; } }
.subject-card {
  background: linear-gradient(135deg, #fff9dd, #e7dfbd);
  border-radius: 20px; padding: 12px;
  display: flex; align-items: center; gap: 12px;
  min-height: 122px;
  cursor: pointer;
  position: relative; overflow: hidden;
  box-shadow: 0 6px 0 rgba(0,0,0,0.42);
  border: 2px solid transparent;
  transition: transform 0.14s, box-shadow 0.14s;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: 0 8px 0 rgba(0,0,0,0.38); }
.subject-card:active { transform: translateY(2px) scale(0.985); box-shadow: 0 2px 0 rgba(0,0,0,0.38); }
.subject-card-accent {
  position: absolute; left: 0; top: 15px; bottom: 15px;
  width: 6px; border-radius: 0 4px 4px 0;
}
.subject-card-icon {
  width: 82px; height: 82px; flex-shrink: 0;
  border-radius: 19px; padding: 4px;
  display: flex; align-items: center; justify-content: center;
}
.subject-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.subject-card-body { flex: 1; }
.subject-card-title {
  font-family: var(--font-display); font-size: clamp(18px,4vw,22px);
  letter-spacing: 0.8px; color: #102b22; display: block;
  line-height: 1.2; margin-bottom: 4px;
}
.subject-card-desc { font-size: 12px; color: #4b6057; line-height: 1.4; margin-bottom: 6px; }
.subject-card-meta {
  font-size: 11px; font-weight: 700; letter-spacing: 0.45px;
  color: #285d48; display: flex; align-items: center; gap: 4px;
}
.subject-card-arrow {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.72); flex-shrink: 0;
  color: #173329; font-size: 16px; font-weight: 900;
}
.subjects-note {
  margin-top: 20px; font-size: 12px; color: rgba(255,255,255,0.58); line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════
   QUIZ VIEW
   ══════════════════════════════════════════════════════════ */
.screen-quiz {
  min-height: 100dvh;
  background: linear-gradient(to bottom, #1a1a2e, #232045, #14131f);
}
.quiz-scroll { padding: 16px 18px; max-width: 760px; margin: 0 auto; }
.quiz-hud { margin-bottom: 14px; }
.hud-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.hud-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.34);
  font-size: 14px; font-weight: 700;
  background: rgba(0,0,0,0.55);
}
.hud-pill .icon { font-size: 14px; }
.hud-score { font-family: var(--font-display); font-size: 18px; color: #fff; }
.hud-score .star { color: var(--gold); }
.hud-lives { display: flex; gap: 4px; align-items: center; }
.life-heart { font-size: 16px; line-height: 1; }
.hud-practice-badge {
  font-size: 10px; font-weight: 900; letter-spacing: 1px;
  color: var(--lime); padding: 4px 10px;
  background: rgba(168,230,0,0.12); border-radius: 100px;
  border: 1px solid rgba(168,230,0,0.3);
}
.hud-timer { margin-top: 6px; }
.timer-bar-track {
  height: 8px; background: rgba(255,255,255,0.14);
  border-radius: 100px; overflow: hidden; margin-bottom: 4px;
}
.timer-bar-fill {
  height: 100%; border-radius: 100px;
  background: var(--correct);
  transition: width 0.25s linear;
}
.timer-bar-fill.low { background: var(--wrong); }
.timer-label {
  text-align: right; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.timer-label.low { color: var(--wrong); }
.streak-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--gold);
  margin-top: 4px;
}
.topic-badge {
  display: inline-block; font-size: 10px; font-weight: 900;
  letter-spacing: 1.2px; color: var(--lime); text-transform: uppercase;
  padding: 5px 10px;
  background: rgba(168,230,0,0.14); border-radius: 100px;
  margin-bottom: 12px;
}
.passage-box {
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,210,10,0.25);
  border-radius: 14px;
  padding: 14px;
  font-size: 15px; color: rgba(255,255,255,0.85);
  line-height: 1.65; margin-bottom: 14px;
}
.quiz-stem {
  font-size: 18px; font-weight: 600; color: #fff;
  line-height: 1.5; margin-bottom: 14px;
}
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.16);
  min-height: 56px; text-align: left;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
  cursor: pointer; width: 100%;
}
.option-btn:hover { background: rgba(255,255,255,0.10); }
.option-btn:active { transform: scale(0.99); }
.option-btn.selected {
  background: rgba(255,210,10,0.16);
  border-color: var(--gold);
  border-width: 2.5px;
}
.option-btn.dimmed { opacity: 0.45; cursor: default; }
.option-btn.correct { background: rgba(39,180,94,0.2); border-color: var(--correct); border-width: 2px; }
.option-btn.incorrect { background: rgba(221,61,52,0.2); border-color: var(--wrong); border-width: 2px; }
.option-letter {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  font-family: var(--font-display); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12); color: #fff;
}
.option-btn.selected .option-letter {
  background: var(--gold); color: var(--ink);
}
.option-text { font-size: 15px; color: #fff; line-height: 1.5; flex: 1; }
.feedback-box {
  margin-top: 14px; padding: 14px;
  background: rgba(255,255,255,0.07);
  border-radius: 14px;
}
.feedback-box .feedback-title {
  font-size: 15px; font-weight: 700;
  color: var(--gold); margin-bottom: 6px;
}
.feedback-box .feedback-title.timeout { color: var(--wrong); }
.feedback-box p { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.5; }

/* Action bar */
.quiz-action-bar {
  position: sticky; bottom: 0; left: 0; right: 0;
  padding: 10px 18px 20px;
  background: rgba(20,20,35,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.quiz-action-bar .max-readable { max-width: 760px; }
.check-btn {
  width: 100%; padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-display); font-size: 20px; letter-spacing: 1.4px;
  text-transform: uppercase;
  min-height: 56px;
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 0 rgba(0,0,0,0.22);
  transition: transform 0.1s, filter 0.1s;
}
.check-btn:hover { filter: brightness(1.06); }
.check-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,0.22); }
.check-btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }
.auto-advance-msg {
  text-align: center; font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85);
  padding: 18px; min-height: 56px; display: flex; align-items: center; justify-content: center;
}

/* ══════════════════════════════════════════════════════════
   QUIZ RESULTS
   ══════════════════════════════════════════════════════════ */
.screen-results {
  min-height: 100dvh;
  background: linear-gradient(to bottom, #1a1a2e, #2b1f4a, #14131f);
}
.results-scroll { padding: 24px 20px 40px; max-width: 760px; margin: 0 auto; }
.results-header { text-align: center; margin-bottom: 20px; }
.results-meta {
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  color: var(--lime); text-transform: uppercase; margin-bottom: 8px;
}
.results-headline {
  font-family: var(--font-display); font-size: clamp(28px,8vw,38px);
  letter-spacing: 2px; color: #fff; line-height: 1.1;
}
.results-badge { text-align: center; margin-bottom: 20px; }
.badge-img {
  width: 148px; height: 148px; border-radius: 50%;
  object-fit: cover; display: block; margin: 0 auto 10px;
  border: 6px solid var(--gold);
  box-shadow: 0 0 32px rgba(255,210,10,0.5);
  animation: badge-pop 0.55s cubic-bezier(0.34,1.56,0.64,1) both 0.15s;
}
@keyframes badge-pop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
.badge-rank-name {
  font-family: var(--font-display); font-size: 32px; letter-spacing: 3px; color: var(--gold);
}
.badge-rank-title { font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.8); }
.rank-progress-section { margin-bottom: 18px; }
.rank-progress-bar-track {
  height: 10px; background: rgba(255,255,255,0.14);
  border-radius: 100px; overflow: hidden; margin-bottom: 6px;
}
.rank-progress-bar-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(to right, var(--lime), var(--gold));
  transition: width 0.8s ease 0.6s;
}
.rank-progress-msg { font-size: 13px; color: rgba(255,255,255,0.72); text-align: center; }
.coach-note {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 16px;
  background: rgba(255,255,255,0.06);
  margin-bottom: 18px;
}
.coach-face {
  width: 52px; height: 52px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.6);
}
.coach-msg {
  font-family: var(--font-display); font-size: 22px; letter-spacing: 1px;
}
.coach-msg.good  { color: var(--lime); }
.coach-msg.poor  { color: var(--orange); }
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 18px; }
.stat-tile {
  padding: 12px; border-radius: 14px;
  background: rgba(255,255,255,0.07);
  text-align: center;
}
.stat-value { font-size: 20px; font-weight: 700; color: #fff; line-height: 1.2; }
.stat-label { font-size: 10px; font-weight: 600; letter-spacing: 0.8px; color: rgba(255,255,255,0.55); margin-top: 2px; }
.breakdown {
  padding: 6px 14px; border-radius: 14px;
  background: rgba(255,255,255,0.05);
  margin-bottom: 18px;
}
.breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .label { color: rgba(255,255,255,0.75); }
.breakdown-row .value { font-weight: 700; color: var(--lime); }
.breakdown-row.total { font-size: 15px; font-weight: 700; }
.breakdown-row.total .label { color: #fff; }
.breakdown-row.total .value { color: var(--gold); }
.rank-ladder-section { margin-bottom: 18px; }
.rank-ladder-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  color: rgba(255,255,255,0.5); text-transform: uppercase; margin-bottom: 8px;
}
.rank-ladder-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.badge-tile {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: default;
}
.badge-tile img {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.4);
  box-shadow: 2px 3px 0 rgba(0,0,0,0.5);
}
.badge-tile.earned img { border-color: var(--gold); border-width: 4px; }
.badge-tile.passed img { border-color: var(--lime); filter: saturate(1); }
.badge-tile.locked img { filter: saturate(0); opacity: 0.45; }
.badge-tile-name { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; color: rgba(255,255,255,0.6); }
.results-closing { font-size: 13px; color: rgba(255,255,255,0.6); text-align: center; margin-bottom: 20px; line-height: 1.5; }
.results-actions { display: flex; flex-direction: column; gap: 10px; }
.results-actions .camp-btn { justify-content: center; }
.back-text-btn {
  text-align: center; padding: 12px;
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.7);
  min-height: 44px; cursor: pointer;
  background: none; border: none; width: 100%;
  transition: color 0.15s;
}
.back-text-btn:hover { color: rgba(255,255,255,0.9); }

/* Confetti */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 200; }

/* ══════════════════════════════════════════════════════════
   WORD RESCUE
   ══════════════════════════════════════════════════════════ */
.screen-wordrescue {
  min-height: 100dvh;
  background-size: cover; background-position: center;
  position: relative;
}
.screen-wordrescue::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(3,12,8,0.62) 0%,
    rgba(7,21,13,0.30) 50%,
    rgba(3,12,8,0.84) 100%);
}
.wordrescue-scroll {
  position: relative; z-index: 1;
  padding: 20px 18px 36px;
}

/* Subject selection */
.wr-select-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wr-select-titles .eyebrow {
  font-size: 10px; font-weight: 900; letter-spacing: 2.2px;
  color: #8fd4a3; text-transform: uppercase; margin-bottom: 4px;
}
.wr-select-titles .title {
  font-family: var(--font-display); font-size: clamp(32px,8vw,42px);
  letter-spacing: 2px; color: var(--gold); line-height: 1.1;
}
.wr-art { width: 86px; flex-shrink: 0; }
.wr-desc { font-size: 15px; color: rgba(255,255,255,0.86); line-height: 1.5; margin-bottom: 18px; }
.wr-select-label {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.wr-select-label .heading { font-family: var(--font-display); font-size: 21px; letter-spacing: 1.2px; color: #fff; }
.wr-select-label .count { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,0.62); }
.wr-subject-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .wr-subject-grid { grid-template-columns: 1fr 1fr; } }
.wr-subject-card {
  background: rgba(13,40,29,0.94); border-radius: 20px;
  padding: 14px; display: flex; align-items: center; gap: 14px;
  min-height: 108px; cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 8px 0 rgba(0,0,0,0.34);
  transition: transform 0.14s, box-shadow 0.14s;
}
.wr-subject-card:hover { transform: translateY(-2px); }
.wr-subject-card:active { transform: translateY(2px) scale(0.985); box-shadow: 0 2px 0 rgba(0,0,0,0.34); }
.wr-subject-icon { width: 76px; height: 76px; border-radius: 18px; flex-shrink: 0; overflow: hidden; padding: 4px; }
.wr-subject-icon img { width: 100%; height: 100%; object-fit: contain; }
.wr-subject-body { flex: 1; }
.wr-subject-name { font-family: var(--font-display); font-size: 21px; letter-spacing: 0.8px; color: #fff; display: block; margin-bottom: 4px; }
.wr-subject-count { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.wr-subject-desc { font-size: 12px; color: rgba(255,255,255,0.68); line-height: 1.4; }
.wr-subject-arrow { font-size: 25px; font-weight: 700; flex-shrink: 0; }

/* Intro panel */
.wr-intro-wrap { display: flex; justify-content: center; }
.wr-intro-panel {
  max-width: 480px; width: 100%;
  padding: 24px;
  background: linear-gradient(135deg, rgba(14,38,25,0.96), rgba(5,18,12,0.98));
  border-radius: 24px;
  border: 1px solid rgba(139,195,74,0.42);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5);
  animation: panel-slide-in 0.58s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes panel-slide-in {
  from { opacity: 0; transform: translateY(26px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}
.wr-intro-eyebrow { font-size: 10px; font-weight: 900; letter-spacing: 2.3px; color: #8fd4a3; text-transform: uppercase; text-align: center; margin-bottom: 14px; }
.wr-title-tiles {
  display: flex; flex-direction: column; gap: 7px;
  align-items: center; margin-bottom: 12px;
}
.wr-tile-row { display: flex; gap: 6px; }
.wr-tile {
  width: 40px; height: 50px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 28px; color: #23301a;
  position: relative;
  animation: tile-flip-in 0.48s cubic-bezier(0.34,1.56,0.64,1) both;
}
.wr-tile.gold-tile {
  background: linear-gradient(to bottom, #f7df0c, #dfa600);
  box-shadow: 0 4px 0 #8a6a00;
}
.wr-tile.lime-tile {
  background: linear-gradient(to bottom, #a8e25c, #6cab27);
  box-shadow: 0 4px 0 #3d6810; color: #12240c;
}
.wr-intro-desc {
  text-align: center; font-size: 14px; color: #cfe6c4; line-height: 1.5; margin-bottom: 14px;
}
.wr-subject-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06); border-radius: 12px;
  margin-bottom: 14px;
}
.wr-subject-chip img { width: 38px; height: 38px; object-fit: contain; }
.wr-subject-chip .chip-label { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: rgba(255,255,255,0.58); display: block; }
.wr-subject-chip .chip-name { font-family: var(--font-display); font-size: 20px; color: #fff; letter-spacing: 0.5px; }
.wr-subject-chip .change-btn {
  margin-left: auto; font-size: 12px; font-weight: 900; color: var(--gold);
  min-height: 44px; padding: 0 8px;
}
.wr-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.wr-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 10px; border-radius: 100px;
  background: rgba(247,223,12,0.12); border: 1px solid rgba(247,223,12,0.38);
  font-size: 14px;
}
.wr-chip .chip-val { font-family: var(--font-display); font-size: 18px; color: #f7df0c; }
.wr-chip .chip-lbl { font-size: 10px; font-weight: 700; color: #efe4a4; }
.wr-rules { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.wr-rule {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(139,195,74,0.20);
}
.wr-rule-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(139,195,74,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.wr-rule-text { font-size: 13px; color: #d7e8cf; line-height: 1.4; }
.start-game-btn {
  width: 100%; min-height: 60px;
  border-radius: 14px; font-family: var(--font-display);
  font-size: 24px; letter-spacing: 2px; color: #0d1f06;
  background: linear-gradient(to bottom, #9ede4f, #5ba504);
  box-shadow: 0 6px 0 #3c6d03;
  border: none; cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.start-game-btn:hover { filter: brightness(1.05); }
.start-game-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #3c6d03; }

/* Game board */
.wr-game-wrap { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 11px; }
.wr-game-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.28); border-radius: 100px;
}
.wr-game-bar img { width: 34px; height: 34px; object-fit: contain; }
.wr-game-bar .subject-name { font-family: var(--font-display); font-size: 18px; letter-spacing: 0.8px; color: #fff; }
.wr-change-btn { margin-left: auto; font-size: 11px; font-weight: 900; color: var(--gold); min-height: 44px; padding: 0 4px; }

.wr-game-stage {
  background: rgba(4,16,10,0.76); border-radius: 16px;
  border: 1px solid rgba(139,195,74,0.22);
  padding: 12px; display: flex; align-items: center; gap: 14px;
}
.wr-hangman-box {
  flex-shrink: 0; background: rgba(0,0,0,0.42); border-radius: 12px;
  border: 1px solid rgba(139,195,74,0.22);
  width: 128px; height: 164px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.wr-hangman-box img { width: 90%; object-fit: contain; filter: invert(1); }
.wr-stage-right { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.wr-stat-label { font-size: 10px; font-weight: 900; letter-spacing: 1.4px; color: #8fb79a; text-transform: uppercase; margin-bottom: 4px; }
.wr-lives-count { display: flex; align-items: baseline; gap: 7px; }
.wr-lives-num { font-family: var(--font-display); font-size: 28px; color: #fff; }
.wr-lives-num.low { color: #ff6b5a; }
.wr-lives-of { font-size: 12px; color: #8fb79a; }
.wr-lives-pips { display: flex; gap: 4px; flex-wrap: wrap; }
.wr-pip {
  height: 10px; flex: 1; min-width: 8px; max-width: 16px;
  border-radius: 4px;
  transition: background 0.3s;
}
.wr-pip.alive { background: #8fd341; }
.wr-pip.dead  { background: rgba(255,255,255,0.13); }
.wr-progress-bar-track { height: 9px; background: rgba(255,255,255,0.12); border-radius: 100px; overflow: hidden; margin-bottom: 4px; }
.wr-progress-bar-fill {
  height: 100%; border-radius: 100px;
  background: linear-gradient(to right, #8bc34a, #f7df0c);
  transition: width 0.4s ease;
}
.wr-found-label { font-size: 12px; color: #bcd6c2; }

.wr-word-panel {
  background: rgba(4,16,10,0.76); border-radius: 16px;
  border: 1px solid rgba(139,195,74,0.22);
  padding: 12px 16px; min-height: 66px;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 5px;
}
.wr-letter-tile {
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  font-family: var(--font-display); color: #fff;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
}
.wr-letter-tile::after {
  content: ''; position: absolute; bottom: 3px; left: 4px; right: 4px;
  height: 3px; border-radius: 2px; background: rgba(168,230,0,0.75);
}
.wr-letter-tile.revealed { background: rgba(39,180,94,0.3); }
.wr-letter-tile.revealed::after { background: #9ede4f; }
.wr-letter-tile.missed { background: rgba(221,61,52,0.2); color: #ff9b91; }
.wr-letter-tile.missed::after { background: var(--wrong); }
.wr-letter-space { display: inline-block; }

.wr-status {
  text-align: center; font-size: 14px; font-weight: 600; min-height: 22px;
  color: #cfe6c4;
}
.wr-status.good { color: #a7e761; }
.wr-status.bad  { color: #ff8a7d; }

.wr-hint-btn {
  background: #163828; border-radius: 22px;
  border: 1px solid rgba(255,210,10,0.5);
  padding: 12px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer; width: 100%; text-align: left;
  transition: filter 0.15s, transform 0.1s;
}
.wr-hint-btn:hover { filter: brightness(1.1); }
.wr-hint-btn:active { transform: scale(0.985); }
.wr-hint-btn:disabled { opacity: 0.46; cursor: default; }
.hint-star { font-size: 40px; line-height: 1; }
.wr-hint-text .hint-title { font-family: var(--font-display); font-size: 22px; color: var(--gold); display: block; margin-bottom: 4px; }
.wr-hint-text .hint-sub { font-size: 14px; color: var(--cream); }

.wr-keyboard { display: flex; flex-direction: column; gap: 6px; }
.wr-key-row { display: flex; justify-content: center; gap: 5px; }
.key-btn {
  min-width: 32px; max-width: 42px; flex: 1;
  height: 46px; border-radius: 9px;
  font-family: var(--font-display); font-size: 18px;
  background: rgba(255,255,255,0.12); color: #fff;
  border: 1px solid rgba(255,255,255,0.22);
  cursor: pointer;
  transition: transform 0.1s, background 0.1s;
}
.key-btn:hover { background: rgba(255,255,255,0.2); }
.key-btn:active { transform: scale(0.9); }
.key-btn.hit { background: #83c838; color: #0f2405; border-color: #83c838; }
.key-btn.miss { background: rgba(221,61,52,0.24); color: #ff9b91; border-color: rgba(221,61,52,0.24); opacity: 0.62; }
.key-btn:disabled { cursor: default; }

.wr-word-input { display: flex; gap: 8px; }
.wr-word-input input {
  flex: 1; height: 48px; padding: 0 14px;
  background: rgba(255,255,255,0.08); border-radius: 12px;
  border: 2px solid rgba(168,230,0,0.50);
  color: #fff; font-size: 16px; text-align: center; text-transform: uppercase;
  outline: none;
  transition: border-color 0.15s;
}
.wr-word-input input:focus { border-color: var(--lime); }
.wr-word-input input.shake {
  border-color: var(--wrong);
  animation: input-shake 0.35s ease;
}
@keyframes input-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-7px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(5px); }
}
.go-btn {
  width: 72px; height: 48px; border-radius: 12px;
  font-family: var(--font-display); font-size: 19px; letter-spacing: 1px;
  color: #0d1f06;
  background: linear-gradient(to bottom, #9ede4f, #5ba504);
  transition: transform 0.1s, filter 0.1s;
}
.go-btn:hover { filter: brightness(1.08); }
.go-btn:active { transform: scale(0.96); }
.go-btn:disabled { opacity: 0.46; cursor: default; }

.wr-new-word-btn {
  min-height: 44px; font-size: 13px; font-weight: 700;
  color: #9fd4ae; padding: 0 8px;
  display: flex; align-items: center; gap: 6px; margin: 0 auto;
  transition: color 0.15s;
}
.wr-new-word-btn:hover { color: #fff; }

/* ══════════════════════════════════════════════════════════
   STUDY TIPS
   ══════════════════════════════════════════════════════════ */
.screen-studytips {
  min-height: 100dvh;
  background-size: cover; background-position: center;
  position: relative;
}
.screen-studytips::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(255,255,255,0.14);
}
.studytips-layout {
  position: relative; z-index: 1;
  padding: 20px 16px 32px;
  display: flex; flex-direction: column;
  min-height: 100dvh;
}
@media (min-width: 700px) {
  .studytips-layout { flex-direction: row; align-items: flex-start; gap: 36px; padding: 24px; }
  .studytips-mentor-col { width: 330px; flex-shrink: 0; }
  .studytips-bubble-col { flex: 1; }
}
.studytips-mentor { position: relative; }
.studytips-mentor img {
  max-height: 380px; object-fit: contain; display: block; margin: 0 auto;
  animation: mentor-float 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 12px 16px rgba(20,10,0,0.22));
}
@keyframes mentor-float {
  from { transform: translateY(3px) scale(0.895); }
  to   { transform: translateY(-3px) scale(0.91); }
}
.tip-bubble {
  background: linear-gradient(135deg, #fffdf2, #ffeec4);
  border-radius: 20px;
  border: 4px solid var(--wood-dark);
  padding: 20px;
  position: relative;
  box-shadow: 5px 7px 0 rgba(0,0,0,0.28);
  animation: bubble-sway 3.5s ease-in-out infinite alternate;
  margin-bottom: 14px;
}
@media (max-width: 699px) {
  .tip-bubble::after {
    content: ''; position: absolute;
    bottom: -20px; left: 30%;
    border: 14px solid transparent;
    border-top-color: var(--wood-dark);
  }
}
@media (min-width: 700px) {
  .tip-bubble::after {
    content: ''; position: absolute;
    left: -20px; top: 50%;
    transform: translateY(-50%);
    border: 14px solid transparent;
    border-right-color: var(--wood-dark);
  }
}
@keyframes bubble-sway {
  from { transform: rotate(-0.35deg); }
  to   { transform: rotate(0.55deg); }
}
.coach-nameplate {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px;
  background: linear-gradient(to bottom, var(--wood-light), var(--wood-dark));
  border-radius: 100px;
  border: 3px solid var(--gold);
  box-shadow: 3px 4px 0 rgba(0,0,0,0.42);
  margin-bottom: 14px;
}
.coach-nameplate .star { color: var(--gold); font-size: 17px; }
.coach-nameplate .name { font-family: var(--font-display); font-size: 23px; letter-spacing: 1.5px; color: #fff; }
.coach-nameplate .says {
  font-family: var(--font-display); font-size: 15px; letter-spacing: 1px;
  color: var(--wood-dark); background: var(--gold);
  padding: 3px 10px; border-radius: 100px; margin-left: auto;
}
.tip-divider {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, var(--orange), var(--gold), var(--orange));
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(255,210,10,0.45);
}
.tip-content { display: flex; align-items: flex-start; gap: 11px; }
.tip-icon-circle {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; box-shadow: 2px 3px 0 rgba(82,35,7,0.32);
}
.tip-text {
  font-family: var(--font-display); font-size: 27px; letter-spacing: 0.65px;
  color: #241a06; line-height: 1.3; flex: 1;
  min-height: 126px; display: flex; align-items: center;
}
.another-tip-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-size: 22px; letter-spacing: 2px;
  color: #14260a;
  padding: 14px 30px; min-height: 64px;
  background: linear-gradient(to bottom, #b6f03a, #6aa50a);
  border-radius: 100px;
  border: 4px solid var(--wood-dark);
  box-shadow: 4px 6px 0 rgba(0,0,0,0.42);
  cursor: pointer; width: 100%; max-width: 300px; margin: 0 auto;
  transition: transform 0.12s, box-shadow 0.12s;
}
.another-tip-btn:hover { filter: brightness(1.05); }
.another-tip-btn:active { transform: translateY(2px); box-shadow: 2px 3px 0 rgba(0,0,0,0.42); }

/* ══════════════════════════════════════════════════════════
   PAST PAPERS
   ══════════════════════════════════════════════════════════ */
.screen-papers {
  min-height: 100dvh;
  background: linear-gradient(to bottom, #1a1a2e, #14131f);
}
.papers-scroll { padding: 16px 18px 36px; max-width: 760px; margin: 0 auto; }
.papers-note { font-size: 13px; color: rgba(255,255,255,0.6); margin-bottom: 18px; line-height: 1.5; }
.paper-cards { display: flex; flex-direction: column; gap: 12px; }
.paper-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 18px; border: 1.5px solid rgba(255,210,10,0.25);
  text-decoration: none; color: inherit;
  transition: background 0.15s, transform 0.1s;
}
.paper-card:hover { background: rgba(255,255,255,0.10); transform: translateX(2px); }
.paper-icon {
  width: 52px; height: 52px; border-radius: 13px; flex-shrink: 0;
  background: rgba(255,210,10,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.paper-body { flex: 1; }
.paper-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.paper-detail { font-size: 13px; color: rgba(255,255,255,0.66); margin-bottom: 4px; }
.paper-pages { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; color: var(--lime); text-transform: uppercase; }
.paper-arrow { color: var(--gold); font-size: 18px; font-weight: 700; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: modal-bg-in 0.2s ease;
}
.modal-overlay.center { align-items: center; }
@keyframes modal-bg-in { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: #07190f; border-radius: 24px 24px 0 0;
  padding: 24px; max-width: 640px; width: 100%;
  max-height: 90dvh; overflow-y: auto;
  animation: modal-slide-up 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-overlay.center .modal-content {
  border-radius: 24px; margin: 20px;
  animation: modal-pop-in 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes modal-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes modal-pop-in   { from { opacity: 0; transform: scale(0.88); } to { opacity: 1; transform: scale(1); } }
.modal-close {
  float: right; font-size: 24px; color: rgba(255,255,255,0.5);
  padding: 4px 8px; cursor: pointer; line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: #fff; }

/* Hint card */
.hint-modal { text-align: center; padding: 8px 0; }
.hint-modal .hint-star-big { font-size: 60px; margin-bottom: 12px; }
.hint-modal .hint-title { font-family: var(--font-display); font-size: 28px; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 14px; }
.hint-modal .hint-body {
  font-size: 18px; color: #cbdfc2; line-height: 1.5; padding: 14px 20px;
  background: rgba(255,255,255,0.06); border-radius: 16px; margin-bottom: 20px;
}
.hint-modal .close-btn {
  width: 100%; padding: 14px; border-radius: var(--radius);
  background: rgba(255,255,255,0.1); color: #fff; font-size: 16px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer; transition: background 0.15s;
}
.hint-modal .close-btn:hover { background: rgba(255,255,255,0.18); }

/* Answer key modal */
.answer-key-modal h2 { font-family: var(--font-display); font-size: 30px; letter-spacing: 2px; color: var(--gold); margin-bottom: 20px; }
.answer-item { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.answer-item:last-child { border-bottom: none; }
.answer-item .q-num { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: rgba(255,255,255,0.5); text-transform: uppercase; margin-bottom: 4px; }
.answer-item .q-stem { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 10px; line-height: 1.5; }
.answer-item .a-correct { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.answer-item .a-correct .checkmark { color: var(--correct); font-size: 18px; }
.answer-item .a-correct .a-text { font-size: 14px; color: #fff; }
.answer-item .a-chosen { font-size: 13px; margin-bottom: 8px; }
.answer-item .a-chosen.wrong-choice { color: var(--wrong); }
.answer-item .a-chosen.timed-out { color: rgba(255,255,255,0.5); }
.answer-item .a-explanation { font-size: 13px; color: rgba(255,255,255,0.72); line-height: 1.55; padding: 10px 12px; background: rgba(255,255,255,0.05); border-radius: 10px; }

/* Outcome sheet (word rescue) */
.outcome-modal {
  text-align: center; padding: 8px 0;
  background: linear-gradient(to bottom, #12301c, #07190f);
  border-radius: 24px 24px 0 0;
}
.outcome-modal .emoji { font-size: 54px; margin-bottom: 12px; }
.outcome-modal .outcome-title { font-family: var(--font-display); font-size: 30px; letter-spacing: 1.5px; color: #fff; margin-bottom: 8px; }
.outcome-modal .outcome-word { font-family: var(--font-display); font-size: 28px; letter-spacing: 3px; color: var(--gold); margin-bottom: 8px; }
.outcome-modal .outcome-hint { font-size: 14px; color: #cbdfc2; line-height: 1.5; max-width: 320px; margin: 0 auto 20px; }

/* ══════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(20,20,35,0.95); color: #fff;
  padding: 10px 20px; border-radius: 100px;
  font-size: 14px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 500;
  animation: toast-in 0.3s ease;
  white-space: nowrap;
}
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ══════════════════════════════════════════════════════════
   ANSWER KEY BUTTON
   ══════════════════════════════════════════════════════════ */
.review-btn {
  width: 100%; padding: 14px 18px; border-radius: var(--radius);
  background: rgba(255,210,10,0.12); border: 2px solid rgba(255,210,10,0.5);
  color: var(--gold);
  font-family: var(--font-display); font-size: 20px; letter-spacing: 1.4px;
  min-height: 56px; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.review-btn:hover { background: rgba(255,210,10,0.2); }
.review-btn:active { transform: scale(0.985); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ══════════════════════════════════════════════════════════ */

/* Tablet: bigger banner, taller stage */
@media (min-width: 600px) {
  .camp-banner {
    width: min(calc(100vw - 80px), 420px);
  }
  .camp-stage {
    height: clamp(200px, 34vw, 320px);
    max-width: 680px;
  }
}

/* Desktop: side-by-side layout — scene LEFT, menu RIGHT */
@media (min-width: 820px) {
  .camp-banner {
    width: min(calc(100vw - 100px), 460px);
  }
  .home-lower {
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 32px;
    width: 100%;
  }
  .camp-stage {
    flex: 0 0 auto;
    width: clamp(340px, 50%, 560px);
    height: clamp(260px, 36vw, 400px);
  }
  .camp-menu {
    flex: 0 0 auto;
    width: clamp(280px, 38%, 440px);
    padding-bottom: 24px;
  }
}

/* Wide desktop: larger everything */
@media (min-width: 1100px) {
  .camp-banner {
    width: min(calc(100vw - 120px), 520px);
  }
  .home-lower { gap: 48px; }
  .camp-stage {
    width: clamp(400px, 52%, 620px);
    height: clamp(300px, 38vw, 460px);
  }
  .camp-menu {
    width: clamp(320px, 36%, 480px);
  }
}

@media (max-width: 380px) {
  .camp-btn .btn-title { font-size: 18px; }
  .quiz-stem { font-size: 16px; }
  .option-text { font-size: 14px; }
  .key-btn { min-width: 26px; font-size: 16px; height: 42px; }
}

/* ── Loading Screen ─────────────────────────────────────── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: #07090e;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

#loader.loader-done {
  opacity: 0;
  visibility: hidden;
}

.loader-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  animation: loader-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.loader-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(255, 210, 10, 0.4);
  animation: loader-pop 0.6s 0.1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.loader-spinner {
  position: relative;
  width: 52px;
  height: 52px;
  animation: loader-pop 0.4s 0.2s ease both;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--lime);
  border-right-color: var(--orange);
  animation: spin 0.9s linear infinite;
}

.spinner-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: var(--gold);
  animation: spin 1.4s linear infinite reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes loader-pop {
  from { opacity: 0; transform: scale(0.8) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
