:root {
  color-scheme: light;
  --ink: #173f46;
  --muted: #52676b;
  --paper: #edf2f2;
  --line: #d5dfdf;
  --accent: #d8ed9d;
  --white: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 90% 0, #dce9e8, transparent 55%); }
button, input, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, input { font: inherit; }
button { cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; text-underline-offset: 4px; }
p { margin: 0; line-height: 1.6; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex="-1"]:focus-visible { outline: 3px solid #a66a05; outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 1rem; z-index: 10; background: white; padding: 1rem; }
.skip-link:focus { top: 1rem; }
main { max-width: 1232px; padding: 1rem 1.5rem 1.5rem; margin: auto; }
.intro-heading { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 1.5rem; padding: 0 .2rem .9rem; }
.eyebrow { font-size: .78rem; letter-spacing: .13em; font-weight: 700; line-height: 1.5; margin: 0 0 .8rem; }
.intro-title .eyebrow { margin-bottom: .35rem; display: flex; align-items: center; gap: .65rem; }
.intro-title .eyebrow::before { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: #33766e; flex-shrink: 0; }
h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(1.7rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -.045em; margin: 0; }
h1 span { font-style: italic; color: #41716e; }
.lead { max-width: 29rem; font-size: 1rem; line-height: 1.5; padding-bottom: 0; color: var(--muted); }
.desktop-break { display: none; }
.player-card { background: white; border: 1px solid #cad8d8; border-radius: 20px; overflow: hidden; box-shadow: 0 22px 65px #153c4310, 0 2px 7px #153c4306; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; background: #f9fbfb; }
.steps li { display: flex; justify-content: center; align-items: center; gap: .65rem; padding: .6rem; color: var(--muted); font-size: .9rem; border-bottom: 3px solid transparent; }
.steps li + li { border-left: 1px solid var(--line); }
.steps li > span { display: grid; place-items: center; flex-shrink: 0; width: 1.7rem; height: 1.7rem; border: 1px solid #aebfbf; border-radius: 50%; font-size: .8rem; }
.steps li[aria-current] { background: #eaf2ee; color: var(--ink); border-bottom-color: #42756b; font-weight: 700; }
.steps li[aria-current] > span { background: var(--ink); color: white; border-color: var(--ink); }
.video-stage { position: relative; display: grid; aspect-ratio: 16 / 9; min-height: 32rem; background: #102d33; overflow: hidden; }
video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.start-screen { position: absolute; inset: 0; display: flex; align-items: flex-end; color: white; padding: 2.5rem; background: linear-gradient(0deg, #071d24ed, #071d2430 58%, #071d2408); }
.start-content { display: grid; justify-items: start; gap: 1rem; }
.film-label { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.3rem, 3vw, 2.1rem); letter-spacing: -.02em; text-transform: none; }
.start-button { display: flex; align-items: center; gap: .8rem; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent); color: #153b34; padding: 1rem 1.4rem; min-height: 62px; font-size: 1.1rem; font-weight: 700; box-shadow: 0 4px 20px #0002; }
.start-button > span { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #153b3412; font-size: .85rem; }
.start-button:hover { background: #e6f5bf; box-shadow: 0 4px 24px #0004; }
.start-content p { font-size: .88rem; color: #edf1ec; }
.stage-notice { position: absolute; inset: 0; display: grid; place-items: center; background: #102f3577; text-align: center; padding: 1rem; color: white; }
.stage-notice span { padding: .8rem 1.2rem; background: #143f46; border: 1px solid #ffffff30; border-radius: 8px; font-weight: 700; }
.controls { display: flex; align-items: center; gap: 1rem; min-height: 72px; padding: .6rem 1.2rem; background: #102f35; border-top: 1px solid #ffffff18; color: white; }
.control-button { min-width: 76px; min-height: 46px; padding: .5rem .7rem; border: 1px solid #698b90; background: #ffffff08; border-radius: 8px; color: white; font-size: .88rem; font-weight: 700; }
.control-button:hover:enabled { background: #31555c; }
.sound { min-width: 120px; }
.progress { flex: 1; min-width: 40px; height: 38px; accent-color: var(--accent); cursor: pointer; }
.progress:disabled { cursor: default; opacity: .6; }
.time { font-size: .83rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.controls :focus-visible { outline-color: var(--accent); }
.story-panel h2 { margin: 0 0 .65rem; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(1.65rem, 3vw, 2.35rem); font-weight: 400; line-height: 1.15; letter-spacing: -.025em; }
.story-panel p { font-size: 1rem; color: var(--muted); }
/* The player keeps its dimensions through every story state. */
.film-overlay { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; padding: 2.3rem; overflow-y: auto; overscroll-behavior: auto; scrollbar-gutter: stable; background: #102f35f7; color: white; }
.overlay-content { width: 100%; margin-block: auto; }
.film-overlay p { color: #dce8e7; }
.film-overlay .eyebrow { font-size: .78rem; color: var(--accent); }
.film-overlay :focus-visible { outline-color: var(--accent); }
.choice-panel .panel-heading { max-width: 36rem; }
.choice-panel h2 { font-size: clamp(2rem, 4vw, 3rem); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.6rem 0 1.2rem; }
.choice { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: .85rem; min-height: 164px; padding: 1.35rem 1.1rem; text-align: left; border: 2px solid #ffffff80; border-radius: 12px; color: var(--ink); background: #f9fbf7; }
.choice:hover { border-color: var(--accent); background: #e8f3d2; box-shadow: 0 0 0 3px #d8ed9d28; }
.choice-letter { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border: 1px solid #b5c9bf; border-radius: 6px; background: #eaf0e9; font-weight: 700; font-size: .85rem; }
.choice strong { display: block; font-size: 1.12rem; line-height: 1.4; }
.choice strong + span { display: block; margin-top: .6rem; font-size: .92rem; line-height: 1.5; color: var(--muted); }
.choice-arrow { align-self: end; font-size: 1.3rem; }
.story-panel .reassurance { font-size: .85rem; }
/* Short explanation pages replace the nested scrolling area. */
.complete-panel { position: relative; inset: auto; grid-area: 1 / 1; padding: 0; overflow: visible; scrollbar-gutter: auto; color: var(--ink); background: #f7faf8; }
.complete-panel > .overlay-content { display: flex; flex-direction: column; flex: 1; margin: 0; }
.result-body { flex: 1; display: grid; align-items: center; padding: 1.5rem 2rem; }
.result-page { grid-area: 1 / 1; width: 100%; max-width: 42rem; margin-inline: auto; }
/* Reserve the largest panel from the start, including at enlarged text sizes.
   Hidden content remains invisible and excluded from assistive navigation. */
.complete-panel[hidden] { display: flex !important; visibility: hidden; pointer-events: none; }
.result-page[hidden], .result-actions[hidden] { display: block !important; visibility: hidden; pointer-events: none; }
.result-summary { padding: 1.1rem 1.3rem; border: 1px solid #bad0c4; border-left: 5px solid #42765b; border-radius: 8px; background: #edf5ee; }
.complete-panel[data-outcome="wrong"] .result-summary { border-color: #ddbdad; border-left-color: #a05236; background: #fff4ee; }
.complete-panel .eyebrow { color: #28513c; font-size: 1rem; letter-spacing: 0; line-height: 1.4; font-weight: 700; margin-bottom: .65rem; }
.complete-panel[data-outcome="wrong"] .result-summary .eyebrow { color: #833d29; }
.complete-panel h2 { font-family: Arial, Helvetica, sans-serif; font-weight: 700; font-size: clamp(1.4rem, 2.8vw, 1.9rem); line-height: 1.3; letter-spacing: -.015em; margin-bottom: .75rem; }
.complete-panel p { font-size: 1.12rem; line-height: 1.6; color: #294549; }
.result-page > p + p { margin-top: .75rem; }
.complete-panel :focus-visible { outline-color: #a66a05; }
.complete-panel .result-instruction { font-size: 1rem; margin-top: .7rem; }
.result-takeaway { padding: .9rem 1rem; border-left: 3px solid #42765b; background: #e8f2e9; border-radius: 0 7px 7px 0; }
.safety-steps { padding-left: 1.4rem; margin: 0 0 1rem; }
.safety-steps li { padding-left: .35rem; margin-bottom: .65rem; font-size: 1.12rem; line-height: 1.55; color: #234637; }
.safety-steps li::marker { font-weight: 700; }
.result-page .advice-source { font-size: 1rem; }
.result-navigation { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; flex-shrink: 0; padding: .65rem 2rem; border-top: 1px solid var(--line); background: #f0f5f1; }
.result-navigation > button:first-child { justify-self: start; min-width: 5rem; }
.result-navigation > button:last-child { justify-self: end; min-width: 6rem; }
.result-navigation p { font-size: 1rem; font-variant-numeric: tabular-nums; }
.result-actions { flex-shrink: 0; padding: .9rem 2rem 1rem; border-top: 1px solid var(--line); background: white; }
.completion-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem; margin: 0 0 .55rem; }
.primary-button { min-height: 54px; padding: .8rem 1.15rem; border: 2px solid var(--ink); border-radius: 8px; background: var(--ink); color: white; font-weight: 700; }
.primary-button:hover { background: #2c6269; border-color: #2c6269; }
.primary-button span { margin-left: .6rem; }
.text-button { min-height: 50px; padding: .7rem .9rem; border: 1px solid #bbcaca; border-radius: 8px; color: var(--ink); background: white; font-size: .92rem; text-decoration: none; }
.text-button:hover { background: #edf3f0; border-color: #698b82; }
.result-actions .completion-actions { margin-bottom: 0; }
.result-actions .completion-actions button { font-size: 1rem; min-height: 54px; }
.commentary-replay { background: #eaf2ed; border-color: #789d8b; font-weight: 700; }
#commentary-note { margin-top: .2rem; }
.commentary-banner { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 1rem; background: #102f35f5; color: white; font-size: .83rem; }
.commentary-banner button { flex-shrink: 0; min-height: 44px; border: 1px solid #b5ceca; border-radius: 7px; background: transparent; padding: .4rem .7rem; color: white; font-size: .83rem; }
.commentary-banner button:hover { background: #31555c; }
.commentary-banner :focus-visible { outline-color: var(--accent); }
.commentary-panel { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; display: flex; flex-direction: column; max-height: calc(100% - 76px); overflow: hidden; padding: 1.3rem 1.6rem; border-top: 4px solid #cf9344; background: #fffdf7; color: var(--ink); box-shadow: 0 -10px 40px #071d2430; }
.commentary-copy { max-width: 48rem; min-height: 0; overflow-y: auto; overscroll-behavior: auto; padding: .25rem; }
.commentary-copy .eyebrow { color: #794516; margin-bottom: .5rem; }
.commentary-copy h2 { margin: 0 0 .5rem; font-size: clamp(1.2rem, 2.2vw, 1.65rem); line-height: 1.3; }
.commentary-copy > p:last-child { color: #40585a; font-size: 1.02rem; line-height: 1.55; }
.commentary-actions { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .65rem 1rem; margin-top: 1rem; }
.commentary-actions > p { font-size: .85rem; color: #536567; }
.commentary-actions > div { display: flex; gap: .6rem; flex-wrap: wrap; }
.commentary-actions .primary-button, .commentary-actions .text-button { min-height: 48px; font-size: .92rem; padding: .6rem .85rem; }
.error-panel { padding: 1.5rem; border-top: 3px solid #a33720; background: #fff5ef; }
.error-panel h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
.error-panel p { margin-bottom: 1rem; }
.no-script { background: white; padding: 1rem; border: 2px solid var(--ink); margin-top: 1rem; }
@media (max-width: 900px) {
  main { padding: .9rem 1.2rem; }
  .intro-heading { gap: 1rem; }
  .video-stage { min-height: 32rem; }
  .result-body { padding: 1.5rem; }
  .film-overlay { padding: 1.6rem; }
  .complete-panel { padding: 0; }
  .choice { padding: 1rem; gap: .6rem; }
  .choice-arrow { display: none; }
}
@media (max-width: 650px) {
  .commentary-banner { padding: .5rem .7rem; gap: .5rem; }
  .commentary-banner > span { font-size: .78rem; }
  .commentary-panel { padding: 1rem; }
  .commentary-copy > p:last-child { font-size: .98rem; }
  .commentary-actions > div { width: 100%; }
  .commentary-actions > div button { flex: 1; }
  main { padding: .7rem .8rem; }
  .intro-heading { grid-template-columns: 1fr; gap: .4rem; padding: 0 .2rem .75rem; }
  h1 { font-size: 1.8rem; }
  .intro-title .eyebrow { font-size: .72rem; letter-spacing: .09em; }
  .lead { font-size: 1rem; line-height: 1.6; }
  .player-card { border-radius: 14px; }
  .steps li { flex-direction: column; gap: .4rem; text-align: center; padding: .45rem .3rem; font-size: .78rem; }
  .steps li > span { width: 1.5rem; height: 1.5rem; }
  .video-stage { min-height: 34rem; }
  .start-screen { padding: 1.4rem; }
  .start-content { gap: .8rem; }
  .film-label { font-size: 1.6rem; }
  .start-button { padding: .8rem 1.1rem; font-size: 1rem; }
  .start-content p { font-size: .82rem; }
  .controls { padding: .5rem .65rem; gap: .5rem; flex-wrap: wrap; }
  .control-button { min-width: 64px; font-size: .8rem; padding: .4rem .5rem; }
  .sound { min-width: 107px; }
  .time { font-size: .75rem; }
  .film-overlay { padding: 1.25rem; }
  .choice-panel h2 { font-size: 2rem; }
  .choice-panel .panel-heading > p:not(.eyebrow) { display: none; }
  .choices { grid-template-columns: 1fr; gap: .8rem; margin-block: 1.2rem; }
  .choice { min-height: 102px; align-items: center; }
  .choice strong { font-size: 1.08rem; }
  .choice strong + span { display: none; }
  .complete-panel { padding: 0; }
  .result-body { padding: 1rem; }
  .result-summary { padding: .9rem; }
  .result-navigation { padding: .6rem 1rem; gap: .5rem; }
  .result-navigation button { padding-inline: .65rem; }
  .result-actions { padding: .8rem 1rem; }
  .completion-actions { gap: .5rem; }
  .completion-actions button { width: 100%; }
}
@media (max-width: 390px) {
  .time { order: 4; width: 100%; text-align: center; }
  .result-actions .primary-button { padding-inline: .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
