:root {
  --blue: #010080;
  --blue-deep: #00005a;
  --red: #CC0001;
  --yellow: #FFD100;
  --white: #FFFFFF;
  --ink: #0D0D3B;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--blue);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255,209,0,0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(204,0,1,0.12) 0%, transparent 40%);
  font-family: 'Work Sans', sans-serif;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.stage {
  width: 100%;
  max-width: 560px;
}

.eyebrow {
  text-align: center;
  color: var(--yellow);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(30px, 6vw, 44px);
  color: var(--white);
  text-align: center;
  margin: 0 0 6px;
  line-height: 1.05;
}

h1 span { color: var(--yellow); font-style: italic; font-weight: 500; }

.sub {
  text-align: center;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  margin-bottom: 26px;
}

.card {
  position: relative;
  background: var(--white);
  border-radius: 22px;
  padding: 32px 28px 28px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.40);
  overflow: hidden;
}

.card::before, .card::after {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.45;
  pointer-events: none;
}
.card::before {
  top: -18px; left: -18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 10 C60 25 60 25 50 40 C40 25 40 25 50 10 Z M10 50 C25 40 25 40 40 50 C25 60 25 60 10 50 Z' fill='none' stroke='%23FFD100' stroke-width='2'/%3E%3Ccircle cx='50' cy='50' r='6' fill='%23CC0001' opacity='0.6'/%3E%3C/svg%3E");
}
.card::after {
  bottom: -18px; right: -18px;
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 10 C60 25 60 25 50 40 C40 25 40 25 50 10 Z M10 50 C25 40 25 40 40 50 C25 60 25 60 10 50 Z' fill='none' stroke='%23010080' stroke-width='2'/%3E%3Ccircle cx='50' cy='50' r='6' fill='%23CC0001' opacity='0.6'/%3E%3C/svg%3E");
}

.petals {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 22px;
}
.petal {
  width: 16px;
  height: 16px;
  border-radius: 60% 40% 60% 40%;
  background: rgba(1,0,128,0.12);
  transition: all 0.35s ease;
}
.petal.done {
  background: var(--red);
  transform: scale(1.08);
}
.petal.current {
  background: var(--yellow);
}

.qimg {
  margin-bottom: 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(1,0,128,0.1);
}
.qimg svg { display: block; width: 100%; height: auto; }

.qnum {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.question {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 22px;
  color: var(--ink);
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.opt {
  text-align: left;
  background: var(--white);
  border: 2px solid rgba(1,0,128,0.15);
  border-radius: 12px;
  padding: 13px 16px;
  font-family: 'Work Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, background 0.15s ease;
}
.opt:hover:not(:disabled) {
  border-color: var(--blue);
  transform: translateY(-1px);
}
.opt:disabled { cursor: default; }
.opt.correct {
  background: rgba(1,0,128,0.07);
  border-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
}
.opt.wrong {
  background: rgba(204,0,1,0.07);
  border-color: var(--red);
  color: var(--red);
}

.feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  line-height: 1.5;
  display: none;
}
.feedback.show { display: block; }
.feedback b { color: var(--yellow); font-family: 'Fraunces', serif; }

.nextrow { margin-top: 18px; text-align: right; }

.btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 11px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.1s ease, background 0.15s ease;
}
.btn:hover { background: #a80001; transform: translateY(-1px); }

.result {
  text-align: center;
  display: none;
}
.result.show { display: block; }
.score-big {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 64px;
  color: var(--red);
  line-height: 1;
  margin-bottom: 4px;
}
.score-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
}
.title-badge {
  display: inline-block;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-style: italic;
  font-size: 22px;
  color: var(--blue);
  background: rgba(1,0,128,0.08);
  padding: 10px 20px;
  border-radius: 30px;
  margin-bottom: 16px;
}
.result p.desc {
  color: rgba(13,13,59,0.7);
  font-size: 14.5px;
  max-width: 380px;
  margin: 0 auto 24px;
  line-height: 1.5;
}
.restart {
  background: var(--blue);
}
.restart:hover { background: var(--blue-deep); }

/* modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(1,0,88,0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: 22px;
  padding: 44px 36px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 40px 80px rgba(0,0,0,0.45);
  animation: modalIn 0.35s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h2 {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: clamp(24px, 5vw, 34px);
  color: var(--ink);
  margin: 10px 0 18px;
  line-height: 1.1;
}

.modal h2 span { color: var(--red); font-style: italic; font-weight: 500; }

.modal p {
  color: rgba(13,13,59,0.65);
  font-size: 15px;
  line-height: 1.55;
  margin: 0 0 6px;
}

.modal .eyebrow { color: var(--blue); }

.modal .btn { margin-top: 28px; }
