:root {
  --paper: #f6f2e9;
  --paper-deep: #e9e2d5;
  --ink: #1c1c1a;
  --muted: #6e6a62;
  --orange: #e94d27;
  --orange-dark: #b93416;
  --green: #217a51;
  --red: #b72d2d;
  --line: #c9c0b1;
  --white: #fffdf8;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 8px 12px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100% - 32px, 720px);
  min-height: calc(100vh - 132px);
  margin: 0 auto;
}

.screen {
  width: 100%;
}

.home-screen {
  display: flex;
  min-height: calc(100vh - 132px);
  padding: clamp(56px, 10vh, 104px) 0 72px;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.logo-crop {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
}

.logo-crop img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  transform: translate(-50%, -50%);
}

.home-logo {
  width: min(100%, 500px);
  height: 126px;
}

.home-logo img {
  width: min(560px, 140vw);
}

.tagline {
  margin: 18px 0 8px;
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.daily-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.streak-line {
  display: inline-flex;
  margin: 26px 0 16px;
  padding: 8px 12px;
  align-items: center;
  gap: 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font-size: 0.92rem;
}

.flame-icon {
  width: 19px;
  height: 19px;
  fill: var(--orange);
}

.button {
  min-height: 48px;
  padding: 12px 22px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  cursor: pointer;
  font-weight: 800;
}

.button-primary {
  color: var(--white);
  border-color: var(--ink);
  background: var(--orange);
}

.button-primary:hover {
  background: var(--orange-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--white);
}

.button-secondary:hover {
  background: var(--paper-deep);
}

.button-small {
  min-height: 38px;
  padding: 7px 14px;
  font-size: 0.88rem;
}

.play-button {
  min-width: 210px;
  font-size: 1.05rem;
}

.home-actions {
  display: flex;
  margin-top: 21px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--line);
}

.text-button,
.footer-button,
.small-link,
.dialog-close,
.danger-button {
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-button:hover,
.footer-button:hover,
.small-link:hover,
.dialog-close:hover {
  color: var(--orange-dark);
}

.schedule-message {
  max-width: 390px;
  margin: 24px auto 0;
  color: var(--muted);
}

.game-screen {
  max-width: 680px;
  min-height: calc(100vh - 132px);
  margin: 0 auto;
  padding: 24px 0 72px;
  text-align: center;
}

.game-header {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  min-height: 58px;
  align-items: center;
  border-bottom: 2px solid var(--ink);
}

.small-link {
  justify-self: start;
}

.mini-logo {
  width: 120px;
  height: 48px;
}

.mini-logo img {
  width: 76px;
}

.game-tools,
.streak-compact {
  display: inline-flex;
  align-items: center;
}

.game-tools {
  justify-self: end;
  gap: 10px;
}

.streak-compact {
  justify-self: end;
  gap: 4px;
  font-weight: 800;
}

.quick-help-button {
  display: inline-grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
}

.quick-help-button:hover {
  color: var(--white);
  background: var(--ink);
}

.round-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px auto 0;
}

.round-progress span {
  height: 7px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
}

.round-progress span.current,
.round-progress span.done {
  background: var(--orange);
}

.round-progress span.done {
  border-color: var(--orange);
}

.question-view,
.round-result {
  padding: clamp(46px, 8vh, 76px) 0 16px;
}

