/* Modern Premium Quiz Styling */
:root {
  --quiz-primary: #ff8800;
  --quiz-secondary: #ff8800; /* Orange */
  --quiz-accent: #ff9d26;
  --quiz-text: #ffffff;
  --quiz-background: #141414;
  --quiz-panel: #101010;
  --quiz-panel-soft: #181818;
  --quiz-border: rgba(255, 255, 255, 0.08);
  --quiz-success: #00e676; /* Vibrant green */
  --quiz-error: #ff1744; /* Vibrant red */
  --quiz-neutral: #9e9e9e;
  --quiz-shadow: 0 22px 60px rgba(0, 0, 0, 0.58);
  --quiz-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  /* Kurzgesagt-inspired vibrant color palette */
  --k-turquoise: #00b9ae;
  --k-blue: #0083c7;
  --k-purple: #8246af;
  --k-pink: #fb3880;
  --k-orange: #ff8e31;
  --k-yellow: #ffde17;
  --k-red: #ff3838;
  --k-green: #25d380;
}

/* Quiz Container */
body.quiz-page main {
  min-height: 100svh;
  margin-top: 0;
  padding: 36px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

html.quiz-inline-active,
body.quiz-inline-active {
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body.quiz-inline-active {
  padding-right: 0 !important;
}

body.quiz-inline-active .home-main {
  min-height: 100svh;
  height: auto;
  margin-top: 0;
  padding: 28px 20px;
  box-sizing: border-box;
  overflow: visible;
}

body.quiz-inline-active #course-view {
  width: 100%;
  min-height: 0;
  height: auto;
  padding: 0;
  box-sizing: border-box;
  overflow: visible;
}

body.quiz-inline-active #quiz-view.active {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100svh - 56px);
  height: auto;
  box-sizing: border-box;
  overflow: visible;
}

body.quiz-inline-active #inline-quiz,
body.quiz-inline-active #inline-quiz .lecture-page,
body.quiz-inline-active #inline-quiz-content {
  width: 100%;
  min-height: 0;
  height: auto;
  padding: 0;
}

body.quiz-inline-active #inline-quiz-title {
  display: none;
}

body.quiz-inline-active #inline-quiz .lecture-page,
body.quiz-inline-active #inline-quiz-content {
  display: flex;
  align-items: center;
  justify-content: center;
}

html.quiz-inline-active.quiz-results-active,
body.quiz-inline-active.quiz-results-active {
  height: auto;
  min-height: 100%;
  overflow-y: auto !important;
}

body.quiz-inline-active.quiz-results-active .home-main {
  min-height: 100svh;
  height: auto;
  padding: 48px 20px;
  overflow: visible;
}

body.quiz-inline-active.quiz-results-active #course-view,
body.quiz-inline-active.quiz-results-active #quiz-view.active {
  height: auto;
  min-height: 0;
  overflow: visible;
}

body.quiz-inline-active.quiz-results-active #quiz-view.active {
  min-height: calc(100svh - 96px);
}

.quiz-container {
  max-width: 860px;
  width: min(860px, calc(100vw - 48px));
  margin: 0 auto;
  background-color: var(--quiz-background);
  border: 1px solid var(--quiz-border);
  border-radius: 28px;
  box-shadow: var(--quiz-shadow);
  padding: 28px;
  color: var(--quiz-text);
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.5s ease-out;
}

.quiz-container.results-mode {
  max-width: 660px;
  width: min(660px, calc(100vw - 48px));
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quiz Header */
#quiz-title {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--quiz-text);
  font-weight: 700;
  position: relative;
}

/* Remove the color spectrum (::after pseudo-element) */
#quiz-title::after {
  display: none;
}

/* Progress Bar */
.quiz-progress {
  height: 8px;
  background-color: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  margin-bottom: 18px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: var(--quiz-secondary);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.quiz-progress.review-progress {
  height: 22px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  margin-bottom: 18px;
}

.review-progress-track {
  display: grid;
  grid-template-columns: repeat(var(--review-count), minmax(8px, 1fr));
  gap: 3px;
  width: 100%;
  height: 22px;
  align-items: center;
}

.review-progress-segment {
  min-width: 0;
  height: 10px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.review-progress-segment.correct {
  background: #00c968;
}

.review-progress-segment.incorrect {
  background: #ff1744;
}

.review-progress-segment:hover {
  filter: brightness(1.18);
}

.review-progress-segment.current {
  height: 20px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}

#quiz-content:not(.hidden) {
  background: #0b0b0b;
  border: 1px solid var(--quiz-border);
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  box-sizing: border-box;
}

#quiz-content.question-height-animating {
  overflow: hidden;
  transition: height 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: height;
}

/* Question Container */
.question-container {
  margin-bottom: 0;
  animation: slideIn 0.25s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.question-text {
  font-size: 1.26rem;
  margin: 0 0 24px;
  line-height: 1.5;
  font-weight: 700;
  color: #f5f5f5;
  text-align: center;
}

.question-kicker {
  margin-bottom: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.36);
  text-align: center;
}

/* Answer Options */
.answer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-option {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.3);
}

.answer-option::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--quiz-secondary);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.answer-option:hover {
  background: #202020;
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0e0e0e, 0 8px 18px rgba(0, 0, 0, 0.35);
}

.answer-option:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0e0e0e, 0 3px 8px rgba(0, 0, 0, 0.25);
}

.answer-option.selected {
  background-color: #242424;
  border-color: rgba(255, 255, 255, 0.16);
}

.answer-option.selected::before {
  opacity: 1;
}

.answer-option.correct {
  background-color: rgba(0, 230, 118, 0.12);
  border-color: rgba(0, 230, 118, 0.45);
}

.answer-option.correct::before {
  background: var(--quiz-success);
  opacity: 1;
}

.answer-option.incorrect {
  background-color: rgba(255, 23, 68, 0.12);
  border-color: rgba(255, 23, 68, 0.45);
}

.answer-option.incorrect::before {
  background: var(--quiz-error);
  opacity: 1;
}

