/* fLcOnX Lab - Sci-Fi Laboratorio Teema */
:root {
  --bg-dark: #080d1a;
  --bg-card: rgba(16, 24, 44, 0.82);
  --bg-card-hover: rgba(24, 36, 66, 0.95);
  --border-glow: rgba(0, 240, 255, 0.3);
  --cyan: #00f0ff;
  --green: #10b981;
  --purple: #a855f7;
  --amber: #f59e0b;
  --red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #00f0ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(0, 240, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 13, 26, 0.7);
  backdrop-filter: blur(10px);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-badge {
  background: linear-gradient(135deg, #00f0ff, #a855f7);
  color: #080d1a;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 1px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
}

.brand-title span {
  color: var(--cyan);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lang-selector {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.btn-lang {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-lang:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-lang.active {
  background: var(--cyan);
  color: #080d1a;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.btn-lang.disabled,
.btn-lang:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(1);
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--cyan);
}

/* Container */
.main-content {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

/* Screen Transitions */
.view-screen {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.view-screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Setup Wizard & Multi-Step Stepper */
.wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13, 20, 36, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.6rem 0.8rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  gap: 0.5rem;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  min-width: 0;
  text-align: left;
}

.step-indicator:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.step-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.step-title {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
  color: inherit;
}

.step-badge {
  font-size: 0.72rem;
  color: var(--cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  opacity: 0.85;
}

.step-indicator.active {
  background: rgba(0, 240, 255, 0.1);
  color: #fff;
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
}

.step-indicator.active .step-num {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #080d1a;
  box-shadow: 0 0 10px var(--cyan);
}

.step-indicator.completed .step-num {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--green);
  color: var(--green);
}

.step-connector {
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
  border-radius: 2px;
}

/* Wizard Panes */
.wizard-panes-container {
  min-height: 380px;
  margin-bottom: 1.5rem;
}

.wizard-step-pane {
  display: none;
}

.wizard-step-pane.active {
  display: block;
  animation: stepFadeIn 0.25s ease-out forwards;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pane-instruction {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

/* Course Search & Scroll Container */
.pane-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.course-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 240px;
  max-width: 320px;
  width: 100%;
}

.course-search-input {
  width: 100%;
  background: rgba(16, 24, 44, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.55rem 2rem 0.55rem 0.85rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
}

.course-search-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  background: rgba(20, 32, 60, 0.95);
}

.btn-clear-search {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.2rem;
  line-height: 1;
}

.btn-clear-search:hover {
  color: #fff;
}

/* IB Level Selector (SL / HL) */
.ib-level-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(16, 24, 44, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.level-selector-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.5px;
}

.level-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.btn-level-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-level-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-level-pill.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 88, 12, 0.35));
  border-color: var(--amber);
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Question Level Badge */
.badge-level {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-level.hl {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border-color: rgba(168, 85, 247, 0.4);
}

.badge-level.perus {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.badge-level.syventava {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.5);
}


.courses-scroll-container {
  max-height: 58vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.3) rgba(255, 255, 255, 0.05);
}

.courses-scroll-container::-webkit-scrollbar {
  width: 6px;
}
.courses-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.courses-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}
.courses-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

.no-courses-found {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* Mission Briefing Card (Step 4) */
.mission-briefing-card {
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(16, 26, 48, 0.9), rgba(12, 38, 64, 0.7));
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.briefing-tag {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--cyan);
}

.briefing-track-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.briefing-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.briefing-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.briefing-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.briefing-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

/* Wizard Navigation Bar */
.wizard-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(13, 20, 36, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  margin-top: 1rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

.btn-wizard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn-wizard:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-wizard:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.btn-wizard-next {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(0, 168, 255, 0.35));
  border-color: rgba(0, 240, 255, 0.4);
  color: #fff;
}

.btn-wizard-next:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.35), rgba(0, 168, 255, 0.5));
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.wizard-step-counter {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.btn-launch-glow {
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.4);
  animation: pulseLaunch 2s infinite ease-in-out;
}

@keyframes pulseLaunch {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
  }
  50% {
    box-shadow: 0 0 35px rgba(0, 240, 255, 0.6);
  }
}

.wizard-section {
  margin-bottom: 2rem;
}

.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan);
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* Layout Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.curriculum-card {
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(16, 24, 44, 0.9), rgba(20, 32, 60, 0.65));
}

.curriculum-card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
}

.curriculum-card.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
  background: linear-gradient(135deg, rgba(16, 36, 68, 0.98), rgba(12, 48, 80, 0.85));
}

.curriculum-card[data-curriculum="ib"].selected {
  border-color: var(--amber);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(32, 28, 48, 0.98), rgba(58, 40, 16, 0.85));
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.selectable-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.selectable-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
}

.selectable-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  background: rgba(16, 24, 44, 0.95);
}

.selectable-card.yo-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(16, 24, 44, 0.9), rgba(45, 26, 10, 0.6));
}

.selectable-card.yo-card:hover {
  border-color: var(--amber);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

.selectable-card.yo-card.selected {
  border-color: var(--amber);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(24, 36, 66, 0.95), rgba(70, 40, 15, 0.7));
}