.round-label,
.dialog-kicker {
  margin: 0;
  color: var(--orange-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.question-text {
  max-width: 620px;
  margin: 22px auto 12px;
  font-size: clamp(1.65rem, 5vw, 2.45rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.range-readout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  width: min(100%, 510px);
  margin: 38px auto 26px;
  align-items: end;
  gap: 18px;
}

.range-readout > div:not(.range-arrow) {
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--ink);
}

.range-readout span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.range-readout strong {
  display: block;
  overflow: hidden;
  font-size: clamp(1.05rem, 4vw, 1.38rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-arrow {
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.range-control {
  position: relative;
  width: calc(100% - 28px);
  height: 40px;
  margin: 0 auto;
  touch-action: none;
}

.range-rail {
  position: absolute;
  top: 14px;
  right: 0;
  left: 0;
  height: 12px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
  pointer-events: none;
}

.range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--orange);
}

.range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  pointer-events: none;
}

.range-input::-webkit-slider-runnable-track {
  height: 40px;
  background: transparent;
}

.range-input::-moz-range-track {
  height: 40px;
  background: transparent;
}

.range-input::-webkit-slider-thumb {
  width: 27px;
  height: 36px;
  margin-top: 2px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--white);
  cursor: grab;
  pointer-events: auto;
}

.range-input::-moz-range-thumb {
  width: 23px;
  height: 32px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  cursor: grab;
  pointer-events: auto;
}

.range-input:focus-visible::-webkit-slider-thumb {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.range-input:focus-visible::-moz-range-thumb {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.range-bounds {
  display: flex;
  width: calc(100% - 28px);
  margin: 2px auto 0;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.78rem;
}

.potential-score {
  margin: 23px 0 18px;
  color: var(--muted);
}

.potential-score strong {
  color: var(--ink);
}

.result-kicker {
  margin: 0;
  color: var(--green);
  font-size: 1rem;
  font-weight: 800;
}

.result-kicker.miss {
  color: var(--red);
}

.result-score {
  margin: 7px 0;
  font-size: clamp(3.2rem, 13vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.result-score small {
  font-size: 0.28em;
  letter-spacing: 0;
}

.result-range {
  margin: 0 0 33px;
  color: var(--muted);
}

.answer-track {
  position: relative;
  width: calc(100% - 28px);
  height: 16px;
  margin: 0 auto 28px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
}

.answer-chosen-range {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--orange);
}

.answer-marker {
  position: absolute;
  top: -8px;
  width: 4px;
  height: 28px;
  background: var(--ink);
  transform: translateX(-2px);
}

.answer-marker::after {
  position: absolute;
  top: -5px;
  left: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.answer-reveal {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 800;
}

.fact-text {
  max-width: 530px;
  min-height: 3em;
  margin: 12px auto 27px;
  color: var(--muted);
}

.complete-screen {
  display: flex;
  min-height: calc(100vh - 132px);
  padding: 54px 0 70px;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

.result-logo {
  width: 210px;
  height: 72px;
  margin-bottom: 24px;
}

.result-logo img {
  width: 270px;
}

.complete-screen h2 {
  margin: 9px 0 0;
  font-size: clamp(2rem, 8vw, 3.25rem);
  letter-spacing: -0.05em;
}

.daily-score {
  margin: 14px 0 0;
  font-size: clamp(3.5rem, 15vw, 6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.07em;
}

.daily-score small {
  font-size: 0.22em;
  letter-spacing: 0;
}

.streak-outcome {
  max-width: 460px;
  margin: 12px auto 27px;
  color: var(--muted);
}

.round-summary {
  width: min(100%, 520px);
  margin-bottom: 27px;
  border-top: 2px solid var(--ink);
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  padding: 11px 2px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.summary-row span:nth-child(2) {
  color: var(--muted);
}

.summary-row strong {
  min-width: 62px;
  text-align: right;
}

.complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.copy-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--green);
  font-weight: 700;
}

.site-footer {
  display: flex;
  width: min(100% - 32px, 760px);
  min-height: 132px;
  margin: 0 auto;
  padding: 25px 0 31px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

.studio-link {
  display: inline-flex;
  color: var(--ink);
  align-items: center;
  gap: 9px;
  font-weight: 700;
  text-decoration: none;
}

.studio-link img {
  width: 92px;
  height: auto;
}

.studio-link span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.site-footer nav a {
  color: var(--ink);
  font-weight: 700;
  text-underline-offset: 3px;
}

.footer-button {
  font-size: inherit;
}

.consent-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  width: min(calc(100% - 36px), 430px);
  padding: 17px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
}

.consent-banner h2 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.consent-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.consent-actions {
  display: flex;
  gap: 7px;
}

.dialog {
  width: min(calc(100% - 32px), 560px);
  max-height: min(86vh, 720px);
  padding: 27px;
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--white);
}

.dialog::backdrop {
  background: rgba(28, 28, 26, 0.62);
}

.dialog form {
  float: right;
}

.dialog-close {
  font-size: 0.82rem;
}

.dialog h2 {
  max-width: 420px;
  margin: 8px 0 19px;
  font-size: clamp(1.75rem, 6vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.quick-help-dialog {
  width: min(calc(100% - 32px), 430px);
}

.quick-help-dialog > p:not(.dialog-kicker) {
  margin-bottom: 0;
}

.quick-help-note {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.how-list {
  padding-left: 21px;
}

.how-list li {
  padding: 5px 0 5px 6px;
}

.how-example {
  display: grid;
  grid-template-columns: auto 1fr auto;
  margin: 24px 0;
  align-items: center;
  gap: 9px;
}

.example-limit {
  font-weight: 800;
}

.example-line {
  position: relative;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-deep);
}

.example-line i {
  position: absolute;
  top: -7px;
  width: 4px;
  height: 22px;
  background: var(--orange);
}

.example-line i:first-child {
  left: 31%;
}

.example-line i:nth-child(3) {
  left: 79%;
}

.example-line b {
  position: absolute;
  top: -4px;
  left: 70%;
  width: 8px;
  height: 16px;
  background: var(--ink);
}

.how-example small {
  grid-column: 2;
  margin-top: 4px;
  color: var(--muted);
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 2px solid var(--ink);
  border-left: 1px solid var(--line);
}

.stat-item {
  min-height: 90px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-item strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.1;
}

.stat-item span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stats-note,
.dialog-fineprint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.consent-status {
  padding: 10px 12px;
  border-left: 4px solid var(--orange);
  background: var(--paper);
  font-weight: 700;
}

.choice-actions {
  display: flex;
  margin-top: 22px;
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
}

.danger-button {
  margin-top: 10px;
  color: var(--red);
  font-size: 0.84rem;
}

.dialog a {
  color: var(--ink);
}

.noscript {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  z-index: 30;
  padding: 12px;
  border: 2px solid var(--ink);
  background: var(--white);
  text-align: center;
}

.legal-body {
  background: var(--paper);
}

.error-screen {
  display: flex;
  min-height: calc(100vh - 132px);
  padding: 64px 0 84px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.error-logo {
  width: min(100%, 360px);
  height: 88px;
  margin-bottom: 26px;
}

.error-logo img {
  width: min(430px, 112vw);
}

.error-screen h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.2rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.error-copy {
  max-width: 390px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.error-home {
  display: inline-flex;
  margin-top: 28px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.legal-shell {
  width: min(100% - 36px, 760px);
  margin: 0 auto;
  padding: 46px 0 72px;
}

.legal-header {
  display: flex;
  padding-bottom: 24px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
}

.legal-logo {
  width: 150px;
  height: 50px;
}

.legal-logo img {
  width: 194px;
}

.back-link {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-underline-offset: 3px;
}

.legal-intro {
  padding: 56px 0 34px;
  border-bottom: 1px solid var(--line);
}

.legal-intro h1 {
  margin: 8px 0 13px;
  font-size: clamp(2.3rem, 9vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.legal-intro p {
  max-width: 600px;
  color: var(--muted);
}

.legal-content {
  padding-top: 13px;
}

.legal-content section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.legal-content h2 {
  margin: 0 0 9px;
  font-size: 1.15rem;
}

.legal-content p,
.legal-content li {
  color: #3f3d38;
}

.legal-content a {
  color: var(--ink);
  font-weight: 700;
}

.legal-note {
  padding: 14px;
  border: 2px solid var(--ink);
  background: var(--white);
  font-size: 0.9rem;
}

@media (max-width: 620px) {
  .app-shell {
    min-height: calc(100vh - 190px);
  }

  .home-screen,
  .game-screen,
  .complete-screen,
  .error-screen {
    min-height: calc(100vh - 190px);
  }

  .home-screen {
    padding-top: 46px;
  }

  .home-logo {
    height: 96px;
  }

  .home-logo img {
    width: min(410px, 112vw);
  }

  .question-view,
  .round-result {
    padding-top: 40px;
  }

  .site-footer {
    min-height: auto;
    padding: 25px 0 34px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 22px;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .consent-banner {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }
}

@media (max-width: 430px) {
  .range-readout {
    gap: 10px;
  }

  .game-header {
    grid-template-columns: 1fr 100px 1fr;
  }

  .mini-logo {
    width: 100px;
  }

  .summary-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .summary-row span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .consent-banner {
    grid-template-columns: 1fr;
  }

  .consent-actions {
    justify-content: flex-end;
  }

  .dialog {
    padding: 23px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
