:root {
  color-scheme: light;
  --ink: #211b45;
  --paper: #e9d8ee;
  --focus: #703f96;
  font-family: 'Baskerville', 'Iowan Old Style', 'Palatino Linotype', 'Book Antiqua', Georgia, serif;
  color: var(--ink);
  background: #211b3d;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.loading-shell { min-height: 100svh; max-width: 460px; margin: 0 auto; padding: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--paper); text-align: center; }
.loading-status { font-size: 21px; line-height: 1.4; max-width: 300px; }
.retry-button { min-width: 160px; }
body { margin: 0; }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
#study { min-height: 100svh; }
.question-screen {
  width: 100%;
  max-width: 460px;
  height: 100svh;
  margin: 0 auto;
  position: relative;
  isolation: isolate;
  background: var(--paper) var(--paper-art, none) center / 100% 100% no-repeat;
  display: flex;
  flex-direction: column;
  padding: max(15px, env(safe-area-inset-top)) 22px max(38px, env(safe-area-inset-bottom));
}
.artwork-scene { position: absolute; inset: 0 0 auto; height: 46%; z-index: -1; pointer-events: none; overflow: clip; }
.satellite { position: absolute; width: 66%; height: 84%; object-fit: contain; right: 1%; top: 16%; }
.signal-waves { position: absolute; left: 27%; top: 32%; width: 18%; height: 38%; stroke: #e795ce; stroke-width: 1; opacity: .7; }
.signal-heading { position: absolute; top: 5.5%; left: 8%; color: #e5b9e9; }
h1 { margin: 0; font-size: clamp(34px, 11.7vw, 52px); line-height: 1; font-weight: 400; letter-spacing: .035em; text-shadow: 0 1px 1px #1a103d; }
.heading-rule { width: 155px; height: 20px; stroke: #edc7e7; stroke-width: 1; display: block; margin-top: 4px; }
.heading-rule .star { fill: #f8d3ec; stroke: none; }
.question-form { margin-top: auto; width: 100%; position: relative; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.question-prompt { display: block; padding: 0; width: 100%; text-align: center; font-size: clamp(21px, 6vw, 26px); font-weight: 400; line-height: 1.13; margin-bottom: 15px; text-shadow: 0 1px 4px #f1e1f5; }
.question-prompt span { display: block; }
.answer-list { display: grid; gap: 8px; }
.answer-choice {
  position: relative;
  width: 100%;
  min-height: 53px;
  padding: 7px 11px 7px 68px;
  display: flex;
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 20px 22px 18px 21px / 19px 20px 21px 22px;
  background: linear-gradient(105deg, #dfcee75c, #f5e9f251 62%, #d1c4e361);
  box-shadow: inset 1px 1px 0 #faf3ff70, 0 1px 2px #74568914;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.answer-choice:nth-child(2) { border-radius: 21px 17px 22px 19px / 20px 23px 18px 21px; }
.answer-choice:nth-child(3) { border-radius: 22px 21px 18px 20px / 23px 19px 22px 17px; }
.answer-choice input { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; margin: 0; opacity: 0; }
.answer-copy { font-size: 19px; line-height: 1.15; letter-spacing: -.005em; position: relative; z-index: 1; }
.choice-ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ink-outline { fill: none; stroke: #332c55; stroke-width: 1; vector-effect: non-scaling-stroke; }
.paper-flecks { opacity: .18; }
.answer-symbol { position: absolute; width: 44px; height: 44px; left: 15px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.answer-choice:has(input:checked) { background-color: #c1a2dd96; box-shadow: inset 0 0 0 1px #593775, 0 2px 4px #69528224; transform: translateX(1px); }
.answer-choice:has(input:checked)::after { content: '✓'; position: absolute; left: 48px; top: 4px; font-size: 15px; font-family: Georgia, serif; font-weight: 700; background: #f4e5f2; border-radius: 50%; width: 18px; height: 18px; text-align: center; line-height: 18px; }
.answer-choice:has(input:focus-visible), .paper-button:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.answer-error { height: 20px; margin: 6px 0 0; line-height: 20px; font-size: 14px; color: #622349; text-align: center; }
.answer-error:focus { outline: 1px dotted #622349; outline-offset: 1px; }
.answer-error:empty:focus { outline: none; }
.navigation-actions { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 4px; margin-top: 7px; }
.paper-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 51px; padding: 6px 14px; border: 1px solid var(--ink); border-radius: 26px 22px 25px 24px / 24px 27px 24px 21px; text-decoration: none; color: var(--ink); font-size: 24px; cursor: pointer; background: #ead9eac2; box-shadow: 2px 2px 0 #eee4f480; transition: transform 140ms ease, background-color 140ms ease; }
.paper-button:active { transform: translateY(1px); }
.paper-button span { font-size: 30px; line-height: 1; }
.navigation-arrow { width: 30px; height: 24px; flex: none; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.paper-stars { position: absolute; inset: 0 -22px; pointer-events: none; }
.ink-star { position: absolute; width: 14px; height: 14px; fill: #393257; }
.ink-star-1 { left: 1%; top: 40px; }
.ink-star-2 { right: 1%; top: 66px; width: 10px; height: 10px; }
.ink-star-3 { left: 3%; top: 0; width: 8px; height: 8px; fill: #8f6daf; }
.next-button { color: #f4d5f3; background: #3f285a var(--paper-art, none) 70% 9% / 290% auto; }
.navigation-star { font-size: 29px; text-align: center; font-weight: 400; }
.selection-dialog { width: min(340px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--ink); border-radius: 22px; color: var(--ink); background: #ebdcf0; box-shadow: 0 15px 40px #25144240; }
.selection-dialog::backdrop { background: #19132f88; }
.selection-dialog p { font-size: 24px; line-height: 1.25; margin: 0 0 22px; }
.selection-dialog .paper-button { width: 100%; }
@media (min-height: 900px) { .question-prompt { margin-bottom: 19px; } .answer-choice { min-height: 59px; } .answer-list { gap: 10px; } .navigation-actions { margin-top: 13px; } .paper-button { min-height: 57px; } .answer-copy { font-size: 19px; } }
@media (max-height: 740px) { .artwork-scene { height: 40%; } .signal-heading { top: 4%; } .question-screen { padding: 12px 19px 19px; background-size: 100% 88%; background-position: center -12px; } .satellite { width: 54%; height: 72%; right: 2%; top: 26%; } .answer-error { height: 18px; line-height: 18px; margin-top: 3px; font-size: 13px; } .question-prompt { font-size: 22px; margin-bottom: 12px; } .answer-choice { min-height: 49px; padding-left: 60px; } .answer-symbol { width: 38px; height: 38px; left: 12px; } .answer-copy { font-size: 17px; } .navigation-actions { margin-top: 3px; } .paper-button { min-height: 47px; font-size: 22px; } }
@media (max-height: 600px) { .artwork-scene { height: 34%; } .signal-heading { top: 4%; } h1 { font-size: 35px; } .heading-rule { width: 132px; margin-top: 1px; } .question-screen { padding: 10px 16px 16px; background-size: 100% 80%; background-position: center -20px; } .satellite { width: 49%; height: 70%; top: 29%; } .answer-error { height: 16px; line-height: 16px; margin-top: 1px; } .question-prompt { font-size: 20px; margin-bottom: 10px; } .answer-list { gap: 7px; } .answer-choice { min-height: 46px; padding: 5px 9px 5px 53px; } .answer-copy { font-size: 16px; } .answer-symbol { width: 34px; height: 34px; left: 11px; } .navigation-actions { margin-top: 1px; grid-template-columns: 1fr 26px 1fr; } .paper-button { min-height: 44px; padding: 5px 8px; font-size: 21px; gap: 7px; } .navigation-star { font-size: 24px; } .answer-choice:has(input:checked)::after { left: 35px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
/* Short phones compress only the painting. Its lower edge fades into paper,
   while the real question, answer targets and navigation retain their size. */
@media (max-height: 740px) {
  .question-screen { background-image: linear-gradient(to bottom, transparent 46%, var(--paper) 78%), var(--paper-art, none); background-size: 100% 100%, 100% 88%; background-position: center top, center -12px; }
  .paper-stars { inset: 0 -19px; }
  .ink-star-1 { left: .8%; top: 32px; width: 8px; height: 8px; }
  .ink-star-2 { right: .8%; top: 56px; width: 7px; height: 7px; }
  .ink-star-3 { display: none; }
}
@media (max-height: 600px) {
  .question-screen { background-size: 100% 100%, 100% 80%; background-position: center top, center -20px; }
  .paper-stars { inset: 0 -16px; }
}
@media (max-height: 530px) {
  .question-screen { padding-bottom: 10px; background-image: linear-gradient(to bottom, transparent 32%, var(--paper) 59%), var(--paper-art, none); background-size: 100% 100%, 100% 67%; background-position: center top, center -20px; }
  .artwork-scene { height: 24%; }
  .satellite { width: 41%; height: 90%; top: 9%; right: 1%; }
  .signal-heading { top: 3.5%; }
  h1 { font-size: 30px; }
  .heading-rule { width: 113px; height: 14px; }
  .question-prompt { font-size: 19px; line-height: 1.1; margin-bottom: 8px; }
  .answer-choice { min-height: 44px; }
  .answer-list { gap: 6px; }
  .navigation-arrow { width: 25px; height: 22px; }
}
/* Width and height are independent: tall narrow phones still need compact nav. */
@media (max-width: 360px) {
  .navigation-actions { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 3px; }
  .navigation-actions .paper-button { min-height: 44px; padding-left: 8px; padding-right: 8px; gap: 6px; font-size: 21px; }
  .navigation-arrow { width: 25px; height: 22px; }
  .navigation-star { font-size: 24px; }
}