.quiz-container.review-mode .answer-option,
.answer-option.review-option,
.answer-option.review-option label {
  cursor: default;
}

.answer-option.review-option input,
.answer-option.review-option label {
  pointer-events: none;
}

.quiz-container.review-mode .answer-option:hover {
  transform: none;
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.3);
}

.quiz-container.review-mode .answer-option:not(.correct):not(.incorrect):hover {
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
}

.quiz-container.review-mode .answer-option.correct:hover {
  background-color: rgba(0, 230, 118, 0.12);
  border-color: rgba(0, 230, 118, 0.45);
}

.quiz-container.review-mode .answer-option.incorrect:hover {
  background-color: rgba(255, 23, 68, 0.12);
  border-color: rgba(255, 23, 68, 0.45);
}

.answer-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.answer-option label {
  display: flex;
  align-items: center;
  width: 100%;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.4;
  color: #f1f1f1;
  padding: 15px 18px;
  position: relative;
  z-index: 1;
}

.answer-option .option-marker {
  display: flex;
  flex: 0 0 auto;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #2a2a2a;
  margin-right: 14px;
  font-weight: bold;
  color: #ffffff;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.answer-option.selected .option-marker {
  background-color: var(--quiz-secondary);
}

.answer-option.correct .option-marker {
  background-color: var(--quiz-success);
}

.answer-option.incorrect .option-marker {
  background-color: var(--quiz-error);
}

.interactive-question .question-text {
  margin-bottom: 18px;
}

.challenge-board {
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.challenge-prompt {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.92rem;
  line-height: 1.45;
}

.build-nuclide-board {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(260px, 1.25fr);
  gap: 16px;
  align-items: stretch;
}

.nuclide-stage {
  min-height: 166px;
  border-radius: 14px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 42px auto;
  grid-template-rows: 1fr 1fr auto;
  align-items: center;
  justify-content: center;
  column-gap: 8px;
  padding: 18px;
}

.nuclide-mass,
.nuclide-charge {
  justify-self: end;
  font-weight: 900;
  color: #ffffff;
}

.nuclide-mass {
  align-self: end;
  font-size: 1.2rem;
}

.nuclide-charge {
  align-self: start;
  font-size: 1rem;
}

.nuclide-symbol {
  grid-row: 1 / 3;
  grid-column: 2;
  font-size: 4rem;
  line-height: 1;
  font-weight: 900;
}

.nuclide-neutrons {
  grid-column: 1 / 3;
  justify-self: center;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
}

.build-fields {
  display: grid;
  gap: 10px;
}

.build-field {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.build-field.correct {
  border-color: rgba(0, 230, 118, 0.45);
  background: rgba(0, 230, 118, 0.09);
}

.build-field.incorrect {
  border-color: rgba(255, 23, 68, 0.45);
  background: rgba(255, 23, 68, 0.09);
}

.build-field-label {
  font-weight: 800;
  color: #f1f1f1;
}

.build-stepper {
  display: grid;
  grid-template-columns: 38px 70px 38px;
  gap: 8px;
  align-items: center;
}

.build-step,
.sequence-move,
.classify-choice,
.error-claim,
.concept-slot,
.concept-chip {
  border: 0;
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.build-step {
  height: 36px;
  border-radius: 10px;
  background: #2a2a2a;
  box-shadow: 0 4px 0 #151515, 0 6px 12px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.build-step:hover:not(:disabled),
.sequence-move:hover:not(:disabled),
.classify-choice:hover,
.error-claim:hover,
.concept-chip:hover {
  background: #303030;
}

.build-step:active:not(:disabled),
.sequence-move:active:not(:disabled),
.classify-choice:active,
.error-claim:active,
.concept-chip:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #151515, 0 3px 8px rgba(0, 0, 0, 0.22);
}

.build-stepper input {
  width: 70px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #080808;
  color: #ffffff;
  text-align: center;
  font-weight: 900;
  box-sizing: border-box;
  padding: 0 8px;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.build-stepper input::-webkit-outer-spin-button,
.build-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.build-stepper input:focus {
  border-color: rgba(255, 255, 255, 0.28);
  background: #0d0d0d;
}

.classify-board,
.error-claims {
  display: grid;
  gap: 12px;
}

.classify-card {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.classify-card-text {
  color: #f3f3f3;
  font-weight: 750;
  line-height: 1.45;
  margin-bottom: 12px;
}

.classify-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.classify-choice {
  min-height: 38px;
  border-radius: 11px;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 12px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  position: relative;
  overflow: hidden;
  padding-left: 14px;
}

.classify-choice::before,
.error-claim::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background-color: var(--quiz-secondary);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.classify-choice.selected,
.error-claim.selected {
  background: #242424;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 12px rgba(0, 0, 0, 0.24);
}

.classify-choice.selected {
  color: var(--quiz-secondary);
}

.classify-choice.selected::before,
.error-claim.selected::before {
  opacity: 1;
}

.error-claim.selected .claim-label {
  color: var(--quiz-secondary);
}

.classify-choice.correct-choice,
.error-claim.correct-choice {
  background: rgba(0, 230, 118, 0.14);
  border: 1px solid rgba(0, 230, 118, 0.45);
}

.classify-choice.incorrect-choice,
.error-claim.incorrect-choice {
  background: rgba(255, 23, 68, 0.14);
  border: 1px solid rgba(255, 23, 68, 0.45);
}

.sequence-board {
  display: grid;
  gap: 10px;
}

.sequence-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  position: relative;
  will-change: transform;
}

.sequence-card.correct {
  border-color: rgba(0, 230, 118, 0.45);
}

.sequence-card.incorrect {
  border-color: rgba(255, 23, 68, 0.45);
}

.sequence-index {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #2a2a2a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.sequence-text {
  color: #f3f3f3;
  font-weight: 750;
  line-height: 1.4;
}

.sequence-controls {
  display: flex;
  gap: 8px;
}

.sequence-move {
  min-width: 58px;
  height: 34px;
  border-radius: 10px;
  background: #2a2a2a;
  box-shadow: 0 4px 0 #151515, 0 6px 12px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.sequence-move:disabled,
.build-step:disabled {
  opacity: 0.4;
  cursor: default;
}

.error-scenario {
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  line-height: 1.5;
  padding: 14px;
  margin-bottom: 12px;
}

.error-claim {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  text-align: left;
  align-items: center;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 12px rgba(0, 0, 0, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
  position: relative;
  overflow: hidden;
}

.claim-label {
  color: rgba(255, 255, 255, 0.46);
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  min-width: max-content;
}

.claim-text {
  color: #f3f3f3;
  line-height: 1.45;
}

.concept-build-board {
  display: grid;
  gap: 14px;
}

.concept-build-board.flash-wrong .concept-statement {
  border-color: #ff3c3c;
  box-shadow: 0 0 12px rgba(255, 60, 60, 0.15);
}

.concept-build-board.flash-correct .concept-statement {
  border-color: #00c853;
  box-shadow: 0 0 12px rgba(0, 200, 83, 0.15);
}

.concept-statement {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 72px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px 14px;
  color: #e8e8e8;
  font-size: 1.02rem;
  font-weight: 760;
  line-height: 1.45;
}

.concept-text {
  display: inline-flex;
  align-items: center;
}

.concept-slot {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(255, 255, 255, 0.25);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  padding: 0 8px;
  box-sizing: border-box;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
}

.concept-slot.no-transition {
  transition: none !important;
}

.concept-slot:focus,
.concept-slot:focus-visible {
  outline: none;
}

.concept-slot:not(.selected):not(.filled):not(.correct):not(.wrong):hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
}

.concept-slot.selected {
  border: 2px solid #ffd700;
  background: rgba(255, 215, 0, 0.08);
  color: rgba(255, 215, 0, 0.6);
}

.concept-slot.selected:hover,
.concept-slot.selected:focus,
.concept-slot.selected:focus-visible {
  border: 2px solid #ffd700;
  background: rgba(255, 215, 0, 0.08);
  color: rgba(255, 215, 0, 0.6);
}

.concept-slot.filled {
  border: 2px solid #0088ff;
  background: rgba(0, 136, 255, 0.12);
  color: #ffffff;
}

.concept-slot.filled.just-filled {
  animation: conceptChipPop 0.2s ease;
}

.concept-slot.correct {
  border-color: #00c853 !important;
  background: rgba(0, 200, 83, 0.12) !important;
  color: #00c853 !important;
}

.concept-slot.wrong {
  border-color: #ff3c3c !important;
  background: rgba(255, 60, 60, 0.12) !important;
  color: #ff3c3c !important;
  animation: conceptSlotShake 0.4s ease;
}

.concept-chip-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}

.concept-chip {
  min-height: 42px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 14px 6px;
  box-shadow: 0 3px 0 #0e0e0e, 0 4px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, background-color 0.14s ease;
}

.concept-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

.concept-chip:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #0e0e0e, 0 2px 6px rgba(0, 0, 0, 0.2);
}

.concept-chip-label {
  font-size: 0.9rem;
  font-weight: 900;
}

.concept-chip-hint {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quiz-container.review-mode .concept-slot,
.quiz-container.review-mode .concept-chip {
  cursor: default;
}

@keyframes conceptSlotShake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
}

@keyframes conceptChipPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.explanation {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--quiz-panel-soft);
  border: 1px solid var(--quiz-border);
  border-left: 3px solid var(--quiz-secondary);
  border-radius: 12px;
  color: #e8e8e8;
  line-height: 1.5;
}

.explanation p {
  margin: 0;
}

/* Quiz Controls */
.quiz-controls {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

.quiz-button {
  background: #1194f6;
  color: white !important;
  border: none;
  border-radius: 14px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #0567b4, 0 6px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 120px;
  text-align: center;
}

.quiz-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.quiz-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0567b4, 0 8px 18px rgba(0, 0, 0, 0.35);
}

.quiz-button:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0567b4, 0 3px 8px rgba(0, 0, 0, 0.25);
}

.quiz-button.primary {
  background: #1194f6;
  color: white !important;
}

.quiz-button.secondary {
  background: #2a2a2a;
  color: white !important;
  border: none;
  box-shadow: 0 4px 0 #171717, 0 6px 14px rgba(0, 0, 0, 0.3);
}

.quiz-button.secondary:hover:not(:disabled) {
  background: #303030;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #171717, 0 8px 18px rgba(0, 0, 0, 0.35);
}

.quiz-button.secondary:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #171717, 0 3px 8px rgba(0, 0, 0, 0.25);
}

