/* Muraya Kontadó: digital children's newspaper of Sint Franciscus College.
   Mobile first; colors from the school's example design and the flag of Curaçao. */

:root {
  --navy: #123a63;
  --navy-dark: #0b2744;
  --flag-blue: #002b7f;
  --flag-yellow: #f9e814;
  --paper: #fbf8f1;
  --card: #ffffff;
  --ink: #1c2433;
  --muted: #5b6475;
  --line: #e4ddcf;
  --right: #1f8f4e;
  --wrong: #c8372d;
  --radius: 18px;
  --shadow: 0 6px 18px rgba(18, 58, 99, 0.12);
  --heading: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Elements hidden by the games must stay hidden even when a class sets display. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--flag-blue);
}

h1,
h2,
h3 {
  font-family: var(--heading);
  line-height: 1.15;
  color: var(--navy);
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0.2em 0 0.4em;
}

h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--flag-yellow);
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--flag-yellow);
  outline-offset: 2px;
}

.icon {
  display: inline-block;
  vertical-align: middle;
  flex: none;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.8rem;
  padding: 0.55rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand-icon {
  color: var(--flag-yellow);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-family: var(--heading);
  font-weight: 800;
  font-size: clamp(1.02rem, 4.2vw, 1.3rem);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.brand-motto {
  font-family: var(--heading);
  font-weight: 700;
  font-size: clamp(0.72rem, 3vw, 0.85rem);
  white-space: nowrap;
  color: var(--flag-yellow);
}

.brand-school {
  display: none;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  padding-left: 0.8rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.brand-school small {
  opacity: 0.8;
}

.lang-switch {
  margin-left: auto;
  flex: none;
  display: flex;
  gap: 0.3rem;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
}

.lang-link.is-current {
  background: var(--flag-yellow);
  border-color: var(--flag-yellow);
  color: var(--navy-dark);
}

.lang-name {
  display: none;
}

.main-nav {
  background: var(--navy-dark);
}

.main-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 0.5rem;
}

.main-nav-inner::-webkit-scrollbar {
  display: none;
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  flex: none;
  min-width: 4.6rem;
  padding: 0.45rem 0.6rem 0.4rem;
  color: #dbe6f3;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
}

.nav-link.is-current {
  color: #fff;
  border-bottom-color: var(--flag-yellow);
}

.nav-link:hover {
  color: #fff;
}

@media (min-width: 1000px) {
  .brand-school {
    display: flex;
  }
}

@media (min-width: 900px) {
  .nav-link {
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.95rem;
    padding: 0.6rem 0.9rem;
  }
}

@media (min-width: 760px) {
  .lang-name {
    display: inline;
  }

  .lang-code {
    display: none;
  }

  .lang-link {
    font-size: 0.85rem;
    padding: 0 0.8rem;
  }
}

/* ---------- Layout ---------- */

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.section {
  margin: 2.2rem 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1.5rem;
}

.section-head h2 {
  margin: 0 0 0.3rem;
  position: relative;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-head {
  margin: 0.5rem 0 1.5rem;
}

.page-head > p {
  max-width: 65ch;
  font-size: 1.1rem;
}

.notice {
  background: #fff6c7;
  border-left: 5px solid var(--flag-yellow);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  max-width: 65ch;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.4rem 0;
}

.prose {
  max-width: 70ch;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.9rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 2px solid var(--navy);
  background: var(--navy);
  color: #fff;
  font: 700 1rem var(--body);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--navy-dark);
}

.button-secondary {
  background: #fff;
  color: var(--navy);
}

.button-secondary:hover {
  background: #eef3f9;
}

.level-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.8rem 0;
}

/* ---------- Home ---------- */

.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 330px;
  display: flex;
  /* Phone: badge above the text instead of on top of the title. */
  flex-direction: column-reverse;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.hero-collage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.hero-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-collage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 39, 68, 0.15) 0%, rgba(11, 39, 68, 0.88) 62%);
}

.hero-content {
  position: relative;
  padding: 1.4rem 1.2rem 1.3rem;
  color: #fff;
  max-width: 640px;
}