.selectable-card.ib-card {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(135deg, rgba(18, 24, 46, 0.9), rgba(42, 28, 15, 0.5));
}

.selectable-card.ib-card:hover {
  border-color: var(--amber);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
}

.selectable-card.ib-card.selected {
  border-color: var(--amber);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
  background: linear-gradient(135deg, rgba(28, 36, 66, 0.98), rgba(65, 42, 18, 0.75));
}

.badge-yo {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #080d1a;
  font-weight: 800;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

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

.subject-code {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Hero Choice Cards */
.heroes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.hero-card {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hero-avatar-box {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.hero-card:hover .hero-avatar-box,
.hero-card.selected .hero-avatar-box {
  transform: scale(1.06);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.hero-svg {
  width: 100%;
  height: 100%;
}

.hero-info {
  flex: 1;
}

.hero-header-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.hero-role-tag,
.hero-gender-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.hero-title {
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 0.35rem;
}

.hero-quote {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.3;
}

/* Start Button */
.launch-bar {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #00a8ff);
  color: #080d1a;
  border: none;
  border-radius: 10px;
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.55);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* =========================================
   GAME SCREEN
   ========================================= */

.game-hud {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  margin-bottom: 0.75rem;
}

.hud-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hud-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.hud-hero-details h4 {
  font-size: 0.9rem;
  font-weight: 700;
}

.hud-hero-details p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hud-streak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-streak.fire {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.2));
  border-color: var(--amber);
  color: #fef08a;
  animation: pulseFire 1.5s infinite;
}

@keyframes pulseFire {
  0%, 100% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.6); }
}

.hud-score {
  text-align: right;
}

.hud-score-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-score-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cyan);
}

/* =========================================
   TRACK VISUALIZATION (RATA)
   ========================================= */

.track-container {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
}

.track-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
}

.track-goal-title {
  color: var(--cyan);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.track-rail-wrapper {
  position: relative;
  padding: 1rem 0;
}

.track-rail-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 1;
}

.track-rail-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 3px;
  transform: translateY(-50%);
  z-index: 1;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px var(--cyan);
}

.track-nodes-row {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.track-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0d1526;
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s;
}

.track-node.completed {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.2);
  color: #fff;
}

.track-node.checkpoint {
  border-color: var(--amber);
  color: var(--amber);
}

.track-node.checkpoint.completed {
  background: rgba(245, 158, 11, 0.3);
}

.track-node.finish {
  border-color: var(--purple);
  color: var(--purple);
  font-size: 0.9rem;
}

.track-node.active-station {
  transform: scale(1.25);
  border-color: #fff;
  box-shadow: 0 0 14px var(--cyan);
  background: var(--cyan);
  color: #080d1a;
}

/* Avatar Sprite on Track */
.track-avatar-pin {
  position: absolute;
  top: -12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 16px var(--accent);
  transform: translateX(-50%);
  transition: left 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
  pointer-events: none;
  background: #080d1a;
}

/* =========================================
   QUESTION CARD
   ========================================= */

.question-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.question-meta-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-report-issue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-report-issue:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.25);
}

.report-flag-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.badge-course {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.formula-hint-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.formula-hint-chip.interactive {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.formula-hint-chip.interactive:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.25);
}

.formula-hint-chip.interactive.revealed {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.45);
  color: #a5f3fc;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.formula-hint-chip .hint-bulb {
  font-size: 0.88rem;
  line-height: 1;
}

.formula-hint-chip.interactive .hint-label {
  font-weight: 700;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  margin-bottom: 1.15rem;
}

/* Options Grid */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

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

.option-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: #f1f5f9;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.option-btn.selected {
  background: rgba(0, 229, 255, 0.22) !important;
  border-color: var(--cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35);
  transform: translateY(-1px);
}

.option-btn.selected .option-letter {
  background: var(--cyan);
  color: #050b14;
  font-weight: 900;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-btn.correct {
  background: rgba(16, 185, 129, 0.25) !important;
  border-color: var(--green) !important;
  color: #6ee7b7 !important;
}

.option-btn.wrong {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: var(--red) !important;
  color: #fca5a5 !important;
}

/* =========================================
   ANALYSIS MODAL (Oppimislaboratorio)
   ========================================= */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  max-width: 540px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.modal-icon.wrong {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-quote {
  font-size: 0.9rem;
  color: var(--amber);
  margin-bottom: 1rem;
  font-style: italic;
  padding-left: 0.75rem;
  border-left: 2px solid var(--amber);
}

.modal-explanation-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-formula {
  margin: 0.75rem 0;
  padding: 0.6rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  text-align: center;
  font-size: 1.1rem;
  color: var(--cyan);
}

.analysis-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.btn-report-analysis {
  padding: 0.55rem 0.95rem;
  font-size: 0.84rem;
}

/* ========================================================
   TEHTÄVÄN VIRHEILMOITUS JA PALAUTE -MODAALI (REPORT MODAL)
   ======================================================== */

.report-modal-box {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.75), 0 0 30px rgba(239, 68, 68, 0.15);
}

.report-question-context {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.1rem;
}

.report-context-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.report-q-id {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.report-q-snippet {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #cbd5e1;
  max-height: 100px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.report-section-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
}

.report-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1.1rem;
}

@media (max-width: 600px) {
  .report-type-grid {
    grid-template-columns: 1fr;
  }
}

.btn-report-type {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
  color: #e2e8f0;
}

.btn-report-type:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-report-type.active {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.25);
}