/* Quiz Results */
#quiz-results {
  text-align: center;
  min-height: 650px;
  animation: fadeIn 0.5s ease-out; /* Restore animation */
}

.results-header {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--quiz-text);
  opacity: 0; /* Start hidden, JS will control appearance */
  transition: opacity 0.5s ease-out; /* Add transition to prevent flickering */
}

.score-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem 0 1rem;
  position: relative;
  opacity: 0; /* Start hidden, JS will control appearance */
  transition: opacity 0.5s ease-out; /* Add transition to prevent flickering */
}

.score-circle {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.5s ease-out;
  overflow: visible;
  z-index: 2;
}

/* Remove all ::before pseudo-element styling */
.score-circle::before {
  content: none;
  display: none;
}

.score-circle.animate::before {
  content: none;
  display: none;
}

/* SVG styling for the progress circle */
.score-circle svg {
  position: absolute;
  top: -8px;
  left: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  transform: rotate(-90deg);
  z-index: 1;
  filter: drop-shadow(0 0 3px rgba(255, 136, 0, 0.3));
}

.score-circle circle {
  fill: transparent;
  stroke: var(--quiz-secondary);
  stroke-width: 8px;
  transition: stroke-dasharray 0.1s linear;
  stroke-linecap: round;
}

.score-value {
  font-size: 3rem;
  font-weight: bold;
  color: var(--quiz-text);
  z-index: 2;
  transition: color 0.3s ease;
}

.score-label {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
}