.hero-welcome {
  display: inline-block;
  margin: 0;
  background: var(--flag-yellow);
  color: var(--navy-dark);
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0.1rem 0.7rem;
  border-radius: 8px;
  transform: rotate(-2deg);
}

.hero-title {
  color: #fff;
  font-size: clamp(2.4rem, 9vw, 4.2rem);
  margin: 0.15em 0 0.2em;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.hero-intro {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

.hero-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-language {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy-dark);
  font-weight: 700;
  text-decoration: none;
}

.hero-language.is-current {
  background: var(--flag-yellow);
}

.hero-badge {
  position: relative;
  flex: none;
  align-self: flex-end;
  margin: 1rem 1rem 0;
  background: #fff;
  color: var(--navy);
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.15;
  text-align: center;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  transform: rotate(4deg);
  box-shadow: var(--shadow);
}

@media (min-width: 760px) {
  .hero {
    min-height: 420px;
    flex-direction: row;
    align-items: flex-end;
  }

  .hero-content {
    padding: 2rem 2.2rem;
  }
}

/* Next to the text only when there is room for both; below that it stays above the text. */
@media (min-width: 1000px) {
  .hero-badge {
    position: absolute;
    margin: 0;
    bottom: 2rem;
    right: 2rem;
    font-size: 1.5rem;
    padding: 1rem 1.4rem;
  }
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.theme-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  border-top: 6px solid var(--theme);
  transition: transform 0.15s;
}

.theme-card:hover {
  transform: translateY(-3px);
}

.theme-card-image {
  position: relative;
}

.theme-card-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.theme-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--theme);
  color: #fff;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.15rem;
  border: 3px solid #fff;
}

.theme-card-image .theme-number {
  position: absolute;
  left: 0.6rem;
  top: 0.6rem;
}

.theme-card-title {
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  background: var(--theme);
  padding: 0.5rem 0.8rem;
}

.theme-card-text {
  padding: 0.6rem 0.8rem 0;
  font-size: 0.95rem;
  color: var(--muted);
  flex: 1;
}

.theme-card-button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.7rem 0.8rem 0.9rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.feature .icon {
  color: var(--navy);
}

.feature-games {
  background: #fff1c9;
}

.feature-coloring {
  background: #fbe0ee;
}

.feature-listen {
  background: #d9f2f1;
}

.feature-teachers {
  background: #dfe9fb;
}

.feature-title {
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--navy);
}

.feature-text {
  flex: 1;
}

.feature-button {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.school-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}

.school-block > div {
  flex: 1 1 260px;
}

.school-block h2 {
  margin-top: 0;
}

/* ---------- Share ---------- */

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 0;
  padding-top: 1rem;
  border-top: 2px dashed var(--line);
}

.share-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
  color: var(--navy);
  margin-right: 0.3rem;
}

.share-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.6rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 0;
  font: 700 0.95rem var(--body);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: var(--navy);
}

.share-whatsapp {
  background: #1f8f4e;
}

.share-facebook {
  background: #1b5fc1;
}

/* ---------- Stories ---------- */

.view-switch {
  display: inline-flex;
  background: #e9e2d3;
  border-radius: 999px;
  padding: 0.25rem;
  margin-top: 0.4rem;
}

.view-switch a {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: var(--navy);
}

.view-switch a.is-current {
  background: var(--navy);
  color: #fff;
}

.theme-section {
  margin: 2rem 0;
  scroll-margin-top: 140px;
}

.theme-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.2rem;
}

.theme-description {
  color: var(--muted);
  margin-top: 0;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.story-card,
.game-tile {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  border-bottom: 5px solid var(--theme, var(--navy));
  transition: transform 0.15s;
}

.story-card:hover,
.game-tile:hover {
  transform: translateY(-3px);
}

.story-card-image {
  position: relative;
}

.story-card-image img,
.game-tile img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.story-card-number {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.story-card-body {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.75rem 0.8rem;
}

.story-card-year {
  font-weight: 800;
  color: var(--theme);
  font-size: 0.9rem;
}

.story-card-title,
.game-tile span {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.2;
}

.game-tile span {
  padding: 0.6rem 0.75rem 0.8rem;
}

.game-tile small {
  display: block;
  font-family: var(--body);
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.2rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.2rem;
  border-left: 4px solid var(--line);
  display: grid;
  gap: 1.2rem;
}

.timeline-item {
  position: relative;
  max-width: 420px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1.2rem - 12px);
  top: 0.35rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--theme);
  border: 3px solid var(--paper);
}

