* {
  box-sizing: border-box;
}

:root {
  --bg: #0d0b1a;
  --bg-2: #171333;
  --card: #1d1840;
  --gold: #f5c542;
  --gold-soft: #ffe9a3;
  --violet: #8f79c9;
  --text: #ece9ff;
  --muted: #a9a3d0;
  --good: #4ad991;
  --bad: #ff6b81;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Philosopher', 'SN Pro', system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
}

/* звёзды */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1px 1px at 70% 15%, #ffe9a3, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent),
    radial-gradient(1px 1px at 85% 55%, #cdb8ff, transparent),
    radial-gradient(1.2px 1.2px at 10% 85%, #fff, transparent),
    radial-gradient(1px 1px at 55% 45%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 92% 88%, #ffe9a3, transparent);
  background-size: 550px 550px;
  animation: twinkle 6s ease-in-out infinite alternate;
  opacity: 0.7;
}

@keyframes twinkle {
  from { opacity: 0.45; }
  to { opacity: 0.85; }
}

.topbar,
main,
.footer {
  position: relative;
  z-index: 1;
}

/* ШАПКА */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(13, 11, 26, 0.75);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(245, 197, 66, 0.25);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__logo {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  color: var(--gold);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.topbar__nav {
  display: flex;
  gap: clamp(0.75rem, 3vw, 2rem);
}

.topbar__nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.topbar__nav a:hover {
  color: var(--gold);
}

/* ГЕРОЙ */
.hero {
  text-align: center;
  padding: clamp(3.5rem, 9vw, 6.5rem) 1.25rem clamp(3rem, 7vw, 5rem);
}

.hero__badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  border: 1px solid rgba(245, 197, 66, 0.5);
  border-radius: 999px;
  color: var(--gold-soft);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__title {
  margin: 1.2rem 0 0.2rem;
  font-family: 'Cinzel', serif;
  font-size: clamp(2.6rem, 9vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 55%, #c98f1b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(245, 197, 66, 0.25);
}

.hero__subtitle {
  margin: 0;
  font-size: clamp(1.1rem, 3.5vw, 1.6rem);
  color: var(--violet);
  font-style: italic;
}

.hero__lead {
  margin: 1.4rem auto 0;
  max-width: 38rem;
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.02rem;
}

.hero__actions {
  margin-top: 2rem;
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero__wand {
  margin-top: 2.2rem;
  font-size: 2.4rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(10deg); }
}

/* КНОПКИ */
.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.7rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--gold {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #3a2a00;
  box-shadow: 0 6px 22px rgba(245, 197, 66, 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(236, 233, 255, 0.35);
}

/* СЕКЦИИ */
.section {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.25rem;
}

.section__title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  color: var(--gold);
  text-align: center;
  margin: 0 0 1.2rem;
  letter-spacing: 0.05em;
}

.section__text {
  max-width: 44rem;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
}

/* ФАКТЫ */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.fact {
  background: var(--card);
  border: 1px solid rgba(143, 121, 201, 0.35);
  border-radius: 16px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fact__num {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

.fact__label {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ГЕРОИ */
.heroes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}

.hero-card {
  background: var(--card);
  border-radius: 18px;
  padding: 1.4rem 1.2rem;
  border-left: 4px solid var(--violet);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.hero-card--gryff { border-left-color: #e33b4c; }
.hero-card--slyth { border-left-color: #3fbf6f; }
.hero-card--raven { border-left-color: #4aa8e0; }
.hero-card--huff { border-left-color: #f5c542; }

.hero-card__emoji {
  font-size: 2rem;
}

.hero-card h3 {
  margin: 0.5rem 0 0.4rem;
  font-family: 'Cinzel', serif;
  color: var(--gold-soft);
  font-size: 1.1rem;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* ТЕСТ */
.section--quiz {
  max-width: 46rem;
}

.quiz {
  background: linear-gradient(180deg, rgba(29, 24, 64, 0.95), rgba(20, 16, 46, 0.95));
  border: 1px solid rgba(245, 197, 66, 0.35);
  border-radius: 22px;
  padding: clamp(1.3rem, 4vw, 2.2rem);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.quiz__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.quiz__score {
  color: var(--gold);
  font-weight: 700;
}

.quiz__bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.quiz__bar-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, var(--violet), var(--gold));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.quiz__question {
  font-family: 'Philosopher', serif;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  margin: 1.4rem 0 1.1rem;
  line-height: 1.45;
  color: var(--text);
}

.quiz__options {
  display: grid;
  gap: 0.7rem;
}

.option {
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(143, 121, 201, 0.45);
  border-radius: 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.option:hover:not(:disabled) {
  border-color: var(--gold);
  background: rgba(245, 197, 66, 0.12);
  transform: translateX(4px);
}

.option:disabled {
  cursor: default;
}

.option--correct {
  border-color: var(--good);
  background: rgba(74, 217, 145, 0.18);
}

.option--wrong {
  border-color: var(--bad);
  background: rgba(255, 107, 129, 0.16);
}

.quiz__fact {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  background: rgba(143, 121, 201, 0.15);
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  color: var(--gold-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.quiz__next {
  margin-top: 1.2rem;
  width: 100%;
}

/* РЕЗУЛЬТАТ */
.quiz__result {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.quiz__result-emoji {
  font-size: 3.4rem;
  animation: float 3s ease-in-out infinite;
}

.quiz__result-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.4rem, 4.5vw, 1.9rem);
  color: var(--gold);
  margin: 0.7rem 0 0.3rem;
}

.quiz__result-score {
  font-size: 1.2rem;
  color: var(--gold-soft);
  margin: 0.2rem 0;
}

.quiz__result-text {
  color: var(--muted);
  line-height: 1.6;
  max-width: 30rem;
  margin: 0.6rem auto 1.5rem;
}

/* ПОДВАЛ */
.footer {
  text-align: center;
  padding: 2rem 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(143, 121, 201, 0.2);
}

@media (max-width: 520px) {
  .topbar__nav a { font-size: 0.85rem; }
  .quiz__next { width: 100%; }
}