.feedback-container {
  min-height: 355px;
  margin: 1.25rem 0 0;
  padding: 0;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: visible;
  opacity: 0; /* Start hidden, JS will control appearance */
  transition: opacity 0.5s ease-out; /* Smooth transition without animation delay */
}

/* Remove the colored gradient background */
.feedback-container::before {
  display: none;
}

.feedback-message {
  font-size: 1.3rem;
  min-height: 1.7em;
  margin: 0 0 1.25rem;
  text-align: center;
  font-weight: 600;
  color: #ffffff;
  text-shadow: none;
  opacity: 0; /* Start hidden, JS will control appearance */
  transition: opacity 0.5s ease-out; /* Smooth transition without animation delay */
}

/* Mission-style feedback grid */
.feedback-grid-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  opacity: 0; /* Start hidden, JS will control appearance */
  transition: opacity 0.5s ease-out; /* Smooth transition without animation delay */
}

.feedback-grid {
  display: grid;
  grid-template-columns: repeat(5, 100px); /* Fixed 5 columns */
  gap: 12px;
  margin-top: 0;
  max-width: 540px; /* Limit width to 5 columns + gaps */
  justify-content: center;
}

/* Remove scrollbar styling for the feedback grid since we don't need it anymore */
.feedback-grid::-webkit-scrollbar,
.feedback-grid::-webkit-scrollbar-track,
.feedback-grid::-webkit-scrollbar-thumb,
.feedback-grid::-webkit-scrollbar-thumb:hover {
  display: none;
}

.mission-item {
  position: relative;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1.2rem 0.8rem;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.mission-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--quiz-neutral);
  opacity: 0.7;
}

.mission-item.correct::before {
  background-color: var(--quiz-success);
}

.mission-item.incorrect::before {
  background-color: var(--quiz-error);
}

.mission-number {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.4rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mission-status {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mission-item.correct .mission-status {
  color: #4caf50;
}

.mission-item.incorrect .mission-status {
  color: #f44336;
}

/* Remove the mission-icon styles */
.mission-icon {
  display: none;
}

.mission-item.correct .mission-icon {
  display: none;
}

.mission-item.incorrect .mission-icon {
  display: none;
}

.mission-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.mission-item.correct:hover {
  background-color: rgba(76, 175, 80, 0.2);
}

.mission-item.incorrect:hover {
  background-color: rgba(244, 67, 54, 0.2);
}

.shape-detective-board,
.radius-builder-board,
.diffuse-edge-board,
.radius-sort-board,
.binding-router-board {
  display: grid;
  gap: 14px;
  width: min(100%, 850px);
  box-sizing: border-box;
  margin-inline: auto;
  padding: 18px;
}

.shape-evidence-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.shape-evidence-card,
.diffuse-info-card,
.diffuse-value-card {
  border-radius: 14px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 13px;
}

.shape-evidence-card strong,
.diffuse-value-card strong {
  display: block;
  color: #ffffff;
  font-size: 1.08rem;
  line-height: 1.1;
}

.shape-evidence-card span,
.diffuse-value-card span,
.diffuse-info-card {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.35;
}

.shape-detective-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(360px, 1.4fr);
  gap: 12px;
  min-width: 0;
}

.shape-visual-panel {
  display: grid;
  gap: 10px;
  min-height: 330px;
  border-radius: 16px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 13px;
  min-width: 0;
  box-sizing: border-box;
}

.shape-visual-box {
  position: relative;
  min-height: 210px;
  border-radius: 14px;
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.shape-crosshair::before,
.shape-crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  left: 20%;
  right: 20%;
  top: 50%;
  height: 1px;
}

.shape-crosshair::after {
  left: 50%;
  right: auto;
  top: 20%;
  bottom: 20%;
  width: 1px;
  height: auto;
}

.shape-nucleus {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: linear-gradient(135deg, #43b4ff 0%, #1f96ed 58%, #1269b3 100%);
  box-shadow: inset -13px -14px 0 rgba(0, 0, 0, 0.18), 0 14px 24px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%) scaleX(var(--shape-scale-x, 1)) scaleY(var(--shape-scale-y, 1));
  transform-origin: center center;
  transition: transform 0.22s ease;
  z-index: 1;
}

.shape-beta-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 900;
}

.shape-beta-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #242424;
}

.shape-beta-track span {
  position: absolute;
  top: 50%;
  width: 58px;
  height: 8px;
  border-radius: inherit;
  background: var(--quiz-secondary);
  transform: translate(-50%, -50%);
  transition: left 0.22s ease;
}

.shape-verdict-pill {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #181818;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 900;
}

.shape-station-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.shape-station {
  border-radius: 14px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  min-width: 0;
  box-sizing: border-box;
}

.shape-station-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shape-station-head strong {
  color: var(--quiz-secondary);
  letter-spacing: 0;
  text-transform: none;
}

.shape-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.shape-choice,
.radius-slot,
.radius-token,
.radius-sort-token,
.radius-sort-bay,
.binding-role-pill,
.binding-result-choice {
  border: 0;
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.shape-choice,
.radius-token,
.radius-sort-token {
  position: relative;
  overflow: hidden;
  min-height: 58px;
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.28);
  padding: 10px 12px;
  text-align: left;
  min-width: 0;
  box-sizing: border-box;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.shape-choice:hover,
.radius-token:hover:not(:disabled),
.radius-sort-token:hover {
  background: #202020;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0e0e0e, 0 8px 18px rgba(0, 0, 0, 0.35);
}

.shape-choice::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--quiz-secondary);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.shape-choice:hover {
  background: #202020;
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0e0e0e, 0 8px 18px rgba(0, 0, 0, 0.35);
}

.shape-choice:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0e0e0e, 0 3px 8px rgba(0, 0, 0, 0.25);
}

.shape-choice.selected,
.radius-token.selected,
.radius-sort-token.selected {
  background: #242424;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--quiz-secondary);
}

.shape-choice.selected::before {
  opacity: 1;
}

