:root {
  --navy: #062957;
  --navy-deep: #031b3b;
  --blue: #1478c9;
  --blue-light: #86d8ff;
  --gold: #d59b24;
  --gold-light: #f5d783;
  --paper: #fffaf0;
  --ink: #173154;
  --green: #0c6d4c;
  --shadow: 0 22px 65px rgba(3, 27, 59, .24);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; }
button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 4px solid var(--blue-light); outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden, .image-hotspot span, .book-card-hotspot span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.back-control {
  position: fixed; top: max(.7rem, env(safe-area-inset-top)); left: max(.7rem, env(safe-area-inset-left)); z-index: 80;
  min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; padding: .65rem 1rem;
  color: white; background: rgba(3, 27, 59, .9); border: 2px solid var(--gold); border-radius: 999px;
  box-shadow: 0 6px 20px rgba(3,27,59,.25); text-decoration: none; font: 700 .95rem Arial, Helvetica, sans-serif;
  backdrop-filter: blur(8px);
}
.back-control:hover { filter: brightness(1.15); }

.entry-page { min-height: 100vh; background: linear-gradient(#dff3ff, #f8fbff); }
.mystery-header {
  min-height: 70px; padding: .65rem clamp(1rem, 4vw, 4rem); display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; color: white; background: linear-gradient(135deg,var(--navy-deep),var(--navy));
  border-bottom: 3px solid var(--gold); box-shadow: 0 7px 20px rgba(3,27,59,.2);
}
.nav-pill {
  width: fit-content; min-height: 44px; display: inline-flex; align-items: center; gap: .45rem; padding: .62rem 1rem;
  color: white; background: rgba(255,255,255,.08); border: 1px solid rgba(245,215,131,.72); border-radius: 999px; cursor: pointer;
}
.nav-pill:hover { background: rgba(255,255,255,.16); }
.npa-mark {
  width: 48px; height: 48px; display: grid; place-items: center; color: var(--gold-light); font-weight: 800;
  border: 2px solid var(--gold); border-radius: 50% 50% 44% 44%; box-shadow: inset 0 0 0 3px var(--navy), inset 0 0 0 4px var(--gold);
}
.entry-main { min-height: calc(100vh - 70px); display: grid; place-items: center; align-content: center; gap: 1rem; padding: clamp(1rem,4vw,3rem); }
.button-three-card {
  position: relative; width: min(1100px,100%); display: block; overflow: hidden; border-radius: 24px; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.button-three-card:hover { transform: translateY(-4px); box-shadow: 0 28px 75px rgba(3,27,59,.27); }
.button-three-card img { display: block; width: 100%; height: auto; }
.card-glimmer { position: absolute; inset: 0; background: linear-gradient(110deg,transparent 35%,rgba(255,255,255,.22) 48%,transparent 61%); transform: translateX(-110%); transition: transform .7s ease; pointer-events: none; }
.button-three-card:hover .card-glimmer { transform: translateX(110%); }
.entry-progress { margin: 0; color: var(--navy); font: 700 1rem Arial,Helvetica,sans-serif; }

.art-page { background: var(--navy-deep); overflow-x: hidden; }
.art-shell { width: min(1672px, 100%); margin: 0 auto; }
.interactive-art { position: relative; width: 100%; }
.interactive-art > img, .crop-stage > img { display: block; width: 100%; height: auto; }
.image-hotspot, .book-card-hotspot {
  position: absolute; z-index: 12; border: 0; color: transparent; background: transparent; cursor: pointer; border-radius: 999px;
}
.image-hotspot:hover, .image-hotspot:focus-visible, .book-card-hotspot:hover, .book-card-hotspot:focus-visible {
  background: rgba(121, 207, 255, .15); box-shadow: 0 0 0 3px rgba(245,215,131,.85), 0 0 22px 8px rgba(121,207,255,.7);
}

.books-art { aspect-ratio: 1672 / 941; }
.desktop-book-actions .read-one { left: 18.3%; top: 65.7%; width: 13%; height: 3.3%; }
.desktop-book-actions .buy-one { left: 18.3%; top: 69.1%; width: 13%; height: 3.3%; }
.desktop-book-actions .read-two { left: 35.2%; top: 65.7%; width: 12.8%; height: 3.3%; }
.desktop-book-actions .buy-two { left: 35.2%; top: 69.1%; width: 12.8%; height: 3.3%; }
.desktop-book-actions .read-three { left: 51.8%; top: 65.7%; width: 12.8%; height: 3.3%; }
.desktop-book-actions .buy-three { left: 51.8%; top: 69.1%; width: 12.8%; height: 3.3%; }
.desktop-book-actions .read-four { left: 68%; top: 65.7%; width: 12.8%; height: 3.3%; }
.desktop-book-actions .buy-four { left: 68%; top: 69.1%; width: 12.8%; height: 3.3%; }
.mobile-book-cards { display: none; }
.solve-mystery-live {
  position: absolute; z-index: 14; left: 58.8%; top: 84.2%; width: 19.4%; height: 5.2%; min-height: 38px;
  display: flex; align-items: center; justify-content: center; padding: .15rem .5rem;
  color: var(--gold-light); background: linear-gradient(#0b4f96, var(--navy)); border: 3px solid var(--gold);
  border-radius: 999px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 5px 14px rgba(3,27,59,.28);
  text-decoration: none; text-align: center; font-size: clamp(.72rem, 1.45vw, 1.55rem); font-weight: 800;
}
.solve-mystery-live:hover { filter: brightness(1.13); box-shadow: 0 0 0 3px rgba(245,215,131,.35), 0 0 24px rgba(121,207,255,.8); }

.gentle-toast {
  position: fixed; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 100; transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem)); padding: .9rem 1.1rem; color: white; background: rgba(3,27,59,.96);
  border: 2px solid var(--gold); border-radius: 12px; box-shadow: var(--shadow); text-align: center;
  font: 700 1rem/1.4 Arial, Helvetica, sans-serif;
}

.book-dialog { width: min(480px, calc(100% - 2rem)); padding: 1.5rem; color: var(--ink); background: var(--paper); border: 3px solid var(--gold); border-radius: 18px; box-shadow: var(--shadow); }
.book-dialog::backdrop { background: rgba(3,27,59,.62); backdrop-filter: blur(4px); }
.dialog-close { position: absolute; right: .65rem; top: .5rem; width: 44px; height: 44px; border: 0; background: transparent; color: var(--navy); font-size: 2rem; cursor: pointer; }
.dialog-kicker { margin: 0; color: #8b5d0a; font: 800 .78rem Arial, Helvetica, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.book-dialog h2 { margin: .5rem 2rem 1.25rem 0; color: var(--navy); font-size: 1.8rem; }
.dialog-actions { display: grid; gap: .7rem; }
.dialog-actions button, .certificate-controls a, .certificate-controls button {
  min-height: 48px; padding: .7rem 1rem; color: white; background: linear-gradient(#0b4f96, var(--navy)); border: 2px solid var(--gold);
  border-radius: 999px; font-weight: 800; text-align: center; text-decoration: none; cursor: pointer;
}

.mystery-art-page { min-height: 100vh; overflow-x: hidden; background: #e8f3f8; }
.mystery-art-shell { min-height: 100vh; display: grid; place-items: center; }
.mystery-art-stage { position: relative; width: min(1672px, 100vw); aspect-ratio: 1672 / 941; overflow: hidden; }
.mystery-approved-art { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.mobile-mystery-header, .mobile-entry-heading { display: none; }
.mystery-art-stage .clue-pieces { position: absolute; z-index: 8; left: 34.2%; top: 31.1%; width: 31.9%; height: 12.1%; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .5%; align-items: center; }
.clue-piece {
  position: relative; width: 100%; height: 100%; min-height: 0; padding: 0; color: #8d5d0c; background: linear-gradient(145deg,#fff,#ffedc3);
  border: max(2px, .17vw) solid var(--gold); cursor: pointer; transition: transform .25s ease, color .55s ease, background .55s ease, filter .55s ease;
  clip-path: polygon(10% 0,39% 0,44% 10%,56% 10%,61% 0,90% 0,100% 10%,100% 39%,90% 44%,90% 56%,100% 61%,100% 90%,90% 100%,61% 100%,56% 90%,44% 90%,39% 100%,10% 100%,0 90%,0 61%,10% 56%,10% 44%,0 39%,0 10%);
}
.clue-piece:hover { filter: brightness(1.04); }
.clue-piece span { display: block; font-size: clamp(1rem, 2.8vw, 2.9rem); font-weight: 800; }
.clue-piece small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.clue-piece.is-solved { color: white; background: linear-gradient(145deg,var(--blue-light),var(--blue)); border-color: white; filter: drop-shadow(0 8px 10px rgba(20,120,201,.35)); }
.clue-piece.just-solved::after {
  content: "✦  ❄  ✦"; position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: clamp(1.3rem, 3vw, 2.5rem);
  text-shadow: 0 0 8px white, 0 0 16px #fff, 0 0 26px var(--blue-light); animation: piece-sparkle 1.15s ease-out both;
}
@keyframes piece-sparkle { 0% { opacity: 0; transform: scale(.6) rotate(-8deg); } 30% { opacity: 1; transform: scale(1.25) rotate(5deg); } 100% { opacity: 0; transform: scale(1.65) rotate(12deg); } }
.mystery-art-stage .clue-entry { position: absolute; z-index: 10; inset: 0; padding: 0; border: 0; background: transparent; }
.mystery-art-stage .clue-input-grid { position: absolute; left: 15.2%; top: 55.4%; width: 69.8%; height: 13.4%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1%; text-align: left; }
.clue-input-grid label { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; padding: 0 .6%; }
.clue-input-grid label > span { display: block; margin: 0 0 4%; color: var(--navy); text-align: center; font-weight: 800; font-size: clamp(.65rem, 1.35vw, 1.35rem); }
.clue-input-grid input { width: 100%; height: 51%; min-height: 0; padding: 0 6%; color: var(--ink); background: white; border: max(1px, .12vw) solid #9da8b6; border-radius: .35rem; font-family: Arial, Helvetica, sans-serif; font-size: clamp(.55rem, 1.05vw, 1.05rem); box-shadow: 0 1px 3px rgba(3,27,59,.12); }
.clue-input-grid input:disabled { color: #0b6548; background: #eaf8f4; border-color: #72b6a0; font-weight: 800; }
.field-message { position: absolute; left: 0; right: 0; top: 100%; display: block; min-height: 0; margin-top: .1rem; text-align: center; font: 700 clamp(.5rem, .75vw, .75rem)/1.2 Arial, Helvetica, sans-serif; }
.success { color: #0b6548; }
.try-again { color: #9a3f28; }
.mystery-art-stage .submit-answer { position: absolute; left: 35.5%; top: 70.4%; width: 29%; height: 7.6%; min-height: 0; min-width: 0; margin: 0; padding: 0 1%; color: white; background: linear-gradient(#12845f,var(--green)); border: max(2px, .18vw) solid var(--gold); border-radius: 999px; box-shadow: 0 6px 14px rgba(3,27,59,.18); font-size: clamp(.65rem, 1.45vw, 1.55rem); font-weight: 800; cursor: pointer; }
.submit-answer:hover { filter: brightness(1.12); }
.form-message { position: absolute; left: 25%; right: 25%; top: 78%; min-height: 1.2em; margin: 0; text-align: center; font: 800 clamp(.55rem, .85vw, .85rem)/1.3 Arial, Helvetica, sans-serif; }
.form-message a { color: var(--navy); }
.mystery-back { position: absolute; z-index: 12; left: 45%; top: 82.4%; width: 10.2%; height: 5.6%; display: flex; align-items: center; justify-content: center; gap: 8%; color: white; background: linear-gradient(#0b4f96,var(--navy)); border: max(2px, .15vw) solid var(--gold); border-radius: 999px; box-shadow: 0 4px 10px rgba(3,27,59,.22); text-decoration: none; font-size: clamp(.6rem, 1.15vw, 1.1rem); font-weight: 800; }
.mystery-back:hover { filter: brightness(1.15); }
.sparkle-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.sparkle-layer span { position: absolute; left: var(--x); top: -3rem; color: var(--gold); font-size: clamp(1rem,2.2vw,2rem); text-shadow: 0 0 8px white; animation: celebration 1.8s var(--delay) ease-out both; }
@keyframes celebration { 0% { opacity: 0; transform: translateY(-2rem) scale(.3) rotate(0); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--drift),105vh) scale(1.2) rotate(260deg); } }

.cropped-shell { height: 100vh; overflow: hidden; }
.cropped-art { height: 100%; overflow: hidden; }
.crop-stage { position: absolute; inset: 0; aspect-ratio: 1672 / 941; transform-origin: center bottom; }
.solved-art .crop-stage { transform: scale(1.13); }
.archive-art .crop-stage { transform: scale(1.09); }
.archive-page .archive-shell {
  width: 100%; height: 100svh; min-height: 0; padding: 64px 12px 12px;
  display: grid; place-items: center; overflow: visible;
}
.archive-page .archive-art {
  width: min(1672px, 100%, calc((100svh - 76px) * 1672 / 867));
  height: auto; aspect-ratio: 1672 / 867; overflow: hidden;
}
/* Hide the obsolete top menu only; preserve the complete bottom and Back button. */
.archive-page .archive-art .crop-stage {
  inset: auto; top: -8.535179%; left: 0; width: 100%; height: 108.535179%;
  aspect-ratio: 1672 / 941; transform: none; container-type: inline-size;
}
.archive-friends {
  position: absolute; left: 62.74%; top: 65.57%; width: 23.57%; height: 20.9%;
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1.3%;
  background: #fff4d9;
}
.archive-friends figure { min-width: 0; margin: 0; display: grid; grid-template-rows: minmax(0,1fr) auto; gap: .3cqw; }
.archive-friends svg { display: block; width: 100%; height: 100%; border: .12cqw solid #bc8529; background: #edf5fb; }
.archive-friends figcaption { color: #06194b; text-align: center; font: 1.02cqw/1.3 Georgia,serif; padding: .15cqw 0; }
.archive-book-teaser {
  position: absolute; left: 60.43%; top: 52.1%; width: 16.98%; height: 5.88%;
  margin: 0; padding: .12cqw .1cqw; color: #06194b; background: #fff3d3;
  font: .96cqw/1.12 Georgia,serif;
}
.solved-page .solved-shell {
  width: 100%; height: 100svh; min-height: 0; padding: 76px 12px 12px;
  display: grid; place-items: center; overflow: visible;
}
.solved-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: max(.55rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) .55rem max(.75rem, env(safe-area-inset-left));
  background: rgba(3,27,59,.96); border-bottom: 3px solid var(--gold);
}
.solved-nav .back-control, .solved-nav .academy-exit {
  position: static; margin: 0; min-height: 44px; box-shadow: none;
}
.mobile-solved-panel { display: none; }
.solved-page .solved-art {
  width: min(1672px, 100%, calc((100svh - 88px) * 1672 / 823));
  height: auto; aspect-ratio: 1672 / 823; overflow: hidden;
}
/* Remove only the obsolete menu strip; fit every remaining pixel and both actions. */
.solved-page .solved-art .crop-stage {
  inset: auto; top: -14.337789%; left: 0; width: 100%; height: 114.337789%;
  aspect-ratio: 1672 / 941; transform: none;
}
.solved-certificate { left: 26.5%; top: 88.3%; width: 19.7%; height: 5.5%; }
.solved-archive { left: 53.8%; top: 88.3%; width: 19.7%; height: 5.5%; }
.archive-back { left: 43.5%; top: 92.3%; width: 12.5%; height: 5.5%; }

.certificate-page { min-height: 100vh; padding: 5rem 1rem 2rem; background: #e8f3fa; }
.certificate-page main { width: min(1050px, 100%); margin: 0 auto; }
.certificate-page main img { display: block; width: 100%; height: auto; box-shadow: var(--shadow); }
.certificate-controls { position: fixed; top: 0; left: 0; right: 0; z-index: 50; min-height: 64px; display: flex; justify-content: center; align-items: center; gap: .65rem; padding: .55rem 1rem; background: rgba(3,27,59,.96); border-bottom: 3px solid var(--gold); }
.certificate-controls a, .certificate-controls button { min-height: 44px; padding: .5rem .9rem; }

@media (max-width: 760px) {
  .back-control { min-height: 40px; padding: .5rem .75rem; font-size: .82rem; }
  .desktop-book-actions { display: none; }
  .mobile-book-cards { display: block; }
  .book-card-hotspot { top: 26.5%; width: 15.2%; height: 46%; border-radius: 10px; }
  .card-one { left: 17.5%; }
  .card-two { left: 34.7%; }
  .card-three { left: 51.4%; }
  .card-four { left: 67.7%; }
  .solve-mystery-live { left: 50%; top: auto; bottom: 1rem; transform: translateX(-50%); width: min(330px, calc(100% - 2rem)); height: 46px; font-size: 1rem; }
  .mystery-art-shell { display: block; min-height: 100vh; padding: max(1rem, env(safe-area-inset-top)) .8rem max(1rem, env(safe-area-inset-bottom)); background: linear-gradient(rgba(244,249,252,.88),rgba(244,249,252,.9)), url("../../assets/mystery-page-reference.png") center / cover fixed; }
  .mystery-art-stage { width: min(540px,100%); min-height: calc(100vh - 2rem); margin: 0 auto; aspect-ratio: auto; overflow: visible; padding: 1rem; background: rgba(255,250,240,.96); border: 3px double var(--gold); border-radius: 22px; box-shadow: var(--shadow); }
  .mystery-approved-art { display: none; }
  .mobile-mystery-header { display: flex; flex-direction: column; text-align: center; }
  .mobile-mystery-header h2 { order: 1; margin: 0; color: var(--navy); font-size: clamp(2.15rem,11vw,3.8rem); line-height: .98; }
  .mobile-mystery-header > p:first-child { order: 2; margin: .55rem 0 0; color: #8b5d0a; font: 800 .82rem/1.35 Arial,Helvetica,sans-serif; }
  .mobile-mystery-header .careful-copy { order: 3; margin: .75rem auto 0; color: #164a91; font: italic 700 1rem/1.2 Georgia,serif; }
  .mobile-entry-heading { display: block; margin: 1.1rem 0 .55rem; color: var(--navy); text-align: center; font-size: 1.7rem; }
  .mystery-art-stage .clue-pieces { position: relative; left: auto; top: auto; width: min(430px,100%); height: auto; margin: .8rem auto 0; grid-template-columns: repeat(2,1fr); gap: .65rem; }
  .clue-piece { min-height: 92px; border-width: 3px; }
  .clue-piece span { font-size: 2.2rem; }
  .mystery-art-stage .clue-entry { position: relative; inset: auto; z-index: 10; }
  .mystery-art-stage .clue-input-grid { position: relative; left: auto; top: auto; width: 100%; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
  .clue-input-grid label { display: block; padding: .65rem; background: rgba(255,246,223,.9); border: 1px solid rgba(213,155,36,.65); border-radius: 12px; }
  .clue-input-grid label > span { margin: 0 0 .4rem; font-size: 1rem; }
  .clue-input-grid input { height: 48px; min-height: 48px; padding: .7rem; border-width: 2px; font-size: 1rem; }
  .field-message { position: static; min-height: 2.4em; margin-top: .3rem; font-size: .75rem; }
  .mystery-art-stage .submit-answer { position: relative; left: auto; top: auto; width: min(360px,100%); height: 52px; min-height: 52px; margin: .8rem auto 0; display: block; border-width: 3px; font-size: 1.05rem; }
  .form-message { position: relative; left: auto; right: auto; top: auto; min-height: 1.4em; margin: .65rem 0 0; font-size: .85rem; }
  .mystery-back { position: relative; left: auto; top: auto; width: 122px; height: 46px; margin: .8rem auto 0; border-width: 2px; font-size: .95rem; }
  .cropped-shell { height: auto; min-height: 100vh; display: grid; place-items: center; }
  .cropped-art { width: 100%; aspect-ratio: 1672 / 941; }
  .solved-page { overflow-x: hidden; background: linear-gradient(#dff3ff,#fffaf0); }
  .solved-page .solved-shell { width: 100%; height: auto; min-height: 100svh; padding: 5.8rem .85rem 2rem; display: block; }
  .solved-page .solved-art { display: none; }
  .solved-nav { align-items: stretch; }
  .solved-nav .back-control, .solved-nav .academy-exit { flex: 1 1 0; justify-content: center; padding: .55rem .45rem; text-align: center; font-size: .78rem; }
  .mobile-solved-panel {
    display: block; width: min(560px,100%); margin: 0 auto; padding: clamp(1.25rem,5vw,2rem);
    color: var(--ink); background: rgba(255,250,240,.98); border: 3px double var(--gold); border-radius: 22px;
    box-shadow: var(--shadow); text-align: center;
  }
  .mobile-solved-kicker { margin: 0 0 .55rem; color: #8b3e24; font: 800 clamp(1.15rem,5.6vw,1.55rem)/1.15 Arial,Helvetica,sans-serif; text-transform: uppercase; letter-spacing: .035em; }
  .mobile-solved-panel h1 { margin: 0; color: var(--navy); font-size: clamp(2.25rem,12vw,4rem); line-height: .98; }
  .mobile-solved-subtitle { margin: .5rem 0 0; color: var(--navy); font-size: clamp(1.12rem,5vw,1.45rem); font-weight: 800; }
  .mobile-solved-motto { margin: .35rem 0 1rem; color: #8b3e24; font-size: 1.05rem; font-style: italic; font-weight: 700; }
  .mobile-solved-story { margin: 0 auto 1.25rem; max-width: 44ch; font-size: 1.08rem; line-height: 1.55; text-align: left; }
  .mobile-solved-actions { display: grid; gap: .8rem; }
  .mobile-solved-actions a { display: flex; flex-direction: column; justify-content: center; min-height: 76px; padding: .8rem 1rem; color: white; border: 3px solid var(--gold); border-radius: 14px; box-shadow: 0 7px 16px rgba(3,27,59,.18); text-decoration: none; }
  .mobile-solved-actions strong { font-size: 1.08rem; line-height: 1.2; }
  .mobile-solved-actions span { margin-top: .28rem; font: .86rem/1.3 Arial,Helvetica,sans-serif; }
  .mobile-certificate-action { background: linear-gradient(#0b4f96,var(--navy)); }
  .mobile-archive-action { background: linear-gradient(#12845f,var(--green)); }
  .mobile-solved-actions a:focus-visible { outline: 4px solid var(--blue-light); outline-offset: 3px; }
  .certificate-controls { flex-wrap: wrap; }
  .certificate-page { padding-top: 7.5rem; }
}

@media (max-width: 470px) {
  .mystery-art-stage .clue-input-grid { grid-template-columns: 1fr; }
  .field-message { min-height: 1.2em; }
  .certificate-controls a, .certificate-controls button { font-size: .8rem; padding: .45rem .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .certificate-controls { display: none; }
  .certificate-page { padding: 0; background: white; }
  .certificate-page main { width: 100%; }
  .certificate-page main img { box-shadow: none; max-width: 100%; max-height: 250mm; width: auto; height: auto; margin: 0 auto; object-fit: contain; }
  .certificate-page, .certificate-page main { min-height: 0; height: auto; }
  .certificate-page main { break-inside: avoid; }
  @page { size: portrait; margin: 10mm; }
}

/* Image A is the desktop surface. Only the actual fields receive pointer events;
   the full-stage form must never intercept the puzzle or Back hotspots. */
.mystery-art-stage .clue-entry { pointer-events: none; }
.clue-entry input, .clue-entry button, .clue-entry a { pointer-events: auto; }
.mystery-approved-art { pointer-events: none; }
.answer-solved { color: #0b6548 !important; }
@media (min-width: 761px) {
  .mystery-art-stage .clue-input-grid { left: 19.98%; top: 51.54%; width: 60.17%; height: 4.99%; gap: 3.08%; }
  .clue-input-grid label { padding: 0; }
  .clue-input-grid label > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
  .clue-input-grid input { height: 100%; padding: 0 5%; font: clamp(12px,1.05vw,18px) Georgia,serif; background: #fff; box-shadow: none; }
  .field-message { font-size: clamp(10px,.8vw,14px); line-height: 1.1; }
  .mystery-art-stage .submit-answer { left: 37.56%; top: 59.30%; width: 24.94%; height: 6.69%; color: transparent; background: transparent; border: 0; box-shadow: none; font-size: 0; }
  .submit-answer span { visibility: hidden; }
  .mystery-back { left: 44.92%; top: 90.65%; width: 10.22%; height: 5.31%; color: transparent; background: transparent; border: 0; box-shadow: none; font-size: 0; }
  .mystery-back span { visibility: hidden; }
  .submit-answer:hover, .mystery-back:hover { box-shadow: 0 0 14px #ffe3a0; }
  .form-message { left: 20%; right: 20%; top: 66.1%; font-size: clamp(11px,.85vw,14px); }
  .mystery-art-stage .clue-pieces { left: 35.7%; top: 25.93%; width: 28.35%; height: 11.58%; gap: 0; }
  .clue-piece { background: transparent; border: 0; clip-path: none; overflow: visible; }
  .clue-piece > span { visibility: hidden; }
  .clue-piece.is-solved { background: transparent; filter: none; }
  .clue-piece svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
  .clue-piece.is-solved svg { filter: sepia(1) saturate(3) hue-rotate(155deg); }
  .piece-two:not(.is-solved) svg { filter: grayscale(1) sepia(.45) brightness(1.12); }
}
@media (max-width: 760px) {
  .clue-piece svg { display: none; }
  .mystery-art-shell { background-image: linear-gradient(rgba(244,249,252,.88),rgba(244,249,252,.9)),url('../../assets/mystery-entry-approved.png'); }
}

/* Original cover files, fitted without cropping or stretching. */
.official-cover { position:absolute; z-index:5; top:27.63%; height:27.31%; display:flex; align-items:center; justify-content:center; background:#08294b; border:2px solid #bc8d37; pointer-events:none; box-shadow:2px 2px 4px #0003; }
.official-cover-1 { left:17.7%; width:13.82%; }
.official-cover-2 { left:34.25%; width:13.94%; }
.official-cover-4 { left:67.05%; width:14.65%; }
.official-cover img { display:block; width:100%; height:100%; object-fit:contain; }

.official-cover-3 { left:50.72%; width:13.82%; }

.reset-answers { position:absolute; z-index:20; top:3%; right:2%; min-height:44px; padding:.55rem 1rem; border:2px solid var(--gold); border-radius:999px; background:var(--navy); color:#fff; font:700 1rem Georgia,serif; cursor:pointer; }
.reset-answers:hover { filter:brightness(1.15); }
.reset-answers:focus-visible { outline:3px solid #fff; outline-offset:3px; }
@media(max-width:760px) { .reset-answers { position:relative; top:auto; right:auto; display:block; margin:1rem auto .5rem; } }

@media (min-width:761px) {
  .mystery-art-stage .clue-pieces { background:#fff5df; }
  .clue-piece svg, .clue-piece.is-solved svg, .piece-two:not(.is-solved) svg { filter:none; overflow:visible; padding:3px; }
  .puzzle-face { fill:#fff1d2; stroke:#b67a22; stroke-width:2.5; stroke-linejoin:round; transition:fill .55s ease,stroke .55s ease; }
  .puzzle-number { fill:#995112; font:bold 47px Georgia,serif; }
  .is-solved .puzzle-face { fill:#88dcf6; stroke:#1786b4; }
  .is-solved .puzzle-number { fill:#086d96; }
}

.academy-exit { position:relative; z-index:1; display:inline-flex; align-items:center; margin:.65rem; min-height:44px; padding:.5rem .8rem; color:#fff; background:#062957; border:2px solid #d5a746; border-radius:999px; font:700 .85rem Georgia,serif; text-decoration:none; }
.academy-exit:focus-visible { outline:3px solid #ffe69c; outline-offset:2px; }
.all-books-exit { position:relative; z-index:1; margin:.65rem; min-height:44px; display:inline-flex; align-items:center; padding:.5rem .8rem; border:2px solid #d5a746; border-radius:999px; color:white; background:#062957; font:700 .85rem Georgia,serif; text-decoration:none; }
.all-books-exit:focus-visible { outline:3px solid #ffe69c; outline-offset:2px; }
@media print { .academy-exit { display:none; } }
@media print { .all-books-exit { display:none; } }

.puzzle-help-links { text-align:center; padding:1rem 1rem 2rem; }
.puzzle-help-links a { display:inline-flex; align-items:center; min-height:44px; background:#fff8e9; color:#043414; border:2px solid #b67a22; border-radius:999px; padding:.6rem 1.2rem; font:bold 1rem Georgia,serif; }
.puzzle-help-links a:focus-visible { outline:3px solid #ffe69c; outline-offset:3px; }