.btn-report-type .type-icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.btn-report-type .type-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.15rem;
}

.btn-report-type .type-desc {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.25;
}

.btn-report-type.active .type-title {
  color: #fca5a5;
}

.report-field {
  margin-bottom: 1rem;
}

.report-comment-label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.report-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: #fff;
  resize: vertical;
  min-height: 75px;
  transition: border-color 0.2s ease;
}

.report-textarea:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.report-status-msg {
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.report-status-msg.sending {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.report-status-msg.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.report-status-msg.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.report-actions-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.btn-report-submit {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  font-weight: 700;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
}

.btn-report-submit:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}

.btn-report-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-exam-review-report {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-exam-review-report:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

/* =========================================
   VICTORY SCREEN (TUTKIMUSTODISTUS)
   ========================================= */

.cert-card {
  background: var(--bg-card);
  border: 2px solid var(--cyan);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 0 50px rgba(0, 240, 255, 0.25);
  position: relative;
  overflow: hidden;
}

.cert-stamp {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  border: 2px dashed var(--cyan);
  color: var(--cyan);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 2px;
  transform: rotate(12deg);
}

.cert-hero-avatar {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.25rem auto;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 25px var(--accent);
}

.cert-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #fff;
}

.cert-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.cert-grade-box {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--cyan);
  border-radius: 12px;
  padding: 1.25rem;
  max-width: 320px;
  margin: 0 auto 2rem auto;
}

.cert-grade-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.cert-grade-text {
  font-size: 2rem;
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.5);
}

.cert-stats-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.cert-stat {
  text-align: center;
}

.cert-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.cert-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cert-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* KaTeX styling tweaks */
.katex {
  font-size: 1.1em !important;
}

.katex-display {
  margin: 0.5em 0 !important;
}

/* ==========================================
   LABORATORION APUVÄLINEET (LAB TOOLS)
   ========================================== */
.lab-tools-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 24, 44, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  flex-wrap: wrap;
}

.tools-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(24, 36, 66, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-tool:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 240, 255, 0.25);
}

.btn-tool.active {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
  animation: toolPulse 1.5s infinite;
}

.btn-tool.used, .btn-tool:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.8);
  border-color: rgba(255, 255, 255, 0.1);
  transform: none;
  box-shadow: none;
}

.tool-count {
  background: rgba(0, 240, 255, 0.2);
  color: var(--cyan);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-tool.used .tool-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

@keyframes toolPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.8); }
}

.question-box.catalyst-active {
  border-color: #10b981 !important;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.35) !important;
}

.option-btn.eliminated {
  opacity: 0.22 !important;
  pointer-events: none !important;
  text-decoration: line-through !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  background: rgba(10, 15, 28, 0.4) !important;
}

/* ==========================================
   FX CANVAS (KONFETTI & PARTIKKELIT)
   ========================================== */
.fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* ==========================================
   SAAVUTUS-ILMOITUS (TOAST)
   ========================================== */
.achievement-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, rgba(16, 24, 44, 0.95), rgba(24, 36, 66, 0.98));
  border: 1px solid #f59e0b;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35), 0 0 20px rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  max-width: 380px;
}

.achievement-toast.show {
  transform: translateX(0);
}

.toast-icon {
  font-size: 2rem;
  animation: bounce 1s infinite alternate;
}

.toast-badge-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #f59e0b;
  text-transform: uppercase;
}

.toast-badge-desc {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  margin-top: 0.15rem;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

/* ==========================================
   HALL OF FAME & ENNÄTYS-MODAALI
   ========================================== */
.records-card {
  max-width: 650px !important;
  width: 90% !important;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
}

.modal-header h2 {
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #fff;
}

.records-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan);
  color: #fff;
}

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.score-course {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.score-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.score-right {
  text-align: right;
}

.score-points {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cyan);
}

.score-grade {
  font-size: 0.8rem;
  font-weight: 700;
  color: #10b981;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.badge-card {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  align-items: center;
  transition: all 0.2s;
}

.badge-card.unlocked {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

.badge-icon {
  font-size: 1.75rem;
  filter: grayscale(1) opacity(0.35);
}

.badge-card.unlocked .badge-icon {
  filter: none;
}

.badge-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

.badge-card.unlocked .badge-title {
  color: #f59e0b;
}

.badge-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.3;
}

/* ==========================================
   RESPONSIIVISUUS: TABLET (PAD) JA MOBIILI
   ========================================== */

