/* Global styles and variables — palette, timing, and motion adjustment points. */
@font-face {
  font-family: 'Fraunces';
  src: url('assets/fonts/Fraunces.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

.site-footer {
  padding: 1rem 1.5rem 2rem;
  text-align: center;
}

.site-footer a {
  color: inherit;
  font-size: 0.9rem;
}

.legal-page {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0;
  line-height: 1.65;
}

.legal-page h1,
.legal-page h2 {
  line-height: 1.2;
}

.legal-page h2 {
  margin-top: 2rem;
}
:root {
  --cream: #FCF0DA;
  --olive: #AEAC78;
  --mustard: #F2C46A;
  --brown: #4C4541;
  --orange: #C45D30;
  --tan: #D4A574;
  --inflation-below: #5E7045;
  --inflation-above: #A34432;
  --display: 'Fraunces', 'Cooper Black', 'Bookman Old Style', Georgia, serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --wave-distance: 6px;
  --rear-period: 18s;
  --front-period: 15s;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--brown); }
button { font: inherit; }
[hidden] { display: none !important; }

/* Background — isolated poster with a static, very faint printed-paper texture. */
.poster {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow-x: hidden;
  background: var(--cream);
}
.poster::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%234C4541' opacity='.22' filter='url(%23grain)' d='M0 0h160v160H0z'/%3E%3C/svg%3E");
}
.account-area {
  position: fixed;
  z-index: 12;
  top: 18px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.account-button {
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid rgba(76,69,65,.72);
  border-radius: 999px;
  background: rgba(252,240,218,.92);
  color: var(--brown);
  font: 700 12px/1 Arial, sans-serif;
  letter-spacing: .02em;
  box-shadow: 0 2px 0 rgba(76,69,65,.24);
  cursor: pointer;
}
.account-button-primary { background: var(--orange); color: var(--cream); }
.account-button:hover { transform: translateY(-1px); }
.account-button:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
.account-profile { width: 38px; height: 38px; }
.account-status {
  position: fixed;
  z-index: 12;
  top: 62px;
  right: 22px;
  width: min(310px, calc(100vw - 44px));
  margin: 0;
  color: var(--brown);
  text-align: right;
  font: 600 12px/1.4 Arial, sans-serif;
}
.account-status:empty { display: none; }
.scenery { position: fixed; inset: 0; pointer-events: none; }
.layer { position: absolute; }
.layer img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Rainbow stripes — keep each SVG's inward bend whole, while its lower arc exits the page edge. */
.rainbow { z-index: 2; top: -2%; width: min(340px, 42.1svh); height: 104%; --stripe-opacity: .65; opacity: var(--stripe-opacity); }
.rainbow img { object-fit: fill; }
.rainbow-left { left: -8%; animation: stripes-left-in .9s .1s var(--ease) both; }
.rainbow-right { right: -8%; animation: stripes-right-in .9s .1s var(--ease) both; }

/* Rear waves — overscan accommodates the entire horizontal motion range. */
.rear-waves { z-index: 3; bottom: -8px; left: -35px; width: calc(100% + 70px); height: clamp(38px, 7svh, 72px); animation: waves-in .9s .2s var(--ease) both; }
.rear-waves .wave-art { object-fit: fill; animation: rear-flow var(--rear-period) 1.2s ease-in-out infinite; }

/* Front waves — independent wrapper entrance and slower inner motion. */
.front-waves { z-index: 5; bottom: -12px; left: -35px; width: calc(100% + 70px); height: clamp(30px, 5svh, 52px); animation: waves-in .9s .35s var(--ease) both; }
.front-waves .wave-art { object-fit: fill; animation: front-flow var(--front-period) 1.2s ease-in-out infinite; }

/* Main content — generous central space, stationary after entrance. */
.main-content {
  position: relative; z-index: 8; width: min(860px, 88%); margin: 0 auto;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 48px 0 80px;
}
.main-content.game-active { justify-content: flex-start; }
.screen { width: 100%; }
.wordmark {
  margin: 0; font-family: var(--display); font-weight: 900;
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
  font-size: clamp(64px, 8.5vw, 122px); line-height: 1.12; letter-spacing: -.065em;
  animation: content-in .8s .55s var(--ease) both;
}
.wordmark span { color: var(--orange); }
.subtitle { margin: 16px 0 32px; font: 400 clamp(20px, 2.2vw, 29px)/1.4 var(--display); font-variation-settings: 'SOFT' 60; letter-spacing: -.035em; animation: content-in .8s .65s var(--ease) both; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 28px;
  border: 1px solid var(--brown); border-radius: 100px; padding: 16px 33px;
  min-width: 160px; min-height: 56px;
  background: var(--orange); color: var(--cream); font: 600 19px/1.2 var(--display);
  box-shadow: 0 2px 0 var(--brown); cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s;
}
#begin { animation: button-in .7s .8s var(--ease) backwards; }
@media (hover: hover) { .button:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--brown); } }
.arrow { position: relative; width: 16px; height: 16px; }
.arrow::before { content: ''; position: absolute; width: 18px; height: 2px; top: 7px; left: -1px; background: currentColor; transform: rotate(-45deg); }
.arrow::after { content: ''; position: absolute; width: 9px; height: 9px; right: 0; top: 0; border-top: 2px solid currentColor; border-right: 2px solid currentColor; }
.arrow-forward { transform: rotate(45deg); }
.arrow-back { transform: rotate(-135deg); }
.button:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--brown); }
.button:focus-visible { outline: 3px solid var(--brown); outline-offset: 7px; }
.challenge-title { margin: 20px 0 36px; font: 700 clamp(30px, 4.5vw, 58px)/1.2 var(--display); letter-spacing: -.04em; }
.challenge-title:focus { outline: none; }
.screen.is-entering { animation: screen-in .35s var(--ease) both; }

