.available-quiz {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.13);
}

.chapter-link em {
  margin-left: auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.18);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.quiz-shell {
  padding-top: 28px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: #cbd5e1;
  font-weight: 800;
}

.quiz-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.quiz-side-panel,
.quiz-card,
.finish-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 32px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.3);
  backdrop-filter: blur(18px);
}

.quiz-side-panel {
  position: sticky;
  top: 18px;
  padding: 18px;
}

.mascot-card {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 16px;
  border-radius: 26px;
  background: radial-gradient(circle at top, rgba(59, 130, 246, 0.28), rgba(15, 23, 42, 0.6));
  overflow: hidden;
}

.mascot-card img {
  width: min(190px, 100%);
  min-height: 160px;
  object-fit: contain;
  animation: mascotFloat 2.5s ease-in-out infinite;
}

.mascot-wrong img {
  animation: mascotShake 0.35s ease-in-out 2;
}

.mascot-streak img,
.mascot-badge img,
.mascot-win img {
  animation: mascotBounce 0.7s ease-in-out infinite alternate;
}

.speech-bubble {
  width: 100%;
  padding: 12px;
  border-radius: 18px;
  color: #e0f2fe;
  background: rgba(2, 6, 23, 0.74);
  border: 1px solid rgba(147, 197, 253, 0.28);
  text-align: center;
  font-weight: 800;
}

.stat-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.stat-box {
  padding: 14px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.72);
}

.stat-box span,
.badge small {
  display: block;
  color: #94a3b8;
  font-size: 0.8rem;
}

.stat-box strong {
  display: block;
  margin-top: 4px;
  color: #f8fafc;
  font-size: 1.25rem;
}

.badge-panel {
  margin-top: 16px;
}

.badge-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.badge-grid {
  display: grid;
  gap: 8px;
}

.badge {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 11px;
  border-radius: 16px;
  opacity: 0.5;
  background: rgba(30, 41, 59, 0.54);
  border: 1px solid transparent;
}

.badge span {
  grid-row: span 2;
  font-size: 1.35rem;
}

.badge.unlocked {
  opacity: 1;
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
}

.quiz-card {
  padding: clamp(18px, 3vw, 34px);
}

.quiz-topline,
.quiz-meta,
.quiz-actions,
.final-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.quiz-topline {
  justify-content: space-between;
  color: #bfdbfe;
  font-weight: 900;
}

.progress-track {
  height: 12px;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #22c55e, #facc15);
  transition: width 200ms ease;
}

.quiz-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(59, 130, 246, 0.14);
  font-size: 0.86rem;
  font-weight: 800;
}

.quiz-card h1,
.finish-card h1 {
  margin: 20px 0 12px;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.question-text {
  margin: 18px 0;
  padding: 18px;
  border-radius: 22px;
  color: #f8fafc;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 1.15rem;
  line-height: 1.65;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.choice-button {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.72);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.choice-button:not(:disabled):hover {
  transform: translateY(-2px);
  border-color: rgba(147, 197, 253, 0.45);
  background: rgba(37, 99, 235, 0.18);
}

.choice-button span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.2);
  font-weight: 900;
}

.choice-button.correct {
  border-color: rgba(34, 197, 94, 0.75);
  background: rgba(34, 197, 94, 0.16);
}

.choice-button.wrong {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.16);
}

.answer-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  line-height: 1.65;
}

.answer-panel h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}

.correct-panel {
  border: 1px solid rgba(34, 197, 94, 0.44);
  background: rgba(34, 197, 94, 0.12);
}

.wrong-panel {
  border: 1px solid rgba(239, 68, 68, 0.44);
  background: rgba(239, 68, 68, 0.12);
}

.quiz-actions {
  margin-top: 20px;
}

.quiz-actions button,
.button-reset {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 0;
  border-radius: 16px;
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.95);
  font-weight: 900;
  cursor: pointer;
}

.quiz-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz-actions .next-button,
.button-reset {
  color: #06121f;
  background: #f8fafc;
}

.finish-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 780px;
  margin: 0 auto;
  padding: 30px;
  text-align: center;
}

.finish-card p {
  color: #cbd5e1;
  line-height: 1.7;
}

.final-stats {
  justify-content: center;
}

.final-stats span {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.72);
}

@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes mascotShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes mascotBounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-10px) scale(1.04); }
}

@media (max-width: 980px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .quiz-side-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .stat-stack {
    grid-template-columns: 1fr 1fr;
  }

  .quiz-actions button {
    width: 100%;
    justify-content: center;
  }
}