@media (max-width: 900px) {
  .wizard-stepper {
    padding: 0.5rem 0.65rem;
    gap: 0.35rem;
  }

  .step-indicator {
    padding: 0.4rem 0.55rem;
    gap: 0.5rem;
  }

  .step-title {
    font-size: 0.78rem;
  }

  .step-badge {
    font-size: 0.68rem;
  }

  .courses-scroll-container {
    max-height: 52vh;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .wizard-stepper {
    margin-bottom: 1.25rem;
  }

  .pane-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .course-search-wrapper {
    max-width: 100%;
  }

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

  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

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

  .briefing-body {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .launch-bar {
    justify-content: stretch;
  }

  .launch-bar .btn-primary {
    width: 100%;
    justify-content: center;
  }

  .cert-stats-row {
    gap: 1.25rem;
  }

  .cert-actions {
    flex-direction: column;
  }

  .cert-actions .btn-primary,
  .cert-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .wizard-stepper {
    padding: 0.4rem;
    gap: 0.2rem;
  }

  .step-indicator {
    padding: 0.4rem 0.35rem;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
  }

  .step-connector {
    display: none;
  }

  .step-num {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }

  .step-title {
    font-size: 0.7rem;
    letter-spacing: 0;
  }

  .step-badge {
    display: none; /* Piilotetaan kapealla puhelimen ruudulla tilan säästämiseksi */
  }

  .courses-scroll-container {
    max-height: 48vh;
  }

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

  .selectable-card {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.05rem;
  }

  .hero-card {
    padding: 0.85rem;
  }

  .hero-avatar-box {
    width: 60px;
    height: 60px;
  }

  .wizard-nav-bar {
    padding: 0.65rem 0.75rem;
  }

  .btn-wizard {
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
  }

  .wizard-step-counter {
    font-size: 0.78rem;
  }
}



/* ==========================================
   KERTAUSLABORATORIO (MISTAKE BANK STYLES)
   ========================================== */
.badge-count {
  display: inline-block;
  background: var(--amber);
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.35rem;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
  animation: pulseAmber 2s infinite;
}

@keyframes pulseAmber {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mistakes-card {
  max-width: 720px !important;
  width: 92% !important;
  max-height: 85vh;
  overflow-y: auto;
}

.mistakes-summary-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.mistake-stat-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.m-stat-val {
  font-size: 1.6rem;
  font-weight: 900;
  font-family: var(--font-mono, monospace);
}

.m-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
.text-cyan { color: var(--cyan); }

.mistakes-actions-bar {
  margin-bottom: 1.25rem;
}

.mistakes-topics-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.mistakes-courses-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.mistake-course-card {
  background: rgba(16, 24, 44, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}

.mistake-course-card:hover {
  background: rgba(24, 36, 66, 0.95);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

.mistake-course-card.active-waiting {
  border-left: 4px solid var(--amber);
}

.mistake-course-card.all-mastered {
  border-left: 4px solid var(--green);
  opacity: 0.75;
}

.m-course-info {
  flex: 1;
}

.m-course-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.m-course-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
}

.m-course-count {
  font-size: 0.75rem;
  font-weight: 700;
}

.m-course-count.waiting {
  color: var(--amber);
}

.m-course-count.done {
  color: var(--green);
}

.m-course-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.btn-review-course {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-review-course:hover {
  background: var(--amber);
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.btn-review-course.done {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  color: var(--green);
}

.mistakes-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.mistakes-empty-state h3 {
  font-size: 1.25rem;
  color: #fff;
  margin: 0.75rem 0 0.35rem 0;
}


/* ==========================================
   OFFLINE STATUS BANNER & PWA
   ========================================== */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.offline-icon {
  font-size: 1.1rem;
}

/* ==========================================
   PELIMUODON VALITSIN (STEP 3)
   ========================================== */
.mode-selector-wrapper {
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
  text-align: left;
}

.mode-selector-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cyan);
  margin-bottom: 0.65rem;
}

.mode-pills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.btn-mode-card {
  background: rgba(16, 24, 44, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.btn-mode-card:hover {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  transform: translateY(-2px);
}

.btn-mode-card.active {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}

.btn-mode-card[data-mode="exam"].active {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.12);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.25);
}

.mode-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mode-card-icon {
  font-size: 1.35rem;
}

.mode-card-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff;
}

.mode-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* ==========================================
   VIRALLINEN KOETILA (TIMED EXAM MODE)
   ========================================== */
.exam-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(16, 24, 44, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.85rem;
}

.exam-hud-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.exam-indicator-badge {
  background: rgba(0, 229, 255, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.exam-status-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-flag {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--amber);
}

.btn-flag.active {
  background: var(--amber);
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

.exam-timer-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.35rem 0.95rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  transition: all 0.25s ease;
}

.exam-timer-box.warning {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.exam-timer-box.danger {
  border-color: #ef4444;
  color: #ef4444;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45);
  animation: timerPulse 1s infinite alternate;
}

@keyframes timerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.btn-exam-finish {
  background: linear-gradient(135deg, #ec4899, #be185d);
  border: 1px solid rgba(236, 72, 153, 0.5);
  padding: 0.55rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.btn-exam-finish:hover {
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.5);
}

/* Kysymysmatriisi */
.exam-nav-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  background: rgba(16, 24, 44, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  align-items: center;
}

.exam-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 24, 44, 0.7);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.exam-nav-btn:hover {
  border-color: var(--cyan);
  color: #fff;
  transform: translateY(-1px);
}

.exam-nav-btn.current {
  border: 2px solid var(--cyan);
  color: #fff;
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.exam-nav-btn.answered {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.exam-nav-btn.current.answered {
  border: 2px solid var(--cyan);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}

.exam-nav-btn.flagged::after {
  content: '🚩';
  position: absolute;
  top: -7px;
  right: -7px;
  font-size: 11px;
}

.exam-nav-btn.flagged {
  border-color: var(--amber) !important;
}

/* Koenavigointipalkki tehtävän alaosassa */
.exam-question-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.exam-nav-center-info {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ==========================================
   KOETILAN ARVOSTELURUUTU (EXAM TRANSCRIPT)
   ========================================== */
.exam-cert-card {
  max-width: 880px;
  margin: 0 auto;
}

.exam-stamp {
  border-color: var(--pink) !important;
  color: var(--pink) !important;
}

.exam-grade-box {
  background: rgba(16, 24, 44, 0.8);
  border: 2px solid var(--cyan);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.exam-grade-box .exam-grade-text {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--cyan);
  margin-top: 0.25rem;
}

.exam-grade-box .exam-grade-subtext {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.exam-transfer-banner {
  margin-bottom: 1.5rem;
  padding: 0.85rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: 10px;
}

.btn-transfer-action {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #000;
}

.btn-transfer-action:hover {
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
}

/* Koetehtävien erittelylista */
.exam-breakdown-wrapper {
  text-align: left;
  margin-top: 2rem;
  width: 100%;
}

.exam-breakdown-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.1rem;
  letter-spacing: 0.3px;
}

.exam-review-card {
  background: rgba(16, 24, 44, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.95rem;
  transition: all 0.2s ease;
}

.exam-review-card.correct {
  border-left: 5px solid #10b981;
}

.exam-review-card.wrong {
  border-left: 5px solid #ef4444;
}

.exam-review-card.unanswered {
  border-left: 5px solid #f59e0b;
}

.exam-review-q-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.exam-review-q-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--cyan);
}

.exam-review-badge {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 5px;
  text-transform: uppercase;
}

.exam-review-badge.correct {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.exam-review-badge.wrong {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.exam-review-badge.unanswered {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.exam-review-q-text {
  font-size: 0.96rem;
  color: #fff;
  margin-bottom: 0.85rem;
  line-height: 1.45;
}

.exam-review-answers-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.exam-ans-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.exam-ans-label {
  font-weight: 700;
  min-width: 120px;
  font-size: 0.8rem;
}

.exam-ans-val {
  color: #fff;
}

.exam-ans-row.student-wrong .exam-ans-val {
  color: #fca5a5;
  text-decoration: line-through;
}

.exam-ans-row.student-correct .exam-ans-val {
  color: #6ee7b7;
}

.exam-ans-row.correct-ans .exam-ans-val {
  color: #6ee7b7;
  font-weight: 700;
}

.exam-review-explanation {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 3px solid rgba(0, 229, 255, 0.3);
}

/* ========================================================
   OMAAN TAHTIIN -VERKKOKIRJAPAINIKKEET & GEOGEBRA-MODAALI
   ======================================================== */

.btn-omaan-tahtiin {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.52rem 0.95rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #38bdf8;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.28), rgba(2, 132, 199, 0.18));
  border: 1px solid rgba(56, 189, 248, 0.45);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.15);
}

.btn-omaan-tahtiin:hover {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.45), rgba(2, 132, 199, 0.32));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
}

.btn-omaan-tahtiin.secondary {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(129, 140, 248, 0.35);
}

.btn-omaan-tahtiin.secondary:hover {
  background: rgba(99, 102, 241, 0.28);
  border-color: #818cf8;
  color: #fff;
}

.btn-omaan-tahtiin.ggb-action {
  color: #6ee7b7;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.15));
  border-color: rgba(16, 185, 129, 0.45);
}

.btn-omaan-tahtiin.ggb-action:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38), rgba(5, 150, 105, 0.28));
  border-color: #10b981;
  color: #fff;
}

.btn-omaan-tahtiin.compact {
  padding: 0.36rem 0.7rem;
  font-size: 0.76rem;
  border-radius: 6px;
}

.course-card-theory-row {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.briefing-theory-row {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.modal-theory-links {
  margin: 0.85rem 0 1.1rem 0;
  padding: 0.75rem 0.9rem;
  background: rgba(14, 25, 48, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.exam-review-theory-row {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn-tool-ggb {
  border-color: rgba(16, 185, 129, 0.45) !important;
  background: rgba(16, 185, 129, 0.14) !important;
}

.btn-tool-ggb:hover {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.26) !important;
}

.btn-tool-theory {
  border-color: rgba(56, 189, 248, 0.45) !important;
  background: rgba(14, 116, 144, 0.22) !important;
  margin-left: auto;
}

/* GeoGebra Simulation Modal */
.geogebra-backdrop {
  padding: 0.6rem !important;
  overflow-y: auto !important;
  align-items: flex-start !important;
}

.geogebra-modal-card {
  background: #0b1325;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 14px;
  max-width: 1720px !important;
  width: 96vw !important;
  height: auto !important;
  max-height: 94vh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: block !important;
  padding: 0.75rem 1.15rem 1rem !important;
  margin: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
  transition: all 0.2s ease;
}

.geogebra-modal-card::-webkit-scrollbar,
.ggb-viewport-wrapper::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.geogebra-modal-card::-webkit-scrollbar-track,
.ggb-viewport-wrapper::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 8px;
}

.geogebra-modal-card::-webkit-scrollbar-thumb,
.ggb-viewport-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.45);
  border-radius: 8px;
  border: 2px solid rgba(15, 23, 42, 0.85);
}

.geogebra-modal-card::-webkit-scrollbar-thumb:hover,
.ggb-viewport-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.75);
}

.geogebra-modal-card.is-fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 0.5rem 0.85rem !important;
}

.ggb-top-header {
  position: sticky;
  top: -0.75rem;
  z-index: 30;
  background: #0b1325;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ggb-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ggb-title-group h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.ggb-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
  font-size: 0.78rem;
  font-weight: 700;
}

.ggb-preset-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-ggb-preset {
  padding: 0.35rem 0.75rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ggb-preset:hover {
  color: #fff;
  border-color: var(--cyan);
}

.btn-ggb-preset.active {
  background: rgba(0, 240, 255, 0.2);
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.ggb-window-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ggb-window {
  padding: 0.32rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ggb-window:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.15);
}

.ggb-context-bar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.ggb-question-summary {
  font-size: 0.84rem;
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-left: 3px solid var(--cyan);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  line-height: 1.35;
}

.ggb-guide-banner {
  font-size: 0.8rem;
  color: #cbd5e1;
  background: rgba(16, 185, 129, 0.12);
  border-left: 3px solid #10b981;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  line-height: 1.35;
}

.ggb-viewport-wrapper {
  width: 100%;
  min-height: 600px;
  background: #ffffff;
  border-radius: 10px;
  overflow: auto !important;
  border: 2px solid rgba(0, 240, 255, 0.35);
  display: block !important;
  position: relative;
}

.ggb-footer-row {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Legal & Attribution Footer */
.app-legal-footer {
  width: 100%;
  max-width: 1120px;
  margin: 1.5rem auto 1rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.legal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1.5;
}

.app-legal-footer a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.app-legal-footer a:hover {
  text-decoration: underline;
  color: var(--cyan);
}

.legal-sep {
  opacity: 0.45;
}

.btn-legal-info {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-legal-info:hover {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.12);
}

/* ========================================================
   SELKEYTETTY 5-VAIHEINEN VALIKKO & VAIKEUSTASOVALINTA
   ======================================================== */

.setup-lang-box {
  margin-top: 1.35rem;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.setup-lang-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.3px;
}

.setup-lang-buttons {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.setup-lang-pill {
  padding: 0.48rem 1rem !important;
  font-size: 0.85rem !important;
  border-radius: 8px !important;
}

/* Step 4: Dedicated Difficulty Level Cards */
.level-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  margin-top: 0.5rem;
}

.level-choice-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem 1.35rem;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(145deg, rgba(16, 24, 44, 0.92), rgba(13, 20, 36, 0.78));
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 215px;
}

.level-choice-card:hover {
  transform: translateY(-3px);
}

.level-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.level-card-icon {
  font-size: 1.55rem;
  line-height: 1;
}

.level-card-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.level-card-badge.perus {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.level-card-badge.syventava {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.level-card-badge.all {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.level-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.45rem;
}

.level-card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
  margin-bottom: 1rem;
}

.level-card-meta {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.level-q-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: #cbd5e1;
}

#card-level-perus:hover,
#card-level-perus.selected {
  border-color: #10b981;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.28);
  background: linear-gradient(145deg, rgba(16, 38, 44, 0.96), rgba(10, 28, 36, 0.88));
}

#card-level-syventava:hover,
#card-level-syventava.selected {
  border-color: #a855f7;
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.28);
  background: linear-gradient(145deg, rgba(32, 20, 52, 0.96), rgba(22, 16, 40, 0.88));
}

#card-level-all:hover,
#card-level-all.selected {
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.28);
  background: linear-gradient(145deg, rgba(16, 34, 62, 0.96), rgba(12, 26, 48, 0.88));
}