.shape-choice.selected {
  background-color: #242424;
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.shape-choice.correct-choice,
.radius-slot.correct,
.radius-sort-token.correct-choice,
.radius-sort-bay.correct {
  background: rgba(0, 230, 118, 0.12);
  border-color: rgba(0, 230, 118, 0.46);
  color: var(--quiz-success);
}

.shape-choice.incorrect-choice,
.radius-slot.incorrect,
.radius-sort-token.incorrect-choice,
.radius-sort-bay.incorrect {
  background: rgba(255, 23, 68, 0.12);
  border-color: rgba(255, 23, 68, 0.46);
  color: var(--quiz-error);
}

.shape-choice span,
.shape-choice small {
  display: block;
}

.shape-choice small,
.radius-token small,
.radius-sort-token span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.76rem;
  line-height: 1.15;
}

.radius-brief {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 14px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
}

.radius-brief strong {
  border-radius: 10px;
  background: #1c1c1c;
  color: var(--quiz-secondary);
  padding: 10px 14px;
  font-size: 1rem;
  white-space: nowrap;
}

.radius-brief span {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 800;
}

.radius-track,
.radius-token-pool {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.radius-slot {
  min-height: 180px;
  display: grid;
  gap: 8px;
  justify-items: center;
  align-content: center;
  border-radius: 14px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.28);
  text-align: center;
  min-width: 0;
  box-sizing: border-box;
}

.radius-slot.filled {
  background: #141414;
  border-color: rgba(255, 255, 255, 0.1);
}

.radius-slot.selected {
  background: #181818;
  border-color: rgba(255, 255, 255, 0.18);
}

.radius-slot.just-filled .radius-orbit::before,
.radius-sort-token.just-placed {
  animation: conceptChipPop 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.radius-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #050505;
}

.radius-orbit::before,
.radius-token-dot {
  content: '';
  width: var(--radius-orbit-size, 42px);
  height: var(--radius-orbit-size, 42px);
  border-radius: 50%;
  background: linear-gradient(135deg, #43b4ff 0%, #1f96ed 70%);
  box-shadow: inset -8px -8px 0 rgba(0, 0, 0, 0.18);
}

.radius-orbit span {
  position: absolute;
  color: rgba(255, 255, 255, 0.72);
}

.radius-token {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
}

.radius-token-dot {
  grid-row: 1 / 3;
  width: var(--radius-token-size, 34px);
  height: var(--radius-token-size, 34px);
  display: block;
}

.radius-token.used {
  opacity: 1;
  cursor: default;
}

.radius-builder-board .radius-slot,
.radius-builder-board .radius-token {
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.radius-builder-board .radius-slot::before,
.radius-builder-board .radius-token::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--quiz-secondary);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.radius-builder-board .radius-slot:hover,
.radius-builder-board .radius-token:hover:not(:disabled) {
  background: #202020;
  border-color: rgba(255, 255, 255, 0.14);
  transform: none;
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.3);
}

.radius-builder-board .radius-slot:active,
.radius-builder-board .radius-token:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0e0e0e, 0 3px 8px rgba(0, 0, 0, 0.25);
}

.radius-builder-board .radius-slot.filled,
.radius-builder-board .radius-slot.selected,
.radius-builder-board .radius-token.selected {
  background: #242424;
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.radius-builder-board .radius-slot.selected::before,
.radius-builder-board .radius-token.selected::before {
  opacity: 1;
}

.radius-builder-board .radius-token.used,
.radius-builder-board .radius-token.used:hover {
  background: #111111;
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.24);
  transform: none;
  transition: none;
}

.radius-builder-board .radius-token.used::before {
  opacity: 0;
}

.radius-builder-board .radius-token.used .radius-token-dot {
  opacity: 0.34;
}

.radius-builder-board .radius-token.used strong,
.radius-builder-board .radius-token.used small {
  color: rgba(255, 255, 255, 0.32);
}

.radius-builder-board .radius-token.selected strong,
.radius-builder-board .radius-token.selected small {
  color: inherit;
}

