:root {
  color-scheme: dark;
  --ground: #1a1008;
  --ink: #f0e6c8;
  --gold: #c8a84b;
  --gold-bright: #f0d070;
  --panel: rgba(0, 0, 0, .7);
  --border: rgba(200, 168, 75, .4);
  --tint: rgba(200, 168, 75, .1);
  --muted: #cdbd92;
  --field: rgba(255, 248, 220, .95);
  --danger: #ffb9aa;
  --font: Georgia, 'Times New Roman', serif;
  --gradient: linear-gradient(135deg, var(--gold), var(--gold-bright), var(--gold));
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--ground); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font-family: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button, a, input, summary { outline-offset: 5px; }
:focus-visible { outline: 2px solid var(--gold-bright); }
[tabindex='-1']:focus { outline: none; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
h1, h2 { font-size: 22px; line-height: normal; font-weight: 600; color: var(--gold-bright); }
.page-progress { position: fixed; inset: 0 0 auto; height: 4px; background: rgba(255,255,255,.1); z-index: 10; }
#page-progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width .4s ease; }
.screen { min-height: 100svh; padding: 20px 16px 40px; }
/* Reference grid: 480px content + two equal outer gutters; fluid below 512px. */
.wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; max-width: 480px; margin: 0 auto; text-align: center; font-weight: 600; }
.logo { display: block; width: 140px; height: auto; filter: drop-shadow(0 0 20px rgba(200,168,75,.5)); }
.affirmation-logo { width: 120px; }
.intro { font-size: 17px; line-height: 1.7; }
.intro h1 { color: var(--ink); font-size: 17px; line-height: 1.7; font-weight: 600; }
.intro p { margin-top: 28.9px; }
.intro .intro-emphasis { color: var(--gold-bright); font-size: 18px; font-weight: 700; margin-top: 36.9px; }
form { width: 100%; }
#name-form { display: flex; flex-direction: column; gap: 18px; }
.text-input { display: block; width: 100%; padding: 16px 20px; border: 2px solid var(--gold); border-radius: 8px; background: var(--field); color: var(--ground); font-size: 18px; text-align: center; }
.text-input::placeholder { color: #756746; opacity: 1; }
.text-input[aria-invalid='true'] { border-color: var(--danger); }
.cta { display: block; width: 100%; padding: 18px; border: 0; border-radius: 8px; background: var(--gradient); color: var(--ground); font-size: 20px; font-weight: 700; letter-spacing: 1px; line-height: 1.15; text-align: center; text-decoration: none; text-transform: uppercase; box-shadow: 0 4px 20px rgba(200,168,75,.5); }
.cta:hover { filter: brightness(1.08); }
.cta:active { transform: translateY(1px); }
.panel { width: 100%; border: 1px solid var(--gold); border-radius: 12px; background: var(--panel); }
.affirmation-panel { padding: 24px; background: rgba(0,0,0,.6); }
.affirmation-panel h1 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.note { color: var(--gold); font-size: 14px; line-height: normal; margin: 8px 0; }
.phrase { font-size: 18px; line-height: 1.5; font-style: italic; margin: 12px 0; }
.affirmation-panel .cta { margin-top: 0; }
.question-header { padding: 16px; margin-bottom: 12px; }
.small-logo { display: inline-block; width: 80px; height: auto; margin: 0 auto 8px; }
.greeting { font-size: 14px; color: var(--gold); margin-bottom: 8px; overflow-wrap: anywhere; }
.balance-label { font-size: 11px; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); opacity: .8; }
.balance { font-size: 32px; font-weight: 700; color: var(--gold-bright); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.energy-row { display: flex; justify-content: space-between; gap: 8px; text-align: left; font-size: 12px; color: var(--gold); margin: 10px 0 4px; }
.track { height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.1); }
.fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width .5s ease; }
.unlocked-strip { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.thumb { display: block; width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--gold); border-radius: 6px; }
.question-card { border-color: var(--border); padding: 20px; }
.question-meta { margin-bottom: 12px; }
.question-tag { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: 2px; }
#question-count { white-space: nowrap; font-size: 12px; color: var(--gold); font-variant-numeric: tabular-nums; }
.question-title { color: var(--ink); font-size: 18px; line-height: 1.5; font-weight: 600; margin-bottom: 18px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { width: 100%; padding: 14px 16px; background: var(--tint); border: 1px solid var(--border); border-radius: 8px; color: var(--ink); font-size: 15px; line-height: normal; text-align: left; }
.choice:hover, .choice[aria-pressed='true'] { border-color: var(--gold); background: rgba(200,168,75,.2); }
.balance-input { padding: 14px; margin-bottom: 12px; }
.balance-input::-webkit-inner-spin-button, .balance-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.text-button { min-height: 44px; margin: 12px auto 0; padding: 8px 4px; border: 0; background: transparent; color: var(--gold); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--gold-bright); }
.error { color: var(--danger); text-align: left; font-size: 14px; font-weight: 400; line-height: 1.5; }
#answer-error { margin-top: 12px; }
dialog { width: min(440px, calc(100% - 40px)); max-height: 90svh; margin: auto; padding: 0; border: 2px solid var(--gold); border-radius: 14px; background: var(--ground); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.85); }
.modal-card { padding: 24px; text-align: center; font-weight: 600; }
.modal-card h2 { margin-bottom: 8px; }
.achievement-note { margin: 0 0 14px; }
.achievement-image { display: inline-block; width: 120px; height: auto; margin: 0 0 14px; border-radius: 10px; }
.achievement-description { font-size: 14px; line-height: normal; margin: 8px 0; }
.achievement-value { padding: 14px; margin: 12px 0; border: 1px solid var(--gold); border-radius: 8px; background: var(--tint); color: var(--gold-bright); font-size: 26px; font-weight: 700; }
.modal-card .cta { margin-top: 8px; }
.processing-panel, .completion-panel { padding: 24px; }
.processing-panel h1 { margin-bottom: 6px; }
.processing-panel > .note { font-size: 13px; margin: 6px 0 16px; }
.processing-status { font-size: 14px; line-height: normal; margin: 0 0 10px; }
.processing-track { height: 8px; margin-bottom: 6px; }
.processing-panel > #processing-percent { font-size: 14px; margin: 0 0 20px; }
.processing-panel h2 { margin-top: 16px; font-size: 20px; }
.portals { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 12px 0; }
.portal { display: flex; flex-direction: column; align-items: center; width: 70px; gap: 4px; }
.portal img { width: 70px; height: 70px; object-fit: cover; border: 2px solid var(--border); border-radius: 8px; }
.portal figcaption { font-size: 10px; color: var(--gold); line-height: 1.2; overflow-wrap: anywhere; }
figure { margin: 0; }
.processing-note { font-size: 16px; line-height: normal; color: var(--muted); margin-top: 16px; }
.completion-panel h1 { margin-top: 12px; overflow-wrap: anywhere; }
.completion-copy { font-size: 17px; line-height: 1.6; margin: 16px 0 20px; }
.focus-label { font-size: 13px; color: var(--gold); }
.priority { color: var(--gold-bright); font-size: 22px; line-height: 1.4; margin: 8px 0 22px; }
.answer-review { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 18px; text-align: left; font-size: 15px; font-weight: 400; }
summary { color: var(--gold-bright); cursor: pointer; min-height: 36px; }
.answer-review ol { padding-left: 24px; }
.answer-review li { margin: 14px 0; line-height: 1.5; }
.review-answer { display: block; color: var(--gold); margin-top: 4px; }
.completion-panel .cta { margin-top: 22px; }
.no-script { max-width: 480px; padding: 20px; margin: 0 auto; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