.timeline-year {
  display: block;
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--theme);
  min-height: 1.4rem;
  margin-bottom: 0.3rem;
}

/* ---------- Story ---------- */

.story {
  max-width: 820px;
  margin: 0 auto;
}

.story-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-weight: 600;
}

.theme-chip {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.story-figure {
  margin: 0 0 1.5rem;
}

.story-figure img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.story-figure figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

.story-text {
  font-size: 1.15rem;
  line-height: 1.75;
}

.story-text h2 {
  font-size: 1.35rem;
  margin: 1.6rem 0 0.4rem;
}

.story-list-item {
  padding-left: 1.2rem;
  position: relative;
}

.story-list-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--theme);
}

.story-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.5rem 0;
  font-weight: 600;
}

.story-languages a {
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--navy);
  text-decoration: none;
  font-weight: 700;
}

.join-in {
  background: var(--card);
  border-radius: var(--radius);
  border-top: 6px solid var(--theme);
  padding: 1rem 1.2rem 0.4rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.join-in > h2 {
  margin-top: 0.2rem;
}

.join-item h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.8rem 0 0.2rem;
}

.join-item audio,
.audio-card audio {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 0.4rem 0;
}

.story-pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.8rem;
  margin: 2rem 0 0;
}

.pager-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border-radius: 14px;
  padding: 0.8rem;
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
  box-shadow: var(--shadow);
}

.pager-link small {
  display: block;
  color: var(--muted);
  font-weight: 600;
}

.pager-next {
  grid-column: 2;
  justify-content: flex-end;
  text-align: right;
}

/* Two long titles side by side do not fit on a small phone. */
@media (max-width: 420px) {
  .story-pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .pager-next {
    grid-column: 1;
  }
}

/* ---------- Quiz ---------- */

.quiz-level {
  display: inline-block;
  margin: 0;
  padding: 0.2rem 0.9rem;
  border-radius: 999px;
  background: var(--theme, var(--navy));
  color: #fff;
  font-weight: 700;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.level-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.2rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  border-left: 8px solid var(--flag-yellow);
}

.level-card-title {
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--navy);
}

.quiz {
  max-width: 760px;
}

.quiz-figure {
  margin: 0 0 1rem;
}

.quiz-figure img {
  border-radius: var(--radius);
  max-height: 340px;
  width: auto;
  box-shadow: var(--shadow);
}

.quiz-figure figcaption {
  color: var(--muted);
  font-size: 0.9rem;
}

.read-aloud {
  background: #fff1c9;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 1.15rem;
}

.quiz-progress {
  font-weight: 800;
  color: var(--navy);
  margin: 1rem 0 0.4rem;
}

.quiz-tasks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.quiz-task {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}

.task-prompt {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.8rem;
}

.task-options {
  display: grid;
  gap: 0.6rem;
}

.task-options-row {
  grid-template-columns: 1fr 1fr;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 3.2rem;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  border: 3px solid var(--line);
  background: #fff;
  font: 600 1.08rem var(--body);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.option:hover {
  border-color: var(--navy);
}

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
}

.option-true,
.option-false {
  justify-content: center;
  font-size: 1.15rem;
}

.option.is-selected {
  border-color: var(--navy);
  background: #eef3f9;
}

.option.is-right {
  border-color: var(--right);
  background: #e3f5ea;
}

.option.is-wrong {
  border-color: var(--wrong);
  background: #fbe6e4;
  opacity: 0.7;
}

