.adventure-main + .release-footer { padding-block: .8rem 1.5rem; border-top: 1px solid var(--line); font-size: .9rem; }
.adventure-hub-intro {
  margin-bottom: 1.35rem;
  padding: clamp(1.25rem, 4vw, 2.7rem);
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: var(--model-surface);
}
.adventure-hub-intro h1, .adventure-cover h1 {
  font-size: clamp(2rem, 4.8vw, 3.65rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.adventure-hub-intro p { margin-top: .75rem; max-width: 57ch; color: var(--muted); }

.adventure-filters { min-width: 0; margin: 0 0 1.15rem; padding: 0; border: 0; }
.adventure-filters legend { padding: 0; margin-bottom: .4rem; font-weight: 800; }
.adventure-filters-row,
.adventure-filter-options { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.adventure-filters-row { justify-content: space-between; }
.adventure-filter { position: relative; display: inline-flex; }
.adventure-filter input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.adventure-filter span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .9rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: .9rem;
  font-weight: 750;
}
.adventure-filter span:hover { background: var(--model-surface); border-color: var(--primary); }
.adventure-filter input:checked + span { color: #fff; background: var(--primary); border-color: var(--primary); }
.adventure-filter input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 3px; }
.adventure-count { color: var(--muted); font-size: .9rem; font-weight: 700; }

.adventure-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.85rem, 2.5vw, 1.5rem);
  list-style: none;
  padding: 0;
  margin: 0;
}
.adventure-card, .adventure-cover {
  --scene-light: #eee9ff;
  --scene-dark: #4937ad;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  min-width: 0;
  box-shadow: 0 5px 16px #26224c09;
}
.adventure-theme-mission { --scene-light: #f3e9ff; --scene-dark: #673aa3; }
.adventure-theme-hawker-centre { --scene-light: #ffebdd; --scene-dark: #873d24; }
.adventure-theme-mrt-journey { --scene-light: #e5edff; --scene-dark: #2f498e; }
.adventure-theme-hdb-playground { --scene-light: #fff0cf; --scene-dark: #71480d; }
.adventure-theme-sungei-buloh { --scene-light: #e1f5ea; --scene-dark: #275d49; }
.adventure-card { overflow: clip; }
.adventure-card:hover { border-color: var(--scene-dark); box-shadow: 0 8px 22px #26224c14; }
.adventure-card:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.adventure-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--ink);
  text-decoration: none;
}
.adventure-card-link:focus-visible { outline: none; }
.adventure-art {
  display: block;
  width: 100%;
  object-fit: cover;
  background: var(--scene-light);
}
.adventure-card .adventure-art { aspect-ratio: 16 / 9; }
.adventure-art-fallback {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fffc 0 22%, transparent 22.5%),
    repeating-linear-gradient(45deg, #ffffff38 0 2px, transparent 2px 18px),
    var(--scene-light);
}
.adventure-art-fallback span { font-size: clamp(2.8rem, 6vw, 4.2rem); line-height: 1; }
.adventure-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem clamp(.9rem, 2.75vw, 1.25rem) 1.15rem;
}
.adventure-subject { font-size: .9rem; font-weight: 750; color: var(--scene-dark); }
.adventure-card .adventure-subject { line-height: 1.35; }
.adventure-grade {
  display: inline-block;
  border-radius: 2rem;
  background: var(--scene-light);
  padding: .2rem .58rem;
  margin-inline-end: .22rem;
  white-space: nowrap;
}
.adventure-card h2 { margin: .6rem 0 .45rem; font-size: 1.34rem; line-height: 1.18; }
.adventure-card-goal { margin-bottom: .9rem; color: var(--muted); font-size: .95rem; }
.adventure-card-footer { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.adventure-card-action {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  min-height: 44px;
  padding: .35rem .85rem;
  border-radius: .75rem;
  color: var(--ink);
  background: var(--accent);
  font-weight: 800;
}
.adventure-card-link:hover .adventure-card-action,
.adventure-card-link:focus-visible .adventure-card-action { color: #fff; background: var(--scene-dark); }
.adventure-status {
  display: inline-block;
  font-size: .84rem;
  font-weight: 750;
  color: var(--muted);
}
.adventure-status[data-complete="true"] { color: #245b43; }
.adventure-back { display: inline-flex; align-items: center; gap: .4rem; min-height: 2.6rem; font-weight: 700; margin-bottom: .45rem; }
.adventure-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .55fr);
  align-items: stretch;
  overflow: hidden;
  margin-bottom: 1rem;
}
.adventure-cover-copy { padding: clamp(1rem, 3vw, 2rem); align-self: center; }
.adventure-cover h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-block: .35rem .6rem; }
.adventure-cover .adventure-art { height: 100%; min-height: 9.5rem; max-height: 15rem; }
#adventure-game { max-width: 50rem; margin-inline: auto; }
.adventure-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  background: var(--paper);
  padding: clamp(.85rem, 4vw, 2rem);
  box-shadow: 0 5px 16px #26224c09;
}
.adventure-panel > * + * { margin-top: .8rem; }
.adventure-panel h2 { margin-block: .35rem .55rem; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.18; }
.adventure-panel h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.adventure-panel p { max-width: 64ch; }
.adventure-step { color: var(--primary); font-size: .9rem; font-weight: 750; }
.adventure-prompt { font-weight: 750; }
.adventure-progress { display: block; width: 100%; height: .65rem; accent-color: var(--primary); margin-block: .35rem .9rem; }
.adventure-model, .adventure-worked {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--model-surface);
  padding: clamp(.6rem, 3vw, 1.15rem);
  margin-inline: 0;
}
.adventure-model table {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.adventure-model caption, .adventure-model figcaption {
  text-align: left;
  font-weight: 750;
  margin-block: 0 .5rem;
}
.adventure-model th, .adventure-model td {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: .4rem .6rem .4rem 0;
}
.adventure-model tbody tr:last-child > * { border-bottom: 0; }
.adventure-dots { color: var(--primary); white-space: nowrap; letter-spacing: .1em; }
.adventure-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}
.adventure-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 2px;
  width: min(100%, calc(var(--cols) * 2.65rem));
  margin-block: .6rem;
}
.adventure-model [data-cell] {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  background: #d8c0ec;
  border-radius: .14rem;
  border: 1px solid #7a5689;
  color: var(--ink);
  font-size: clamp(.7rem, 3vw, 1rem);
  font-weight: 750;
}
.adventure-model [data-cell="."] { background: #fff; border-color: #bbaaab; }
.adventure-model [data-cell="B"], .adventure-model [data-cell="G"] { background: #cfe9db; border-color: #547361; }
.adventure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .9rem;
  margin-block: .55rem 0;
  padding: 0;
  list-style: none;
  font-size: .88rem;
}
.adventure-legend li { display: flex; align-items: center; gap: .3rem; }
.adventure-legend [data-cell] { width: 1.25rem; }
.adventure-form { margin-top: .85rem; }
.adventure-form > * + * { margin-top: .5rem; }
.adventure-choices { min-width: 0; border: 0; margin-inline: 0; padding: 0; }
.adventure-choices legend, .adventure-answer label { font-weight: 750; }
.adventure-choices label {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  cursor: pointer;
  min-height: 2.65rem;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  margin-top: .45rem;
}
.adventure-choices input { accent-color: var(--primary); flex: 0 0 auto; margin: .33rem 0 0; }
.adventure-choices label:has(:checked) { background: var(--model-surface); border-color: var(--control-border); }
.adventure-answer { display: grid; justify-items: start; gap: .4rem; }
.adventure-answer input {
  max-width: 100%;
  width: 9rem;
  min-height: 2.65rem;
  padding: .5rem .65rem;
  border: 1px solid var(--control-border);
  border-radius: .55rem;
  margin-inline-end: .4rem;
  background: var(--page);
  color: var(--ink);
}
.adventure-hint { padding: .6rem .85rem; background: var(--model-surface); border-left: 4px solid var(--control-border); }
.adventure-feedback:not(:empty) {
  padding: .75rem .9rem;
  border-left: 4px solid var(--control-border);
  border-radius: .45rem;
  background: var(--model-surface);
}
.adventure-feedback[data-result="correct"] { border-color: #3c775e; background: #e8f6ed; }
.adventure-feedback[data-result="try-again"] { border-color: var(--warning); background: #fdf0f3; }

@media (max-width: 850px) {
  .adventure-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .adventure-cover {
    grid-template-columns: minmax(0, 1fr);
  }
  .adventure-cover .adventure-art { grid-row: 1; max-height: 7rem; min-height: 5.5rem; aspect-ratio: 32 / 9; }
  .adventure-model th, .adventure-model td { padding-inline-end: .4rem; font-size: .9rem; }
}
@media (max-width: 500px) {
  .adventure-cards { grid-template-columns: minmax(0, 1fr); }
}
