:root {
  --bg-1: #071323;
  --bg-2: #0d1024;
  --surface: rgba(13, 21, 44, 0.72);
  --surface-strong: rgba(20, 30, 62, 0.82);
  --border: rgba(140, 173, 255, 0.28);
  --text: #eef3ff;
  --muted: #adbbdc;
  --accent: #44f2b8;
  --accent-2: #4ca8ff;
  --accent-3: #ffcc66;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Outfit", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 0%, #10254b 0%, transparent 45%),
    radial-gradient(circle at 90% 20%, #14275a 0%, transparent 40%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  overflow-x: hidden;
}

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 40%, black, transparent 75%);
  z-index: -3;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(75px);
  z-index: -2;
}

.bg-orb-one {
  width: 340px;
  height: 340px;
  background: rgba(68, 242, 184, 0.22);
  top: -80px;
  left: -60px;
}

.bg-orb-two {
  width: 280px;
  height: 280px;
  background: rgba(76, 168, 255, 0.22);
  bottom: -40px;
  right: -50px;
}

.topbar {
  padding: 1.4rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 3rem;
}

.brand-logo {
  width: clamp(170px, 24vw, 260px);
  max-width: 100%;
  height: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 1.1rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.hero {
  margin-top: 0.2rem;
  background: linear-gradient(160deg, rgba(76, 168, 255, 0.1), rgba(68, 242, 184, 0.08)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.2rem;
}

.pill {
  margin: 0;
  display: inline-flex;
  border: 1px solid rgba(68, 242, 184, 0.4);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.32rem 0.84rem;
  font-size: 0.8rem;
}

.hero h1 {
  margin: 0.8rem 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

.tagline {
  margin: 0;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.5;
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0.72rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(100deg, var(--accent), #75ffd8);
  color: #053328;
  box-shadow: 0 10px 24px rgba(68, 242, 184, 0.25);
}

.btn-outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.start-btn {
  min-width: 170px;
  padding: 0.84rem 1.24rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 1px rgba(68, 242, 184, 0.35),
    0 10px 28px rgba(68, 242, 184, 0.36);
  animation: startPulse 1.6s ease-in-out infinite;
}

.start-btn:hover {
  transform: translateY(-1px) scale(1.01);
}

@keyframes startPulse {
  0% {
    box-shadow:
      0 0 0 1px rgba(68, 242, 184, 0.35),
      0 10px 28px rgba(68, 242, 184, 0.32);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(68, 242, 184, 0.08),
      0 14px 32px rgba(68, 242, 184, 0.48);
  }
  100% {
    box-shadow:
      0 0 0 1px rgba(68, 242, 184, 0.35),
      0 10px 28px rgba(68, 242, 184, 0.32);
  }
}

.hero-panel {
  background: var(--surface-strong);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1rem;
}

.panel-title {
  margin: 0 0 0.8rem;
  font-size: 0.86rem;
  color: var(--accent-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.path-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.78rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
  color: var(--muted);
}

.path-item span:last-child {
  color: #d6e4ff;
  font-weight: 600;
}

.path-item:last-child {
  border-bottom: 0;
}

.stats {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.stat-card {
  margin: 0;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
}

.stat-value {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
}

.stat-label {
  margin: 0.28rem 0 0;
  color: var(--muted);
}

.grid {
  margin: 1rem 0 2.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1.2rem;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(68, 242, 184, 0.4);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.card h2 {
  margin: 0;
  font-size: 1.28rem;
  color: #87ffd6;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: #07273a;
  font-weight: 700;
  background: linear-gradient(120deg, #7ad5ff, #9ff7e2);
}

.chip-link {
  text-decoration: none;
}

.card p {
  margin: 0.6rem 0 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.card li {
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
}

.card li::before {
  content: "\2192";
  color: var(--accent);
  margin-right: 0.5rem;
}

.topic-link {
  color: var(--text);
  text-decoration: none;
}

.topic-link:hover {
  color: #9df7dc;
  text-decoration: underline;
}

.card li:last-child {
  border-bottom: 0;
}

.compact-hero {
  grid-template-columns: 1fr;
}

.quiz-game {
  margin: 1.1rem 0 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 22px;
  padding: 1rem;
  background: linear-gradient(160deg, rgba(18, 33, 70, 0.68), rgba(8, 19, 42, 0.88));
  backdrop-filter: blur(8px);
}

.quiz-meta {
  margin: 0;
  padding: 0.45rem 0.74rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.quiz-hud {
  position: sticky;
  top: 0.5rem;
  z-index: 7;
  margin-bottom: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 0.8rem;
  background: linear-gradient(170deg, rgba(14, 28, 58, 0.95), rgba(10, 21, 47, 0.92));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.quiz-stats {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.quiz-meta span {
  color: var(--text);
}

.quiz-hint {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.quiz-game.is-locked .progress-track,
.quiz-game.is-locked .progress-wrap,
.quiz-game.is-locked .question-strip,
.quiz-game.is-locked .question-list,
.quiz-game.is-locked .quiz-nav {
  display: none;
}

.progress-wrap {
  margin-bottom: 0.75rem;
}

.progress-label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a8bddd;
}

.progress-track {
  height: 11px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #44f2b8, #4ca8ff);
  transition: width 0.25s ease, background 0.25s ease;
}

.time-track {
  background: rgba(255, 255, 255, 0.1);
}

.time-fill {
  background: linear-gradient(90deg, #4ca8ff, #44f2b8);
}

.timer-meta.is-warning {
  border-color: rgba(255, 204, 102, 0.65);
  background: rgba(255, 204, 102, 0.18);
  color: #ffe4ad;
}

.timer-meta.is-warning span {
  color: #ffefcf;
}

.timer-meta.is-danger {
  border-color: rgba(255, 136, 136, 0.72);
  background: rgba(255, 122, 122, 0.22);
  color: #ffd4d4;
}

.timer-meta.is-danger span {
  color: #fff2f2;
}

.question-strip {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.question-dot {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: #c8d8f7;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.question-dot:hover {
  transform: translateY(-1px);
  border-color: rgba(76, 168, 255, 0.66);
}

.question-dot.is-current {
  color: #061e3c;
  border-color: transparent;
  background: linear-gradient(120deg, #75ffd8, #7bc7ff);
  box-shadow: 0 6px 18px rgba(76, 168, 255, 0.35);
}

.question-dot.is-visited:not(.is-current) {
  border-color: rgba(140, 173, 255, 0.45);
}

.question-dot.is-correct {
  border-color: rgba(83, 255, 188, 0.75);
  background: rgba(83, 255, 188, 0.2);
  color: #cbffe9;
}

.question-dot.is-wrong {
  border-color: rgba(255, 145, 145, 0.8);
  background: rgba(255, 145, 145, 0.2);
  color: #ffd2d2;
}

.question-list {
  margin: 0;
  display: grid;
  gap: 0;
}

.question-card {
  display: none;
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 1.1rem;
  min-height: 330px;
}

.question-card.is-active-question {
  display: block;
}

.question-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.question-state {
  margin: 0;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #c4d5f3;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.question-state.is-visited {
  border-color: rgba(157, 201, 255, 0.55);
  color: #d5e6ff;
}

.question-state.is-correct {
  border-color: rgba(68, 242, 184, 0.8);
  background: rgba(68, 242, 184, 0.14);
  color: #bfffe6;
}

.question-state.is-wrong {
  border-color: rgba(255, 136, 136, 0.75);
  background: rgba(255, 136, 136, 0.14);
  color: #ffd3d3;
}

.question-card h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}

.question-meta {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: #9fc8ff;
}

.options-group {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.option-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.65rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease, background 0.18s ease;
}

.option-item:hover {
  border-color: rgba(120, 177, 255, 0.65);
  background: rgba(102, 164, 255, 0.08);
  transform: translateY(-1px);
}

.option-item input {
  margin-top: 0.24rem;
  accent-color: #4ca8ff;
}

.option-item.is-correct {
  border-color: rgba(68, 242, 184, 0.8);
  background: rgba(68, 242, 184, 0.18);
}

.option-item.is-wrong {
  border-color: rgba(255, 130, 130, 0.7);
  background: rgba(255, 130, 130, 0.18);
}

.question-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 0.55rem 0.84rem;
  font-size: 0.92rem;
}

.result-message {
  margin: 0.85rem 0 0;
  font-weight: 600;
}

.result-message.correct {
  color: #88ffd7;
}

.result-message.wrong {
  color: #ff9b9b;
}

.result-message.warning {
  color: #ffd57f;
}

.explanation-box {
  margin-top: 0.7rem;
  padding: 0.72rem;
  border-radius: 12px;
  border: 1px solid rgba(124, 190, 255, 0.4);
  background: rgba(76, 168, 255, 0.1);
  color: #d8e7ff;
  line-height: 1.45;
}

.is-hidden {
  display: none;
}

.quiz-nav {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.quiz-nav .btn {
  min-width: 0;
}

.summary-card {
  margin-top: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(170deg, rgba(15, 29, 59, 0.76), rgba(11, 23, 48, 0.9));
}

.summary-card h3 {
  margin: 0 0 0.65rem;
}

.summary-card p {
  margin: 0.32rem 0;
  color: #d9e5ff;
}

.summary-actions {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.summary-actions .btn {
  min-width: 160px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.seo-section {
  margin: 1.4rem 0 2.4rem;
  padding: 1.15rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  transition: padding 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.seo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.seo-head h2 {
  margin: 0;
}

.seo-toggle {
  white-space: nowrap;
}

.seo-content {
  transition: opacity 0.2s ease;
}

.seo-section.is-collapsed {
  padding: 0.78rem 1rem;
  border-color: rgba(157, 233, 255, 0.24);
  background: rgba(110, 168, 255, 0.05);
}

.seo-section.is-collapsed .seo-head {
  margin-bottom: 0;
}

.seo-section.is-collapsed h2 {
  font-size: 1.04rem;
}

.seo-section h2,
.seo-section h3 {
  margin: 0 0 0.55rem;
}

.seo-section p {
  margin: 0 0 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}

.seo-section details {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.65rem;
  background: rgba(255, 255, 255, 0.02);
}

.seo-section summary {
  cursor: pointer;
  font-weight: 600;
}

.seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.seo-links a {
  text-decoration: none;
  color: #9de9ff;
  border: 1px solid rgba(157, 233, 255, 0.3);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.9rem;
}

.seo-links a:hover {
  color: #d5f8ff;
  border-color: rgba(157, 233, 255, 0.55);
}

.settings-card {
  margin: 1rem 0 2.3rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 1.1rem;
}

.quiz-settings-form {
  display: grid;
  gap: 0.95rem;
}

.settings-block label,
.settings-label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

.quiz-settings-form select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  padding: 0.62rem 0.72rem;
}

.checkbox-grid {
  display: grid;
  gap: 0.45rem;
}

.checkbox-grid label,
.radio-row label {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  color: var(--muted);
  margin: 0;
}

.radio-row {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .brand-logo {
    width: clamp(160px, 52vw, 230px);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .stats,
  .grid {
    grid-template-columns: 1fr;
  }

  .quiz-nav .btn {
    width: 100%;
  }

  .quiz-nav {
    grid-template-columns: 1fr;
  }

  .question-strip {
    max-height: 132px;
    overflow-y: auto;
    padding-right: 0.15rem;
  }

  .question-dot {
    width: 1.9rem;
    height: 1.9rem;
  }

  .seo-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
