:root {
  --ink: #0f1f2c;
  --mist: #f4f1ec;
  --clay: #e6b88f;
  --steel: #4b6e8f;
  --sunset: #ff8a5b;
  --mint: #b3e3d8;
  --shadow: rgba(15, 31, 44, 0.18);
  --military: #5a7a5a;
  --civilian: #4b6e8f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #ffe9d6 0%, #f6f2ec 45%, #e6eef4 100%);
  min-height: 100vh;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Splash Screen */
.splash {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  gap: 40px;
}

.splash-header h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0 0 16px;
}

.splash-header .lead {
  max-width: 500px;
  margin: 0 auto;
}

.mode-selection {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 600px;
}

.mode-card {
  background: white;
  border: 2px solid transparent;
  border-radius: 24px;
  padding: 32px 24px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: var(--sunset);
  box-shadow: 0 16px 40px var(--shadow);
}

.mode-card:focus-visible {
  outline: 3px solid var(--sunset);
  outline-offset: 2px;
}

.mode-icon {
  font-size: 3rem;
}

.mode-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
}

.mode-desc {
  font-size: 0.95rem;
  color: var(--steel);
}

.splash-footer {
  color: var(--steel);
  font-size: 0.9rem;
}

.other-apps {
  margin-top: 40px;
  text-align: center;
}

.other-apps-label {
  color: var(--steel);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}

.app-links {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.app-link {
  color: var(--steel);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 16px;
  border: 1px solid var(--steel);
  border-radius: 20px;
  transition: all 0.2s ease;
}

.app-link:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: rgba(255,255,255,0.5);
}

.back-btn {
  background: none;
  border: none;
  color: var(--steel);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 0;
  margin-top: 8px;
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: var(--ink);
}

.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-end;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--steel);
  margin: 0 0 10px;
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  margin: 0 0 12px;
}

.lead {
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0;
}

.scoreboard {
  background: white;
  padding: 16px 20px;
  border-radius: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  box-shadow: 0 12px 30px var(--shadow);
  min-width: 380px;
}

.score-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--steel);
}

.score-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 6px;
}

.quiz {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: start;
}

.image-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.image-frame {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 20px 40px var(--shadow);
  background: #0f1f2c;
  min-height: 320px;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: reveal 0.8s ease both;
}

.image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  background: rgba(15, 31, 44, 0.6);
  color: white;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--sunset);
  animation: spin 1s linear infinite;
}

.caption {
  background: rgba(255, 255, 255, 0.8);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  box-shadow: 0 12px 24px var(--shadow);
}

.question-panel {
  background: white;
  padding: 28px;
  border-radius: 24px;
  box-shadow: 0 12px 30px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.question-panel h2 {
  margin: 0;
  font-size: 1.6rem;
}

.instruction {
  margin: 0;
  color: var(--steel);
}

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

.choice {
  border: 2px solid transparent;
  background: var(--mist);
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
  animation: rise 0.45s ease both;
  animation-delay: var(--delay, 0s);
}

.choice:hover {
  transform: translateY(-2px);
  border-color: var(--mint);
}

.choice[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.choice.correct {
  border-color: #2a9d68;
  background: #dff5eb;
}

.choice.wrong {
  border-color: #d5524b;
  background: #ffe5e3;
}

.result {
  font-size: 1.1rem;
  font-weight: 600;
  min-height: 28px;
}

.primary {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #ff9b6c, #f6725a);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.secondary {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: #e7eef5;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.footer {
  font-size: 0.9rem;
  color: var(--steel);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--steel);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.share-btn:hover {
  background: var(--ink);
}

/* Focus styles for accessibility */
.choice:focus-visible,
.primary:focus-visible,
.secondary:focus-visible,
.share-btn:focus-visible {
  outline: 3px solid var(--sunset);
  outline-offset: 2px;
}

/* Active states */
.primary:active,
.secondary:active,
.share-btn:active {
  transform: scale(0.98);
}

@media (max-width: 720px) {
  .page {
    padding: 36px 20px 24px;
  }

  .scoreboard {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-panel {
    padding: 22px;
  }

  .button-row {
    flex-direction: column;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
