:root {
  color-scheme: light;
  --ink: #2b2037;
  --muted: #67586f;
  --accent: #654683;
  --accent-deep: #4b3165;
  --paper: #f7f3fa;
  --panel: #fff;
  --lavender: #eee4f6;
  --line: #e1d5e8;
  font-family: system-ui, -apple-system, "PingFang SC", sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #ac85d3;
  outline-offset: 3px;
}
.home, .feedback { width: min(920px, calc(100% - 36px)); margin: 0 auto; }
.brand { height: 73px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand span { display: flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: .12em; font-weight: 750; }
.brand b, .section-head span, .badge { color: var(--accent-deep); background: var(--lavender); padding: 6px 11px; border-radius: 99px; font-size: 12px; white-space: nowrap; }
.opening { display: grid; grid-template-columns: minmax(215px, 300px) 1fr; gap: clamp(25px, 6vw, 66px); align-items: center; padding: 36px 0; }
.portrait { position: relative; margin: 0; height: 360px; border-radius: 23px; overflow: hidden; background: var(--lavender); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.portrait button { position: absolute; bottom: 12px; left: 12px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; font-weight: 750; color: var(--accent); margin: 0 0 10px; }
.welcome h1 { margin: 0 0 15px; font: 800 clamp(36px, 5.4vw, 65px)/1.1 "Songti SC", "Noto Serif CJK SC", serif; letter-spacing: -.04em; }
.lede { color: var(--muted); line-height: 1.7; font-size: 15px; margin: 0 0 16px; max-width: 27em; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
.primary, .outline, .icon { border: 1px solid var(--line); border-radius: 11px; padding: 9px 13px; min-height: 44px; background: var(--panel); color: var(--accent-deep); font-weight: 650; }
.primary { color: white; background: var(--accent-deep); border-color: var(--accent-deep); padding-inline: 17px; }
.primary span { padding-left: 12px; }
.outline[aria-pressed="true"] { background: var(--lavender); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 22px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { display: grid; grid-template-columns: 112px 1fr; gap: 13px; align-items: stretch; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; background: var(--panel); }
.card img { width: 100%; height: 100%; min-height: 142px; object-fit: cover; object-position: center 26%; }
.card-text { padding: 13px 12px 13px 0; }
.card h3 { margin: 3px 0 5px; font-size: 16px; }
.card p { margin: 0 0 8px; }
.card .eyebrow, .card .muted { font-size: 11px; }
.card button { min-height: 40px; font-size: 12px; }
footer { padding: 23px 0; color: var(--muted); font-size: 12px; }
a { color: var(--accent-deep); }
.player { width: min(760px, 100%); margin: 0 auto; min-height: 100dvh; background: var(--panel); border-inline: 1px solid var(--line); }
.player-header { display: flex; align-items: center; gap: 10px; padding: 10px 17px; background: var(--paper); }
.player-header .eyebrow { margin: 0 auto 0 0; }
.icon { width: 43px; height: 43px; padding: 0; font-size: 24px; }
.sequence-progress { width: 100%; display: block; height: 5px; border: 0; border-radius: 0; appearance: none; accent-color: var(--accent); }
.sequence-progress::-webkit-progress-bar { background: var(--lavender); }
.sequence-progress::-webkit-progress-value { background: var(--accent); }
.player-content { display: grid; grid-template-columns: minmax(235px, 325px) minmax(200px, 1fr); gap: 20px; align-items: start; padding: 16px; }
.screen { position: relative; width: 100%; aspect-ratio: 9 / 16; isolation: isolate; background: #b3a8ba; border-radius: 16px; overflow: hidden; }
.screen video, #guide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#guide { pointer-events: none; }
.halo, .trace { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.halo { stroke: #382447; stroke-width: 10; opacity: .75; }
.trace { stroke: #fff0ba; stroke-width: 5; }
.instructions h1 { font-size: 25px; margin: 4px 0 9px; }
.instructions p { line-height: 1.6; margin: 0 0 10px; }
.route { font-weight: 750; color: var(--accent-deep); font-size: 14px; }
.settings { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.settings button { font-size: 12px; }
.safety { background: var(--paper); border-radius: 9px; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.status { min-height: 1.5em; }
.transport { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; padding: 7px 12px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fcf9fdf5; }
.timer-center { display: grid; justify-items: center; gap: 2px; }
.timer { width: 100px; height: 100px; border: 0; background: transparent; position: relative; color: var(--accent-deep); display: grid; align-content: center; justify-items: center; gap: 2px; }
.timer svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke: var(--line); stroke-width: 5; }
.timer #ring { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
#digits { font-size: 27px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
#timer-label { font-size: 11px; font-weight: 700; }
.duration { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.duration select { border: 1px solid var(--line); border-radius: 7px; padding: 4px; background: var(--panel); color: var(--accent-deep); font-size: 12px; }
.feedback { padding-top: max(45px, 10vh); }
.feedback h1 { margin: 0 0 15px; font-size: clamp(32px, 6vw, 55px); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback .status { margin: 18px 0; }
@media (max-width: 620px) {
  .home, .feedback { width: calc(100% - 28px); }
  .brand { height: 60px; }
  .brand span { font-size: 9px; }
  .opening { grid-template-columns: 1fr; gap: 22px; padding: 18px 0 25px; }
  .portrait { height: clamp(205px, 60vw, 310px); }
  .portrait img { object-position: center 23%; }
  .welcome h1 { font-size: clamp(37px, 10vw, 53px); }
  .welcome h1 br { display: none; }
  .cards { grid-template-columns: 1fr; }
  .card { grid-template-columns: 104px 1fr; }
  .player { border: 0; }
  .player-content { grid-template-columns: 1fr; gap: 11px; padding: 11px 14px 6px; }
  .screen { width: min(100%, 350px, 47svh); margin: 0 auto; }
  .instructions h1 { font-size: 21px; }
  .instructions p { font-size: 13px; }
  .player-header { padding: 5px 13px; }
}
/* Keep the video above the fixed practice controls. */
@media (min-height: 490px) {
  .screen { width: min(100%, 350px, max(150px, calc((100svh - 230px) * .5625))); justify-self: center; }
}

.photo-prompt { padding: 10px 16px; background: var(--paper); }
.feedback .photo-prompt { padding: 0; margin-bottom: 16px; }
.photo-prompt button { font-size: 13px; }
.photo-prompt p { margin: 6px 0 0; }
.photo-prompt [role="status"]:empty { margin: 0; }
.photos { width: min(700px, calc(100% - 28px)); margin: 0 auto; padding: 18px 0 30px; }
.photos h1 { margin: 14px 0; font-size: clamp(28px, 7vw, 43px); }
#photos-note { min-height: 1.55em; }
.photo-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo-pair figure { margin: 0; }
.photo-frame { position: relative; display: grid; place-items: center; overflow: hidden; aspect-ratio: 3 / 4; border: 1px solid var(--line); border-radius: 13px; background: var(--lavender); }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.photo-frame p { margin: 0; padding: 10px; text-align: center; }
.photo-pair figcaption { padding: 7px 2px 0; font-size: 13px; font-weight: 650; }
.photo-picker { position: relative; display: inline-flex; align-items: center; font-size: 13px; }
.photo-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-picker:focus-within { outline: 3px solid #ac85d3; outline-offset: 3px; }

/* Empty states expose real, keyboard-accessible navigation to photo capture. */
.photo-frame > div { padding: 12px 8px; text-align: center; width: 100%; }
.photo-frame > div p { padding: 0 0 12px; }
.photo-frame button { max-width: 100%; min-height: 48px; padding: 10px; line-height: 1.5; touch-action: manipulation; }
.photo-picker { min-height: 48px; touch-action: manipulation; }
.photo-frame button:focus-visible { outline: 3px solid #ac85d3; outline-offset: 2px; }
