:root {
  --main: #0e3976;
  --accent: #ffc107;
  --base: #ffffff;
  --bg: #f5f7fa;
  --support: #d9e4f2;
  --text: #1f2937;
  --muted: #64748b;
  --danger: #ef4444;
  --yes: #16a34a;
  --no: #2563eb;
  --shadow: 0 24px 80px rgba(14, 57, 118, 0.18);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 193, 7, 0.24), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(14, 57, 118, 0.18), transparent 32rem),
    var(--bg);
}

button { font: inherit; }

.app-shell {
  width: min(100%, 960px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen {
  display: none;
  width: 100%;
  animation: fadeIn 0.35s ease both;
}

.screen.is-active { display: block; }

.start-screen,
.quiz-screen,
.result-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(217, 228, 242, 0.9);
  border-radius: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.start-screen {
  max-width: 720px;
  margin: auto;
  padding: clamp(28px, 6vw, 64px);
  text-align: center;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--main);
  background: var(--support);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

h1 {
  margin: 18px 0 12px;
  color: var(--main);
  font-size: clamp(40px, 8vw, 72px);
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.lead {
  margin: 0 auto 28px;
  color: var(--muted);
  line-height: 1.9;
}

.start-card {
  margin: 0 auto 28px;
  padding: 18px;
  max-width: 460px;
  background: #fff8df;
  border: 1px solid rgba(255, 193, 7, 0.45);
  border-radius: 24px;
  text-align: left;
}

.start-card p { margin: 6px 0; }
.start-card-title { color: var(--main); font-weight: 800; }

.primary-button,
.secondary-button,
.ghost-button,
.answer-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.primary-button {
  padding: 15px 28px;
  color: #fff;
  background: var(--main);
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 14px 32px rgba(14, 57, 118, 0.28);
}

.secondary-button {
  padding: 14px 22px;
  color: var(--main);
  background: var(--support);
  border-radius: 999px;
  font-weight: 800;
}

.primary-button:hover,
.secondary-button:hover,
.answer-button:hover { transform: translateY(-2px); }

.primary-button:disabled,
.secondary-button:disabled,
.answer-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

#start-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 360px);
  min-height: 68px;
  margin-top: 4px;
  padding: 20px 34px;
  background: linear-gradient(135deg, var(--main), #0b4d9e 64%, #082f67);
  border: 2px solid rgba(255, 193, 7, 0.7);
  font-size: clamp(18px, 4.2vw, 24px);
  letter-spacing: 0.03em;
  box-shadow:
    0 18px 42px rgba(14, 57, 118, 0.34),
    0 0 0 8px rgba(255, 193, 7, 0.16);
  animation: startButtonPulse 2.4s cubic-bezier(0.25, 1, 0.5, 1) infinite;
  transform-origin: center;
}

#start-button::after {
  content: "";
  position: absolute;
  inset: -45% -30%;
  z-index: 0;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 193, 7, 0.48) 50%,
    rgba(255, 255, 255, 0.16) 55%,
    transparent 65%
  );
  transform: translateX(-72%) rotate(4deg);
  animation: startButtonShine 3.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  pointer-events: none;
}

#start-button span {
  position: relative;
  z-index: 1;
}

#start-button:hover {
  animation-name: none;
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 24px 54px rgba(14, 57, 118, 0.42),
    0 0 0 10px rgba(255, 193, 7, 0.22);
}

#start-button:active {
  animation-name: none;
  transform: translateY(1px) scale(0.98);
  box-shadow:
    0 12px 28px rgba(14, 57, 118, 0.3),
    0 0 0 5px rgba(255, 193, 7, 0.2);
}

#start-button:focus-visible {
  outline: 4px solid rgba(255, 193, 7, 0.8);
  outline-offset: 5px;
}

.quiz-screen {
  min-height: 680px;
  padding: clamp(18px, 4vw, 32px);
}

.quiz-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}