/* Buying Power Explorer --------------------------------------------------
   A deliberately spare editorial screen: one result, then the data beneath. */
.welcome-actions {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin-inline: auto;
}
.welcome-actions .button { justify-content: center; }
.welcome-actions .button-outline {
  min-width: 244px;
  min-height: 47px;
  gap: 14px;
  padding: 11px 22px;
  border-color: rgba(76,69,65,.7);
  background: rgba(252,240,218,.88);
  color: var(--brown);
  font-size: 16px;
  box-shadow: 0 2px 0 rgba(76,69,65,.28);
}
.welcome-actions .button-outline:hover { background: var(--mustard); }
.welcome-actions .button-outline .arrow { width: 13px; height: 13px; transform: scale(.76); }
.buying-power-screen {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 15px 0 clamp(88px, 14vh, 140px);
  text-align: left;
}
.bp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0 0 clamp(36px, 5vw, 52px);
}
.bp-top-label,.bp-eyebrow,.bp-result-overline {
  color: var(--orange);
  font: 800 10px/1.45 Arial, sans-serif;
  letter-spacing: .17em;
}
.bp-top-label { color: rgba(76,69,65,.68); text-align: right; }
.bp-back {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  border: 0;
  background: none;
  padding: 8px 0;
  color: var(--brown);
  cursor: pointer;
  font: 700 13px/1.4 Arial, sans-serif;
}
.bp-back:hover { color: var(--orange); }
.bp-back span { font-size: 23px; line-height: .8; }
.bp-header { margin: 0 auto 35px; text-align: center; }
.bp-header .bp-eyebrow { margin: 0 0 13px; }
.bp-header h2 {
  max-width: 690px;
  margin: 0 auto 12px;
  font: 850 clamp(37px, 6.6vw, 62px)/1.04 var(--display);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
  letter-spacing: -.065em;
}
.bp-header h2 em { color: var(--orange); font-style: normal; }
.bp-header h2:focus { outline: none; }
.bp-header > p:last-child {
  max-width: 490px;
  margin: 0 auto;
  font: 500 16px/1.55 Arial, sans-serif;
}
.bp-loading,.bp-error {
  padding: 26px;
  border: 1px solid rgba(76,69,65,.25);
  border-radius: 17px;
  text-align: center;
  font: 600 14px/1.5 Arial, sans-serif;
}
.bp-selector-block { margin-bottom: 30px; }
.bp-selector-block h3,.bp-year-heading label {
  display: block;
  margin: 0 0 13px;
  font: 750 14px/1.4 Arial, sans-serif;
}
.bp-categories {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}
.bp-category {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
  border: 1.5px solid rgba(76,69,65,.35);
  border-radius: 14px;
  background: rgba(255,251,241,.65);
  color: var(--brown);
  cursor: pointer;
  font: 750 13px/1.3 Arial, sans-serif;
  text-align: center;
  transition: background .18s, border .18s, transform .18s, box-shadow .18s;
}
.bp-category:hover { background: rgba(242,196,106,.25); transform: translateY(-2px); }
.bp-category.is-selected {
  background: rgba(242,196,106,.38);
  border: 2px solid var(--brown);
  box-shadow: 0 3px 0 rgba(76,69,65,.24);
}
.bp-category-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--orange);
  font: 700 26px/1 var(--display);
}
.bp-category.is-selected .bp-category-mark { background: var(--orange); color: var(--cream); border-color: var(--orange); }
.bp-year-block {
  padding: 25px clamp(16px, 4vw, 30px) 18px;
  border: 1px solid rgba(76,69,65,.28);
  border-radius: 18px;
  background: rgba(255,251,241,.55);
}
.bp-year-heading { display: flex; justify-content: space-between; align-items: center; }
.bp-year-heading label { margin: 0; }
.bp-year-heading output {
  color: var(--orange);
  font: 850 32px/1 var(--display);
  font-variant-numeric: tabular-nums;
}
#bp-year {
  display: block;
  width: 100%;
  height: 34px;
  margin: 14px 0 0;
  cursor: pointer;
  accent-color: var(--orange);
  touch-action: pan-y;
}
.bp-year-ticks { display: flex; justify-content: space-between; gap: 3px; }
.bp-year-ticks span { font: 700 10px/1.5 Arial, sans-serif; opacity: .75; font-variant-numeric: tabular-nums; }
#bp-year-help {
  margin: 12px 0 0;
  color: rgba(76,69,65,.7);
  font: 500 11px/1.5 Arial, sans-serif;
}
.bp-result {
  padding: clamp(22px,5vw,40px);
  border: 1px solid rgba(76,69,65,.35);
  border-radius: 23px;
  background: rgba(255,249,235,.84);
  box-shadow: 0 4px 0 rgba(76,69,65,.09);
  text-align: center;
}
.bp-result-overline { margin: 0 0 12px; }
.bp-result-main h3 {
  max-width: 660px;
  margin: 0 auto 13px;
  font: 800 clamp(27px, 4.3vw, 40px)/1.16 var(--display);
  letter-spacing: -.035em;
}
.bp-result-main h3.bp-better { color: var(--inflation-below); }
.bp-result-main h3.bp-worse { color: var(--orange); }
.bp-result-main p { max-width: 530px; margin: 0 auto 21px; font: 500 16px/1.5 Arial,sans-serif; }
.bp-amounts {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  max-width: 565px;
  margin: 0 auto 16px;
}
.bp-amount {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; min-height: 120px;
  padding: 15px 8px;
  border-radius: 14px;
  background: rgba(242,196,106,.19);
}
.bp-amount:last-child { background: rgba(174,172,120,.21); }
.bp-amount-label {
  font: 800 9px/1.4 Arial,sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bp-amount strong {
  margin: 5px 0;
  font: 850 clamp(25px, 4.6vw, 39px)/1.1 var(--display);
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.bp-amount small { max-width: 185px; font: 500 10px/1.4 Arial,sans-serif; opacity: .8; }
.bp-amount-arrow { color: var(--orange); font: 750 27px/1 var(--display); }
.bp-income-comparison { margin: 0 auto; font: 700 13px/1.65 Arial,sans-serif; }
.bp-qualifier { max-width: 535px; margin: 14px auto 0; color: rgba(76,69,65,.78); font: 500 11px/1.5 Arial,sans-serif; }
.bp-method { margin: 20px 0 0; border: 1px solid rgba(76,69,65,.28); border-radius: 14px; background: rgba(255,251,241,.55); }
.bp-method > summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 19px 22px; cursor: pointer;
  list-style: none;
  font: 750 15px/1.3 var(--display);
}
.bp-method > summary::-webkit-details-marker { display: none; }
.bp-method > summary span { color: var(--orange); font: 800 24px/1 Arial,sans-serif; }
.bp-method[open] > summary span { transform: rotate(45deg); }
.bp-method-inner { padding: 0 22px 22px; font: 500 12px/1.6 Arial,sans-serif; }
.bp-method-inner p { margin-top: 0; }
.bp-method-inner h3 { font: 750 14px/1.3 Arial,sans-serif; margin: 20px 0 5px; }
.bp-method-note,.bp-method-date { opacity: .79; }
#bp-sources { display: grid; gap: 7px; padding-left: 21px; margin: 10px 0 17px; }
#bp-sources a { color: var(--orange); text-underline-offset: 3px; overflow-wrap: anywhere; }
.bp-back:focus-visible,.bp-category:focus-visible,#bp-year:focus-visible,
.bp-method summary:focus-visible,.welcome-actions .button:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 4px;
}
@media (max-width: 600px) {
  .account-area { top: 12px; right: 12px; }
  .account-status { top: 56px; right: 12px; width: calc(100vw - 24px); }
  .account-button { min-height: 34px; padding: 7px 12px; }
  .buying-power-screen { width: 100%; padding-top: 0; }
  .bp-top { margin-bottom: 30px; }
  .bp-top-label { font-size: 8px; }
  .bp-categories { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bp-category { min-height: 82px; flex-direction: row; gap: 9px; }
  .bp-category-mark { width: 32px; height: 32px; font-size: 22px; flex: 0 0 auto; }
  .bp-year-ticks span { font-size: 8px; }
  .bp-amount { min-height: 113px; }
  .bp-amount-label { font-size: 8px; }
  .bp-amount strong { font-size: clamp(20px, 6vw, 31px); }
}
@media (prefers-reduced-motion: reduce) {
  .bp-category { transition: none; }
}

/* Playable question ------------------------------------------------------- */
.game-screen { padding: clamp(22px, 5vh, 56px) 0 118px; }
.challenge-meta {
  display: flex; justify-content: space-between; gap: 20px; margin: 0 auto 28px;
  font: 700 10px/1.4 Arial, sans-serif; letter-spacing: 2.2px; text-transform: uppercase;
}
.product-name {
  margin: 0 0 18px; color: var(--orange);
  font: 700 clamp(16px, 2vw, 21px)/1.35 Arial, sans-serif; letter-spacing: 2.2px; text-transform: uppercase;
}
.modern-price-block { display: grid; justify-items: center; gap: 3px; }
.modern-price-block > span { font: 600 13px/1.4 Arial, sans-serif; }
.modern-price { font: 850 clamp(46px, 8vw, 78px)/1 var(--display); letter-spacing: -.05em; }
.game-screen .challenge-title { margin: 30px 0 24px; font-size: clamp(28px, 4.5vw, 48px); }
#guess-form { display: grid; justify-items: center; }
#guess-form label { margin-bottom: 9px; font: 600 12px/1.4 Arial, sans-serif; }
.money-input {
  width: min(270px, 100%); min-height: 62px; border: 2px solid var(--brown);
  border-radius: 18px; background: rgba(252, 240, 218, .88); box-shadow: 0 3px 0 rgba(76, 69, 65, .2);
  transition: width .8s var(--ease), min-height .8s var(--ease), background-color 1.8s var(--ease);
}
.money-input:not(.is-revealed):focus-within { outline: 3px solid var(--mustard); outline-offset: 3px; }
.guess-entry { display: flex; align-items: center; min-height: 58px; }
.guess-entry > span { padding-left: 20px; font: 700 28px/1 var(--display); }
.money-input input {
  width: 100%; min-width: 0; border: 0; outline: 0; padding: 13px 18px 13px 8px;
  background: transparent; color: var(--brown); font: 700 30px/1.1 var(--display); text-align: center;
}
.money-input input::placeholder { color: rgba(76, 69, 65, .35); }
.money-input.is-revealed { width: min(640px, 100%); min-height: 126px; }
.money-input.accuracy-very-wrong { background: #E3B0A0; }
.money-input.accuracy-wrong { background: #E0B07C; }
.money-input.accuracy-close { background: #C5C796; }
.money-input.accuracy-excellent { background: #EBCF87; }
.answer-reveal {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  min-height: 122px; padding: 20px clamp(18px, 5vw, 46px); gap: clamp(12px, 3vw, 28px);
}
.answer-price { display: grid; justify-items: center; gap: 7px; min-width: 0; }
.answer-price span {
  font: 700 9px/1.3 Arial, sans-serif; letter-spacing: 1.5px; text-transform: uppercase;
}
.answer-price strong { font: 800 clamp(29px, 5vw, 44px)/1 var(--display); letter-spacing: -.035em; }
.answer-arrow { color: var(--orange); font: 700 clamp(24px, 4vw, 34px)/1 var(--display); }
.form-error { min-height: 20px; margin: 7px 0 10px; color: #8e351f; font: 600 12px/1.4 Arial, sans-serif; }
.button:disabled { cursor: not-allowed; opacity: .48; transform: none; box-shadow: 0 1px 0 var(--brown); }
.status-panel { padding: 40px 20px; font: 650 24px/1.4 var(--display); }
.error-panel { color: #8e351f; }

/* In-place answer reveal ------------------------------------------------- */
.answer-followup { margin-top: 15px; }
.question-score {
  margin: 0; color: var(--orange); opacity: 0; transform: translateY(8px);
  font: 800 clamp(25px, 4vw, 36px)/1.2 var(--display);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.question-score small { display: block; margin-top: 5px; color: var(--brown); font: 700 13px/1.3 Arial, sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.answer-followup.is-visible .question-score { opacity: 1; transform: none; }
.next-question { margin: 18px 0 22px; background: var(--mustard); color: var(--brown); }
.economic-comparisons { display: grid; gap: 9px; width: min(640px, 100%); margin: 0 auto; text-align: left; }
.economic-accordion {
  overflow: hidden; border: 1px solid rgba(76, 69, 65, .45); border-radius: 14px;
  background: rgba(252, 240, 218, .82);
}
.economic-accordion > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 18px;
  color: var(--brown); cursor: pointer; list-style: none; font: 700 clamp(17px, 2.5vw, 22px)/1.2 var(--display);
}
.economic-accordion > summary::-webkit-details-marker { display: none; }
.economic-accordion > summary span { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease); }
.economic-accordion[open] > summary span { transform: rotate(225deg); }
.accordion-content { padding: 0 18px 18px; font: 400 13px/1.55 Arial, sans-serif; }
.inflation-panel-content { display: grid; gap: 0; }
.inflation-benchmark { padding: 16px; border-top: 1px solid rgba(76, 69, 65, .18); border-radius: 10px; background: rgba(242, 196, 106, .3); }
.inflation-panel-label { margin: 0; font: 700 12px/1.4 Arial, sans-serif; }
.inflation-benchmark-value { margin: 5px 0 4px; color: var(--orange); font: 850 clamp(30px, 5vw, 40px)/1 var(--display); letter-spacing: -.025em; }
.inflation-benchmark-value span { font: 700 13px/1.3 Arial, sans-serif; letter-spacing: 0; }
.inflation-panel-subtitle { margin: 0; opacity: .78; font: 500 11px/1.4 Arial, sans-serif; }
.inflation-actual-comparison { padding: 16px 0 15px; }
.inflation-direction { display: flex; align-items: center; gap: 8px; margin: 0; font: 800 clamp(22px, 4vw, 30px)/1.1 var(--display); }
.inflation-direction-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 2px solid currentColor; border-radius: 50%; font: 900 19px/1 Arial, sans-serif; }
.inflation-direction-below { color: var(--inflation-below); }
.inflation-direction-above { color: var(--inflation-above); }
.inflation-direction-neutral { color: var(--brown); }
.inflation-summary { margin: 9px 0 0; font: 500 13px/1.55 Arial, sans-serif; }
.inflation-period-note { margin: 7px 0 0; opacity: .72; font: 500 11px/1.45 Arial, sans-serif; }
.inflation-unavailable { padding: 16px 0; border-top: 1px solid rgba(76, 69, 65, .18); }
.inflation-unavailable p:last-child { margin: 7px 0 0; }
.inflation-sources { padding-top: 12px; border-top: 1px solid rgba(76, 69, 65, .24); }
.inflation-sources > summary { display: inline-flex; align-items: center; gap: 7px; color: var(--orange); cursor: pointer; list-style: none; font: 700 12px/1.4 Arial, sans-serif; text-decoration: underline; text-underline-offset: 3px; }
.inflation-sources > summary::-webkit-details-marker { display: none; }
.inflation-sources > summary span { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease); }
.inflation-sources[open] > summary span { transform: rotate(225deg); }
.inflation-source-list { padding-top: 12px; }
.inflation-source-list ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.inflation-source-list li { display: grid; gap: 2px; }
.inflation-source-list li > span { font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.inflation-source-list a { color: var(--orange); font-weight: 700; }
.inflation-source-list small, .inflation-sources-empty { opacity: .72; font-size: 10px; }
.inflation-sources-empty { margin: 0; }
.total-score {
  position: fixed; z-index: 10; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; justify-content: space-between; align-items: center; width: min(720px, calc(100% - 32px));
  min-height: 66px; padding: 15px 22px 13px; border-top: 1px solid rgba(76, 69, 65, .5);
  border-bottom: 1px solid rgba(76, 69, 65, .5); border-radius: 10px;
  background: rgba(252, 240, 218, .94); box-shadow: 0 3px 12px rgba(76, 69, 65, .12); text-transform: uppercase;
}
.total-score span { font: 700 13px/1.3 Arial, sans-serif; letter-spacing: 2px; }
.total-score strong { color: var(--orange); font: 800 32px/1 var(--display); }

/* Final results ---------------------------------------------------------- */
.results-screen { width: 100%; }
.results-title { margin: 8px 0 26px; font: 700 clamp(31px, 5vw, 52px)/1.15 var(--display); letter-spacing: -.04em; }
.results-title strong { color: var(--orange); white-space: nowrap; }
.final-results { margin-bottom: 30px; padding: clamp(30px, 6vw, 60px); border: 1px solid rgba(76, 69, 65, .35); border-radius: 22px; background: rgba(252, 240, 218, .86); }
.final-results > p:last-child { margin-bottom: 0; font: 500 16px/1.5 Arial, sans-serif; }
.sources-methodology { overflow: hidden; margin: 0 auto 28px; border: 1px solid rgba(76, 69, 65, .45); border-radius: 16px; background: rgba(252, 240, 218, .9); text-align: left; }
.sources-methodology > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; cursor: pointer; list-style: none; font: 750 clamp(18px, 2.6vw, 24px)/1.2 var(--display); }
.sources-methodology > summary::-webkit-details-marker { display: none; }
.sources-methodology > summary span { width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease); }
.sources-methodology[open] > summary span { transform: rotate(225deg); }
.sources-content { padding: 0 20px 20px; font: 400 13px/1.55 Arial, sans-serif; }
.general-inflation { overflow: hidden; margin-top: 16px; border: 1px solid rgba(76, 69, 65, .3); border-radius: 11px; background: rgba(242, 196, 106, .16); }
.general-inflation > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; cursor: pointer; list-style: none; font: 750 17px/1.2 var(--display); }
.general-inflation > summary::-webkit-details-marker { display: none; }
.general-inflation > summary span { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s var(--ease); }
.general-inflation[open] > summary span { transform: rotate(225deg); }
.general-inflation-content { padding: 0 15px 15px; }
.general-inflation-content > p { margin: 0 0 12px; }
.source-question { padding-top: 16px; border-top: 1px solid rgba(76, 69, 65, .25); }
.source-question h3 { margin: 0 0 6px; color: var(--orange); font: 750 17px/1.3 var(--display); }
.source-question > p { margin: 6px 0 12px; }
.source-question ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.source-question li { display: grid; gap: 2px; }
.source-question li > span { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.source-question a { color: var(--orange); font-weight: 700; }
.source-question small { display: block; opacity: .78; }
.source-note { font-size: 11px; opacity: .78; }
.button-secondary { background: var(--cream); color: var(--brown); }

/* One shared results card: score, standing, and distribution curve. */
.final-results-combined {
  margin-bottom: 30px;
  padding: clamp(24px, 4vw, 40px);
}
.final-results-combined .results-title {
  margin: 8px 0 16px;
}
.score-distribution-content {
  width: 100%;
  padding-top: 14px;
  text-align: left;
}
.score-distribution-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.score-distribution-standing {
  order: 2;
  position: relative;
  isolation: isolate;
  margin: 0;
  text-align: center;
  font: 700 clamp(18px, 2.7vw, 25px)/1.5 var(--display);
}
.score-distribution-sentence {
  position: relative;
  z-index: 1;
}
.score-distribution-beat {
  color: var(--inflation-below);
  font: 800 clamp(30px, 4.2vw, 42px)/1.15 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.score-distribution-demo {
  order: 1;
  align-self: flex-end;
  margin-bottom: 0;
  color: var(--inflation-below);
  font: 750 10px/1.5 Arial, sans-serif;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.score-distribution-plot { width: 100%; margin-top: 0; }
.score-distribution-svg { display: block; width: 100%; height: auto; overflow: visible; }
.score-chart-area { fill: var(--tan); opacity: .28; }
.score-chart-curve {
  fill: none;
  stroke: var(--orange);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.score-chart-axis, .score-chart-tick { stroke: rgba(76, 69, 65, .52); stroke-width: 1.5; }
.score-chart-labels { font: 600 11px/1 Arial, sans-serif; fill: var(--brown); }
.score-chart-marker {
  stroke: var(--inflation-below);
  stroke-width: 3;
  stroke-dasharray: 8 6;
}
.score-chart-dot { fill: var(--inflation-below); stroke: var(--cream); stroke-width: 2; }
.score-chart-marker-label {
  fill: var(--inflation-below);
  font: 800 12px/1 Arial, sans-serif;
  letter-spacing: 1px;
}
.score-distribution-disclaimer {
  margin: 10px 0 0;
  color: rgba(76, 69, 65, .83);
  font: 400 12px/1.5 Arial, sans-serif;
}
@media (max-width: 600px) {
  .final-results-combined { padding: 22px 18px; }
  .score-distribution-standing { font-size: 18px; }
  .score-distribution-beat { font-size: clamp(27px, 7vw, 34px); }
  .score-distribution-demo { font-size: 9px; }
}

/* Decorative score physics and period-accurate, solid-color burst wedges. */
.results-score-digit {
  display: inline-block;
  white-space: pre;
  transform-origin: 50% 85%;
  will-change: transform;
}
.score-chart-player-marker { pointer-events: none; }
.score-chart-interaction-surface {
  fill: transparent;
  pointer-events: all;
}
.score-chart-marker-string {
  fill: none;
  stroke: var(--inflation-below);
  stroke-width: 3;
  stroke-dasharray: 8 6;
  stroke-linecap: round;
}
.score-chart-player-marker .score-chart-dot {
  transition: r .18s ease, stroke-width .18s ease;
}
.score-chart-player-marker.is-string-latched .score-chart-dot {
  r: 7px;
  stroke-width: 3;
}
/* Bounded click-and-pull states. Decorative elements never block controls. */
.wordmark.cursor-ready,
.results-title strong {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.wordmark.is-letter-dragging,
.results-title strong.is-score-dragging { cursor: grabbing; }
html.is-wave-dragging {
  cursor: grabbing;
  user-select: none;
  -webkit-user-select: none;
}
@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  .wordmark, .results-title strong { cursor: auto; }
}

/* Developer mode ---------------------------------------------------------- */
.dev-panel {
  position: fixed; z-index: 12; right: 12px; top: 12px; width: min(310px, calc(100% - 24px));
  padding: 13px; border: 1px solid var(--brown); border-radius: 12px; background: rgba(252, 240, 218, .97);
  box-shadow: 0 5px 18px rgba(76, 69, 65, .18); font: 600 11px/1.4 Arial, sans-serif; text-align: left;
}
.dev-panel strong, .dev-panel label { display: block; margin-bottom: 7px; }
.dev-actions, .dev-date-row { display: flex; gap: 5px; margin-bottom: 8px; }
.dev-panel button, .dev-panel input { min-height: 30px; border: 1px solid var(--brown); border-radius: 7px; background: var(--cream); color: var(--brown); }
.dev-panel button { cursor: pointer; }
.dev-panel input { min-width: 0; flex: 1; }
.dev-panel p { min-height: 15px; margin: 4px 0 0; }
.dev-score-options { border-top: 1px solid rgba(76, 69, 65, .22); margin-top: 8px; padding-top: 10px; }
.dev-score-options label:first-child { display: flex; align-items: center; gap: 8px; }
.dev-score-options input[type=checkbox] {
  flex: 0 0 auto; width: 16px; height: 16px; min-height: 16px; accent-color: var(--orange);
}
.dev-score-options input[type=number] { width: 100%; max-width: 90px; padding: 4px; }


/* Entrance animations — complete by 1.55 seconds. */
@keyframes stripes-left-in { from { opacity: 0; transform: translate(-25px, -35px); } to { opacity: var(--stripe-opacity); transform: none; } }
@keyframes stripes-right-in { from { opacity: 0; transform: translate(25px, -35px); } to { opacity: var(--stripe-opacity); transform: none; } }
@keyframes waves-in { from { opacity: 0; transform: translateY(45px); } to { opacity: 1; transform: none; } }
@keyframes content-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes button-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Ambient animations — small, slow horizontal wave motion. */
@keyframes rear-flow { 0%, 100% { transform: translateX(calc(-1 * var(--wave-distance))); } 50% { transform: translateX(var(--wave-distance)); } }
@keyframes front-flow { 0%, 100% { transform: translateX(5px); } 50% { transform: translateX(-5px); } }

/* Responsive layout — keep the central quiet space clear on narrow/short screens. */
@media (max-width: 900px) {
  .wordmark { font-size: clamp(64px, 10vw, 95px); }
}
@media (max-width: 600px) {
  .main-content { width: 90%; padding: 40px 0 64px; }
  .wordmark { font-size: clamp(44px, 13vw, 78px); }
  .subtitle { margin: 18px 0 30px; font-size: clamp(17px, 5vw, 25px); }
  .rainbow { width: min(160px, 42.1svh); --stripe-opacity: .5; }
  .rainbow-left { left: -48px; }
  .rainbow-right { right: -48px; }
  .challenge-meta { margin-bottom: 20px; font-size: 8px; letter-spacing: 1.5px; }
  .inflation-benchmark { padding: 14px; }
  .total-score { bottom: 18px; min-height: 60px; padding: 13px 18px 11px; }
  .total-score span { font-size: 12px; }
  .total-score strong { font-size: 29px; }
}
@media (max-width: 460px) {
  .money-input.is-revealed { min-height: 214px; }
  .answer-reveal { grid-template-columns: 1fr; min-height: 210px; gap: 10px; padding: 18px; }
  .answer-arrow { transform: rotate(90deg); }
}
@media (max-height: 500px) {
  .main-content { padding: 28px 0 48px; }
  .wordmark { font-size: clamp(44px, 8vw, 76px); }
  .subtitle { margin: 10px 0 22px; font-size: 20px; }
}

/* Reduced-motion accessibility — all entrances and decorative motion become static. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Cursor lettering overlays the original typeset word without changing kerning. */
.wordmark { position: relative; }
.wordmark > .wordmark-source { color: var(--brown); }
.wordmark.cursor-ready .wordmark-source { visibility: hidden; }
.wordmark .letter { position: absolute; top: 0; color: var(--brown); pointer-events: none; }
.wordmark .letter.is-cents { color: var(--orange); }
.wave-art { display: block; width: 100%; height: 100%; overflow: visible; }
