/* Hamed's World v2 · round 9 S2: the cockpit scene (her guide p08). Her tokens only (tokens.css). Motion: opacity/transform only,
   off under prefers-reduced-motion. Phone first (390), the picture is never cropped (intrinsic 1440×874, contain). */
.sc { background: var(--c-ivory); padding-block: 8px var(--sec-y); }
.sc-in { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sc-bar { margin-bottom: 8px; }
.sc-head { margin-block: 8px 16px; }
.sc-book { margin: 0; color: var(--c-gold); font-weight: 700; font-size: var(--fs-small); }
.sc-title { margin: 0; color: var(--c-navy); }
.sc-intro { margin: 4px 0 0; font-size: var(--fs-kid); color: var(--c-body); }
.sc-ph { display: inline-block; margin: 8px 0 0; padding: 2px 10px; border-radius: 999px; background: #FFF4D6; color: #6B4E12; font-size: var(--fs-small); border: 1px dashed var(--c-gold); }

/* tools: the two paths + the passport */
.sc-tools { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sc-paths { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--c-card); border: 1px solid var(--c-line); }
.sc-path { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--c-navy); font: inherit; font-weight: 600; font-size: var(--fs-small); cursor: pointer; transition: background-color 160ms ease, color 160ms ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sc-path[aria-pressed="true"] { background: var(--c-navy); color: #fff; }
.sc-path-ico svg { width: 22px; height: 22px; display: block; }
.sc-path:focus-visible { outline: var(--focus); outline-offset: 2px; }

.sc-pass { display: flex; align-items: center; gap: 10px; }
.sc-pass-h { margin: 0; font-weight: 700; color: var(--c-navy); font-size: var(--fs-small); }
.sc-pass-n { color: var(--c-muted); font-weight: 600; }
.sc-stars { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sc-star svg { width: 26px; height: 26px; display: block; fill: none; stroke: var(--c-silver); stroke-width: 1.6; transition: fill 240ms ease, stroke 240ms ease, transform 240ms var(--ease-out); }
.sc-star.is-on svg { fill: var(--c-gold); stroke: var(--c-gold); }

/* the stage: picture + hotspots in % so they track the picture at every width */
.sc-stage { position: relative; margin-inline: calc(var(--gutter) * -1); }
.sc-pic, .sc-img { display: block; width: 100%; height: auto; }
.sc-hots { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.sc-hot-li { position: absolute; left: var(--ax); top: var(--ay); width: 0; height: 0; }
.sc-hot { --s: 52px; position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s); padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sc-hot-dot { position: absolute; inset: 11px; border-radius: 50%; background: rgba(255, 246, 223, .12); border: 2.5px solid #F0D28A; box-shadow: 0 0 0 1px rgba(16, 28, 48, .45), 0 0 12px 3px rgba(255, 214, 140, .7), inset 0 0 0 1px rgba(16, 28, 48, .3), inset 0 0 8px rgba(255, 214, 140, .4); transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.sc-hot-dot::before { content: ""; position: absolute; inset: 0; margin: auto; width: 12px; height: 12px; background: #FFF1CC; filter: drop-shadow(0 0 3px rgba(255, 214, 140, .9)); -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1.5c.6 5.6 4.9 9.9 10.5 10.5-5.6.6-9.9 4.9-10.5 10.5C11.4 16.9 7.1 12.6 1.5 12 7.1 11.4 11.4 7.1 12 1.5z"/></svg>') center / contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1.5c.6 5.6 4.9 9.9 10.5 10.5-5.6.6-9.9 4.9-10.5 10.5C11.4 16.9 7.1 12.6 1.5 12 7.1 11.4 11.4 7.1 12 1.5z"/></svg>') center / contain no-repeat; }
.sc-hot.is-found .sc-hot-dot::before { display: none; }
.sc-hot-ring { position: absolute; inset: 11px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(233, 199, 123, .9), 0 0 16px 4px rgba(255, 214, 140, .6); opacity: 0; }
.sc-hot:active .sc-hot-dot { transform: scale(.92); }
.sc-hot:focus-visible { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 6px var(--c-navy); }
.sc-hot.is-found .sc-hot-dot { background: var(--c-gold); border-color: #FFF1CC; }
.sc-hot.is-found .sc-hot-dot::after { content: ""; position: absolute; inset: 7px; background: #fff; -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1.5c.6 5.6 4.9 9.9 10.5 10.5-5.6.6-9.9 4.9-10.5 10.5C11.4 16.9 7.1 12.6 1.5 12 7.1 11.4 11.4 7.1 12 1.5z"/></svg>') center / contain no-repeat; mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 1.5c.6 5.6 4.9 9.9 10.5 10.5-5.6.6-9.9 4.9-10.5 10.5C11.4 16.9 7.1 12.6 1.5 12 7.1 11.4 11.4 7.1 12 1.5z"/></svg>') center / contain no-repeat; }
.sc-hot-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 8px; background: var(--c-night); color: #fff; font-weight: 600; font-size: 15px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 150ms ease; }
@media (hover: hover) { .sc-hot:hover .sc-hot-tip { opacity: 1; } .sc-hot:hover .sc-hot-dot { transform: scale(1.08); } }
.sc-hot:focus-visible .sc-hot-tip { opacity: 1; }
/* the read path shows the names on the picture (desktop only, where there is room) */
@media (min-width: 900px) { .sc[data-path="read"] .sc-hot-tip { opacity: 1; } .sc-hot { --s: 64px; } .sc-hot-dot, .sc-hot-ring { inset: 14px; } }
/* calm: the rings are a static glow; only the next suggested one breathes, once every 4.5 s (opacity + scale, no stagger) */
@media (prefers-reduced-motion: no-preference) {
  .sc-hot.is-next:not(.is-found) .sc-hot-ring { animation: sc-breathe 4.5s ease-in-out infinite; }
}
@keyframes sc-breathe { 0%, 60%, 100% { opacity: 0; transform: none; } 30% { opacity: 1; transform: scale(1.22); } }

/* the text list (the alternative path) */
.sc-listwrap { margin-top: 14px; }
.sc-list-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-weight: 600; }
.sc-list-toggle svg { width: 22px; height: 22px; }
.sc-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sc-list-btn { width: 100%; display: grid; grid-template-columns: 32px 1fr; gap: 2px 12px; align-items: start; text-align: start; padding: 12px 14px; min-height: 56px; border: 1px solid var(--c-line); border-radius: var(--radius-card); background: var(--c-card); color: var(--c-body); font: inherit; cursor: pointer; }
.sc-list-btn:focus-visible { outline: var(--focus); outline-offset: 2px; }
.sc-list-star { grid-row: span 2; } .sc-list-star svg { width: 28px; height: 28px; fill: none; stroke: var(--c-silver); stroke-width: 1.6; }
.sc-list-btn.is-found .sc-list-star svg { fill: var(--c-gold); stroke: var(--c-gold); }
.sc-list-word { font-weight: 700; color: var(--c-navy); font-size: var(--fs-kid); }
.sc-list-line { font-size: var(--fs-small); }
.sc:not(.is-live) .sc-list-toggle { display: none; }

/* the card: a native dialog; bottom sheet on phone, centred card on desktop */
.sc-card { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--c-card); color: var(--c-body); box-shadow: 0 -10px 40px rgba(16, 28, 48, .3); overflow: auto; overscroll-behavior: contain; }
.sc-card::backdrop { background: rgba(16, 28, 48, .55); }
.sc-card-in { padding: 8px 20px max(20px, env(safe-area-inset-bottom)); }
.sc-card-top { display: flex; justify-content: flex-end; }
.sc-x { width: 48px; height: 48px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: var(--c-sand); color: var(--c-navy); cursor: pointer; }
.sc-x svg { width: 24px; height: 24px; }
.sc-x:focus-visible { outline: var(--focus); outline-offset: 2px; }
.sc-card-body { display: grid; gap: 14px; }
.sc-crop { display: block; width: 132px; aspect-ratio: 1; border-radius: 18px; background-repeat: no-repeat; background-color: var(--c-night); box-shadow: 0 0 0 3px var(--c-card), 0 0 0 5px var(--c-gold); margin-top: -24px; }
.sc-word-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sc-word { margin: 0; font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); line-height: 1.3; color: var(--c-navy); }
.sc-say { margin: 0; color: var(--c-gold); font-weight: 600; font-size: var(--fs-kid); }
.sc-line { margin: 0; font-size: var(--fs-kid); line-height: var(--lh-ar); }
.sc-mission { display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-card); background: var(--c-ivory); border: 1px solid var(--c-line); }
.sc-prompt-row { display: flex; align-items: center; gap: 10px; }
.sc-prompt { margin: 0; flex: 1; font-weight: 700; color: var(--c-navy); font-size: var(--fs-kid); }
.listen-btn.icon-only { padding: 8px; width: 48px; justify-content: center; }
.sc-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.sc-opt { width: 100%; min-height: 56px; }
.sc-do { justify-self: start; min-height: 56px; }
.sc-do .ico svg { width: 26px; height: 26px; display: block; }
.sc-fb:empty { display: none; }
.sc-fb { display: grid; gap: 12px; justify-items: start; }
.sc-retry { margin: 0; color: var(--c-body); }
.sc-praise { display: flex; align-items: center; gap: 12px; }
.sc-praise-t { margin: 0; font-weight: 700; font-size: var(--fs-kid); color: var(--c-navy); }
.sc-stamp { flex: none; display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--c-gold); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c-gold); }
.sc-stamp svg { width: 30px; height: 30px; fill: #fff; }

/* the listen path: minimal reading, big icons (the line stays for the grown-up reading along, smaller) */
.sc-card[data-path="listen"] .sc-line { font-size: var(--fs-small); color: var(--c-muted); }
.sc-card[data-path="listen"] .sc-crop { width: 160px; }

/* the end state */
.sc-end { margin-top: 20px; padding: 20px; border-radius: var(--radius-card); background: var(--c-night); color: #fff; display: grid; gap: 12px; justify-items: center; text-align: center; }
.sc-end:focus { outline: none; } .sc-end:focus-visible { outline: var(--focus); outline-offset: 3px; }
.sc-stamp--end { width: 72px; height: 72px; box-shadow: 0 0 0 3px var(--c-night), 0 0 0 5px var(--c-gold); }
.sc-stamp--end svg, .sc-stamp--end .ico svg { width: 40px; height: 40px; } /* CD r9 re-check: beat the generic .ico svg 22 px */
.sc-end-stars { display: flex; gap: 10px; margin: 0; padding: 0; list-style: none; }
.sc-end-stars svg { width: 40px; height: 40px; fill: var(--c-gold); display: block; }
.sc-end-h { margin: 0; color: #fff; }
.sc-end .lead { margin: 0; color: #E9EDF3; }
.sc-end .row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 4px 0 0; }
.sc-end .btn--secondary { color: #fff; border-color: #fff; }
.sc-end .btn--primary { background: var(--c-gold); color: var(--c-night); }
.sc-end .listen-btn { background: transparent; color: #fff; border-color: #fff; }
.sc-saved { margin-top: 14px; }

@media (prefers-reduced-motion: no-preference) {
  .sc-card[open] { animation: sc-up 240ms cubic-bezier(.23, 1, .32, 1); }
  .sc-card[open]::backdrop { animation: sc-fade 200ms ease; }
  .sc-stamp.is-new { animation: sc-stamp 280ms cubic-bezier(.23, 1, .32, 1); }
  .sc-do.is-turned .sc-spin svg { transform: rotate(180deg); transition: transform 500ms cubic-bezier(.23, 1, .32, 1); }
  .sc-end:not([hidden]) .sc-end-stars li { animation: sc-stamp 280ms cubic-bezier(.23, 1, .32, 1) backwards; animation-delay: calc(var(--i) * 120ms); }
}
@keyframes sc-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sc-fade { from { opacity: 0; } }
@keyframes sc-stamp { from { transform: scale(1.3); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 760px) {
  .sc-stage { margin-inline: 0; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
  .sc-card { width: min(680px, 92vw); margin: auto; border-radius: 22px; }
  .sc-card-in { padding: 12px 28px 28px; }
  .sc-card-body { grid-template-columns: 180px 1fr; align-items: start; gap: 24px; }
  .sc-crop, .sc-card[data-path="listen"] .sc-crop { width: 180px; margin-top: 0; }
  .sc-list { grid-template-columns: repeat(2, 1fr); }
  .sc-end { grid-template-columns: auto 1fr; justify-items: start; text-align: start; padding: 28px 32px; }
  .sc-end .row { justify-content: flex-start; }
}

/* round 9 copy: path hint, motion pause, list hint, unverified note, how-to line */
.sc-hintrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-bottom: 10px; }
.sc-hint { margin: 0; font-weight: 600; color: var(--c-navy); font-size: var(--fs-kid); }
.sc-motion { min-height: 48px; font-size: var(--fs-small); }
.sc.is-still .sc-hot-ring { animation: none !important; opacity: 0; }
.sc-list-hint { margin: 8px 0 0; }
.sc-unv { margin: 0; padding: 4px 10px; justify-self: start; border-radius: 8px; background: #FFF4D6; color: #6B4E12; font-size: 15px; border: 1px dashed var(--c-gold); }
.sc-card-text { display: grid; gap: 10px; }
.sc-how { margin: 0; color: var(--c-muted); font-size: var(--fs-small); }
.sc-end[hidden], .sc-listbox[hidden] { display: none; }
.sc-end-text { display: grid; gap: 10px; justify-items: inherit; text-align: inherit; }
.sc-end .lead { text-align: inherit; }
@media (max-width: 599px) { .sc-paths { width: 100%; } .sc-path { flex: 1; justify-content: center; padding-inline: 8px; } }
/* no horizontal overflow at 390: the stage clips; name tips only where there is room, pulled inwards near the picture's edges */
.sc-stage { overflow: clip; }
.sc-star { position: relative; }
.sc-hot-tip { transform: translateX(var(--tx, -50%)); }
.sc-hot-li[data-edge="end"] { --tx: -88%; } .sc-hot-li[data-edge="start"] { --tx: -12%; }
@media (max-width: 899px) { .sc-hot-tip { display: none; } }

/* round 9 finish (checkpoint): audio controls are secondary everywhere (ivory/white, 1 px gold outline, navy text); never navy */
.sc-card .listen-btn, .sc-card .listen-btn--big { background: #fff; color: var(--c-navy); border: 1px solid var(--c-gold); font-size: var(--fs-small); min-height: 48px; padding: 6px 14px; }
.sc-card .listen-btn.icon-only { padding: 0; width: 48px; }
.sc-card .listen-btn.playing { background: #FFF6DF; box-shadow: inset 0 0 0 2px var(--c-gold); }
@media (hover: hover) and (pointer: fine) { .sc-card .listen-btn:hover, .sc-card .listen-btn--big:hover { background: #FFF6DF; } }
.sc-card .listen-btn:focus-visible { outline: var(--focus); outline-offset: 2px; }
/* each answer option with its own voice button beside it */
.sc-opts { grid-template-columns: 1fr; }
.sc-opt-li { display: flex; align-items: center; gap: 8px; }
.sc-opt-li .sc-opt { flex: 1; }
.sc-opt-v { flex: none; }
@media (min-width: 760px) { .sc-opts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
/* the adult note on a card whose text waits for the story file */
.sc-unv-note { margin: 2px 0 0; color: var(--c-muted); font-size: 14px; }
/* passport count: bigger, clearer digits */
.sc-pass-n { font-size: 1.15em; color: var(--c-navy); }
/* phone 390: the picture is the hero of the first screen; the tools come in one slim block below it */
@media (max-width: 759px) {
  .sc-in { display: flex; flex-direction: column; }
  .sc-bar { order: 0; } .sc-head { order: 1; margin-block: 4px 12px; } .sc-stage { order: 2; } .sc-hintrow { order: 3; margin: 10px 0 6px; }
  .sc-tools { order: 4; gap: 10px; } .sc-listwrap { order: 5; } .sc-end { order: 6; } .sc-saved { order: 7; } .sc-live { order: 8; }
  .sc-intro { font-size: var(--fs-small); }
  .sc-hint { font-size: var(--fs-small); }
  .sc-pass { width: 100%; justify-content: space-between; }
  .sc-hot-dot, .sc-hot-ring { inset: 13px; }
}