.ghost-button {
  padding: 10px 12px;
  color: var(--main);
  background: transparent;
  border-radius: 12px;
  font-weight: 700;
}

.progress-wrap {
  height: 12px;
  background: var(--support);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--main));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.counter {
  color: var(--muted);
  font-weight: 800;
}

.swipe-zone {
  position: relative;
  height: 470px;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: pan-y;
}

.question-card {
  width: min(100%, 560px);
  min-height: 360px;
  padding: clamp(28px, 6vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--base);
  border: 1px solid rgba(217, 228, 242, 0.9);
  border-radius: 32px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.16);
  user-select: none;
  will-change: transform;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.question-card:focus { outline: 3px solid rgba(255, 193, 7, 0.7); }

.question-kicker {
  margin: 0 0 16px;
  color: var(--main);
  font-weight: 900;
}

.question-card h2 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.question-hint {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.answer-badge {
  position: absolute;
  top: 48px;
  z-index: 3;
  padding: 12px 24px;
  border: 4px solid currentColor;
  border-radius: 18px;
  font-size: 32px;
  font-weight: 1000;
  letter-spacing: 0.08em;
  opacity: 0;
  transform: rotate(-8deg) scale(0.86);
  pointer-events: none;
}

.answer-badge.yes { color: var(--yes); right: 14%; }
.answer-badge.no { color: var(--no); left: 14%; transform: rotate(8deg) scale(0.86); }

.answer-buttons {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.answer-button {
  min-width: 160px;
  padding: 16px 24px;
  color: #fff;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
}

.no-button { background: var(--no); }
.yes-button { background: var(--yes); }

.keyboard-help {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.result-screen {
  position: relative;
  max-width: 760px;
  margin: auto;
}

.result-card {
  position: relative;
  z-index: 2;
  padding: clamp(28px, 6vw, 56px);
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.result-label {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 7px 12px;
  color: var(--main);
  background: #fff8df;
  border-radius: 999px;
  font-weight: 900;
}

.result-card h2 {
  margin: 0 0 18px;
  color: var(--main);
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.result-copy {
  color: var(--text);
  font-size: 18px;
  line-height: 1.9;
}

.result-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--support);
}

.result-section h3 {
  margin: 0 0 12px;
  color: var(--main);
}

.result-section ul {
  margin: 0;
  padding-left: 1.25em;
  line-height: 1.9;
}

blockquote {
  margin: 0;
  padding: 18px 20px;
  background: #f8fafc;
  border-left: 6px solid var(--accent);
  border-radius: 18px;
  font-weight: 800;
  line-height: 1.8;
}

.ng-section p {
  display: inline-flex;
  margin: 0;
  padding: 10px 14px;
  color: #991b1b;
  background: #fee2e2;
  border-radius: 14px;
  font-weight: 900;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

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

@keyframes startButtonPulse {
  0%, 100% {
    box-shadow:
      0 18px 42px rgba(14, 57, 118, 0.34),
      0 0 0 8px rgba(255, 193, 7, 0.16);
  }
  50% {
    box-shadow:
      0 24px 52px rgba(14, 57, 118, 0.42),
      0 0 0 14px rgba(255, 193, 7, 0.08);
  }
}

@keyframes startButtonShine {
  0%, 42% { transform: translateX(-72%) rotate(4deg); }
  72%, 100% { transform: translateX(72%) rotate(4deg); }
}

@media (max-width: 640px) {
  .app-shell { padding: 14px; }
  .quiz-screen { min-height: 620px; }
  .quiz-header { grid-template-columns: 1fr auto; }
  .progress-wrap { grid-column: 1 / -1; grid-row: 2; }
  .swipe-zone { height: 420px; }
  .question-card { min-height: 330px; }
  .answer-button { min-width: 132px; }
  #start-button {
    min-height: 64px;
    padding-inline: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  #start-button,
  #start-button::after {
    animation: none;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .answer-button {
    transition-duration: 0.01ms;
  }
}
