:root {
  --bg: #fef0f7;
  --surface: rgba(255, 255, 255, 0.65);
  --surface-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(192, 132, 252, 0.18);
  --border-strong: rgba(192, 132, 252, 0.32);
  --text: #2d1b3d;
  --text-dim: #6b5577;
  --text-mute: #9a89af;
  --accent: #ec4899;
  --accent-2: #c084fc;
  --accent-3: #a78bfa;
  --gradient: linear-gradient(135deg, #ec4899 0%, #c084fc 50%, #a78bfa 100%);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.12);
  --red: #e11d48;
  --red-soft: rgba(225, 29, 72, 0.10);
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 10% -10%, rgba(236, 72, 153, 0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(192, 132, 252, 0.16), transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, rgba(167, 139, 250, 0.14), transparent 60%);
  pointer-events: none;
  z-index: -1;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

a { color: inherit; text-decoration: none; }

/* NAV */
.g-nav {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(254, 240, 247, 0.75);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.g-nav__back {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dim);
  transition: color 0.25s var(--ease);
}
.g-nav__back:hover { color: var(--accent); }

/* LANG SWITCH */
.lang-switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-switch__btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s var(--ease);
}
.lang-switch__btn.is-active {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.3);
}

/* LAYOUT */
.g-main {
  display: flex;
  justify-content: center;
  padding: 3rem 1.25rem 4rem;
  min-height: calc(100vh - 64px);
}

.g-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(192, 132, 252, 0.18);
  align-self: flex-start;
}

.g-head { text-align: center; margin-bottom: 1.75rem; }
.g-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.g-subtitle { color: var(--text-dim); font-size: 0.95rem; margin-top: 0.35rem; }

/* QUIZ */
.quiz__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 0.6rem;
}
.quiz__score strong { color: var(--accent); }

.progress {
  height: 6px;
  background: rgba(192, 132, 252, 0.18);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.75rem;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 999px;
  transition: width 0.4s var(--ease);
}

.quiz__prompt {
  text-align: center;
  font-size: 1.25rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.quiz__prompt strong { color: var(--text); }

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.option {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding: 1rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: center;
}
.option:hover:not(:disabled) {
  border-color: var(--accent);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(236, 72, 153, 0.18);
}
.option:disabled { cursor: default; }
.option.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}
.option.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

/* FEEDBACK */
.feedback {
  min-height: 1.6rem;
  text-align: center;
  font-weight: 600;
  margin-top: 1.25rem;
  font-size: 1rem;
}
.feedback.is-correct { color: var(--green); }
.feedback.is-wrong { color: var(--red); }
.feedback strong { font-weight: 700; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.3);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.45);
}
.btn--ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover { background: #fff; border-color: var(--accent); }

.next-btn {
  display: block;
  margin: 1.5rem auto 0;
}

/* RESULT */
.result { text-align: center; padding: 1rem 0; }
.result__emoji { font-size: 3.5rem; line-height: 1; margin-bottom: 0.75rem; }
.result__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}
.result__score { font-size: 1.15rem; margin-bottom: 0.5rem; }
.result__score strong { color: var(--accent); }
.result__msg { color: var(--text-dim); margin-bottom: 1.75rem; }
.result__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* RESPONSIVE */
@media (max-width: 480px) {
  .g-card { padding: 1.5rem; }
  .options { grid-template-columns: 1fr; }
  .quiz__prompt { font-size: 1.1rem; }
}
