:root {
  --navy: #06183f;
  --navy-2: #0b2f70;
  --blue: #174ea6;
  --red: #cf1f3d;
  --red-dark: #97152a;
  --cream: #fff8ed;
  --paper: #f8fbff;
  --ink: #07162f;
  --muted: #68748d;
  --gold: #ffd45a;
  --green: #138057;
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.12), transparent 22%),
    radial-gradient(circle at 84% 22%, rgba(207, 31, 61, 0.34), transparent 26%),
    linear-gradient(145deg, #07163a 0%, #092a66 48%, #c51d39 118%);
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

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

button {
  font: inherit;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.flag-shadow {
  position: absolute;
  width: 92vw;
  max-width: 920px;
  height: 260px;
  border-radius: 48% 52% 44% 56%;
  opacity: 0.23;
  filter: blur(18px);
  transform-origin: center;
  animation: waveDrift 9s ease-in-out infinite alternate;
}

.flag-one {
  top: 7%;
  left: -16%;
  background: repeating-linear-gradient(100deg, rgba(255,255,255,0.42) 0 22px, rgba(207,31,61,0.66) 22px 44px, rgba(255,255,255,0.28) 44px 66px);
}

.flag-two {
  right: -26%;
  bottom: 2%;
  background: repeating-linear-gradient(108deg, rgba(255,255,255,0.22) 0 18px, rgba(23,78,166,0.82) 18px 38px, rgba(207,31,61,0.5) 38px 56px);
  animation-delay: -3s;
}

.star {
  position: absolute;
  color: rgba(255, 255, 255, 0.46);
  font-size: 22px;
  animation: starPulse 4.8s ease-in-out infinite;
}

.s1 { top: 8%; left: 10%; }
.s2 { top: 18%; right: 15%; animation-delay: -1.1s; }
.s3 { top: 56%; left: 6%; animation-delay: -2.1s; }
.s4 { right: 10%; bottom: 18%; animation-delay: -3s; }
.s5 { left: 48%; bottom: 8%; animation-delay: -1.8s; }

.game-shell {
  width: min(100%, 540px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  display: grid;
  align-items: center;
}

.screen {
  display: none;
}

.screen.active {
  display: flex;
}

.splash {
  min-height: calc(100svh - 28px);
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  color: var(--cream);
}

.map-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1.52;
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.18);
  overflow: hidden;
}

.map-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 35%, rgba(255,255,255,0.18) 48%, transparent 62% 100%);
  transform: translateX(-115%);
  animation: sheen 6.5s ease-in-out 2.4s infinite;
}

.usa-map {
  width: 100%;
  height: 100%;
  display: block;
}

.map-blank {
  fill: rgba(255, 255, 255, 0.075);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2;
}

.state-cell rect {
  width: 36px;
  height: 25px;
  rx: 5px;
  stroke: rgba(255,255,255,0.45);
  stroke-width: 1.2;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.23));
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: translateY(18px) scale(0.5) rotate(-4deg);
  animation: statePop 0.46s cubic-bezier(.2,.9,.18,1.2) forwards;
}

.state-cell text {
  fill: #07162f;
  font: 900 10px Inter, sans-serif;
  text-anchor: middle;
  dominant-baseline: middle;
  opacity: 0;
  animation: labelIn 0.25s ease forwards;
}

