:root {
  color-scheme: dark;
  font-family: ui-rounded, system-ui, sans-serif;
  color: #f5efd9;
  background: #101c33;
  font-synthesis: none;
  --gold: #f7cf83;
  --mint: #9bdfc5;
  --faint: #a3b4c9;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
button, a {
  touch-action: manipulation;
}
button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid #526078;
  background: #23334c;
  color: #f5efd9;
  border-radius: 15px;
  min-height: 46px;
  padding: 11px 17px;
  transition: background 120ms, transform 120ms, border-color 120ms;
}
button:hover {
  background: #344860;
  border-color: var(--gold);
}
button:active {
  transform: scale(.96);
}
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
button:disabled {
  cursor: default;
  opacity: .35;
}
button.primary {
  background: var(--gold);
  color: #1b2637;
  border-color: var(--gold);
  box-shadow: 0 5px 0 #9a7749, 0 10px 30px #0003;
}
button.primary:hover {
  background: #ffe2aa;
}
button.secondary {
  background: #18283ed9;
}
button.small {
  font-size: 13px;
  padding: 8px 12px;
}
#app {
  position: relative;
  height: 100%;
  width: 100%;
  isolation: isolate;
}
#sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  touch-action: none;
}
header {
  height: 66px;
  max-width: 920px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
}
#home {
  text-decoration: none;
  color: var(--gold);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 2px;
}
#home span {
  font-size: 12px;
  vertical-align: 3px;
}
.tools {
  display: flex;
  gap: 7px;
}
.tools button {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  background: #18283ebf;
  font-size: 22px;
}
#screen {
  width: 100%;
  height: calc(100% - 66px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 8px 20px 22px;
}
.page {
  width: min(100%, 540px);
  min-height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 17px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 3px;
  font-weight: 800;
  color: var(--mint);
  text-transform: uppercase;
}
h1, h2, h3, p {
  margin: 0;
}
h1 {
  font-family: Georgia, serif;
  font-weight: normal;
  font-size: clamp(37px, 9vw, 61px);
  letter-spacing: -2px;
  line-height: 1.02;
}
h2 {
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: normal;
  letter-spacing: -1px;
}
p {
  color: #bdcad9;
  font-size: 14px;
  line-height: 1.6;
}
.hero {
  display: flex;
  flex-direction: column;
  gap: 13px;
  text-align: center;
}
.hero-art {
  width: 100%;
  height: clamp(80px, 20vh, 170px);
  display: block;
}
.hero h1 em {
  color: var(--gold);
  font-style: normal;
}
.action-stack {
  display: grid;
  gap: 13px;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 13px;
  border-top: 1px solid #a9c1dc25;
  border-bottom: 1px solid #a9c1dc25;
}
.stats div {
  text-align: center;
  display: grid;
  gap: 3px;
}
.stats strong {
  color: var(--gold);
  font-size: 21px;
}
.stats span, .fine {
  font-size: 11px;
  color: var(--faint);
}
.fine {
  text-align: center;
  line-height: 1.6;
}
.drill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.drill-grid button {
  display: grid;
  text-align: left;
  gap: 7px;
  padding: 16px;
}
.drill-grid b {
  font-size: 25px;
  color: var(--gold);
}
.drill-grid span {
  font-size: 13px;
}
.intro-icon {
  margin: 5px auto;
  width: 100px;
  height: 100px;
  border: 1px solid #f7cf8366;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 50px;
  color: var(--gold);
  background: #23334c;
  box-shadow: 0 0 0 12px #f7cf8308, 0 0 0 24px #f7cf8304;
}
.intro {
  text-align: center;
  gap: 25px;
}
.intro p {
  max-width: 330px;
  margin: auto;
}
.drill-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.drill-progress i {
  width: 25px;
  height: 5px;
  border-radius: 5px;
  background: #4e5d71;
}
.drill-progress i.done {
  background: var(--mint);
}
.drill-progress i.current {
  background: var(--gold);
}
.game-page {
  justify-content: flex-start;
  gap: 12px;
  padding-top: 6px;
}
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
}
.hud strong {
  color: var(--gold);
  font-size: 18px;
}
.timer {
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: #57647b55;
}
.timer i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--mint);
  transform-origin: left;
}
.question-heading {
  text-align: center;
  font-size: 16px;
  letter-spacing: 0;
  font-family: inherit;
  font-weight: 650;
  margin: 6px 0;
}
#scene {
  width: 100%;
  height: clamp(125px, 26vh, 245px);
  display: block;
  border-radius: 24px;
  background: #111e35a8;
  border: 1px solid #65738a42;
  touch-action: none;
}
#instruction {
  text-align: center;
  min-height: 24px;
  font-size: 13px;
  color: #d3dfeb;
}
.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}
.answers button {
  font-size: 27px;
  min-height: 67px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 0 #07101d;
  position: relative;
}
.answers button em {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 10px;
  font-style: normal;
  color: #9aaac1;
}
.answers button.selected {
  border-color: var(--mint);
  color: var(--mint);
  opacity: .7;
  background: #27564e;
}
.answers button.lit {
  background: var(--gold);
  color: #263145;
  border-color: #fff0bb;
  box-shadow: 0 0 25px #f7cf8377;
}
.answers.signals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.answers.signals button {
  font-size: 34px;
}
.answers.compare button {
  font-size: 22px;
}
.feedback {
  text-align: center;
  min-height: 26px;
  font-weight: 700;
  color: var(--mint);
  font-size: 16px;
}
.feedback.miss {
  color: #f7bfaa;
}
#next {
  width: 100%;
}
.bottom-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.score-number {
  font-size: 64px;
  font-family: Georgia, serif;
  color: var(--gold);
  line-height: 1;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
.result-grid div {
  padding: 11px 12px;
  background: #22324ac9;
  border: 1px solid #66738a44;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.result-grid b {
  color: var(--mint);
}
#chart {
  height: 190px;
  width: 100%;
  border-radius: 18px;
  background: #101b2dcc;
}
.chart-list {
  display: grid;
  gap: 9px;
  max-height: 150px;
  overflow: auto;
}
.chart-list div {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 8px 5px;
  border-bottom: 1px solid #53617a66;
}
#toast {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  background: #31455b;
  box-shadow: 0 5px 20px #0008;
  border-radius: 20px;
  padding: 10px 18px;
  font-size: 12px;
  max-width: 90%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  z-index: 3;
}
#toast.show {
  opacity: 1;
}
#overlay {
  position: absolute;
  inset: 0;
  background: #0b1428ed;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 22px;
}
#overlay[hidden] {
  display: none;
}
.pause-card {
  display: grid;
  gap: 20px;
  text-align: center;
  width: min(100%, 350px);
}
@media (max-width: 350px) {
  header { padding: 8px 12px; }
  #home span { font-size: 10px; letter-spacing: 1px; }
  #screen { padding-left: 14px; padding-right: 14px; }
  .page { gap: 13px; }
  .answers button { min-height: 57px; }
}
@media (max-height: 670px) {
  header { height: 56px; }
  #screen { height: calc(100% - 56px); padding-top: 3px; }
  .hero-art { height: 80px; }
  .page { gap: 12px; }
  #scene { height: 140px; }
  .game-page { gap: 8px; }
  .answers button { min-height: 55px; padding: 8px; }
  h1 { font-size: 42px; }
  .intro-icon { width: 76px; height: 76px; font-size: 40px; }
}
@media (min-width: 650px) and (max-height: 550px) {
  header { max-width: 1000px; }
  .page { max-width: 760px; width: 100%; }
  .home-page { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px 32px; }
  .home-page .hero { grid-row: span 3; }
  .hero-art { height: 90px; }
  .home-page .fine { grid-column: 2; }
  .game-page { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; align-content: start; }
  .hud, .timer { grid-column: 1 / -1; }
  .question-heading { grid-column: 1; }
  #scene { grid-column: 1; grid-row: 4 / span 3; height: 180px; }
  #instruction { grid-column: 2; grid-row: 3; }
  .answers { grid-column: 2; grid-row: 4; }
  .feedback { grid-column: 2; grid-row: 5; }
  .bottom-actions { grid-column: 2; grid-row: 6; }
  .drill-grid { grid-template-columns: repeat(3, 1fr); }
  .intro { gap: 13px; }
  .intro-icon { width: 55px; height: 55px; font-size: 30px; }
  .results-page { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 12px 24px; }
  .results-page .hero { grid-row: span 3; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