.briefing-body-4 {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

@media (max-width: 920px) {
  .level-cards-grid {
    grid-template-columns: 1fr;
  }
  .briefing-body-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .briefing-body-4 {
    grid-template-columns: 1fr;
  }
  .setup-lang-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ========================================================
   VAALEA TEEMA (LIGHT THEME - SCIENTIFIC DATA ANALYSIS STYLE)
   ======================================================== */

body.light-theme {
  --bg-dark: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.96);
  --bg-card-hover: #f8fafc;
  --border-glow: rgba(2, 132, 199, 0.35);
  --cyan: #0284c7;
  --green: #059669;
  --purple: #7c3aed;
  --amber: #d97706;
  --red: #dc2626;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent: #0284c7;

  background-color: #f1f5f9;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(14, 165, 233, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(124, 58, 237, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
}

/* Header & Navigation */
body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #cbd5e1;
  box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
}

body.light-theme .brand-title,
body.light-theme #txt-app-title {
  color: #0f172a !important;
}

body.light-theme .logo-badge {
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.3);
}

body.light-theme .lang-selector {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.light-theme .btn-lang {
  color: #475569;
}

body.light-theme .btn-lang:hover {
  color: #0f172a;
  background: #e2e8f0;
}

body.light-theme .btn-lang.active {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

body.light-theme .btn-icon {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

body.light-theme .btn-icon:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0369a1;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

body.light-theme .btn-theme-toggle {
  border-color: rgba(2, 132, 199, 0.4);
  background: #f0f9ff;
  color: #0369a1;
}

/* Wizard Stepper & Controls */
body.light-theme .wizard-stepper,
body.light-theme .wizard-nav-bar,
body.light-theme .setup-lang-box {
  background: rgba(255, 255, 255, 0.95);
  border-color: #cbd5e1;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

body.light-theme .setup-lang-label {
  color: #1e293b;
}

body.light-theme .step-indicator:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.light-theme .step-indicator.active {
  background: #e0f2fe;
  color: #0f172a;
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.12);
}

body.light-theme .step-num {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .step-indicator.active .step-num {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

body.light-theme .step-connector {
  background: #cbd5e1;
}

body.light-theme .course-search-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .course-search-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

body.light-theme .btn-clear-search:hover {
  color: #0f172a;
}

/* Selectable Cards, Curriculum, Courses, Difficulty Levels, Heroes */
body.light-theme .selectable-card,
body.light-theme .curriculum-card,
body.light-theme .level-choice-card,
body.light-theme .btn-mode-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

body.light-theme .selectable-card:hover,
body.light-theme .curriculum-card:hover,
body.light-theme .btn-mode-card:hover {
  background: #f8fafc;
  border-color: #0284c7;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.12);
}

body.light-theme .selectable-card.selected,
body.light-theme .curriculum-card.selected,
body.light-theme .btn-mode-card.active,
body.light-theme #card-level-all:hover,
body.light-theme #card-level-all.selected {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-color: #0284c7;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.18);
}

body.light-theme .curriculum-card[data-curriculum="ib"].selected,
body.light-theme .selectable-card.yo-card.selected,
body.light-theme .selectable-card.ib-card.selected {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-color: #d97706;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.18);
}

body.light-theme .selectable-card.yo-card,
body.light-theme .selectable-card.ib-card {
  background: linear-gradient(135deg, #ffffff, #fffbeb);
  border-color: rgba(217, 119, 6, 0.45);
}

body.light-theme #card-level-perus:hover,
body.light-theme #card-level-perus.selected {
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  border-color: #059669;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.18);
}

body.light-theme #card-level-syventava:hover,
body.light-theme #card-level-syventava.selected {
  background: linear-gradient(145deg, #f5f3ff, #ede9fe);
  border-color: #7c3aed;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.18);
}

body.light-theme .btn-mode-card[data-mode="exam"].active {
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border-color: #db2777;
  box-shadow: 0 6px 18px rgba(219, 39, 119, 0.16);
}

body.light-theme .card-title,
body.light-theme .hero-name,
body.light-theme .mode-card-title,
body.light-theme .level-card-title,
body.light-theme .briefing-val {
  color: #0f172a;
}

body.light-theme .subject-code,
body.light-theme .hero-role-tag,
body.light-theme .hero-gender-tag {
  background: #f1f5f9;
  color: #334155;
}

body.light-theme .hero-avatar-box {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

body.light-theme .vlab-entry-banner {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(124, 58, 237, 0.1)) !important;
  border-color: rgba(2, 132, 199, 0.35) !important;
}

body.light-theme .vlab-promo-title,
body.light-theme #txt-vlab-wizard-promo-title {
  color: #0f172a !important;
}

body.light-theme .vlab-promo-desc,
body.light-theme #txt-vlab-wizard-promo-desc {
  color: #475569 !important;
}

/* Mission Briefing & Wizard Nav */
body.light-theme .mission-briefing-card {
  background: linear-gradient(135deg, #ffffff, #f0f9ff);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

body.light-theme .briefing-header,
body.light-theme .briefing-theory-row,
body.light-theme .course-card-theory-row {
  border-color: #e2e8f0;
}

body.light-theme .btn-wizard {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .btn-wizard:hover:not(:disabled) {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

body.light-theme .btn-wizard-next {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #0284c7;
  color: #ffffff;
}

body.light-theme .btn-wizard-next:hover:not(:disabled) {
  background: linear-gradient(135deg, #0369a1, #075985);
  color: #ffffff;
}

body.light-theme .btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.3);
}

/* Game Screen, HUD, Track & Question Card */
body.light-theme .game-hud,
body.light-theme .track-container,
body.light-theme .lab-tools-bar,
body.light-theme .exam-hud,
body.light-theme .exam-nav-matrix,
body.light-theme .question-box,
body.light-theme .cert-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
}

body.light-theme .hud-streak {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .hud-streak.fire {
  background: #fef3c7;
  border-color: #d97706;
  color: #b45309;
}

body.light-theme .track-rail-line {
  background: #e2e8f0;
}

body.light-theme .track-node {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .track-node.completed {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

body.light-theme .track-node.active-station {
  background: #0284c7;
  border-color: #0369a1;
  color: #ffffff;
}

body.light-theme .track-avatar-pin {
  background: #ffffff;
  border-color: #0284c7;
}

body.light-theme .btn-tool {
  background: #f8fafc;
  border-color: rgba(2, 132, 199, 0.35);
  color: #0f172a;
}

body.light-theme .btn-tool:hover:not(:disabled) {
  background: #e0f2fe;
  border-color: #0284c7;
}

body.light-theme .question-text,
body.light-theme .cert-title,
body.light-theme .cert-stat-val,
body.light-theme .exam-breakdown-heading,
body.light-theme .exam-review-q-text,
body.light-theme .exam-ans-val {
  color: #0f172a;
}

body.light-theme .formula-hint-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .formula-hint-chip.interactive {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}

body.light-theme .formula-hint-chip.interactive.revealed {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

body.light-theme .btn-report-issue,
body.light-theme .btn-exam-review-report {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

body.light-theme .btn-report-issue:hover,
body.light-theme .btn-exam-review-report:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

body.light-theme .option-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .option-btn:hover:not(:disabled) {
  background: #f0f9ff;
  border-color: #0284c7;
}

body.light-theme .option-letter {
  background: #e2e8f0;
  color: #1e293b;
}

body.light-theme .option-btn.selected {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0f172a !important;
}

body.light-theme .option-btn.selected .option-letter {
  background: #0284c7;
  color: #ffffff;
}

body.light-theme .option-btn.correct {
  background: #d1fae5 !important;
  border-color: #059669 !important;
  color: #065f46 !important;
}

body.light-theme .option-btn.wrong {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #991b1b !important;
}

/* Exam Mode & Modals */
body.light-theme .exam-timer-box {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .exam-nav-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .exam-nav-btn.current {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

body.light-theme .exam-nav-btn.answered {
  background: #d1fae5;
  border-color: #059669;
  color: #065f46;
}

body.light-theme .exam-grade-box,
body.light-theme .exam-review-card {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-theme .exam-review-answers-box {
  background: #f1f5f9;
}

body.light-theme .exam-review-explanation {
  background: #ffffff;
  border-color: #e2e8f0;
  border-left: 3px solid #0284c7;
}

body.light-theme .modal-backdrop {
  background: rgba(15, 23, 42, 0.55);
}

body.light-theme .modal-box,
body.light-theme .modal-card,
body.light-theme .geogebra-modal-card {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

body.light-theme .modal-header {
  border-bottom-color: #e2e8f0;
}

body.light-theme .modal-title,
body.light-theme .modal-header h2,
body.light-theme .ggb-title-group h2,
body.light-theme .score-course,
body.light-theme .m-course-title,
body.light-theme .mistakes-empty-state h3 {
  color: #0f172a;
}

body.light-theme .modal-close-btn:hover {
  color: #0f172a;
}

body.light-theme .modal-explanation-card,
body.light-theme .mistakes-summary-banner,
body.light-theme .score-row,
body.light-theme .badge-card,
body.light-theme .mistake-course-card,
body.light-theme .report-question-context {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .modal-formula {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

body.light-theme .modal-theory-links {
  background: #f0f9ff;
  border-color: #bae6fd;
}

body.light-theme .tab-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

body.light-theme .tab-btn.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

body.light-theme .btn-report-type {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

body.light-theme .btn-report-type .type-title {
  color: #0f172a;
}

body.light-theme .btn-report-type.active {
  background: #fef2f2;
  border-color: #dc2626;
}

body.light-theme .btn-report-type.active .type-title {
  color: #b91c1c;
}

body.light-theme .report-comment-label,
body.light-theme .report-q-snippet,
body.light-theme .legal-modal-body {
  color: #334155 !important;
}

body.light-theme .report-textarea {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.light-theme .ggb-top-header {
  background: #ffffff;
  border-bottom-color: #e2e8f0;
}

body.light-theme .btn-ggb-preset,
body.light-theme .btn-ggb-window {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

body.light-theme .btn-ggb-preset.active {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0369a1;
}

body.light-theme .ggb-question-summary {
  background: #f0f9ff;
  color: #0f172a;
  border-color: #bae6fd;
}

body.light-theme .ggb-guide-banner {
  background: #ecfdf5;
  color: #065f46;
}

body.light-theme .achievement-toast {
  background: #ffffff;
  border-color: #d97706;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

body.light-theme .toast-badge-desc {
  color: #0f172a;
}

body.light-theme .app-legal-footer {
  border-top-color: #cbd5e1;
  color: #475569;
}

body.light-theme .app-legal-footer a {
  color: #0284c7;
}

body.light-theme .btn-legal-info {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

body.light-theme .btn-legal-info:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0369a1;
}