.state-cell.blue rect { fill: #5c9dff; }
.state-cell.red rect { fill: #ee3b55; }
.state-cell.white rect { fill: #fff8ed; }
.state-cell.red text { fill: #fff8ed; }
.state-cell.blue text { fill: #fff; }

.skip-intro .state-cell rect,
.skip-intro .state-cell text {
  animation-duration: 0.01s;
  animation-delay: 0s !important;
}

.inset-labels text {
  fill: rgba(255, 255, 255, 0.42);
  font: 900 11px Inter, sans-serif;
  letter-spacing: 0.12em;
}

.splash-title-card {
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  animation: titleArrive 0.7s ease 9.35s forwards;
}

.skip-intro .splash-title-card {
  opacity: 1;
  transform: none;
  animation: none;
}

.kicker {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(3rem, 15vw, 5.3rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  text-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.tagline {
  max-width: 24rem;
  margin: 0 auto;
  color: rgba(255, 248, 237, 0.86);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

.splash-actions {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 12px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  animation: titleArrive 0.6s ease 9.85s forwards;
}

.skip-intro .splash-actions,
.splash-actions.ready {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  animation: none;
}

.primary-action,
.secondary-action,
.icon-button,
.modal-close {
  border: 0;
  cursor: pointer;
}

.primary-action,
.secondary-action {
  width: 100%;
  min-height: 54px;
  border-radius: 12px;
  font-weight: 900;
}

.primary-action {
  color: #fff;
  background: linear-gradient(180deg, #f23a56, var(--red-dark));
  box-shadow: 0 16px 34px rgba(151, 21, 42, 0.38);
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.62;
}

.secondary-action {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}

.compact {
  min-height: 46px;
}

.play {
  width: 100%;
  min-height: calc(100svh - 28px);
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cream);
  padding: 0 2px;
}

.app-eyebrow {
  margin: 0 0 1px;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-header h2 {
  margin: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: 2.1rem;
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.icon-button,
.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--cream);
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  font-weight: 900;
}

.play-panel {
  display: grid;
  gap: 12px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hud div,
.prompt-wrap,
.choice-card,
.reveal,
.modal {
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.94);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255,255,255,0.8);
}

.hud div {
  padding: 9px 8px 8px;
  text-align: center;
}

.hud-label {
  display: block;
  color: #5d6880;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hud strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.prompt-wrap {
  padding: 14px 14px 15px;
}

.scope-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 9px;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#question-text {
  margin-bottom: 8px;
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(1.28rem, 5.8vw, 1.95rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: 0;
  text-wrap: balance;
}

.range {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.25;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.choice-card {
  position: relative;
  min-height: 108px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.choice-card:active {
  transform: scale(0.98);
}

.choice-card:disabled {
  cursor: default;
}

.choice-card .rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #e73350, var(--red-dark));
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(151,21,42,0.22);
}

.choice-card .value {
  display: block;
  color: var(--ink);
  font-size: clamp(1.05rem, 5.2vw, 1.44rem);
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.choice-card.correct {
  border-color: rgba(19, 128, 87, 0.7);
  background: #ebfff6;
}

.choice-card.wrong {
  border-color: rgba(207, 31, 61, 0.7);
  background: #fff0f3;
}

.choice-card.neutral {
  opacity: 0.52;
}

.reveal {
  padding: 14px;
}

.result-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.result-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-badge.miss {
  background: var(--red);
}

#actual-answer {
  line-height: 1.2;
}

#fact-text {
  margin-bottom: 9px;
  color: #26334c;
  font-size: 0.92rem;
  line-height: 1.34;
}

.source-link {
  display: inline-flex;
  margin-bottom: 11px;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 8, 25, 0.68);
  backdrop-filter: blur(10px);
}

.modal {
  position: relative;
  width: min(100%, 440px);
  padding: 20px;
  color: var(--ink);
}

.modal h2 {
  margin-bottom: 8px;
  font-family: Newsreader, Georgia, serif;
  font-size: 2.1rem;
  line-height: 1;
}

.modal p:not(.kicker) {
  color: var(--muted);
  line-height: 1.42;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--ink);
  background: #eaf0fb;
}

.rules-modal {
  padding-right: 54px;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 16px 0 10px;
}

.share-grid a {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.share-grid a:nth-child(2),
.share-grid a:nth-child(4) {
  background: var(--red);
}

.modal .secondary-action {
  margin-bottom: 9px;
  color: var(--blue);
  background: #eaf1ff;
  border: 0;
}

@keyframes waveDrift {
  from { transform: translate3d(-2%, -1%, 0) rotate(-8deg) skewX(-8deg); }
  to { transform: translate3d(4%, 2%, 0) rotate(-2deg) skewX(6deg); }
}

@keyframes starPulse {
  0%, 100% { opacity: 0.25; transform: scale(0.86); }
  50% { opacity: 0.72; transform: scale(1.08); }
}

@keyframes statePop {
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes labelIn {
  to { opacity: 1; }
}

@keyframes titleArrive {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheen {
  0%, 42% { transform: translateX(-115%); }
  72%, 100% { transform: translateX(115%); }
}

@media (max-height: 740px) {
  .game-shell {
    align-items: start;
    padding-top: max(8px, env(safe-area-inset-top));
  }

  .play {
    justify-content: flex-start;
    gap: 8px;
  }

  .app-header h2 {
    font-size: 1.72rem;
  }

  .hud {
    gap: 8px;
  }

  .hud div {
    padding: 7px 8px;
  }

  .hud strong {
    font-size: 1.12rem;
  }

  .prompt-wrap {
    padding: 11px;
  }

  #question-text {
    font-size: 1.14rem;
  }

  .choices {
    gap: 10px;
  }

  .choice-card {
    min-height: 82px;
    padding: 10px;
  }

  .choice-card .rank {
    width: 27px;
    height: 27px;
    margin-bottom: 8px;
  }

  .choice-card .value {
    font-size: 0.98rem;
  }

  .reveal {
    padding: 11px;
  }
}

@media (min-width: 720px) {
  body {
    display: grid;
    place-items: center;
  }

  .game-shell {
    min-height: auto;
  }

  .splash,
  .play {
    min-height: 790px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
