:root {
  font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  color-scheme: light dark;
  --bg: #f2f6ff;
  --text: #1f2b46;
  --accent: #ff7a18;
  --accent-2: #2c7dfa;
  --success: #1fbf75;
  --error: #e95252;
  --card: #ffffff;
  --shadow: 0 15px 45px rgba(20, 36, 70, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
}

.background-layer {
  position: fixed;
  inset: 0;
  background: url("./images/karst-landscape.jpg") center/cover no-repeat;
  filter: blur(16px);
  transform: scale(1.05);
  z-index: -2;
}

.background-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg
  );
}

audio {
  display: none;
}

.audio-widget {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: rgba(8, 14, 32, 0.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 25px rgba(6, 10, 24, 0.35);
  z-index: 25;
}

.audio-widget button {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.audio-widget button:hover {
  transform: scale(1.1);
}

.audio-widget input[type="range"] {
  width: 140px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.5);
  height: 4px;
  border-radius: 999px;
  cursor: pointer;
}

.audio-widget input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(44, 125, 250, 0.4);
}

.audio-widget input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(44, 125, 250, 0.4);
}

.welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(230, 233, 241, 0.733);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeIn 0.6s ease;
}

.welcome-overlay.hidden {
  animation: fadeOut 0.5s forwards;
}

.welcome-card {
  background: var(--card);
  padding: 2.5rem 3rem;
  border-radius: 24px;
  box-shadow: var(--shadow);
  text-align: center;
  max-width: 520px;
  transform: scale(0.95);
  animation: popIn 0.8s ease forwards;
}

.welcome-card h1 {
  margin-bottom: 1rem;
}

.welcome-card button {
  margin-top: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  padding: 0.9rem 2.2rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-card button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(44, 125, 250, 0.35);
}

.hero {
  text-align: center;
  margin-top: 3rem;
  animation: floatIn 1s ease;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.quiz-container {
  width: min(900px, 90vw);
  margin: 2rem auto 3rem;
}

.question-area {
  background: var(--card);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: var(--shadow);
  animation: slideUp 0.8s ease;
}

.question-area.swap {
  animation: pulse 0.6s ease;
}

.question-meta {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: #5b6580;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.options {
  list-style: none;
  padding: 0;
  margin: 2rem 0;
  display: grid;
  gap: 1rem;
}

.options li {
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  background: #f7f9ff;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, border 0.15s ease, box-shadow 0.15s ease;
}

.options li:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(51, 82, 125, 0.12);
}

.options li.correct {
  border-color: var(--success);
  background: rgba(31, 191, 117, 0.12);
}

.options li.wrong {
  border-color: var(--error);
  background: rgba(233, 82, 82, 0.12);
}

.options li.locked {
  pointer-events: none;
  opacity: 0.95;
}

.options li .label {
  font-weight: 700;
  color: var(--accent-2);
}

.explanation {
  min-height: 2rem;
  font-size: 1rem;
  color: #3b4560;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.explanation.visible {
  opacity: 1;
  transform: translateY(0);
}

.controls {
  display: flex;
  justify-content: flex-end;
}

.controls button {
  padding: 0.8rem 1.8rem;
  border-radius: 12px;
  border: none;
  background: var(--accent-2);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

footer {
  margin-bottom: 1.5rem;
  color: #6b7692;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.85);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes floatIn {
  0% {
    opacity: 0;
    transform: translateY(25px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .question-area {
    padding: 1.75rem;
  }

  .welcome-card {
    padding: 2rem;
  }

  .hero h1 {
    font-size: 1.9rem;
  }
}