.task-number {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.number-input {
  width: 9rem;
  min-height: 3rem;
  font-size: 1.3rem;
  padding: 0 0.8rem;
  border-radius: 12px;
  border: 3px solid var(--line);
}

.task-hint {
  color: var(--muted);
  margin: 0.4rem 0;
}

.task-check {
  margin-top: 0.6rem;
}

.task-feedback {
  font-weight: 800;
  font-size: 1.15rem;
  min-height: 1.4em;
  margin: 0.6rem 0 0.2rem;
}

.task-feedback.is-right {
  color: var(--right);
}

.task-feedback.is-wrong {
  color: var(--wrong);
}

.task-answer summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--flag-blue);
  padding: 0.4rem 0;
}

.task-answer p {
  background: #f3f6fb;
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  margin: 0.3rem 0 0;
}

.quiz-nav {
  margin: 1rem 0;
}

.quiz-result {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.4rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--flag-yellow);
}

.quiz-result .level-buttons {
  justify-content: center;
}

.quiz-result-title {
  font-family: var(--heading);
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--navy);
  margin: 0.2rem 0;
}

.quiz-score {
  font-size: 1.3rem;
  font-weight: 700;
}

.level-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  color: var(--muted);
}

/* ---------- Word search ---------- */

.wordsearch {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.wordsearch-grid {
  display: grid;
  gap: 4px;
  background: #e6eef6;
  padding: 8px;
  border-radius: var(--radius);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  width: min(100%, 470px);
}

.wordsearch-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
}

.cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 8px;
  background: #fff;
  font: 800 clamp(1rem, 4.6vw, 1.45rem) var(--heading);
  color: var(--navy);
  cursor: pointer;
  padding: 0;
}

.cell.is-start {
  background: var(--flag-yellow);
}

.cell.is-miss {
  background: #f8d3cf;
}

.cell.is-found {
  color: #fff;
}

.cell.found-0 {
  background: #e74c3c;
}

.cell.found-1 {
  background: #2b78c5;
}

.cell.found-2 {
  background: #23915a;
}

.cell.found-3 {
  background: #8e44ad;
}

.cell.found-4 {
  background: #e67e22;
}

.cell.is-solution {
  outline: 3px solid var(--flag-yellow);
  outline-offset: -3px;
  background: #fff7b8;
}

.wordsearch-side {
  flex: 1 1 240px;
}

.wordsearch-side h2 {
  margin-top: 0;
}

.word-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.word-list li {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.word-list li.is-found {
  text-decoration: line-through;
  background: #e3f5ea;
  border-color: var(--right);
  color: var(--right);
}

.wordsearch-status,
.differences-status {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--right);
  min-height: 1.4em;
}

/* ---------- Spot the difference ---------- */

.differences-panels {
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 900px) {
  .differences-panels {
    grid-template-columns: 1fr 1fr;
  }
}

.difference-panel {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  line-height: 0;
}

.difference-panel img {
  width: 100%;
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
}

.panel-label {
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 2;
  background: #fff;
  color: var(--navy);
  font: 800 1.2rem var(--heading);
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 2px solid var(--navy);
}

.marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 4px solid #ff2d55;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}

.marker.is-own {
  border-color: #ff9800;
}

.marker.is-hint {
  border-style: dashed;
  border-color: var(--flag-yellow);
  animation: pulse 0.6s ease-in-out 3;
}

.marker.is-miss {
  width: 26px;
  border-color: #fff;
  background: rgba(200, 55, 45, 0.6);
  animation: fade 0.8s forwards;
}

@keyframes pulse {
  50% {
    transform: translate(-50%, -50%) scale(1.15);
  }
}

@keyframes fade {
  to {
    opacity: 0;
  }
}

/* ---------- Matching pictures ---------- */