.radius-builder-board .radius-slot.just-filled .radius-orbit::before {
  animation: radiusNucleusIn 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.radius-builder-board .radius-slot.just-reset .radius-orbit {
  animation: radiusNucleusReset 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes radiusNucleusIn {
  0% {
    opacity: 0.45;
    transform: scale(0.72);
  }
  70% {
    opacity: 1;
    transform: scale(1.12);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes radiusNucleusReset {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.86);
  }
  100% {
    transform: scale(1);
  }
}

.diffuse-edge-layout {
  display: grid;
  grid-template-columns: minmax(430px, 1.35fr) minmax(260px, 0.75fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
  border-radius: 16px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  box-sizing: border-box;
}

.diffuse-edge-board {
  background: #080808;
}

.diffuse-plot-panel,
.diffuse-control-panel {
  min-width: 0;
  box-sizing: border-box;
  border-radius: 16px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.diffuse-plot-panel {
  display: grid;
  place-items: center;
  background: #050505;
}

.diffuse-edge-svg {
  width: min(100%, 560px);
  aspect-ratio: 500 / 340;
  display: block;
}

.diffuse-density-band {
  fill: rgba(255, 136, 0, 0.14);
  stroke: rgba(255, 136, 0, 0.22);
}

.diffuse-density-area {
  fill: rgba(255, 136, 0, 0.08);
}

.diffuse-density-line {
  fill: none;
  stroke: var(--quiz-secondary);
  stroke-width: 5;
  stroke-linecap: round;
}

.diffuse-correct-line {
  fill: none;
  stroke: var(--quiz-success);
  stroke-width: 8;
  stroke-linecap: round;
}

.diffuse-radius-line {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2;
  stroke-dasharray: 5 7;
}

.diffuse-axis-label {
  fill: rgba(255, 255, 255, 0.74);
  font-size: 20px;
  font-weight: 950;
}

.diffuse-control-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  background: #080808;
}

.diffuse-control-panel .diffuse-info-card,
.diffuse-control-panel .diffuse-value-card {
  background: #050505;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.diffuse-value-card > span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.diffuse-value-card strong {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  font-size: 1.5rem;
  color: #ffffff;
  line-height: 1.05;
}

.diffuse-value-card strong span {
  display: inline;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.diffuse-slider-wrap {
  display: grid;
  gap: 12px;
}

.diffuse-slider-labels {
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 900;
  font-size: 0.9rem;
}

.diffuse-slider {
  width: 100%;
  height: 26px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.diffuse-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.diffuse-slider::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border: 0;
  border-radius: 8px;
  background: var(--quiz-secondary);
  box-shadow: 0 4px 0 #9c4d00, 0 6px 12px rgba(0, 0, 0, 0.32);
  appearance: none;
  -webkit-appearance: none;
}

.diffuse-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.diffuse-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 8px;
  background: var(--quiz-secondary);
  box-shadow: 0 4px 0 #9c4d00, 0 6px 12px rgba(0, 0, 0, 0.32);
}

.radius-sort-board {
  width: min(100%, 810px);
  box-sizing: border-box;
}

.radius-sort-layout {
  display: grid;
  gap: 16px;
  width: min(100%, 760px);
  box-sizing: border-box;
  margin-inline: auto;
}

.radius-sort-pool,
.radius-sort-bay {
  min-width: 0;
  box-sizing: border-box;
  border-radius: 16px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.radius-sort-panel-label {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.radius-sort-token-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(58px, auto);
  gap: 9px;
  min-height: 64px;
  align-content: start;
  align-items: start;
}

.radius-sort-token-stack > .radius-sort-empty {
  grid-column: 1 / -1;
  height: 64px;
}

.radius-sort-bays {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.radius-sort-bay {
  min-height: 0;
  background: #0b0b0b;
  transition: background-color 0.16s ease, border-color 0.16s ease;
  display: flex;
  flex-direction: column;
}

.radius-sort-bay:hover {
  background: #101010;
}

.radius-sort-bay-head {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  text-align: center;
}

.radius-sort-bay-title {
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 950;
}

.radius-sort-bay-detail {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 850;
}

.radius-sort-dropzone {
  min-height: 132px;
  flex: 1 1 auto;
  display: grid;
  grid-auto-rows: minmax(58px, auto);
  gap: 10px;
  align-content: start;
  border-radius: 12px;
  background: #101010;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px;
  box-sizing: border-box;
}

.radius-sort-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-self: stretch;
  justify-self: stretch;
  color: rgba(255, 255, 255, 0.34);
  font-weight: 900;
  text-align: center;
}

.radius-sort-token {
  display: grid;
  gap: 2px;
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.radius-sort-token:hover {
  background: #202020;
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0e0e0e, 0 8px 18px rgba(0, 0, 0, 0.35);
}

.radius-sort-token:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0e0e0e, 0 3px 8px rgba(0, 0, 0, 0.25);
}

.radius-sort-token::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 999px 999px 0;
  background: var(--quiz-secondary);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.radius-sort-token.selected::before {
  opacity: 1;
}

.radius-sort-token.selected {
  background-color: #242424;
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.radius-sort-token.is-moving {
  pointer-events: none;
  z-index: 5;
}

.radius-sort-token strong {
  color: inherit;
}

.binding-router-rolebar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.binding-role-pill {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  border-radius: 14px;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.24);
  padding: 10px 14px;
  text-align: left;
  min-width: 0;
  box-sizing: border-box;
}

.binding-role-pill span,
.binding-ledger-card span,
.binding-result-panel > span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.binding-role-pill strong {
  justify-self: end;
  font-size: 0.95rem;
}

.binding-role-pill.active {
  background: #242424;
  border-color: rgba(255, 136, 0, 0.58);
}

.binding-role-pill.active strong,
.binding-result-choice.selected {
  color: var(--quiz-secondary);
}

.binding-role-pill.correct-choice,
.binding-result-choice.correct-choice {
  border-color: rgba(0, 230, 118, 0.48);
  background: rgba(0, 230, 118, 0.12);
  color: var(--quiz-success);
}

.binding-role-pill.incorrect-choice,
.binding-result-choice.incorrect-choice {
  border-color: rgba(255, 23, 68, 0.48);
  background: rgba(255, 23, 68, 0.12);
  color: var(--quiz-error);
}

.binding-router-stage {
  position: relative;
  min-height: 340px;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 18px;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.binding-router-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.binding-router-axis {
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2;
}

.binding-router-curve-shadow {
  fill: none;
  stroke: rgba(255, 136, 0, 0.16);
  stroke-width: 22;
  stroke-linecap: round;
}

.binding-router-curve {
  fill: none;
  stroke: var(--quiz-secondary);
  stroke-width: 7;
  stroke-linecap: round;
}

.binding-router-route,
.binding-correct-route {
  fill: none;
  stroke: #ffffff;
  stroke-width: 5;
  stroke-linecap: round;
  pointer-events: none;
}

.binding-router-board.correct .binding-router-route,
.binding-correct-route {
  stroke: var(--quiz-success);
}

.binding-router-board.incorrect .binding-router-route {
  stroke: var(--quiz-error);
}

.binding-router-axis-label {
  fill: rgba(255, 255, 255, 0.66);
  font-size: 17px;
  font-weight: 950;
}

.binding-router-y-label {
  text-anchor: end;
}

.binding-router-x-label {
  text-anchor: middle;
}

.binding-region-node {
  cursor: pointer;
  outline: none;
}

.binding-region-hit {
  fill: transparent;
}

.binding-region-dot {
  fill: #1d1d1d;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 3;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 0.16s ease, stroke 0.16s ease, transform 0.16s ease;
}

.binding-region-label {
  fill: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  font-weight: 950;
  paint-order: stroke;
  pointer-events: none;
  stroke: #080808;
  stroke-linejoin: round;
  stroke-width: 5px;
}

.binding-region-node:hover .binding-region-dot,
.binding-region-node:focus-visible .binding-region-dot {
  fill: #242424;
  stroke: rgba(255, 136, 0, 0.78);
  transform: scale(1.18);
}

.binding-region-node.is-start .binding-region-dot,
.binding-region-node.is-end .binding-region-dot {
  fill: var(--quiz-secondary);
  stroke: #ffffff;
}

.binding-region-node.is-start .binding-region-label,
.binding-region-node.is-end .binding-region-label {
  fill: var(--quiz-secondary);
}

.binding-region-node.correct-choice .binding-region-dot {
  fill: var(--quiz-success);
  stroke: rgba(255, 255, 255, 0.9);
}

.binding-region-node.incorrect-choice .binding-region-dot {
  fill: var(--quiz-error);
  stroke: rgba(255, 255, 255, 0.9);
}

.binding-region-node.correct-choice .binding-region-label {
  fill: var(--quiz-success);
}

.binding-region-node.incorrect-choice .binding-region-label {
  fill: var(--quiz-error);
}

.binding-router-ledger {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.25fr);
  gap: 10px;
  min-width: 0;
}

.binding-ledger-card,
.binding-result-panel {
  min-width: 0;
  box-sizing: border-box;
  border-radius: 14px;
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.binding-ledger-card {
  display: grid;
  gap: 5px;
}

.binding-ledger-card strong {
  color: #ffffff;
  font-size: 1.3rem;
}

.binding-delta-card.positive strong {
  color: var(--quiz-success);
}

.binding-delta-card.negative strong {
  color: var(--quiz-error);
}

.binding-result-panel {
  display: grid;
  gap: 8px;
}

.binding-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.binding-result-choice {
  min-height: 42px;
  border-radius: 12px;
  background: #242424;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 0 #0e0e0e, 0 6px 14px rgba(0, 0, 0, 0.26);
}

.quiz-container.review-mode .shape-choice,
.quiz-container.review-mode .radius-slot,
.quiz-container.review-mode .radius-token,
.quiz-container.review-mode .radius-sort-token,
.quiz-container.review-mode .radius-sort-bay,
.quiz-container.review-mode .binding-role-pill,
.quiz-container.review-mode .binding-region-node,
.quiz-container.review-mode .binding-result-choice {
  cursor: default;
}

.quiz-container.review-mode .binding-region-node {
  pointer-events: none;
}

/* Animation for mission items */
@keyframes missionAppear {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(20px);
  }
  60% {
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mission-item {
  animation: missionAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(var(--item-index) * 0.1s);
  opacity: 0;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .feedback-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
  }
  
  .mission-number {
    font-size: 1.5rem;
  }
  
  .mission-status {
    font-size: 0.8rem;
  }
}

/* Animations */
.fade-enter {
  opacity: 0;
}

.fade-enter-active {
  opacity: 1;
  transition: opacity 0.5s;
}

.fade-exit {
  opacity: 1;
}

.fade-exit-active {
  opacity: 0;
  transition: opacity 0.5s;
}

/* Confetti Animation for Success */
.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: #f0f;
  opacity: 0;
}

@keyframes confetti-fall {
  0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
  .quiz-container {
    margin: 0 auto;
    padding: 1.5rem;
    border-radius: 22px;
  }

  #quiz-content:not(.hidden) {
    padding: 18px;
    border-radius: 16px;
  }

  .build-nuclide-board {
    grid-template-columns: 1fr;
  }

  .shape-evidence-strip,
  .shape-detective-layout,
  .diffuse-edge-layout,
  .radius-sort-bays,
  .binding-router-rolebar,
  .binding-router-ledger,
  .binding-result-grid {
    grid-template-columns: 1fr;
  }

  .shape-choice-grid,
  .radius-brief,
  .radius-track,
  .radius-token-pool,
  .radius-sort-token-stack {
    grid-template-columns: 1fr;
  }

  .binding-router-stage {
    min-height: 420px;
  }

  .sequence-card {
    grid-template-columns: 34px 1fr;
  }

  .sequence-controls {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .error-claim {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .concept-statement {
    justify-content: flex-start;
    font-size: 0.96rem;
  }
  
  #quiz-title {
    font-size: 1.8rem;
  }
  
  .question-text {
    font-size: 1.2rem;
  }
  
  .quiz-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .quiz-button {
    width: 100%;
  }
  
  .score-circle {
    width: 120px;
    height: 120px;
  }
  
  .score-value {
    font-size: 2.5rem;
  }
}

/* For KaTeX Support */
.katex {
  font-size: 1.1em !important;
}

/* Hidden Class */
.hidden {
  display: none !important;
}

.mission-item::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 10px;
  background: transparent;
  z-index: -1;
  transition: box-shadow 0.3s ease;
}

.mission-item:hover::after {
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.mission-item.incorrect:hover::after {
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
}

.mission-item.correct {
  background-color: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.mission-item.incorrect {
  background-color: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.3);
}

#quiz-results .quiz-controls {
  display: flex;
  justify-content: space-between;
  max-width: 540px;
  margin: 1.5rem auto 0;
  opacity: 0; /* Start hidden, JS will control appearance */
  transition: opacity 0.5s ease-out;
}

/* Cartoonish star burst animation for high scores - with more vibrant colors */
@keyframes starBurst {
  0% {
    box-shadow: 0 0 0 0 var(--k-orange), 0 0 0 0 var(--k-green), 0 0 0 0 var(--k-blue), 0 0 0 0 var(--k-pink);
    transform: scale(1);
  }
  25% {
    box-shadow: 0 0 0 15px var(--k-orange), 0 0 0 25px var(--k-green), 0 0 0 35px var(--k-blue), 0 0 0 45px var(--k-pink);
    transform: scale(1.1);
  }
  50% {
    box-shadow: 0 0 0 20px var(--k-orange), 0 0 0 30px var(--k-green), 0 0 0 40px var(--k-blue), 0 0 0 50px var(--k-pink);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 25px transparent, 0 0 0 45px transparent, 0 0 0 65px transparent, 0 0 0 85px transparent;
    transform: scale(1);
  }
}

/* Replace celebration stars with exploding square flares */
.flare-square {
  position: absolute;
  width: 30px;
  height: 30px;
  opacity: 0;
  z-index: 1;
  animation: flareExplode 1.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
  transform-origin: center center;
}

@keyframes flareExplode {
  0% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(0) rotate(0deg);
  }
  15% {
    opacity: 1;
    transform: translate(calc(var(--sx) * 0.8), calc(var(--sy) * 0.8)) scale(0.6) rotate(20deg);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(1) rotate(180deg);
  }
}

/* Comic explosion particles for high scores - updated with vibrant colors and gravity */
.score-particle {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  animation: particleExplode 1.4s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
  z-index: 1;
  transform-origin: center center;
}

@keyframes particleExplode {
  0% {
    transform: translate(var(--sx), var(--sy)) scale(0);
    opacity: 0;
  }
  15% {
    transform: translate(calc(var(--sx) * 0.8), calc(var(--sy) * 0.8)) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(1);
    opacity: 0;
  }
}

/* Progress bar tip square particles */
.progress-particle-square {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 0; /* Square shape */
  opacity: 0;
  z-index: 5; /* Higher z-index to ensure visibility */
  animation: progressSquare 1s ease-out forwards;
  transform-origin: center center;
  pointer-events: none; /* Ensure particles don't interfere with interactions */
  will-change: transform, opacity; /* Improve animation performance */
}

.progress-particle-square.small {
  animation-name: progressSquareSmall;
  animation-duration: 0.8s;
}

@keyframes progressSquare {
  0% {
    transform: translate(0, 0) scale(0.2) rotate(0deg);
    opacity: 0;
  }
  15% {
    transform: translate(0, 0) scale(1.2) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--fx), var(--fy)) scale(0.8) rotate(90deg);
    opacity: 0;
  }
}

