[hidden] { display: none !important; }
:root {
  --paper: #fffdf7;
  --ink: #3d2b1f;
  --ink-soft: #7a6555;
  --stage: #2b2622;
  --bar: #1f1b18;
  --accent: #f2b33d;
  --page-font: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--stage);
  color: #f4ede4;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--bar);
  min-height: 48px;
}
/* The Kinderbuch-Atelier logo + word mark (KI highlighted), to the main site. */
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-right: 6px;
  padding-right: 12px; border-right: 1px solid rgba(255, 255, 255, .15);
  color: #fff; font-weight: 800; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.brand img { display: block; width: 36px; height: 36px; }
.brand .accent { color: var(--accent); }
.brand:hover .brand-name { color: var(--accent); }
.bar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .title strong { font-size: 1rem; }
.bar .title span { color: #b9ab9c; font-size: .85rem; margin-left: 8px; }
.btn {
  border: 0;
  border-radius: 999px;
  background: #3a332d;
  color: #f4ede4;
  font: inherit;
  font-size: .9rem;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: #4a423a; }
.btn.on { background: var(--accent); color: #2b2622; }
.btn:disabled { opacity: .4; cursor: default; }
#stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  touch-action: pan-y;
}
#view { position: relative; display: flex; gap: 0; transition: opacity .35s ease, transform .35s ease; }
#view.leave-next { opacity: 0; transform: translateX(-24px); }
#view.leave-prev { opacity: 0; transform: translateX(24px); }
.page {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  font-family: var(--page-font);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.page.left { border-radius: 8px 0 0 8px; box-shadow: -6px 10px 30px rgba(0,0,0,.35); }
.page.right { border-radius: 0 8px 8px 0; }
.page.single { border-radius: 8px; }
.page.left::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 6%;
  background: linear-gradient(to left, rgba(0,0,0,.12), transparent);
  pointer-events: none;
}
.page.right::after {
  content: ""; position: absolute; top: 0; left: 0; bottom: 0; width: 6%;
  background: linear-gradient(to right, rgba(0,0,0,.12), transparent);
  pointer-events: none;
}
.page img.full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page .lay { position: absolute; inset: 0; display: flex; }
.lay.col { flex-direction: column; }
.lay.col-rev { flex-direction: column-reverse; }
.lay.row { flex-direction: row; }
.lay.row-rev { flex-direction: row-reverse; }
.lay .pic { flex: 0 0 58%; position: relative; overflow: hidden; }
.lay.row .pic, .lay.row-rev .pic { flex-basis: 50%; }
.lay .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lay .txt { flex: 1; min-height: 0; min-width: 0; }
.txt {
  padding: 6% 8%;
  overflow: hidden;
  line-height: var(--lh, 1.5);
  font-weight: 600;
}
.txt p { margin: 0 0 .6em 0; }
.txt h3 { margin: 0 0 .5em 0; font-size: 1.15em; }
/* Raised initial: large, but on the baseline of the first line. */
.txt .drop { font-size: 2.2em; line-height: 1; vertical-align: baseline; margin-right: .03em; font-weight: 800; }
.text-page { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 9% 10% 7%; }
/* Ornament: the lines run across the whole text width, the star centred. */
.text-page .orn { flex: none; display: flex; align-items: center; gap: .6em; color: var(--ink-soft); }
.text-page .orn::before, .text-page .orn::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .5; }
.text-page .txt { flex: 1; padding: 6% 0; }
.float-pic { float: left; width: 45%; margin: 0 4% 2% 0; border-radius: 4px; }
.float-pic.right { float: right; margin: 0 0 2% 4%; }
.overlay-txt {
  position: absolute; left: 6%; right: 6%; bottom: 5%;
  background: rgba(255, 253, 247, .88);
  border-radius: 10px;
  padding: 3% 4%;
  max-height: 45%;
}
.num { position: absolute; bottom: 2.2%; left: 0; right: 0; text-align: center; color: var(--ink-soft); font-size: .7em; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12%; }
.dedi-symbol { font-size: 3em; margin-bottom: .4em; }
.dedi-text { font-style: italic; white-space: pre-line; line-height: 1.6; }
.cover-text h1 { margin: 0 0 .3em 0; font-size: 2em; }
.cover-text h2 { margin: 0 0 1em 0; font-size: 1.1em; font-weight: 600; color: var(--ink-soft); }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 72px; border: 0; border-radius: 12px;
  background: rgba(0,0,0,.28); color: #fff; font-size: 28px; cursor: pointer;
}
.nav:hover { background: rgba(0,0,0,.45); }
.nav:disabled { opacity: .15; cursor: default; }
#prev { left: 10px; }
#next { right: 10px; }
#msg { max-width: 520px; padding: 24px; text-align: center; line-height: 1.6; }
#msg a { color: var(--accent); }
/* No book to show: the Klabauterbold shrugs above the explanation. */
#msg.problem { max-width: 560px; }
#msg.problem .kai { display: block; width: min(240px, 55vw); height: auto; margin: 0 auto 8px; }
#msg.problem h1 { font-size: 1.5rem; margin: 0 0 .5em; color: #fff; }
#msg.problem p { margin: 0 0 1em; color: #d9cbbb; }
.muted { color: #b9ab9c; font-size: .85rem; }
.made a { color: #b9ab9c; text-decoration: none; }
.made a:hover { color: #fff; }
@media (max-width: 640px) {
  .bar .title span { display: none; }
  .brand-name { display: none; }
  .brand { padding-right: 8px; }
  .btn .lbl { display: none; }
  .nav { width: 36px; height: 56px; font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #view { transition: none; }
}
.spacer { flex: 1; }
.float-txt { position: absolute; inset: 0; padding: 8%; }
.al-left { text-align: left; }
.al-center { text-align: center; }
.al-right { text-align: right; }
.al-justify { text-align: justify; }

/* Special pages: about the author, publisher programme */
.special {
  position: absolute; inset: 0; padding: 9% 9%;
  display: flex; flex-direction: column;
  font-family: var(--special-font, var(--page-font));
  font-weight: 400; line-height: 1.45;
}
.special h2 { margin: 0 0 1em 0; font-size: 1.45em; text-align: center; }
.special.on-image { inset: 5%; background: rgba(255, 255, 255, .8); border-radius: 10px; padding: 6%; }
.sp-col { display: flex; flex-direction: column; align-items: center; gap: .5em; }
.sp-col .sp-text, .sp-col > div { width: 100%; }
.sp-row { display: flex; align-items: flex-start; gap: 6%; flex: 1; min-height: 0; }
/* Beside the text the photo's top edge lines up with the author's name. */
.sp-row .sp-photo { margin: .15em 0 0; }
.sp-row.rev { flex-direction: row-reverse; }
.sp-text { flex: 1; min-width: 0; }
.sp-photo { flex: none; width: 7.5em; height: 7.5em; border-radius: 50%; overflow: hidden; margin: .6em auto 1em; }
/* Golden halo around the author's photo: a fine gold ring and a soft glow
   that breathes and whose light slowly circles the photo. */
.sp-photo {
  border: .14em solid #e9c25a;
  box-shadow:
    0 0 0 .1em rgba(255, 236, 170, .9),
    0 0 .9em .25em rgba(240, 190, 70, .75),
    0 0 2.2em .7em rgba(240, 190, 70, .35);
  animation: halo-glow 6s linear infinite, halo-ring 3s ease-in-out infinite alternate;
}
@keyframes halo-glow {
  0%   { box-shadow: 0 0 0 .1em rgba(255, 236, 170, .9), 0 -.35em .9em .25em rgba(240, 190, 70, .8), 0 0 2em .6em rgba(240, 190, 70, .3); }
  25%  { box-shadow: 0 0 0 .1em rgba(255, 236, 170, .9), .35em 0 1.2em .35em rgba(240, 190, 70, .65), 0 0 2.6em .9em rgba(240, 190, 70, .42); }
  50%  { box-shadow: 0 0 0 .1em rgba(255, 236, 170, .9), 0 .35em .9em .25em rgba(240, 190, 70, .8), 0 0 2em .6em rgba(240, 190, 70, .3); }
  75%  { box-shadow: 0 0 0 .1em rgba(255, 236, 170, .9), -.35em 0 1.2em .35em rgba(240, 190, 70, .65), 0 0 2.6em .9em rgba(240, 190, 70, .42); }
  100% { box-shadow: 0 0 0 .1em rgba(255, 236, 170, .9), 0 -.35em .9em .25em rgba(240, 190, 70, .8), 0 0 2em .6em rgba(240, 190, 70, .3); }
}
@keyframes halo-ring {
  from { border-color: #e2b84c; }
  to   { border-color: #fbe29a; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-photo { animation: none; }
}
.sp-col .sp-photo { width: 7.5em; }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-name { font-weight: 700; font-size: 1.2em; }
.sp-meta { color: var(--ink-soft); font-size: .9em; margin-top: .3em; }
.sp-bio { margin-top: .8em; }
.pp-list { columns: 2; column-gap: 2em; }
.pp-list.single { columns: 1; font-size: 1.35em; }
.pp-entry { display: flex; gap: .7em; align-items: flex-start; break-inside: avoid; margin-bottom: 1.1em; }
.pp-cover { flex: none; width: 4.2em; height: 2.8em; }
.pp-cover img { width: 100%; height: 100%; object-fit: contain; object-position: left center; }
/* The cover the star trail is circling: slightly larger, with a soft shadow
   (drop-shadow follows the picture, not its box). */
.pp-cover { position: relative; }
.pp-cover img { transition: transform .5s ease, filter .5s ease; transform-origin: 40% 50%; }
.pp-cover.lit { z-index: 2; }
.pp-cover.lit img { transform: scale(1.35); filter: drop-shadow(0 .3em .45em rgba(60, 40, 20, .42)); }
/* The author's photo while the star circles it. */
.sp-photo { transition: transform .6s ease; }
.sp-photo.lit { transform: scale(1.3); }
@media (prefers-reduced-motion: reduce) {
  .pp-cover img, .sp-photo { transition: none; }
}
.pp-small { color: var(--ink-soft); font-size: .78em; }
.pp-title { font-weight: 700; }

/* Page overview: thumbnails of every spread, a click jumps there */
#overview {
  position: absolute; inset: 0; z-index: 5;
  background: #1f1b18;
  display: flex; flex-direction: column;
}
.ov-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
#ov-grid {
  flex: 1; overflow-y: auto; padding: 8px 16px 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px 14px; align-content: start;
}
.th-card {
  border: 0; background: none; color: #d8cfc4; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 4px;
  border-radius: 8px;
}
.th-card:hover, .th-card:focus-visible { background: #3a332d; outline: none; }
.th-card.current .th-frame { outline: 3px solid var(--accent); }
.th-card.current .th-cap { color: var(--accent); font-weight: 700; }
.th-frame { display: flex; width: 100%; max-height: 160px; border-radius: 4px; overflow: hidden; background: var(--paper); }
.th-leaf { flex: 1; min-width: 0; position: relative; display: flex; align-items: flex-start; justify-content: center; overflow: hidden; color: var(--ink); }
.th-leaf + .th-leaf { border-left: 1px solid rgba(0, 0, 0, .12); }
.th-leaf.none { background: transparent; }
.th-leaf img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th-leaf span { font-size: 9px; line-height: 1.3; padding: 6px; text-align: center; font-family: var(--page-font); }
.th-cap { font-size: .8rem; }
@media (max-width: 640px) {
  #ov-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* "Vorlesen starten": shown when the browser blocks sound without a click */
.start-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4;
  border: 0; border-radius: 999px; padding: 18px 30px;
  background: var(--accent); color: #2b2622; font: inherit; font-size: 1.2rem; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); cursor: pointer;
}
.start-btn:hover { filter: brightness(1.06); }

/* Jump to the first / last page (footer, around the page indicator) */
.btn-sm { padding: 5px 11px; font-size: .85rem; }

/* Star trail over the publisher programme (drawn by reader.js) */
.star-trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

/* Music credit in the footer (CC BY tracks must be named); fills the gap */
.credit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; padding: 0 12px; text-align: center; }

/* Read-along: the sentence being spoken */
.s { transition: background-color .3s ease; border-radius: .2em; }
.s.speaking { background: rgba(242, 179, 61, .32); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Good-night mode: warm and dim; after the book everything rests */
body.night { --stage: #14100d; --bar: #0f0c0a; }
body.night .page { filter: brightness(.72) sepia(.3) saturate(.9); }
body.night .bar, body.night .nav { opacity: .75; }
body.sleeping #view { opacity: .25; transition: opacity 6s ease; }
body.sleeping .bar { opacity: .2; transition: opacity 6s ease; }

/* The end page */
.end-page { gap: .4em; }
.end-page h1 { margin: .2em 0; font-size: 2.6em; font-family: var(--special-font, var(--page-font)); }
.end-orn { color: var(--ink-soft); letter-spacing: .6em; }
.end-moon { font-size: 3em; }
.muted-ink { color: var(--ink-soft); margin: 0; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 1em; }
.end-btn { font-size: .95em; }
.end-made { margin-top: 1.2em; color: var(--ink-soft); font-size: .8em; }

/* "Weiterlesen?" and short notes */
.resume, .toast {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 6;
  background: #1f1b18; color: #f4ede4; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); text-align: center;
}
.resume { top: 50%; transform: translate(-50%, -50%); padding: 20px 24px; max-width: 90%; }
.resume p { margin: 0 0 4px; font-size: 1.05rem; }
.toast { bottom: 24px; padding: 10px 18px; font-size: .9rem; }

/* The opener's theatre curtain, parting once */
.curtain { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.curtain > div {
  position: absolute; top: 0; bottom: 0; width: 51%;
  background: repeating-linear-gradient(90deg, #7a1420 0 6%, #9b1c2c 6% 12%);
  box-shadow: inset 0 -30px 40px rgba(0, 0, 0, .35);
  animation: curtain-open 1.8s ease-in-out .25s forwards;
}
.curtain .c-left { left: 0; transform-origin: left center; }
.curtain .c-right { right: 0; transform-origin: right center; animation-name: curtain-open-r; }
@keyframes curtain-open { to { transform: translateX(-100%); } }
@keyframes curtain-open-r { to { transform: translateX(100%); } }

/* Ken Burns: pictures drift in slowly (cinema setting) */
body.kb .page img.full, body.kb .page .pic img { animation: ken-burns 16s ease-in-out infinite alternate; transform-origin: 40% 40%; }
@keyframes ken-burns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }

/* Opening effect on the cover (cinema setting) */
.open-fade { animation: open-fade 1.2s ease both; }
.open-zoom { animation: open-zoom 1.4s ease both; }
.open-up { animation: open-up 1.2s ease both; }
.open-flip { animation: open-flip 1.4s ease both; transform-origin: left center; }
@keyframes open-fade { from { opacity: 0; } }
@keyframes open-zoom { from { opacity: 0; transform: scale(.7); } }
@keyframes open-up { from { opacity: 0; transform: translateY(60px); } }
@keyframes open-flip { from { opacity: 0; transform: perspective(1200px) rotateY(-80deg); } }

@media (prefers-reduced-motion: reduce) {
  .curtain { display: none; }
  body.kb .page img.full, body.kb .page .pic img { animation: none; }
}

/* ---- kids mode: a tap turns, the controls hide (the lock leaves it) ---- */
body.kid .bar, body.kid .nav, body.kid #overview { display: none !important; }
body.kid #stage { cursor: pointer; }
.kid-lock {
  position: fixed; right: 12px; bottom: 12px; z-index: 20;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(31, 27, 24, .55); color: #fff; font-size: 20px;
  opacity: .55; cursor: pointer; touch-action: none;
}
.kid-lock.holding { opacity: 1; animation: kid-hold 1.5s linear forwards; }
@keyframes kid-hold { from { box-shadow: 0 0 0 0 var(--accent); } to { box-shadow: 0 0 0 10px var(--accent); } }

/* ---- the "find it" game ---- */
.find-chip {
  position: absolute; top: 3%; left: 50%; transform: translateX(-50%); z-index: 4;
  padding: .35em .9em; border-radius: 999px; white-space: nowrap;
  background: rgba(0, 0, 0, .62); color: #fff; font-weight: 700; font-size: .85em;
  pointer-events: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}
.find-chip.done { background: rgba(46, 125, 50, .85); animation: find-pop .4s ease; }
@keyframes find-pop { 50% { transform: translateX(-50%) scale(1.15); } }
.find-ring {
  position: absolute; z-index: 3; border-radius: 50%; pointer-events: none;
  border: 3px solid var(--accent); box-shadow: 0 0 18px rgba(242, 179, 61, .7);
  animation: find-ring 1.1s ease-in-out infinite;
}
@keyframes find-ring { 50% { transform: scale(1.15); opacity: .55; } }
.find-miss {
  position: absolute; z-index: 4; transform: translate(-50%, -50%); pointer-events: none;
  color: #fff; font-size: 1.6em; text-shadow: 0 0 6px rgba(0, 0, 0, .7);
  animation: find-miss .9s ease forwards;
}
@keyframes find-miss { to { opacity: 0; transform: translate(-50%, -80%); } }
.find-spark {
  position: absolute; z-index: 5; transform: translate(-50%, -50%); pointer-events: none;
  color: #f5c242; font-size: 1.3em; text-shadow: 0 0 8px rgba(245, 194, 66, .9);
  animation: find-spark 1.1s ease-out forwards;
}
@keyframes find-spark {
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.4); opacity: 0; }
}

/* ---- turning the page like paper ---- */
.flip-layer { position: absolute; inset: 0; z-index: 7; pointer-events: none; perspective: 2200px; }
.flip-layer > .flip-still, .flip-sheet { position: absolute; }
.flip-sheet { transform-style: preserve-3d; animation: flip-next .75s cubic-bezier(.45, .05, .35, 1) forwards; }
.flip-sheet.to-left { transform-origin: left center; }
.flip-sheet.to-right { transform-origin: right center; animation-name: flip-prev; }
.flip-sheet.single.to-left { animation-name: flip-away; }
.flip-sheet.single.to-right { transform-origin: right center; animation-name: flip-away-r; }
.flip-sheet > .flip-front, .flip-sheet > .flip-back {
  position: absolute; inset: 0; margin: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.flip-sheet > .flip-back { transform: rotateY(180deg); }
.flip-shade {
  position: absolute; inset: 0; pointer-events: none; backface-visibility: hidden;
  background: linear-gradient(to left, rgba(0, 0, 0, .28), transparent 60%);
  animation: flip-shade .75s ease forwards;
}
.flip-sheet.to-right .flip-shade { background: linear-gradient(to right, rgba(0, 0, 0, .28), transparent 60%); }
@keyframes flip-next { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@keyframes flip-prev { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@keyframes flip-away { from { transform: rotateY(0); opacity: 1; } 70% { opacity: 1; } to { transform: rotateY(-100deg); opacity: 0; } }
@keyframes flip-away-r { from { transform: rotateY(0); opacity: 1; } 70% { opacity: 1; } to { transform: rotateY(100deg); opacity: 0; } }
@keyframes flip-shade { 0% { opacity: 0; } 45% { opacity: 1; } 100% { opacity: 0; } }

/* ---- PIN ---- */
.pin-form { display: flex; gap: 10px; justify-content: center; margin: 0 0 1em; }
.pin-form input {
  width: 7.5em; padding: .45em .6em; border-radius: 10px; border: 2px solid #5a4f45;
  background: #1f1b18; color: #fff; font-size: 1.4rem; letter-spacing: .5em; text-align: center;
}
.pin-form input:focus { outline: none; border-color: var(--accent); }
.pin-wrong { color: #ff9b8a !important; }

/* ---- the end page: a heart, a greeting ---- */
.end-btn.heart.on { background: #e25563; color: #fff; }
.end-btn.heart.pop { animation: heart-pop .5s ease; }
@keyframes heart-pop { 40% { transform: scale(1.18); } }
.greet { width: min(420px, 92%); text-align: left; }
.greet input, .greet textarea {
  display: block; width: 100%; margin: 8px 0; padding: 8px 10px; border-radius: 10px;
  border: 1px solid #5a4f45; background: #2b2622; color: #f4ede4; font: inherit; resize: vertical;
}
.greet input:focus, .greet textarea:focus { outline: none; border-color: var(--accent); }
.greet .greet-hint { font-size: .8rem; color: #b9ab9c; }
.greet #greet-count { float: right; }
.greet .end-actions { justify-content: flex-end; }

@media (prefers-reduced-motion: reduce) {
  .find-ring, .find-spark, .kid-lock.holding { animation: none; }
}

/* ---- the find-it game: several things, progress, reward, the question ---- */
.find-chip s { opacity: .6; }
.find-chip .find-count { margin-left: .6em; font-weight: 400; opacity: .8; }
.find-reward {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9;
  display: flex; align-items: center; gap: 12px; padding: 16px 24px 16px 12px;
  background: #fff8e1; color: #3d2b1f; border: 4px solid var(--accent); border-radius: 26px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: 1.2rem; text-align: center;
  animation: reward-in .6s cubic-bezier(.3, 1.6, .5, 1);
}
.find-reward-kai { width: 120px; height: 120px; }
.find-medal { font-size: 2.6rem; }
@keyframes reward-in { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
.find-ask {
  position: absolute; left: 12px; bottom: 12px; z-index: 8; display: flex; align-items: flex-end;
  pointer-events: none;
}
.find-ask-kai { width: 96px; height: 96px; }
.find-ask-text {
  margin-bottom: 52px; padding: 10px 14px; border-radius: 16px; background: #fff; color: #3d2b1f;
  font-weight: 700; font-size: 1.1rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}

/* ---- the solution page ---- */
.solution h2 { text-align: center; }
.sol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(28%, 1fr)); gap: 3%; }
.sol-cell { min-width: 0; }
.sol-pic { position: relative; border-radius: 6px; overflow: hidden; line-height: 0; }
.sol-img { width: 100%; height: auto; display: block; }
.sol-ring {
  position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px solid #e53935; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
}
.sol-cap { font-size: .7em; color: var(--ink-soft); margin-top: .3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- idle: the controls slide out, the next click brings them back ---- */
header.bar, footer.bar { transition: transform .45s ease, opacity .45s ease; }
.nav { transition: opacity .45s ease; }
body.idle header.bar { transform: translateY(-100%); opacity: 0; }
body.idle footer.bar { transform: translateY(100%); opacity: 0; }
body.idle .nav { opacity: 0; pointer-events: none; }
