:root {
  --bg-1: #f7f1e8;
  --bg-2: #fdfbf7;
  --bg-3: #eefad8;
  --primary: #b8f26a;
  --primary-dark: #79b62e;
  --accent: #111111;
  --accent-2: #f0e6cf;
  --text: #111111;
  --muted: #40444d;
  --glass: #fffdf7;
  --glass-strong: #f7f1e8;
  --stroke: rgba(17, 17, 17, 0.2);
  --shadow: 0 16px 32px rgba(17, 17, 17, 0.12);
  --option-bg: #fff8ee;
  --option-hover: #f3ecdf;
  --option-selected: #e6f4d5;
  --option-correct: #daf3e1;
  --option-wrong: #ffe2d7;
  --option-border: rgba(17, 17, 17, 0.3);
  --option-border-strong: rgba(17, 17, 17, 0.6);
  --focus-ring: rgba(184, 242, 106, 0.35);
  --option-ring: rgba(184, 242, 106, 0.4);
  --primary-soft: #d3f78a;
  --orb-1: linear-gradient(135deg, #dff8a7, #f7f1e8);
  --orb-2: linear-gradient(135deg, #f0e6cf, #fdfbf7);
  --radius-lg: 20px;
  --radius-md: 12px;
}

body[data-theme="orange"] {
  --bg-1: #fff1df;
  --bg-2: #fff9f1;
  --bg-3: #ffe6c7;
  --primary: #f4a132;
  --primary-dark: #d47f0f;
  --option-selected: #ffe3c2;
  --option-hover: #f6ebde;
  --focus-ring: rgba(244, 161, 50, 0.35);
  --option-ring: rgba(244, 161, 50, 0.35);
  --primary-soft: #f8c07a;
  --orb-1: linear-gradient(135deg, #ffe1b2, #fff3e3);
  --orb-2: linear-gradient(135deg, #ffd1a6, #fff7ed);
}

body[data-theme="red"] {
  --bg-1: #fff1ee;
  --bg-2: #fff8f6;
  --bg-3: #ffe2da;
  --primary: #f28c82;
  --primary-dark: #c65a52;
  --option-selected: #fde0da;
  --option-hover: #f6ece8;
  --focus-ring: rgba(242, 140, 130, 0.35);
  --option-ring: rgba(242, 140, 130, 0.35);
  --primary-soft: #f6b0a8;
  --orb-1: linear-gradient(135deg, #ffe0d8, #fff4f1);
  --orb-2: linear-gradient(135deg, #ffd1c7, #fff7f3);
}

body[data-theme="purple"] {
  --bg-1: #f5eefc;
  --bg-2: #fbf7ff;
  --bg-3: #e9defa;
  --primary: #b58ae6;
  --primary-dark: #7b4acb;
  --option-selected: #eee0fb;
  --option-hover: #f3edf9;
  --focus-ring: rgba(181, 138, 230, 0.35);
  --option-ring: rgba(181, 138, 230, 0.35);
  --primary-soft: #caa7f0;
  --orb-1: linear-gradient(135deg, #ead8fb, #faf4ff);
  --orb-2: linear-gradient(135deg, #dbc6f5, #fdf7ff);
}

body[data-theme="blue"] {
  --bg-1: #eef5ff;
  --bg-2: #f7fbff;
  --bg-3: #dbeaff;
  --primary: #8cb7f2;
  --primary-dark: #4d79c9;
  --option-selected: #e0ecff;
  --option-hover: #eef3fa;
  --focus-ring: rgba(140, 183, 242, 0.35);
  --option-ring: rgba(140, 183, 242, 0.35);
  --primary-soft: #a9c9f6;
  --orb-1: linear-gradient(135deg, #dbeaff, #f4f8ff);
  --orb-2: linear-gradient(135deg, #c9defc, #f8fbff);
}

body[data-theme="pink"] {
  --bg-1: #fff1f6;
  --bg-2: #fffafc;
  --bg-3: #ffe3ee;
  --primary: #ff8fb7;
  --primary-dark: #d9467c;
  --option-selected: #ffd6e6;
  --option-hover: #f6ecf2;
  --focus-ring: rgba(255, 143, 183, 0.35);
  --option-ring: rgba(255, 143, 183, 0.35);
  --primary-soft: #ffc0d6;
  --orb-1: linear-gradient(135deg, #ffd9e8, #fff6fa);
  --orb-2: linear-gradient(135deg, #ffcade, #fff8fb);
}

body[data-theme="quiz-ppn-palette"] {
  --bg-1: #fff3b0;
  --bg-2: #fff8cf;
  --bg-3: #f6e2a4;
  --primary: #e09f3e;
  --primary-dark: #9e2a2b;
  --accent: #335c67;
  --accent-2: #fff3b0;
  --text: #335c67;
  --muted: rgba(51, 92, 103, 0.75);
  --glass: #fff7d6;
  --glass-strong: #fff0c8;
  --stroke: rgba(51, 92, 103, 0.25);
  --option-bg: #fff9de;
  --option-selected: #ffe7b9;
  --option-hover: #fff1c9;
  --option-border: rgba(51, 92, 103, 0.35);
  --option-border-strong: rgba(51, 92, 103, 0.6);
  --focus-ring: rgba(224, 159, 62, 0.35);
  --option-ring: rgba(224, 159, 62, 0.35);
  --primary-soft: #f0b86a;
  --orb-1: linear-gradient(135deg, #fff3b0, #e09f3e);
  --orb-2: linear-gradient(135deg, #ffe2a4, #fff7d2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3));
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 24px;
  opacity: 0.7;
  animation: float 12s ease-in-out infinite;
  border: 1px solid rgba(17, 17, 17, 0.12);
}

.orb-1 {
  width: 280px;
  height: 280px;
  background: var(--orb-1);
  top: -60px;
  left: -40px;
  transform: rotate(-6deg);
}

.orb-2 {
  width: 320px;
  height: 320px;
  background: var(--orb-2);
  bottom: -80px;
  right: -60px;
  animation-delay: -6s;
  transform: rotate(8deg);
}

.grid-light {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(17, 17, 17, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px);
  background-size: 140px 140px;
  opacity: 0.22;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(20px);
  }
}

.app {
  width: 100%;
  max-width: 100%;
  position: relative;
}

.screen {
  display: none;
  animation: fadeUp 0.5s ease;
}

.screen.active {
  display: block;
}

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

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.card {
  border-radius: var(--radius-lg);
  padding: 22px;
  background: var(--glass);
}

.cover-card {
  text-align: center;
  display: grid;
  gap: 18px;
}

.cover-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  color: var(--accent);
}

.eyebrow {
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.8rem;
}

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.identity-form {
  display: grid;
  gap: 12px;
  text-align: left;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.field-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(17, 17, 17, 0.35);
  background: #fffdf7;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.field input:focus {
  border-color: rgba(17, 17, 17, 0.65);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-error {
  min-height: 18px;
  color: #9d2f1f;
  font-size: 0.85rem;
}

.btn {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  border: 1px solid rgba(17, 17, 17, 0.6);
  border-radius: 14px;
  padding: 14px 24px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--primary);
  color: #111111;
  box-shadow: 0 12px 24px rgba(17, 17, 17, 0.14);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(17, 17, 17, 0.18);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: #fffdf7;
  color: var(--text);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 32, 58, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.quiz-header {
  margin-bottom: 12px;
}

.progress-info {
  display: grid;
  gap: 10px;
}

.progress-text {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.88rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #fffdf7;
  border: 1px solid rgba(17, 17, 17, 0.12);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-soft));
  transition: width 0.3s ease;
}

.quiz-card {
  display: grid;
  gap: 14px;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.question-meta h2 {
  font-size: 1.02rem;
}

.badge {
  background: #fffdf7;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17, 17, 17, 0.2);
  font-weight: 600;
  font-size: 0.72rem;
}

.question-text {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.options-grid {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--option-border);
  background: var(--option-bg);
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.option:hover {
  transform: translateY(-2px);
  background: var(--option-hover);
  border-color: var(--option-border-strong);
  box-shadow: 0 12px 22px rgba(17, 17, 17, 0.12);
}

.option:active {
  transform: translateY(0);
}

.option.selected {
  background: var(--option-selected);
  border-color: var(--option-border-strong);
  box-shadow: 0 0 0 3px var(--option-ring);
}

.option.correct {
  background: var(--option-correct);
  border-color: rgba(43, 91, 16, 0.4);
  box-shadow: 0 0 0 3px rgba(184, 242, 106, 0.35);
}

.option.wrong {
  background: var(--option-wrong);
  border-color: rgba(157, 47, 31, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 183, 170, 0.35);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #111111;
  color: #fffdf7;
  flex-shrink: 0;
}

.option-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  line-height: 1.45;
}


.result-card {
  display: grid;
  gap: 24px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.result-icon {
  width: 52px;
  height: 52px;
  color: var(--primary);
}

.score-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.score-item {
  background: var(--glass-strong);
  border-radius: var(--radius-md);
  border: 1px solid rgba(17, 17, 17, 0.12);
  padding: 16px;
  text-align: center;
}

.score-label {
  color: var(--muted);
  font-size: 0.85rem;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 6px;
}

.answer-key h3 {
  margin-bottom: 10px;
}

.answer-key ol {
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--text);
  line-height: 1.6;
}

.calc-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.32);
  opacity: 1;
  pointer-events: all;
  transition: opacity 0.2s ease;
  padding: 20px;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  max-width: 480px;
  width: 100%;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  gap: 14px;
  animation: pop 0.25s ease;
  text-align: center;
  background: var(--glass);
  border: 1px solid rgba(17, 17, 17, 0.25);
}

.modal-card.is-correct {
  background: #edffd2;
  border-color: rgba(121, 182, 46, 0.5);
}

.modal-card.is-wrong {
  background: #ffe6df;
  border-color: rgba(200, 85, 67, 0.45);
}

.modal-card.is-correct .modal-icon,
.modal-card.is-correct .modal-title {
  color: #2b5b10;
}

.modal-card.is-wrong .modal-icon,
.modal-card.is-wrong .modal-title {
  color: #9d2f1f;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  color: var(--primary);
}

.modal-text {
  color: var(--muted);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.icon-svg {
  width: 100%;
  height: 100%;
}

@media (min-width: 768px) {
  body {
    padding: 32px;
  }

  .card {
    padding: 32px;
  }

  .question-text {
    font-size: 1.05rem;
  }

  .identity-form {
    gap: 14px;
  }

  .field input {
    padding: 14px 16px;
    font-size: 1rem;
  }

  .progress-bar {
    height: 8px;
  }

  .question-meta h2 {
    font-size: 1.2rem;
  }

  .badge {
    font-size: 0.78rem;
    padding: 5px 12px;
  }

  .option {
    font-size: 0.95rem;
    padding: 14px 16px;
  }

  .option-letter {
    width: 34px;
    height: 34px;
  }
}

@media (min-width: 1024px) {
  :root {
    --radius-lg: 24px;
    --radius-md: 14px;
  }
}

@media (min-width: 1024px) {
  .app {
    max-width: 860px;
  }
}