@keyframes progressSquareSmall {
  0% {
    transform: translate(0, 0) scale(0.2) rotate(0deg);
    opacity: 0;
  }
  20% {
    transform: translate(0, 0) scale(1) rotate(45deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--fx), var(--fy)) scale(0.6) rotate(90deg);
    opacity: 0;
  }
}

/* Score circle animation */
.score-circle.celebrate {
  animation: celebratePulse 1s ease-in-out, starBurst 2s ease-out;
}

/* Comic explosion animation - more energetic */
@keyframes celebratePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Score circle error shake animation for low scores */
.score-circle.error-shake {
  animation: shakeAnimation 0.5s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  perspective: 1000px;
}

/* Simple shake animation without flashing */
@keyframes shakeAnimation {
  10%, 90% {
    transform: translate3d(-2px, 0, 0);
  }
  
  20%, 80% {
    transform: translate3d(4px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-6px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(6px, 0, 0);
  }
}

/* XP and Level Styles */
.xp-bubble {
  background-color: #001372;
  color: white;
  padding: 10px 14px;
  border-radius: 20px;
  border: none; /* Remove the white border */
  font-weight: bold;
  z-index: 100;
  pointer-events: none;
  animation: xpBubblePopFromCircle 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform-origin: bottom center;
}

@keyframes xpBubblePopFromCircle {
  0% {
    transform: translateY(20px) scale(0.2);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.xp-bubble span {
  font-size: 16px;
  font-weight: bold;
}

.xp-orb {
  pointer-events: none;
  z-index: 100;
  background-color: #001372 !important;
  border: 1px solid white;
}

.level-progress-container {
  margin: 0 auto;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  width: 80%;
  max-width: 500px;
  position: relative;
  z-index: 5;
}

.level-progress-slot {
  min-height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 18px;
}

.level-progress-slot .level-progress-container {
  flex: 1 1 auto;
}

.level-header {
  color: white;
  font-weight: bold;
  margin-bottom: 10px;
}

.level-title {
  font-size: 18px;
}

.level-xp {
  font-size: 16px;
  opacity: 0.9;
}

.level-progress-bar-container {
  background-color: #0c0c0c;
  height: 25px; /* Taller bar */
  border-radius: 12.5px; /* Half the height for perfect rounded ends */
  overflow: hidden;
  border: 4px solid #1d1d1d; /* Same color as the fill */
  position: relative;
  box-sizing: border-box; /* Make sure border is counted in size calculation */
}

.level-progress-bar {
  background: #002aff; /* Single solid color */
  height: 100%;
  border-radius: 8.5px; /* Adjusted to match the container's inner radius */
  transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

/* Game-like level up message with slide-in from right and punch effect */
.level-up-message {
  background-color: #001372;
  color: white;
  border: 3px solid #fbbe00; /* Yellow border for contrast */
  padding: 25px 50px;
  border-radius: 15px;
  font-weight: bold;
  font-size: 28px;
  text-transform: uppercase;
  text-align: center;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1000;
  transform: translate(100vw, -50%); /* Start offscreen to the right */
  animation: levelUpSlideIn 0.4s forwards, 
             levelUpPunch 0.3s forwards 0.4s,
             levelUpSlideOut 0.6s forwards 2.5s;
}

@keyframes levelUpSlideIn {
  0% { transform: translate(100vw, -50%); }
  80% { transform: translate(-55%, -50%); }
  100% { transform: translate(-50%, -50%); }
}

@keyframes levelUpPunch {
  0% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -50%) scale(1.3); }
  50% { transform: translate(-50%, -50%) scale(0.9); }
  70% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes levelUpSlideOut {
  0% { transform: translate(-50%, -50%); }
  100% { transform: translate(-150vw, -50%); } /* Exit to the left */
}

.level-up-particle {
  position: fixed;
  width: 10px;
  height: 10px;
  background-color: #fbbe00; /* Use a solid color instead of random */
  border: 1px solid white;
  opacity: 1;
  z-index: 999;
  transform-origin: center;
  animation: levelUpParticleBounce 0.8s forwards;
}

.level-up-particle.square {
  border-radius: 0;
}

.level-up-particle.blue {
  background-color: #001372;
}

.level-up-particle.red {
  background-color: #e30050;
}

@keyframes levelUpParticleBounce {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(0.5) rotate(var(--r, 0deg));
    opacity: 0;
  }
} 
