:root {
  --night-1: #0b1030;
  --night-2: #1d1642;
  --night-3: #3a2450;
  --gold: #ffd76a;
  --gold-2: #e0a12a;
  --gold-ink: #3a1e00;
  --parchment: #f4e4bc;
  --parchment-hi: #fbf1d3;
  --parchment-edge: #a0702a;
  --ink: #4a240a;
  --ink-soft: #6b4a2a;
  --text-on-night: #f6ecd6;
  --muted-on-night: #c9b6e8;
  --ok: #2f8a4f;
  --no: #b8382c;
  --title-font: "Cinzel Decorative", "Cinzel", "Trajan Pro", Georgia, serif;
  --head-font: "Cinzel", "Trajan Pro", Georgia, serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 16px/1.5 var(--body-font);
  color: var(--text-on-night);
  background: linear-gradient(to bottom, var(--night-1), var(--night-2) 45%, var(--night-3)) fixed;
}
a { color: var(--gold); }
img { max-width: 100%; }

/* ---------- Header / footer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(11, 8, 30, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 215, 106, 0.2);
}
.logo {
  font: 700 1.25rem var(--title-font);
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
}
.logo-mark { font-family: var(--body-font); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.nav a, .nav .linklike {
  font: 600 0.9rem var(--head-font);
  color: var(--text-on-night);
  text-decoration: none;
}
.nav a:hover, .nav .linklike:hover { color: var(--gold); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; }
.view { flex: 1; width: 100%; outline: none; }
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  font-size: 0.8rem;
  color: var(--muted-on-night);
  border-top: 1px solid rgba(255, 215, 106, 0.15);
}
.site-footer a { color: var(--muted-on-night); }
.art-legal { position: absolute; left: 0; right: 0; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 0 12px; font-size: .78rem; z-index: 5; }
.art-legal a, .art-legal span { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.8); text-decoration: none; opacity: .9; }
.art-legal a:hover { text-decoration: underline; opacity: 1; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.policy { line-height: 1.6; }
.policy h2 { font-size: 1.15rem; margin: 22px 0 6px; color: #6b4a1f; }
.policy ul { padding-left: 22px; }
.policy li { margin: 4px 0; }
.policy .contact-email { font-size: 1.2rem; font-weight: 700; }
.policy-links { margin-top: 26px; font-size: .9rem; text-align: center; }
.form-foot.agree { font-size: .85rem; }
.renew-note { font-size: .9rem; text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 700 0.95rem var(--head-font);
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.65em 1.4em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: filter 0.15s, background 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-gold { color: var(--gold-ink); background: linear-gradient(#ffe08a, var(--gold-2)); border-color: #8a5a12; }
.btn-gold:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost { color: var(--gold); background: rgba(20, 12, 40, 0.5); border-color: rgba(255, 215, 106, 0.55); }
.btn-ghost:hover:not(:disabled) { background: rgba(60, 40, 90, 0.7); }
.btn-ink { color: #fff6da; background: linear-gradient(#b5651d, #7a3a0c); border-color: #7a4a12; }
.btn-ink:hover:not(:disabled) { filter: brightness(1.1); }
.btn-outline-ink { color: #7a3a0c; background: transparent; border-color: #7a4a12; }
.btn-outline-ink:hover:not(:disabled) { background: rgba(122, 58, 12, 0.08); }
.btn-danger { color: #fff; background: #9b2c22; border-color: #6e1b14; }
.btn-sm { font-size: 0.8rem; padding: 0.45em 1em; }
.btn-lg { font-size: 1.05rem; padding: 0.8em 1.8em; }

/* ---------- Layout helpers ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 32px 16px 48px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 40px 16px 56px; }
.eyebrow {
  margin: 0 0 4px;
  font: 700 0.75rem var(--head-font);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-on-night);
}
.page-title { margin: 0 0 6px; font: 700 clamp(1.6rem, 4vw, 2.2rem) var(--head-font); color: var(--gold); }
.page-sub { margin: 0 0 24px; color: var(--muted-on-night); }
.parchment {
  color: var(--ink);
  background: linear-gradient(var(--parchment-hi), var(--parchment));
  border: 3px double var(--parchment-edge);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}
.parchment h2, .parchment h3 { font-family: var(--head-font); color: #6b2f0a; }
.parchment a:not(.btn) { color: #8a440f; } /* text links only; buttons keep their own colors */
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(78vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 140px;
  text-align: center;
}
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 90px 80px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 160px 20px, #ffe9b0, transparent),
    radial-gradient(1px 1px at 130px 150px, #fff, transparent),
    radial-gradient(1px 1px at 40px 170px, #cfd8ff, transparent),
    radial-gradient(1.5px 1.5px at 190px 120px, #fff, transparent);
  background-size: 210px 200px;
  animation: twinkle 4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.5; } to { opacity: 1; } }
.moon {
  position: absolute;
  top: 10%;
  right: 10%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbe6, #f1dfa6 60%, #d9c27f);
  box-shadow: 0 0 50px 14px rgba(255, 240, 190, 0.22);
}
.castle-silhouette { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42%; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: 680px; }
.hero h1 {
  margin: 4px 0 12px;
  font: 700 clamp(2.6rem, 9vw, 4.8rem)/1.05 var(--title-font);
  color: var(--gold);
  text-shadow: 0 4px 24px rgba(255, 190, 70, 0.4);
}
.hero .lead { margin: 0 auto 24px; max-width: 46ch; font-size: clamp(1rem, 2.4vw, 1.2rem); color: #e8dcf5; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.hero-note { margin: 14px 0 0; font-size: 0.85rem; color: var(--muted-on-night); }

.section { max-width: 1080px; margin: 0 auto; padding: 48px 16px; }
.section-title { margin: 0 0 6px; text-align: center; font: 700 clamp(1.5rem, 4vw, 2rem) var(--head-font); color: var(--gold); }
.section-sub { margin: 0 auto 28px; max-width: 56ch; text-align: center; color: var(--muted-on-night); }

/* ---------- Level cards ---------- */
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 20px;
  color: var(--ink);
  background: linear-gradient(var(--parchment-hi), var(--parchment));
  border: 3px double var(--parchment-edge);
  border-top: 8px solid var(--lc, #c98a1b);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.level-card.is-rec { box-shadow: 0 0 0 3px var(--gold), 0 14px 34px rgba(0, 0, 0, 0.35); }
.lc-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 10px;
  font-size: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lc, #c98a1b) 18%, #fff8e6);
  border: 2px solid var(--lc, #c98a1b);
}
.lc-code { margin: 0; font: 700 0.75rem var(--head-font); letter-spacing: 0.18em; text-transform: uppercase; color: var(--lc, #8b5a1f); }
.level-card h3 { margin: 2px 0 4px; font: 700 1.35rem var(--head-font); color: #4a1f05; }
.lc-grades { margin: 0 0 8px; font-weight: 700; color: var(--ink-soft); }
.lc-tag { margin: 0 0 16px; flex: 1; color: #5b3a1c; }
.rec-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 3px 10px;
  font: 700 0.7rem var(--head-font);
  letter-spacing: 0.06em;
  color: var(--gold-ink);
  background: var(--gold);
  border-radius: 999px;
}
.soon-badge { color: #fff; background: #7b6f8f; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.step {
  padding: 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 215, 106, 0.2);
}
.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  font: 700 1.1rem var(--head-font);
  color: var(--gold-ink);
  background: var(--gold);
  border-radius: 50%;
}
.step h3 { margin: 0 0 6px; font: 700 1.1rem var(--head-font); color: var(--gold); }
.step p { margin: 0; color: #e0d4ef; }

/* ---------- Forms ---------- */
.form-card { padding: 28px clamp(18px, 5vw, 32px); }
.form-card h1 { margin: 0 0 4px; font: 700 1.7rem var(--head-font); color: #6b2f0a; }
.form-card .sub { margin: 0 0 20px; color: var(--ink-soft); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .field .label { font-weight: 700; font-size: 0.9rem; color: #4a240a; }
.field input, .field select, .field textarea {
  font: inherit;
  color: #2a1606;
  padding: 0.65em 0.8em;
  border: 2px solid #c9a46a;
  border-radius: 10px;
  background: #fffaf0;
  color-scheme: light;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(201, 138, 27, 0.4); border-color: #a0702a; }
.field .help { font-size: 0.8rem; color: var(--ink-soft); }
.form-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #7a1d14;
  background: #fbe0dc;
  border: 1px solid #e3a59c;
}
.form-ok {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #1e5a33;
  background: #dff3e5;
  border: 1px solid #9fd1ae;
}
.form-foot { margin: 16px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.rec-hint { padding: 10px 12px; border-radius: 8px; background: rgba(201, 138, 27, 0.12); color: #5b3a1c; font-size: 0.9rem; }

/* ---------- Heroes (children) ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.kid-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.kid-top { display: flex; align-items: center; gap: 12px; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font: 700 1.4rem var(--head-font);
  color: #fff6da;
  background: radial-gradient(circle at 40% 35%, #c9532f, #7a1d14);
}
.kid-card h3 { margin: 0; font-size: 1.25rem; }
.kid-meta { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
.kid-last { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; background: rgba(160, 112, 42, 0.12); }
.add-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  padding: 20px;
  text-decoration: none;
  color: var(--gold);
  border: 2px dashed rgba(255, 215, 106, 0.5);
  border-radius: 14px;
  font: 700 1.05rem var(--head-font);
}
.add-card:hover { background: rgba(255, 215, 106, 0.06); }
.add-card span { font-size: 2.2rem; line-height: 1; }

/* ---------- Quiz ---------- */
.quiz { max-width: 760px; margin: 0 auto; padding: 28px 16px 48px; }
.quiz-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 8px 16px; margin-bottom: 14px; }
.quiz-head h1 { margin: 0; font: 700 clamp(1.3rem, 3.5vw, 1.7rem) var(--head-font); color: var(--gold); }
.q-count { font: 700 0.95rem var(--head-font); color: var(--muted-on-night); }
.q-dots { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; margin-bottom: 18px; }
.q-dot {
  height: 30px;
  font: 600 0.75rem var(--body-font);
  color: var(--muted-on-night);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(201, 182, 232, 0.35);
  border-radius: 6px;
  cursor: pointer;
}
.q-dot.done { color: var(--gold-ink); background: #e9c56a; border-color: #e9c56a; }
.q-dot.cur { outline: 2px solid var(--gold); outline-offset: 2px; }
.q-card { padding: 26px clamp(18px, 5vw, 32px); }
.sample-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b3a1c;
  background: rgba(160, 112, 42, 0.18);
  border-radius: 999px;
}
.q-title { margin: 0 0 6px; font: 700 0.85rem var(--head-font); letter-spacing: 0.12em; text-transform: uppercase; color: #8b5a1f; }
.speak-btn { float: left; margin: 0 12px 6px 0; width: 46px; height: 46px; border-radius: 50%; border: 2px solid #c98a1b; background: #fff4d6; font-size: 1.4rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.speak-btn:hover, .speak-btn:focus-visible { background: #ffe7a8; }
.speak-btn.talking { background: #ffd34d; border-color: #e07b00; animation: mk-talk 0.9s ease-in-out infinite; }
@keyframes mk-talk { 50% { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(255, 196, 0, .35); } }
.q-prompt { margin: 0 0 20px; max-width: 40em; font: 600 clamp(1.15rem, 3vw, 1.45rem)/1.5 var(--body-font); color: #2a1606; }
.q-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  margin: -6px auto 20px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d8bd8a;
}
.q-image-sm { max-height: 160px; margin: 0 0 10px; }
/* Drawn pictures (SVG) already have their own frame: no second frame, and room to be read. */
.q-image[src$=".svg"], .q-image[src^="data:image/svg"] { padding: 0; border: 0; background: none; width: 100%; max-width: 560px; max-height: 360px; object-fit: contain; }
@media (max-width: 560px) {
  .quiz { padding-left: 8px; padding-right: 8px; }
  .q-card { padding: 20px 12px; }
  .q-image[src$=".svg"], .q-image[src^="data:image/svg"] { max-height: none; margin-bottom: 16px; }
}
.q-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  font: 600 1.15rem var(--body-font);
  text-align: left;
  color: #2a1606;
  background: #fffaf0;
  border: 2px solid #d8bd8a;
  border-radius: 12px;
  cursor: pointer;
}
.choice:hover { border-color: #a0702a; }
.choice.sel { background: #fff0c2; border-color: #c98a1b; box-shadow: 0 0 0 3px rgba(201, 138, 27, 0.3); }
.choice-key {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  font: 700 0.9rem var(--head-font);
  color: #fff6da;
  background: #8b5a1f;
  border-radius: 50%;
}
.choice.sel .choice-key { background: #c98a1b; }
.q-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.q-confirm { margin-top: 16px; padding: 18px; text-align: center; }
.q-confirm p { margin: 0 0 12px; }

/* ---------- Results ---------- */
.report-head { display: grid; grid-template-columns: auto 1fr; gap: 18px 24px; align-items: center; padding: 24px clamp(18px, 4vw, 32px); }
.report-score { font: 700 clamp(2.8rem, 9vw, 4rem)/1 var(--title-font); color: #5a2d0c; text-align: center; }
.report-score small { display: block; margin-top: 4px; font: 700 0.75rem var(--head-font); letter-spacing: 0.16em; color: #8b5a1f; }
.report-head h1 { margin: 0; font: 700 1.5rem var(--head-font); color: #6b2f0a; }
.report-head p { margin: 2px 0 0; color: var(--ink-soft); }
.report-actions { grid-column: 1 / -1; }
@media (max-width: 560px) { .report-head { grid-template-columns: 1fr; text-align: center; } .report-actions { justify-content: center; } }

.unlock-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 18px 0;
  padding: 18px 22px;
  border-radius: 14px;
  background: linear-gradient(120deg, #3a2160, #5a2d6e);
  border: 1px solid rgba(255, 215, 106, 0.5);
}
.unlock-banner h2 { margin: 0 0 2px; font: 700 1.15rem var(--head-font); color: var(--gold); }
.unlock-banner p { margin: 0; color: #e0d4ef; font-size: 0.92rem; }

.strip { display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; margin: 4px 0 6px; }
.strip span { height: 14px; border-radius: 3px; background: var(--c); }
.ok { --c: var(--ok); }
.no { --c: var(--no); }
.legend { display: flex; gap: 16px; margin-bottom: 18px; font-size: 0.8rem; color: var(--muted-on-night); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: var(--c); }

.answer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.answer-item { padding: 16px 18px; border-left: 6px solid var(--c); }
.ai-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ai-num { font: 700 1rem var(--head-font); color: #6b2f0a; }
.ai-status { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.ai-prompt { margin: 6px 0 10px; font-size: 1.15rem; font-weight: 700; color: #2a1606; }
.ai-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.ai-choices li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(160, 112, 42, 0.35);
  background: rgba(255, 255, 255, 0.5);
}
.ai-choices li.is-correct { border-color: var(--ok); background: #e3f4e8; }
.ai-choices li.is-wrong { border-color: var(--no); background: #fbe3df; }
.tag { padding: 1px 7px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 999px; color: #fff; }
.tag-you { background: #6b4a2a; }
.tag-ans { background: var(--ok); }
.ai-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; font-size: 0.92rem; color: #4a240a; }
.pic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0.35em 0.9em;
  font: 700 0.8rem var(--head-font);
  letter-spacing: 0.02em;
  color: #1e5a33;
  background: #e3f4e8;
  border: 2px solid #2f8a4f;
  border-radius: 999px;
  cursor: pointer;
}
.pic-btn:hover { background: #d2ecd9; }
.pic-btn.locked { color: #5a5068; background: #ece6f2; border-color: #8a7fa8; }
.pic-btn.locked:hover { background: #e0d8ea; }
.modal.modal-wide { width: min(100%, 780px); }
.locked-art { display: block; width: min(100%, 320px); height: auto; margin: 0 auto 14px; }
.locked-solution {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed #b08a4a;
  background: rgba(90, 45, 110, 0.07);
  font-size: 0.88rem;
  color: #5b3a1c;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(8, 5, 20, 0.7);
}
.modal { width: min(100%, 460px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 26px; text-align: center; }
.modal h2 { margin: 0 0 8px; }
.modal ul { text-align: left; margin: 0 0 16px; padding-left: 1.2em; }
.modal .note { margin: 0 0 18px; padding: 10px 12px; font-size: 0.85rem; border-radius: 8px; background: rgba(160, 112, 42, 0.12); }

/* ---------- Admin ---------- */
.admin-section { padding: 22px clamp(16px, 4vw, 28px); margin-bottom: 22px; }
.admin-section h2 { margin: 0 0 4px; font-size: 1.3rem; }
.admin-section > p { margin: 0 0 16px; color: var(--ink-soft); }
.table-wrap { overflow-x: auto; margin-bottom: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid rgba(160, 112, 42, 0.3); vertical-align: middle; }
.table th { font: 700 0.75rem var(--head-font); letter-spacing: 0.08em; text-transform: uppercase; color: #8b5a1f; }
.table code { font-size: 0.8rem; color: #5b3a1c; }
.status { font-size: 0.75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.status.on { color: #1e5a33; background: #d5efdc; }
.status.off { color: #6b5a50; background: #e6ddd2; }
.grade-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.grade-checks label { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; }
.coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.coverage li { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.5); font-size: 0.85rem; }
.coverage li.missing { background: #fbe0dc; color: #7a1d14; }
textarea.code { font: 0.82rem/1.4 ui-monospace, Menlo, monospace; min-height: 180px; }
pre.code-sample { overflow-x: auto; margin: 0 0 12px; padding: 12px; font-size: 0.78rem; border-radius: 8px; background: #2a1a0d; color: #f4e4bc; }

.empty { padding: 28px; text-align: center; }

/* ---------- Adventure map (assets/map.png + HTML entrances) ---------- */
.map { position: absolute; inset: 0; }
.map-node {
  --s: 1; /* entrance zoom: 1.15 while hovered, focused, or selected */
  position: absolute;
  left: calc(var(--bx) * 100% / 1536);   /* anchored at the badge center */
  top: calc(var(--by) * 100% / 1024);
  z-index: 3;
  display: flex;
  align-items: flex-start;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  transform: translate(-3.1cqw, -3.1cqw) scale(var(--s));
  transform-origin: 3.1cqw 3.1cqw;
  transition: transform 200ms ease;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.map-node::before { content: ""; position: absolute; inset: -6px; } /* extra touch area on small screens */
.gate-badge {
  position: relative;
  z-index: 2;
  flex: none;
  display: grid;
  place-items: center;
  width: 6.2cqw;
  height: 6.2cqw;
  border-radius: 50%;
  font: 700 4.1cqw/1 Georgia, "Times New Roman", serif;
  color: #fff;
  text-shadow: 0 0.2cqw 0 rgba(0, 0, 0, 0.35);
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--badge) 55%, #fff), var(--badge) 55%, color-mix(in srgb, var(--badge) 65%, #000));
  border: 0.5cqw solid #e7b444;
  box-shadow: 0 0 0 0.18cqw #7a4a12, 0 0.4cqw 0.8cqw rgba(0, 0, 0, 0.35);
  transition: box-shadow 200ms ease;
}
.gate-plaque {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(var(--pw) * 100cqw / 1536);
  height: 6.1cqw;
  margin: calc(var(--py) * 100cqw / 1536 + 0.05cqw) 0 0 -1.4cqw;
  padding: 0 0.5cqw 0 1.4cqw;
  line-height: 1.1;
  background: linear-gradient(#fdf0d0, #f1d6a0);
  border: 0.25cqw solid #a8743a;
  border-radius: 0.9cqw;
  box-shadow: inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.5), 0 0.35cqw 0.7cqw rgba(60, 30, 5, 0.35);
  transition: box-shadow 200ms ease;
}
.gate-plaque b { font: 700 2.3cqw Georgia, "Times New Roman", serif; color: var(--ink); }
.gate-plaque > span:not(.gate-note):not(.node-enter) { font: 700 1.48cqw Georgia, "Times New Roman", serif; color: #3a2410; white-space: nowrap; }
.gate-note {
  position: absolute;
  top: -1.1cqw;
  right: 0.6cqw;
  padding: 0.15cqw 0.6cqw;
  font: 700 0.95cqw var(--body-font);
  color: #fff;
  white-space: nowrap;
  background: #2f8a4f;
  border-radius: 999px;
  box-shadow: 0 0.15cqw 0.4cqw rgba(0, 0, 0, 0.3);
}
.node-enter {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 0.6cqw);
  padding: 0.4cqw 1.1cqw;
  font: 700 max(12px, 1.25cqw) var(--head-font);
  white-space: nowrap;
  color: var(--gold-ink);
  background: linear-gradient(#ffe08a, var(--gold-2));
  border: 0.15cqw solid #8a5a12;
  border-radius: 999px;
  box-shadow: 0 0.3cqw 0.8cqw rgba(60, 30, 5, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.map-node.soon .gate-plaque, .map-node.soon .gate-badge { filter: grayscale(0.7); }
.map-node.soon .node-enter { color: #fff; background: #7b6f8f; border-color: #5a5068; }

/* Active entrance: mouse hover (desktop only), keyboard focus, or the first tap on touch screens. */
.map-node.is-selected, .map-node:focus-visible { --s: 1.15; z-index: 10; outline: none; }
.map-node.is-selected .gate-badge, .map-node:focus-visible .gate-badge {
  box-shadow: 0 0 0 0.18cqw #7a4a12, 0 0 0 0.7cqw rgba(255, 215, 106, 0.55), 0 0 2.4cqw 0.8cqw rgba(255, 200, 80, 0.75);
}
.map-node.is-selected .gate-plaque, .map-node:focus-visible .gate-plaque {
  box-shadow: inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.5), 0 0 2cqw 0.5cqw rgba(255, 200, 80, 0.7);
}
.map-node.is-selected .node-enter, .map-node:focus-visible .node-enter { opacity: 1; }
.map-node:focus-visible .gate-plaque { outline: 3px solid var(--gold-2); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .map-node:hover { --s: 1.15; z-index: 10; }
  .map-node:hover .gate-badge { box-shadow: 0 0 0 0.18cqw #7a4a12, 0 0 0 0.7cqw rgba(255, 215, 106, 0.55), 0 0 2.4cqw 0.8cqw rgba(255, 200, 80, 0.75); }
  .map-node:hover .gate-plaque { box-shadow: inset 0 0 0 0.2cqw rgba(255, 255, 255, 0.5), 0 0 2cqw 0.5cqw rgba(255, 200, 80, 0.7); }
  .map-node:hover .node-enter { opacity: 1; }
}

/* Respect reduced-motion: no zoom; the glow still shows which entrance is active. */
@media (prefers-reduced-motion: reduce) {
  .map-node, .map-node:hover, .map-node:focus-visible, .map-node.is-selected { --s: 1 !important; transition: none; }
  .gate-badge, .gate-plaque, .node-enter { transition: none; }
}

.btn-upgrade { background: linear-gradient(180deg, #ffe08a, #e0a12a); color: #3b1f05; border: 2px solid #fff4d6; box-shadow: 0 0 0 3px rgba(224,161,42,.45), 0 4px 12px rgba(0,0,0,.35); font-weight: 800; }
.map-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}
.pan-hint { display: none; }
.grade-jump { display: none; }
.loading { min-height: 60vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: #f7d77a; font-weight: 700; }
.loading-crown { font-size: 3rem; animation: mk-bounce 1s ease-in-out infinite; }
@keyframes mk-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@media (prefers-reduced-motion: reduce) { .loading-crown { animation: none; } }

/* ---------- Member map ---------- */
.free-entrance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(120deg, #1f4a3a, #2f6b4a);
  border: 1px solid rgba(255, 215, 106, 0.45);
}
.free-entrance > div { flex: 1; min-width: 200px; }
.free-entrance h2 { margin: 0; font: 700 1.15rem var(--head-font); color: var(--gold); }
.free-entrance p { margin: 2px 0 0; font-size: 0.9rem; color: #dcefe2; }
.fe-icon { font-size: 2.2rem; }
.hero-picks { display: grid; gap: 8px; margin: 0 0 16px; text-align: left; }
.hero-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid #d8bd8a;
  border-radius: 12px;
  background: #fffaf0;
}
.hero-pick:hover { border-color: #a0702a; }
.hero-pick.is-rec { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(224, 161, 42, 0.3); }
.hero-pick .avatar { width: 40px; height: 40px; font-size: 1.1rem; }
.hero-pick small { color: var(--ink-soft); }
button.hero-pick { width: 100%; font: inherit; text-align: left; cursor: pointer; }

/* Member test sets 1–5 */
.set-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 0 0 16px; }
.set-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 10px 8px;
  text-decoration: none;
  color: var(--ink);
  border: 2px solid #d8bd8a;
  border-radius: 12px;
  background: #fffaf0;
}
.set-pick b { font: 700 1rem var(--head-font); }
.set-pick small { color: var(--ink-soft); font-size: 0.8rem; }
a.set-pick:hover, a.set-pick:focus-visible { border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(224, 161, 42, 0.3); }
.set-pick.is-off { opacity: 0.55; }

.quiz-exit { margin: 22px 0 0; text-align: center; font-size: 0.85rem; }
.quiz-exit a { color: var(--muted-on-night); }
.muted { color: #8b7a66; font-size: 0.85rem; }
.modal .lc-code { margin: 0; }

/* ---------- Full-screen art pages: welcome + adventure map ---------- */
body.art-mode .site-header,
body.art-mode .site-footer { display: none; }
.artscreen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #2a3f5e;
}
.art-blur {
  /* blurred copy of the art fills any letterbox area around the picture */
  position: absolute;
  inset: -40px;
  background: center / cover no-repeat;
  filter: blur(24px) brightness(0.75);
}
.art-stage {
  position: relative;
  container-type: inline-size; /* cqw units scale the map entrances with the art */
  width: min(100vw, 150dvh);
  aspect-ratio: 3 / 2;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}
.art-img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.hotspot {
  position: absolute;
  z-index: 4;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: box-shadow 0.15s, background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.hotspot:hover, .hotspot:focus-visible {
  outline: none;
  background: rgba(255, 240, 180, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 215, 106, 0.95), 0 0 28px rgba(255, 215, 106, 0.8);
}
.hotspot:active { transform: scale(0.97); }
/* hotspot positions are percentages of each 1536 × 1024 artwork */
.art-welcome .hs-free  { left: 22.9%; top: 62.3%; width: 26.7%; height: 13.5%; border-radius: 1.4vmin; }
.art-welcome .hs-login { left: 51.0%; top: 62.3%; width: 26.6%; height: 13.5%; border-radius: 1.4vmin; }
.art-welcome .hs-sound    { left: 86.8%; top: 2.0%; width: 5.3%; height: 8.0%; border-radius: 50%; }
.art-welcome .hs-settings { left: 93.5%; top: 2.0%; width: 5.3%; height: 8.0%; border-radius: 50%; }
.art-map .hs-home     { left: 2.9%; top: 2.0%; width: 10.7%; height: 16%; border-radius: 30%; }
.art-map .hs-sound    { left: 86.1%; top: 1.9%; width: 5.35%; height: 8.0%; border-radius: 50%; }
.art-map .hs-settings { left: 93.2%; top: 1.9%; width: 5.35%; height: 8.0%; border-radius: 50%; }
.hs-sound.muted::after {
  /* red slash over the painted speaker when sound is off */
  content: "";
  position: absolute;
  left: 12%;
  top: 46%;
  width: 76%;
  height: 9%;
  border-radius: 2px;
  background: #d8352a;
  box-shadow: 0 0 0 1.5px #fff6da;
  transform: rotate(-45deg);
}

/* Phones held upright (owner 2026-11-02): the WHOLE map at once — no sideways panning. The map fills the
   width at the top; the grade buttons and the other buttons sit underneath it, never on top of it. */
@media (max-width: 700px) and (orientation: portrait) {
  .artscreen.pannable { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 10px; overflow: visible; min-height: 100dvh; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(#1b1440, #2b2360); }
  .artscreen.pannable .art-blur { display: none; }
  .artscreen.pannable .art-stage { position: relative; flex: none; width: 100vw; height: calc(100vw / 1.5); max-width: none; max-height: none; aspect-ratio: auto; box-shadow: none; }
  /* Big grade buttons under the map: every grade one tap away. */
  .artscreen.pannable .grade-jump {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    position: static; margin: 0 12px; padding: 0; background: none; box-shadow: none;
  }
  .artscreen.pannable .grade-jump button {
    min-height: 52px; border-radius: 14px; border: 2px solid #c98a1b; background: #fff4d6; color: #5a3418;
    font: 800 1.1rem var(--head-font); cursor: pointer;
  }
  .artscreen.pannable .map-bar, .artscreen.pannable ~ .map-bar { position: static; transform: none; margin: 0 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .artscreen.pannable .plan-strip { position: static; transform: none; margin: 0 12px; max-width: none; justify-content: center; }
  .artscreen.pannable .owner-fab { position: static; align-self: center; }
  .artscreen.pannable .pan-hint { display: none; }
}
@keyframes hint-out { to { opacity: 0; } }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

/* ---------- Membership ---------- */
.solution {
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef6ea;
  border: 1px solid #a9cf9c;
  color: #23401c;
  font-size: 0.95rem;
}
.solution p { margin: 4px 0 0; }
.solution-steps { margin: 6px 0 0; padding-left: 1.4em; }
.solution-steps li { margin: 3px 0; }
.solution-image { display: block; width: 100%; max-width: 720px; height: auto; margin: 12px auto 4px; border-radius: 12px; border: 1px solid #c9dcc0; }
.join-card h1 { font-size: 1.9rem; }
.price-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 6px 0 12px; }
.price-card { border: 2px solid #d9c49b; border-radius: 14px; padding: 14px; background: #fffaf0; display: grid; gap: 4px; justify-items: center; text-align: center; }
.price-card.best { border-color: #c98a1b; box-shadow: 0 0 0 3px rgba(201,138,27,.15); }
.price-card .amt { font-size: 2rem; font-weight: 700; color: #5a3418; }
.price-card small { color: #8b5a1f; }
.price-card .btn { margin-top: 8px; }
.early-note { text-align: center; }
.compare-wrap { overflow-x: auto; margin: 10px 0 6px; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; background: #fffaf0; border: 2px solid #d9c49b; border-radius: 14px; overflow: hidden; }
.compare th, .compare td { padding: 10px 12px; text-align: center; border-bottom: 1px solid #eadcbc; vertical-align: middle; }
.compare thead th { background: #f3e5c4; color: #5a3418; font-size: 1.05rem; }
.compare thead th:last-child { background: #f7d77a; }
.compare tbody th { text-align: left; color: #5a3418; font-weight: 700; }
.compare tbody td:last-child { background: #fff4d6; }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.compare small { color: #8b5a1f; font-weight: normal; }
.compare .no { color: #c0392b; font-weight: 700; }
.compare-note { font-size: .85rem; text-align: center; }
.perks-title { font-size: 1.1rem; margin: 18px 0 10px; color: #6b4a1f; }
.perks-title small { font-weight: normal; font-size: .85rem; color: #8b5a1f; }
.solution-locked { background: #f6efe0; border-color: #d9c49b; }
.solution-locked p { margin: 6px 0 0; }
.perks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.perks li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(160, 112, 42, 0.3);
  color: #4a240a;
}
.perks li span { font-size: 1.6rem; line-height: 1.2; }
.join-card .note { margin: 0 0 16px; padding: 10px 12px; text-align: center; border-radius: 8px; background: rgba(160, 112, 42, 0.12); }

/* Fractions: numerator over denominator */
.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.12em;
  font-size: 0.85em;
  line-height: 1.05;
  text-align: center;
}
.frac-num { padding: 0 0.15em 0.04em; border-bottom: 0.09em solid currentColor; }
.frac-den { padding: 0.04em 0.15em 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* A hero's test reports */
.report-list { display: grid; gap: 10px; }
.report-row { display: grid; grid-template-columns: 1.3fr 2fr auto auto; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.rr-test { color: #6b4a22; }
.report-row:hover, .report-row:focus-visible { outline: 2px solid #c98a1b; }
.rr-title { font-size: 1.05rem; }
.rr-title b { color: #8b5a1f; }
.rr-score { font-size: 1.15rem; white-space: nowrap; }
.rr-go { color: #8b5a1f; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .report-row { grid-template-columns: 1fr auto; } .rr-test { grid-column: 1 / -1; order: 3; font-size: .9rem; } .rr-go { display: none; } }
/* Badges */
.kid-badges { margin: 8px 0 0; font-size: .9rem; }
.kb-icons { font-size: 1.1rem; letter-spacing: 2px; }
.badges { padding: 18px 20px; border-radius: 14px; margin: 0 0 22px; color: var(--ink); }
.badges .section-title { margin-top: 0; text-align: left; color: var(--ink); }
.badges .section-title small { font: 700 1rem var(--body-font); color: var(--ink-soft); margin-left: 8px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badge { display: grid; gap: 3px; justify-items: center; text-align: center; padding: 12px 8px; border-radius: 12px; background: #efe6cf; color: #6b5a40; border: 2px dashed #cdbb94; }
.badge.won { background: #fff6dc; color: var(--ink); border: 2px solid #d4a02a; box-shadow: 0 2px 6px rgba(120, 80, 20, .18); }
.badge-icon { font-size: 2rem; line-height: 1.1; }
.badge:not(.won) .badge-icon { filter: grayscale(1); opacity: .7; }
.badge-name { font-size: .95rem; }
.badge-desc { font-size: .8rem; line-height: 1.3; }
.badge-when { font-size: .75rem; font-weight: 700; color: #8b5a1f; }
.badge:not(.won) .badge-when { color: #7a6a52; }
.new-badges { margin: 16px 0; padding: 16px 20px; border-radius: 14px; color: var(--ink); text-align: center; }
.new-badges h2 { margin: 0 0 10px; font: 700 1.4rem var(--head-font); color: #8b5a1f; }
.nb-list { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 12px; }
.nb { display: grid; justify-items: center; gap: 2px; max-width: 160px; padding: 10px; border-radius: 12px; background: #fff6dc; border: 2px solid #d4a02a; animation: nb-pop .6s ease-out both; }
.nb small { font-size: .78rem; }
@keyframes nb-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nb { animation: none; } }

/* The skills report on a hero's reports page */
.skills { padding: 18px 20px; border-radius: 14px; margin: 0 0 26px; color: var(--ink); }
.skills .section-title { margin-top: 0; text-align: left; color: var(--ink); }
.sk-head { margin: 4px 0 12px; color: var(--ink-soft); }
.sk-grade { margin: 16px 0 8px; font-size: 1.05rem; color: #8b5a1f; }
.sk-list { display: grid; gap: 4px; }
.sk-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(90px, 1fr) auto; gap: 12px; align-items: center; padding: 6px 0; }
.sk-name { font-weight: 700; }
.sk-weak .sk-name { color: var(--no); }
.sk-few { margin: 8px 0 0; color: var(--ink-soft); font-style: italic; }
.sk-bar { height: 12px; border-radius: 6px; background: #e8dcc0; overflow: hidden; }
.sk-fill { display: block; height: 100%; border-radius: 6px; }
.sk-low { background: #c0392b; } .sk-mid { background: #d68910; } .sk-high { background: var(--ok); }
.sk-num { font-size: .92rem; white-space: nowrap; color: var(--ink-soft); }
.sk-tip { margin: -2px 0 8px; padding: 8px 12px; background: #fff7e0; border-left: 4px solid #d68910; border-radius: 6px; }
.sk-lock { display: block; margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #fff4d6; border: 1px dashed #c98a1b; color: var(--ink); text-decoration: none; }
.sk-lock:hover, .sk-lock:focus-visible { outline: 2px solid #c98a1b; }
@media (max-width: 640px) { .sk-row { grid-template-columns: 1fr auto; } .sk-bar { grid-column: 1 / -1; order: 3; } }
.solution .speak-btn { float: right; margin: 0 0 6px 12px; width: 40px; height: 40px; font-size: 1.2rem; }
.renewal-off { background: #fff4d6; border: 1px solid #e3b25a; border-radius: 10px; padding: 10px 14px; }

/* Membership page: picture-solution examples */
.examples { margin: 18px 0 10px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); border: 1px solid #e3cf9f; }
.examples h2 { margin: 0 0 4px; font-size: 1.2rem; }
.example-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.example-tab { border: 2px solid #c98a1b; background: #fff8e6; color: #6b3a0c; border-radius: 999px; padding: 6px 14px; font-weight: 700; cursor: pointer; }
.example-tab.on { background: #c98a1b; color: #fff; }
.example-q { margin: 6px 0; }

/* Contest board: a drawn wooden sign with tear-off calendars; every word on it is page text.
   Sizes use the board's own width (cqw), so the same board works small on a map and big in a pop-up. */
.cboard { position: relative; aspect-ratio: 600 / 400; background: url("../assets/contest-board.svg") center / 100% 100% no-repeat; container-type: inline-size; color: #4a240a; }
.cb-title { position: absolute; left: 28.5%; width: 46%; top: 4.6cqw; height: 7.4cqw; margin: 0; display: flex; align-items: center; justify-content: center; font: 800 3cqw var(--head-font); color: #5a2f10; white-space: nowrap; }
.cb-cals { position: absolute; left: 6%; right: 6%; top: 13.5cqw; display: grid; grid-template-columns: 1fr 1fr; gap: 4%; }
.cb-item { display: grid; justify-items: center; text-align: center; }
.cb-cal { position: relative; width: 25cqw; aspect-ratio: 200 / 220; margin-top: .8cqw; background: url("../assets/calendar-page.svg") center / 100% 100% no-repeat; }
.cb-mon { position: absolute; top: 8%; height: 21%; left: 2%; right: 2%; display: flex; align-items: center; justify-content: center; color: #fff; font: 800 2.7cqw var(--head-font); letter-spacing: .06em; white-space: nowrap; }
.cb-day { position: absolute; top: 33%; left: 0; right: 4%; text-align: center; font: 800 13.5cqw/1 var(--head-font); color: #a3231c; }
.cb-day.cb-word { top: 42%; font-size: 7.5cqw; }
.cb-name { margin: 0; height: 6cqw; line-height: 6cqw; white-space: nowrap; font: 800 4.4cqw/6cqw var(--body-font); color: #fff7e2; text-shadow: 0 1px 2px #3b1f05, 0 0 6px rgba(59,31,5,.6); }
.cb-left { margin: .8cqw 0 0; font: 800 3.3cqw/1.2 var(--body-font); color: #ffe7a8; text-shadow: 0 1px 2px #3b1f05; white-space: nowrap; }
.cb-item.soon .cb-day { animation: cb-pulse 1.4s ease-in-out infinite; }
@keyframes cb-pulse { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .cb-item.soon .cb-day { animation: none; } }
.cboard-big { width: min(100%, 520px); margin: 6px auto 14px; }
.contest-corner { position: absolute; z-index: 6; }
.cc-board { display: block; cursor: pointer; border-radius: 22px; transition: transform .2s; }
.cc-board:hover, .cc-board:focus-visible { transform: scale(1.04); outline: none; }
.cc-board:focus-visible .cboard { filter: drop-shadow(0 0 6px #ffd76a); }
.cc-welcome { left: 1.2%; bottom: calc(34px + env(safe-area-inset-bottom, 0px)); width: clamp(220px, 24vw, 320px); }
.cc-map { left: 1.2%; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); width: clamp(200px, 20vw, 280px); }
.cc-pill { display: none; }
@media (max-width: 640px) {
  .cc-board { display: none; }
  .cc-pill { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid #c98a1b; background: linear-gradient(180deg, #b9783a, #8e5322); color: #fff7e2; font: 800 .95rem var(--head-font); box-shadow: 0 3px 10px rgba(0,0,0,.4); cursor: pointer; }
  .contest-corner { width: auto; }
  .cc-welcome { left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .cc-map { position: fixed; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto; }
}
.contest-list { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.contest { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #fff6dc; border: 1px solid #e3c98a; color: var(--ink); }
.ct-main { display: grid; gap: 2px; }
.ct-main span { font-size: .85rem; color: var(--ink-soft); }
.ct-link { font-size: .85rem; font-weight: 700; color: #1f5fae; white-space: nowrap; }
.ct-note { font-size: .8rem; }
@media (max-width: 640px) { .contest { grid-template-columns: 1fr; } }
/* Why thinking math (parents) */
.parent-value { margin: 14px 0 6px; padding: 14px 16px; border-radius: 12px; background: #fff6dc; border: 1px solid #e3c98a; text-align: left; }
.parent-value h2, .parents-card h2 { margin: 0 0 8px; font: 700 1.3rem var(--head-font); color: #8b5a1f; }
.parents-card h2 { margin-top: 22px; }
.pv-lead { margin: 0 0 10px; }
.pv-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.pv-list li { line-height: 1.45; }
/* Membership status on the member map */
.plan-strip { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 21; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 240px); padding: 7px 14px; border-radius: 999px; border: 2px solid #c98a1b; background: rgba(251, 241, 211, .95); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.35); white-space: nowrap; }
.plan-strip.paid { border-color: #d4a02a; background: linear-gradient(180deg, #fff3c4, #f6d77a); }
.plan-strip:hover, .plan-strip:focus-visible { outline: 3px solid #ffd76a; }
.ps-kind { font-weight: 800; }
.ps-when { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.ps-more { font-weight: 700; color: #8b5a1f; }
@media (max-width: 640px) { .plan-strip { position: fixed; top: auto; bottom: calc(176px + env(safe-area-inset-bottom, 0px)); max-width: calc(100% - 24px); font-size: .85rem; gap: 8px; } .ps-more { display: none; } }
.benefit-list { list-style: none; margin: 10px 0 16px; padding: 0; display: grid; gap: 6px; text-align: left; }
.benefit-list li { display: grid; grid-template-columns: 26px 1fr; column-gap: 6px; align-items: baseline; }
.benefit-list li span { color: var(--ok); font-weight: 800; }
.benefit-list li small { grid-column: 2; color: var(--ink-soft); }
.benefit-list li.off b { color: #8a7a60; }
.email-pref { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 12px 16px; border-radius: 12px; color: var(--ink); cursor: pointer; max-width: 560px; }
.email-pref input { width: 22px; height: 22px; margin-top: 2px; accent-color: #2f8a4f; }
.email-pref span { display: grid; gap: 2px; }
.email-pref small { color: var(--ink-soft); }
.early-terms { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: #fff4d6; border: 2px solid #e0a12a; text-align: left; color: var(--ink); }
.early-terms .et-head { margin: 0 0 6px; font-weight: 800; font-size: 1.05rem; }
.early-terms ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.early-terms li { line-height: 1.45; font-size: .93rem; }
/* Owner: member list */
.owner-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0 0 18px; }
.owner-stats div { display: grid; gap: 2px; padding: 14px 16px; border-radius: 12px; color: var(--ink); text-align: center; }
.owner-stats b { font: 800 1.8rem var(--head-font); color: #8b5a1f; }
.owner-stats span { font-size: .85rem; color: var(--ink-soft); }
.owner-table { border-radius: 12px; overflow-x: auto; color: var(--ink); }
.owner-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.owner-table th, .owner-table td { padding: 10px 12px; border-bottom: 1px solid #e3c98a; text-align: left; vertical-align: top; }
.owner-table th { background: #f3ead8; font-weight: 800; white-space: nowrap; }
.owner-table tr.paid td { background: #eef6ea; }
.owner-table small { color: var(--ink-soft); }
.ow-new { display: inline-block; padding: 1px 7px; border-radius: 8px; background: #2f8f4e; color: #fff; font-size: .72rem; font-weight: 800; vertical-align: middle; }
.owner-table .warn { color: #b8382c; }
.owner-h { margin: 22px 0 8px; font: 700 1.3rem var(--head-font); color: #ffd76a; }
.owner-h small { font: 700 1rem var(--body-font); color: #f6ecd6; margin-left: 6px; }
.install-card h2 { margin: 18px 0 8px; font: 700 1.2rem var(--head-font); color: #8b5a1f; }
.ins-steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 8px; text-align: left; line-height: 1.5; }
.ins-ico { display: inline-block; padding: 0 6px; border: 1px solid #8b5a1f; border-radius: 6px; font-size: .9em; }
.ins-more { margin: 8px 0; padding: 8px 12px; border-radius: 10px; background: #fff6dc; border: 1px solid #e3c98a; text-align: left; }
.ins-more summary { cursor: pointer; font-weight: 700; }
.ow-hero + .ow-hero { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e3c98a; }
.delete-acct { margin-top: 28px; opacity: .85; }
.login-note { background: #eef6ea; border: 1px solid #2f8a4f; border-radius: 10px; padding: 10px 12px; color: #1f5a26; font-weight: 700; }
.nowrap { white-space: nowrap; }
.owner-fab { position: absolute; left: calc(12px + env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 22; padding: 6px 12px; border-radius: 999px; background: #3b1f05; color: #ffd76a; border: 2px solid #ffd76a; font: 800 .8rem var(--head-font); text-decoration: none; box-shadow: 0 3px 10px rgba(0,0,0,.45); }
.owner-fab:hover, .owner-fab:focus-visible { background: #5a2f10; }
/* owner-only link (owner 2026-11-02): bottom-left corner, never over the title */
.artscreen.art-map .owner-fab { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
/* Tablets: larger text and pictures for children (see markTablet in app.js) */
.tablet .quiz, .tablet .wrap, .tablet .wrap-narrow { zoom: 1.3; }
.tablet .modal { zoom: 1.15; }
.tablet .site-header { zoom: 1.15; }
/* Invite friends */
.invite { margin: 20px 0 0; padding: 18px 20px; border-radius: 14px; color: var(--ink); max-width: 720px; }
.invite .section-title { margin-top: 0; text-align: left; color: var(--ink); font-size: 1.4rem; }
.iv-link { display: flex; gap: 8px; margin: 10px 0; }
.iv-link input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid #c9a46a; background: #fff; font: 600 .95rem var(--body-font); color: var(--ink); }
.iv-count { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.iv-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed #c9a46a; font-weight: 800; color: #8a7a60; }
.iv-dot.on { border: 2px solid var(--ok); background: #eef6ea; color: var(--ok); }
.iv-ok { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: #eef6ea; color: #1f5a26; font-weight: 700; }
.iv-tip { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: #fff6dc; }

/* Previous / Next stay at the bottom of the screen while answering, so kids never scroll to find Next. */
.quiz .q-nav { position: sticky; bottom: 0; z-index: 5; margin: 18px -10px 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(11, 16, 48, 0) 0%, rgba(11, 16, 48, 0.88) 35%, rgba(11, 16, 48, 0.96) 100%); border-radius: 16px 16px 0 0; }
.quiz .q-nav .btn { min-height: 52px; }
.quiz .q-nav .btn-gold.ready { animation: next-pulse 1.2s ease-in-out 2; }
@keyframes next-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.35); } }
.map-bar .btn { white-space: nowrap; }
.daily-pref { flex-wrap: wrap; align-items: center; cursor: default; }
.daily-pref label { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 260px; cursor: pointer; }
.daily-pref select { font: inherit; padding: 6px 10px; border-radius: 10px; border: 1px solid #c9a46a; background: #fffaf0; color: var(--ink); }

.form-foot.help { font-size: .82rem; }

/* Halloween (Oct 1 – Nov 7, js/spooky.js) */
.spooky-hi { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; margin: 0; padding: 6px 18px; border-radius: 999px; background: #2b0f4ccc; border: 2px solid #ff9a1f; color: #ffb347; font-weight: 800; font-size: clamp(14px, 2.4vw, 20px); white-space: nowrap; pointer-events: none; }
html.spooky .btn-gold { background: linear-gradient(#ffb347, #ff7a00); border-color: #7a3a00; color: #2b0f4c; }

/* Submit: "Loading..." with a spinner while the answers are graded */
.btn.is-loading { opacity: .9; cursor: progress; }
.btn .spin { display: inline-block; width: 1em; height: 1em; margin-right: .4em; vertical-align: -.15em; border: .18em solid currentColor; border-right-color: transparent; border-radius: 50%; animation: btn-spin .8s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
/* phones held upright: the painted speaker and gear are off the side of the wide map, so they become
   round buttons pinned to the top right corner */
@media (max-width: 700px) and (orientation: portrait) {
  .art-map .hs-sound, .art-map .hs-settings { position: fixed; left: auto; top: calc(10px + env(safe-area-inset-top, 0px)); width: 46px; height: 46px; z-index: 30;
    border-radius: 50%; background: rgba(74, 42, 16, .88); border: 2px solid #ffd76a; box-shadow: 0 3px 8px #0006; display: grid; place-items: center; font-size: 22px; line-height: 1; }
  .art-map .hs-sound { right: 64px; } .art-map .hs-settings { right: 10px; }
  .art-map .hs-sound::before { content: '🔊'; } .art-map .hs-settings::before { content: '⚙️'; }
}

/* Members' gift banner (until Oct 31) */
.gift-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; display: block; width: max-content; max-width: min(92vw, 720px); padding: 8px 18px; border-radius: 999px; background: linear-gradient(90deg, #e8590c, #ff922b); border: 2px solid #ffe066; color: #fff; font-weight: 800; font-size: clamp(13px, 2.2vw, 18px); text-align: center; text-decoration: none; box-shadow: 0 6px 16px #0006; animation: gift-pulse 2.4s ease-in-out infinite; }
.gift-banner span { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: #fff; color: #c2410c; }
@keyframes gift-pulse { 50% { transform: translateX(-50%) scale(1.04); } }
@media (max-width: 700px) { .gift-banner { position: fixed; top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); white-space: normal; width: 92vw; border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .gift-banner { animation: none; } }

/* ===== Quest mode: 4 stages × 5 challenges (js/app.js viewQuest) ===== */
.qm-coins { padding: 6px 14px; font: 700 1.05rem var(--body-font); color: var(--gold-ink); background: linear-gradient(#ffe48a, #e0a12a); border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.qm-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 14px; }
.qm-stage { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(201,182,232,.3); opacity: .7; }
.qm-stage.now { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,215,106,.35); }
.qm-stage.won { opacity: 1; background: rgba(47,138,79,.18); border-color: rgba(120,210,150,.6); }
.qm-foe { font-size: 1.5rem; line-height: 1; }
.qm-pips { display: flex; gap: 4px; }
.qm-pips i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); }
.qm-pips i.hit { background: #ffd76a; border-color: #fff3c4; box-shadow: 0 0 6px #ffd76a; }
.qm-pips i.miss { background: #8a6db8; border-color: #b9a2e0; }
.qm-pips i.cur { background: #fff; animation: qm-blink 1s ease-in-out infinite; }
.qm-land { font: 700 .7rem var(--head-font); letter-spacing: .06em; color: var(--muted-on-night); }
@keyframes qm-blink { 50% { transform: scale(1.35); } }
.qm-arena { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.qm-monster { display: grid; justify-items: center; gap: 4px; flex: none; }
.qm-face { font-size: clamp(2.6rem, 9vw, 3.4rem); line-height: 1; animation: qm-bob 2.4s ease-in-out infinite; }
@keyframes qm-bob { 50% { transform: translateY(-5px) rotate(-4deg); } }
.qm-hp { display: block; width: 64px; height: 8px; border-radius: 99px; background: rgba(0,0,0,.4); overflow: hidden; }
.qm-hp i { display: block; height: 100%; background: linear-gradient(90deg, #e2483a, #ff8a5c); transition: width .5s; }
.qm-say { margin: 0; color: var(--text-on-night); font-size: 1rem; }
.qm-say b { color: var(--gold); }
.qm-hint { clear: both; margin: -6px 0 16px; padding: 10px 14px; border-radius: 10px; background: #fff7d6; border: 2px dashed #e0a12a; color: #3a1e00; font-weight: 600; }
.qm-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 0; }
.qm-tool small { margin-left: 4px; font-weight: 700; color: var(--gold); }
.qm-go { justify-content: center; }
.qm-go .btn { min-width: 220px; font-size: 1.2rem; }
.qm-rule { text-align: center; color: var(--muted-on-night); margin: 6px 0 0; font-size: .9rem; }
.qm-clear { margin: 10px auto 0; max-width: 560px; padding: 26px 20px; text-align: center; }
.qm-clear h1 { margin: 6px 0 8px; font: 700 clamp(1.5rem, 5vw, 2rem) var(--head-font); color: var(--ink); }
.qm-chest { font-size: 4rem; line-height: 1; animation: qm-pop .7s cubic-bezier(.2,1.6,.4,1) both; }
.qm-big { font-size: 1.15rem; font-weight: 700; color: #3a1e00; }
.qm-loot { font: 700 1.4rem var(--body-font); color: #a8660b; animation: qm-pop .6s .3s cubic-bezier(.2,1.6,.4,1) both; }
.qm-loot small { display: block; font-size: .9rem; color: var(--ink-soft); }
@keyframes qm-pop { from { transform: scale(0) rotate(-20deg); opacity: 0; } }
.qm-fx { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 16px; background: rgba(8,5,25,.55); cursor: pointer; animation: qm-fade .2s both; }
.qm-fx-card { max-width: 420px; padding: 22px 22px 16px; text-align: center; border-radius: 22px; background: var(--parchment-hi); border: 4px solid var(--gold-2); box-shadow: 0 12px 40px rgba(0,0,0,.5); animation: qm-pop .45s cubic-bezier(.2,1.6,.4,1) both; }
.qm-fx.oops .qm-fx-card { border-color: #8a6db8; }
.qm-fx-card p { margin: 10px 0 8px; font: 800 1.3rem/1.35 var(--body-font); color: #2a1606; }
.qm-fx-big { font-size: 6rem; line-height: 1; }
.qm-fx.yay .qm-fx-big { animation: qm-spin 1s ease-out both; filter: drop-shadow(0 0 18px #ffd76a); }
.qm-fx.oops .qm-fx-big { animation: qm-wobble .8s ease-in-out 2; }
.qm-fx-tap { font-size: .85rem; color: var(--ink-soft); }
@keyframes qm-fade { from { opacity: 0; } }
@keyframes qm-spin { from { transform: scale(.2) rotate(-540deg); } 70% { transform: scale(1.25) rotate(10deg); } }
@keyframes qm-wobble { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.qm-toast { position: fixed; left: 50%; top: 16px; z-index: 8000; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.4); animation: qm-fade .3s both; }
@media (max-width: 560px) {
  .qm-bar { gap: 4px; }
  .qm-pips i { width: 9px; height: 9px; }
  .qm-say { font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) { .qm-face, .qm-fx-big, .qm-chest, .qm-loot, .qm-fx-card, .qm-pips i.cur { animation: none !important; } }

/* Energy ⚡ (owner 2026-11-02: replaces coins) */
.qm-energy { display: inline-flex; gap: 2px; padding: 5px 10px; border-radius: 999px; background: #2b2340; box-shadow: 0 2px 8px rgba(0,0,0,.3); font-size: 1.15rem; line-height: 1; }
.qm-energy i { font-style: normal; filter: grayscale(1) brightness(.6); opacity: .55; }
.qm-energy i.on { filter: none; opacity: 1; }
.qm-games { position: fixed; inset: 0; z-index: 900; background: #fdf6e3; }
.qm-games iframe { width: 100%; height: 100%; border: 0; display: block; }
.qm-games-open, .qm-games-open body { overflow: hidden; }
.qm-energy.drain { animation: qm-drain .6s 2; }
@keyframes qm-drain { 50% { transform: scale(1.15); box-shadow: 0 0 0 4px #e0474c; } }
.qm-lost { font: 800 1.3rem var(--body-font); color: #e0474c; margin: 4px 0; }
/* U.S. States Adventure monsters in the quest (owner 2026-11-02) */
.qm-foe-img { width: 34px; height: 34px; object-fit: contain; display: block; margin: 0 auto; }
.qm-face-img { width: clamp(84px, 24vw, 120px); height: clamp(84px, 24vw, 120px); object-fit: contain; animation: qm-bob 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.qm-ko-img { width: 150px; height: 150px; object-fit: contain; }
@media (prefers-reduced-motion: reduce) { .qm-face-img { animation: none !important; } }
.qm-top-right { display: inline-flex; align-items: center; gap: 8px; }
.qm-music { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #ffffff55; background: #2b2340; font-size: 1.2rem; cursor: pointer; }
.qm-pick h1 { margin-bottom: 4px; }
.qm-levels { display: grid; gap: 12px; margin: 18px 0; }
.qm-level { display: grid; gap: 4px; padding: 16px; border-radius: 16px; font-size: 1.35rem; text-align: center; color: #fff; border: 3px solid #0003; }
.qm-level small { font-size: 1rem; font-weight: 600; opacity: .95; }
.qm-level.easy { background: #2f9d55; } .qm-level.medium { background: #2d6cdf; } .qm-level.hard { background: #d6452a; }
.choice.qm-struck { opacity: .45; text-decoration: line-through; }
.qm-level-btn { padding: 6px 10px; border-radius: 999px; border: 2px solid #ffffff55; background: #2b2340; color: #fff; font: 700 .95rem var(--body-font); cursor: pointer; }
.qm-gate { width: 140px; font-size: 1.6rem; text-align: center; padding: 6px; border-radius: 10px; border: 2px solid var(--ink-soft, #555); display: block; margin: 8px auto 0; }
.qm-level.on { outline: 4px solid #ffd84d; }
.qm-verdict { font: 900 1.8rem var(--body-font); margin: 2px 0 6px; letter-spacing: .5px; }
.qm-verdict.yes { color: #1f9d55; } .qm-verdict.no { color: #d6452a; } .qm-verdict.try { color: #2d6cdf; }
/* Royal Palace: the castle on the map is a door (owner 2026-11-02) */
.art-map .hs-palace { left: 40.5%; top: 27%; width: 22%; height: 33%; border-radius: 30%; display: flex; align-items: flex-end; justify-content: center; }
.palace-tag { margin-bottom: 4%; padding: .25em .8em; border-radius: 999px; background: rgba(59,31,5,.88); color: #ffd76a; border: 2px solid #ffd76a; font: 800 clamp(.7rem, 1.6vw, 1.05rem) var(--head-font); white-space: nowrap; transition: transform .25s; animation: palace-float 2.6s ease-in-out infinite; }
/* owner 2026-11-02: no glowing frame — hovering the castle makes the sign bigger and it floats */
.art-map .hs-palace:hover, .art-map .hs-palace:focus-visible { background: none; box-shadow: none; }
.art-map .hs-palace:active { transform: none; }
.art-map .hs-palace:hover .palace-tag, .art-map .hs-palace:focus-visible .palace-tag { transform: scale(1.35); animation-duration: 1.2s; }
@keyframes palace-float { 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .palace-tag { animation: none; } }
.palace-page { max-width: 640px; }
.palace-head { text-align: center; padding: 18px; margin-bottom: 14px; }
.palace-h2 { color: #ffd76a; margin: 22px 0 8px; font-size: 1.4rem; }
.palace-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin: 10px 0; border-radius: 16px; background: #fff8e6; border: 3px solid #e0a12a; color: #3a1e00; text-decoration: none; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.palace-card.big { background: linear-gradient(#ffe48a, #f2b33d); }
.palace-card b { display: block; font-size: 1.3rem; } .palace-card small { display: block; font-size: 1rem; opacity: .85; }
.pc-em { font-size: 2.4rem; }
/* Logged in: the painted "Login" button is covered by "Enter the Kingdom" (owner 2026-11-02) */
.hs-login.is-in .enter-cover { position: absolute; inset: 4% 2%; display: flex; align-items: center; justify-content: center; gap: .4em; border-radius: 1.2vmin; background: linear-gradient(#1f4fa8, #0d2a66); border: .35vmin solid #e8b43c; color: #fff4c8; font: 800 clamp(.45rem, 1.75vw, 1.6rem) var(--head-font); line-height: 1.1; text-align: center; text-shadow: 0 2px 3px rgba(0,0,0,.5); box-shadow: inset 0 0 0 .3vmin #0b1e4a; overflow: hidden; padding: 0 4%; }
.hs-login.is-in .enter-cover b { color: #ffd76a; }
/* Royal Palace doors: each game's own picture + its name (owner 2026-11-02, like hte-learning.com) */
.palace-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.palace-door { display: block; border-radius: 16px; overflow: hidden; background: #fff8e6; border: 3px solid #e0a12a; color: #3a1e00; text-decoration: none; box-shadow: 0 3px 10px rgba(0,0,0,.3); transition: transform .2s; }
.palace-door:hover, .palace-door:focus-visible { transform: translateY(-4px) scale(1.03); }
.palace-door img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.palace-door.is-logo img { object-fit: contain; background: #fff; padding: 12%; }
.palace-door b { display: block; padding: 10px 8px; text-align: center; font-size: 1.15rem; }
/* Palace layout v2 (owner 2026-11-02): wide HTE gate on top, then one row of four doors */
.palace-page { max-width: 1100px; }
.palace-banner { position: relative; display: block; border-radius: 18px; overflow: hidden; border: 3px solid #e0a12a; box-shadow: 0 3px 12px rgba(0,0,0,.35); margin: 6px 0 16px; transition: transform .2s; }
.palace-banner:hover, .palace-banner:focus-visible { transform: translateY(-3px); }
.palace-banner img { display: block; width: 100%; aspect-ratio: 2.6 / 1; object-fit: cover; object-position: center 35%; }
.palace-banner b { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; text-align: center; color: #fff; font-size: 1.3rem; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.palace-doors { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .palace-doors { grid-template-columns: 1fr 1fr; } }
/* Suggested next level after a strong result (owner 2026-11-02: a grown-up decides) */
.level-tip { margin: 14px 0; padding: 14px 18px; border-radius: 14px; font-size: 1.1rem; }
.level-tip p { margin: 0 0 10px; }
.level-tip .row { gap: 10px; flex-wrap: wrap; }
