:root {
  --sky-1: #6fb6ff;
  --sky-2: #4aa0ff;
  --cloud: rgba(255, 255, 255, 0.45);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.85);
  --shadow: rgba(0, 0, 0, 0.2);
  --card: rgba(255, 255, 255, 0.92);
  --cardText: #0b2a4a;
  --primary: #2fb34a;
  --primaryDark: #21943a;
  --danger: #d61b1b;
  --success: #02ff5f;
  --neutral: #e9f2ff;
  --border: rgba(0, 60, 120, 0.25);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  /* Background image only (no overlay/gradient box) */
  background-image: url("assets/images/background.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px 16px 12px;
}

.hero-header {
  text-align: center;
  padding-top: 6px;
}

.hero-logo {
  width: min(620px, 92vw);
  height: auto;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, 0.14));
}

.stage {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 16px;
  padding: 8px 0 10px;
}

.stage__clouds {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Remove decorative overlay/gradient layer so UI sits directly on background image */
  display: none;
}

.character {
  margin: 0;
  z-index: 1;
}

.character__img {
  width: min(360px, 78vw);
  height: auto;
  /* No border/background framing around the character */
  border-radius: 0;
  box-shadow: none;
}

.screen {
  z-index: 2;
  width: 100%;
  max-width: 720px;
  display: grid;
  justify-items: center;
  gap: 10px;
  transition: opacity 220ms ease, transform 220ms ease;
}

.screen.screen--hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: absolute;
}

.microcopy {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
  /* Stronger shadow so small white text reads on bright background */
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.25);
}

.hud {
  width: 100%;
  max-width: 820px;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 0 4px;
}

.toggles {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.balance__label {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.balance__value {
  font-family: Fredoka, Inter, system-ui, sans-serif;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 6px;
  text-shadow:
    2px 3px 0 rgba(0, 0, 0, 0.68),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.toast {
  min-height: 22px;
  margin-top: 6px;
  font-weight: 700;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.22),
    0 10px 22px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.card {
  width: 100%;
  background: var(--card);
  color: var(--cardText);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  padding: 16px;
}

.question {
  font-family: Fredoka, Inter, system-ui, sans-serif;
  font-weight: 700;
  margin: 6px 0 12px;
  text-align: center;
}

.answers {
  display: grid;
  gap: 10px;
}

.answer {
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  font-size: 18px;
}

.answer.is-correct {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
}

/* Ensure answer state colors win against `.card .btn--ghost` */
.card .answer.is-correct {
  background: rgba(34, 197, 94, 0.22);
  background-image: none;
  border-color: rgba(34, 197, 94, 0.55);
}

.answer.is-wrong {
  background: rgba(227, 76, 76, 0.22);
  border-color: rgba(227, 76, 76, 0.55);
}

.card .answer.is-wrong {
  background: rgba(227, 76, 76, 0.22);
  background-image: none;
  border-color: rgba(227, 76, 76, 0.55);
}

.answer.is-reveal {
  outline: 3px solid rgba(34, 197, 94, 0.35);
}

.card .answer.is-reveal {
  outline: 3px solid rgba(34, 197, 94, 0.35);
}

.counter {
  color: rgba(11, 42, 74, 0.75);
  font-weight: 700;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  user-select: none;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--primary), var(--primaryDark));
  color: white;
}

.btn--ghost {
  /* Slightly darker background so white text stays readable on bright sky */
  background: rgba(255, 255, 255, 0.26);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.25),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

.card .btn--ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.75));
  color: #0b2a4a;
  border: 1px solid rgba(0, 60, 120, 0.22);
}

.btn--xl {
  padding: 16px 20px;
  font-family: Fredoka, Inter, system-ui, sans-serif;
  font-size: 28px;
  min-width: min(320px, 80vw);
}

.btn--sm {
  padding: 10px 12px;
  font-weight: 800;
}

.u-hidden {
  display: none;
}

.results-actions {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.results-balance,
.results-score,
.results-copy {
  margin: 8px 0;
  font-weight: 700;
}

.results-score {
  opacity: 0.8;
}

.footer {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 0 2px;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

@media (min-width: 840px) {
  body {
    background-attachment: fixed;
  }
  .hud {
    max-width: 900px;
  }
  .card {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .toast,
  .btn {
    transition: none !important;
  }
}