.matching-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(48px, 0.7fr) minmax(0, 1fr);
  max-width: 760px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.matching-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.matching-column {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.matching-left {
  grid-column: 1;
}

.matching-right {
  grid-column: 3;
}

.matching-column li {
  display: flex;
  align-items: center;
}

.match-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem;
  border: 3px solid transparent;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.matching-left .match-item {
  justify-content: space-between;
}

.match-item img {
  display: block;
  width: calc(100% - 1.6rem);
  height: auto;
  max-height: 160px;
  object-fit: contain;
  border-radius: 8px;
}

.match-dot {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #8ec9e3;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #8ec9e3;
}

.match-item.is-selected {
  border-color: var(--flag-yellow);
  box-shadow: 0 0 0 3px var(--navy);
}

.match-item.is-wrong {
  border-color: var(--wrong);
  animation: shake 0.4s;
}

.match-item.is-matched {
  cursor: default;
}

.match-item:disabled {
  opacity: 1;
  color: inherit;
}

.match-line {
  stroke-width: 6;
  stroke-linecap: round;
}

.match-color-0 { --match: #e74c3c; }
.match-color-1 { --match: #2b78c5; }
.match-color-2 { --match: #23915a; }
.match-color-3 { --match: #8e44ad; }
.match-color-4 { --match: #e67e22; }

.match-line {
  stroke: var(--match);
}

.match-item.is-matched {
  border-color: var(--match);
}

.match-item.is-matched .match-dot {
  background: var(--match);
  box-shadow: 0 0 0 2px var(--match);
}

.matching-status {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--right);
  min-height: 1.4em;
}

.matching-status.is-wrong {
  color: var(--wrong);
}

@keyframes shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ---------- Coloring ---------- */

.coloring-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.coloring-tile {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--navy);
  font-family: var(--heading);
  font-weight: 800;
  box-shadow: var(--shadow);
}

.coloring-tile img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  width: 100%;
  background: #fff;
  border-bottom: 2px solid var(--line);
}

.coloring-tile span {
  padding: 0.7rem 0.9rem;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.swatch {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--swatch);
  box-shadow: 0 0 0 2px #c9c2b4;
  cursor: pointer;
}

.swatch[aria-checked="true"] {
  box-shadow: 0 0 0 4px var(--navy);
  transform: scale(1.1);
}

.canvas-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.5rem;
  max-width: 900px;
}

.coloring-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.print-only {
  display: none;
}

/* ---------- Listen, teachers, sponsors ---------- */

.audio-list {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.audio-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  border-left: 8px solid #2aa198;
}

.audio-icon {
  color: #2aa198;
}

.audio-body {
  flex: 1;
}

.audio-body h2 {
  margin: 0;
}

.audio-meta {
  color: var(--muted);
  margin: 0.2rem 0;
}

.teacher-tips {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  box-shadow: var(--shadow);
  max-width: 820px;
}

.teacher-tips li {
  margin: 0.4rem 0;
}

.download-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.8rem;
}

.download {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  background: var(--card);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.download .icon {
  color: var(--navy);
}

.download strong,
.download small {
  display: block;
}

.download small {
  color: var(--muted);
}

.heart {
  color: #d23f7d;
}

.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.2rem;
}

.sponsor-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sponsor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 210px;
  background: #fff;
  border-bottom: 2px solid var(--line);
}

.sponsor-logo img {
  max-height: 170px;
  width: auto;
}

.sponsor-logo-dark {
  background: #000;
}

.sponsor-body {
  padding: 1.1rem 1.3rem 1.4rem;
}

.sponsor-body h2 {
  margin-top: 0;
}

.thanks {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  max-width: 70ch;
}

.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-page p {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--navy);
  color: #dbe6f3;
  border-top: 6px solid var(--flag-yellow);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.8rem 1rem 2.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
}

.footer-brand,
.footer-school,
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-brand .brand-name {
  color: #fff;
}

.footer-slogan {
  margin: 0.5rem 0 0;
  font-style: italic;
}

.site-footer a {
  color: #fff;
}

.footer-school strong {
  color: #fff;
}

.footer-sponsors {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
}

.footer-sponsor-logos {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.footer-sponsor-logos img {
  height: 54px;
  width: auto;
  background: #000;
  border-radius: 8px;
  padding: 4px;
}

.footer-sponsor-logos img + img {
  background: #fff;
}

/* ---------- Print ---------- */

@media print {
  .site-header,
  .site-footer,
  .share,
  .join-in,
  .story-pager,
  .story-languages,
  .breadcrumb,
  .level-buttons,
  .palette,
  .skip-link,
  .view-switch {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .story-figure img {
    box-shadow: none;
    max-height: 9cm;
    width: auto;
  }

  .coloring .canvas-wrap {
    display: none;
  }

  .coloring .print-only {
    display: block;
    width: 100%;
  }
}
