/* Pegasus Mathematics — cockpit dark theme */

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: linear-gradient(160deg, #0f0f1a 0%, #1a1a2e 50%, #0d1117 100%);
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app { min-height: 100vh; padding: 28px 20px; }

.screen { display: none; max-width: 720px; margin: 0 auto; }
.screen.active { display: block; }

/* ---------- CADETPRO header ---------- */
.cadetpro-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.cadetpro-brand { display: flex; align-items: center; gap: 14px; }
.cadetpro-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,152,0,0.9);
  font-size: 22px; font-weight: 800;
}
.cadetpro-titles { display: flex; flex-direction: column; }
.cadetpro-title {
  font-size: 18px; font-weight: 800; color: #fff; letter-spacing: 0.5px;
}
.cadetpro-subtitle {
  font-size: 11px; color: rgba(255,255,255,0.3); letter-spacing: 1px; font-weight: 500;
}

/* ---------- Section divider ---------- */
.section-divider {
  display: flex; align-items: center; gap: 14px; margin: 18px 0 12px;
}
.section-divider .line {
  flex: 1; height: 1px; background: rgba(255, 255, 255, 0.08);
}
.section-divider .label {
  font-size: 11px; font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 2.5px; text-transform: uppercase; padding: 0 2px;
}

/* ---------- Menu containers ---------- */
.menu-title, .menu-subtitle { display: none; }
.mode-row, .category-grid {
  display: flex; flex-direction: column; gap: 10px;
}

/* ---------- Staggered rise-in on screen load ---------- */
@keyframes kbRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
#screen-menu.active .kiosk-info-card,
#screen-menu.active .mode-row .kiosk-btn,
#screen-menu.active .category-group,
#screen-menu.active .mixed-mode-btn {
  animation: kbRise .45s cubic-bezier(.2,.8,.2,1) both;
}
#screen-menu.active .kiosk-info-card:nth-child(1) { animation-delay: .02s; }
#screen-menu.active .kiosk-info-card:nth-child(2) { animation-delay: .06s; }
#screen-menu.active .kiosk-info-card:nth-child(3) { animation-delay: .10s; }
#screen-menu.active .kiosk-info-card:nth-child(4) { animation-delay: .14s; }
#screen-menu.active .mode-row .kiosk-btn:nth-child(1) { animation-delay: .18s; }
#screen-menu.active .mode-row .kiosk-btn:nth-child(2) { animation-delay: .22s; }
#screen-menu.active .category-group:nth-child(1) { animation-delay: .26s; }
#screen-menu.active .category-group:nth-child(2) { animation-delay: .30s; }
#screen-menu.active .category-group:nth-child(3) { animation-delay: .34s; }
#screen-menu.active .category-group:nth-child(4) { animation-delay: .38s; }
#screen-menu.active .category-group:nth-child(5) { animation-delay: .42s; }
#screen-menu.active .category-group:nth-child(6) { animation-delay: .46s; }
#screen-menu.active .mixed-mode-btn { animation-delay: .50s; }
@media (prefers-reduced-motion: reduce) {
  #screen-menu.active .kiosk-info-card,
  #screen-menu.active .mode-row .kiosk-btn,
  #screen-menu.active .category-group,
  #screen-menu.active .mixed-mode-btn {
    animation: none;
  }
}

/* ---------- Category groups (hierarchical menu) ---------- */
.category-groups { display: flex; flex-direction: column; gap: 12px; }
.category-group { display: flex; flex-direction: column; }

.category-group-header {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px 0 22px; border-radius: 8px;
  cursor: pointer; min-height: 56px;
  position: relative; overflow: hidden;
  background: #14141f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform .15s ease, filter .15s ease, border-color .15s ease;
}
.category-group-header::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--grp-color, #6366f1);
  z-index: 0;
}
.category-group-header > * { position: relative; z-index: 1; }
.category-group-header:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  border-color: rgba(255, 255, 255, 0.12);
}
.category-group-header .group-dot { display: none; }
.category-group-header .group-name {
  font-size: 13px; font-weight: 800; flex: 1; min-width: 0;
  letter-spacing: 1.2px;
  color: #e5e7ec; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.category-group-header .group-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.category-sub-list {
  display: flex; flex-direction: column; gap: 1px;
  padding-left: 20px; margin-left: 4px;
  border-left: 2px solid rgba(255,255,255,0.06);
}
.category-sub-item {
  display: flex; align-items: center;
  padding: 10px 14px; border-radius: 6px;
  cursor: pointer; transition: background 0.12s, transform 0.12s; min-height: 44px;
}
.category-sub-item:hover { background: rgba(255,255,255,0.04); transform: translateX(1px); }
.category-sub-item.empty { opacity: 0.45; cursor: default; }
.category-sub-item.empty:hover { background: transparent; transform: none; }
.category-sub-item .sub-code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: #64748b; font-size: 11px; width: 40px; font-weight: 600;
  letter-spacing: 0.5px; flex-shrink: 0;
}
.category-sub-item .sub-name { font-size: 12.5px; font-weight: 500; flex: 1; color: #cbd5e1; letter-spacing: 0.2px; }
.category-sub-item .sub-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: #475569; font-variant-numeric: tabular-nums;
}
.category-sub-item.has-questions .sub-name { color: #e2e8f0; font-weight: 600; }
.category-sub-item.active-cat .sub-name { font-weight: 700; color: #f1f5f9; }
.category-sub-item.active-cat .sub-count { font-weight: 700; color: #94a3b8; }

.category-table-header { display: flex; justify-content: space-between; padding: 4px 14px 8px; }
.category-table-header span { color: #475569; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }

.mixed-mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 16px 20px;
  background:
    radial-gradient(125% 85% at 0% 0%, rgba(255,255,255,0.22), transparent 58%),
    linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  border-radius: 10px; cursor: pointer; color: #fff;
  font-size: 12.5px; font-weight: 800; letter-spacing: 2.2px;
  font-family: inherit; text-transform: uppercase;
  min-height: 52px; margin-top: 14px;
  position: relative; overflow: hidden; isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.30),
    0 8px 22px rgba(139,92,246,0.32),
    0 1px 0 rgba(0,0,0,0.4);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, filter .18s ease;
}
.mixed-mode-btn::before {
  /* 135° milled hatch texture */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.04) 0 2px, transparent 2px 11px);
  opacity: 0.85;
  z-index: 0;
}
.mixed-mode-btn::after {
  /* shimmer sweep on hover */
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 60%;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.28) 45%, rgba(255,255,255,0.10) 55%, transparent 100%);
  transform: translateX(-120%);
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  z-index: 1;
}
.mixed-mode-btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.38),
    inset 0 -1px 0 rgba(0,0,0,0.32),
    0 14px 30px rgba(139,92,246,0.42),
    0 2px 0 rgba(0,0,0,0.4);
}
.mixed-mode-btn:hover::after { transform: translateX(120%); }
.mixed-mode-btn:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.40),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 2px 6px rgba(139,92,246,0.28);
}
.mixed-mode-btn > * { position: relative; z-index: 2; }

/* ---------- Quiz popup modal ---------- */
.quiz-popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease-out;
}
.quiz-popup {
  width: 92vw; max-width: 420px; max-height: 80vh; overflow-y: auto;
  background: rgba(15,23,42,0.98); border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  backdrop-filter: blur(12px); animation: slideUp 0.2s ease-out;
}
.quiz-popup-header {
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.quiz-popup-header .popup-title { display: flex; align-items: center; gap: 10px; }
.quiz-popup-header .popup-title-dot { width: 8px; height: 8px; border-radius: 3px; }
.quiz-popup-header .popup-title-text { font-size: 15px; font-weight: 800; letter-spacing: 0.5px; }
.quiz-popup-header .popup-close {
  width: 32px; height: 32px; border: none; border-radius: 6px;
  background: rgba(255,255,255,0.05); color: #94a3b8; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.quiz-popup-header .popup-close:hover { background: rgba(255,255,255,0.1); }

.quiz-popup-body { padding: 14px 20px; }
.popup-section-label { color: #94a3b8; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; margin-bottom: 10px; }

.popup-cat-row {
  display: flex; align-items: center; padding: 10px 14px; border-radius: 8px;
  margin-bottom: 4px; cursor: pointer; transition: background 0.12s; min-height: 48px;
  border: 1px solid transparent;
}
.popup-cat-row:hover { background: rgba(255,255,255,0.03); }
.popup-cat-row.disabled { opacity: 0.4; cursor: not-allowed; }

.popup-checkbox {
  width: 20px; height: 20px; border-radius: 5px; margin-right: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; border: 2px solid #475569;
}
.popup-checkbox.checked { border-color: transparent; color: #fff; }
.popup-checkbox.disabled { border-color: #334155; }

.popup-cat-info { flex: 1; }
.popup-cat-name { font-size: 13px; font-weight: 500; color: #94a3b8; }
.popup-cat-sub { font-size: 10px; color: #475569; margin-top: 1px; }
.popup-cat-row.checked .popup-cat-name { color: #e2e8f0; font-weight: 600; }
.popup-cat-count { font-size: 11px; color: #475569; }
.popup-cat-row.checked .popup-cat-count { font-weight: 700; }

.popup-counter-wrap { padding: 8px 20px 16px; }
.popup-counter {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.30), rgba(0,0,0,0.10));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 10px 16px;
  box-shadow:
    inset 0 1px 3px rgba(0,0,0,0.45),
    inset 0 0 0 1px rgba(255,255,255,0.03);
}
.popup-counter-btn {
  width: 46px; height: 46px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(255,255,255,0.10), transparent 65%),
    linear-gradient(to bottom,
      rgba(255,255,255,0.06) 0%,
      rgba(255,255,255,0.02) 55%,
      rgba(0,0,0,0.20) 100%);
  color: #cbd5e1;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 24px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.35),
    0 2px 6px rgba(0,0,0,0.35),
    0 1px 0 rgba(0,0,0,0.4);
  transition: transform .12s ease, box-shadow .12s ease, color .12s ease, border-color .12s ease, background .12s ease;
}
.popup-counter-btn:hover {
  color: #ffffff;
  border-color: rgba(129,140,248,0.45);
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(165,180,252,0.18), transparent 65%),
    linear-gradient(to bottom, rgba(99,102,241,0.18) 0%, rgba(79,70,229,0.08) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.35),
    0 4px 10px rgba(99,102,241,0.28),
    0 1px 0 rgba(0,0,0,0.4);
}
.popup-counter-btn:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.55),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 1px 2px rgba(0,0,0,0.2);
}
.popup-counter-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.popup-counter-value { flex: 1; text-align: center; }
.popup-counter-num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 32px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: -1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 0 12px rgba(129,140,248,0.2);
}
.popup-counter-label { font-size: 12px; color: #64748b; margin-left: 6px; }
.popup-counter-info { text-align: center; font-size: 10px; color: #475569; margin-top: 6px; }

.popup-start-wrap { padding: 4px 20px 18px; }
.popup-start-btn {
  width: 100%; padding: 16px 14px; border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 900; letter-spacing: 2.2px;
  cursor: pointer; font-family: inherit;
  text-transform: uppercase;
  position: relative; overflow: hidden; isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.32),
    0 8px 22px rgba(0,0,0,0.35),
    0 1px 0 rgba(0,0,0,0.4);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, filter .18s ease;
}
.popup-start-btn::before {
  /* 135° milled hatch texture */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.04) 0 2px, transparent 2px 11px);
  opacity: 0.85; z-index: 0;
}
.popup-start-btn::after {
  /* shimmer sweep on hover */
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 60%;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,0.30) 45%, rgba(255,255,255,0.10) 55%, transparent 100%);
  transform: translateX(-120%);
  transition: transform .7s cubic-bezier(.2,.8,.2,1);
  pointer-events: none; z-index: 1;
}
.popup-start-btn:hover { transform: translateY(-1.5px); filter: brightness(1.06); }
.popup-start-btn:hover::after { transform: translateX(120%); }
.popup-start-btn:active { transform: translateY(0); box-shadow: inset 0 2px 5px rgba(0,0,0,0.40), inset 0 -1px 0 rgba(255,255,255,0.06), 0 2px 6px rgba(0,0,0,0.25); }
.popup-start-btn:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }
.popup-start-btn:disabled::after { display: none; }
.popup-start-btn > * { position: relative; z-index: 2; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Kiosk-btn pattern (milled-metal precision-instrument) ---------- */
.kiosk-btn, .mode-card, .category-card {
  width: 100%; min-height: 78px; border: none; border-radius: 10px;
  cursor: pointer; color: #ffffff; font-family: inherit; text-align: left;
  display: flex; align-items: stretch; padding: 0;
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(125% 85% at 0% 0%, rgba(255,255,255,0.20), transparent 58%),
    linear-gradient(135deg, var(--kb-c1, #334155) 0%, var(--kb-c2, #1e293b) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.30),
    0 6px 18px var(--kb-shadow, rgba(0,0,0,0.30)),
    0 1px 0 rgba(0,0,0,0.45);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease, filter .18s ease;
}
.kiosk-btn::before, .mode-card::before, .category-card::before {
  /* 135° hatched milled texture */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg,
    rgba(255,255,255,0.03) 0 2px, transparent 2px 11px);
  opacity: 0.85;
  z-index: 0;
}
.kiosk-btn::after, .mode-card::after, .category-card::after {
  /* corner bloom top-right, revealed on hover */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(70% 55% at 100% 0%, rgba(255,255,255,0.22), transparent 62%);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 0;
}
.kiosk-btn:hover::after, .mode-card:hover::after, .category-card:hover::after { opacity: 1; }
.kiosk-btn:hover, .mode-card:hover, .category-card:hover {
  transform: translateY(-1.5px); filter: brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.32),
    0 12px 26px var(--kb-shadow, rgba(0,0,0,0.40)),
    0 2px 0 rgba(0,0,0,0.45);
}
.kiosk-btn:active, .mode-card:active, .category-card:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,0.40),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 2px 6px var(--kb-shadow, rgba(0,0,0,0.25));
}
.kiosk-btn.kiosk-btn-locked, .mode-card.locked, .category-card.locked {
  opacity: 0.4; cursor: not-allowed;
}
.kiosk-btn.kiosk-btn-locked:hover, .mode-card.locked:hover, .category-card.locked:hover {
  transform: none; filter: none;
}
.kiosk-btn.kiosk-btn-locked:hover::after { opacity: 0; }

.kb-color {
  width: 6px; flex-shrink: 0; position: relative;
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--kb-rail, #fff) 100%, #fff 25%) 0%,
    var(--kb-rail, rgba(255,255,255,0.6)) 45%,
    var(--kb-rail, rgba(255,255,255,0.6)) 60%,
    color-mix(in srgb, var(--kb-rail, #000) 75%, #000) 100%);
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,0.45),
    inset -1px 0 0 rgba(0,0,0,0.30),
    2px 0 12px color-mix(in srgb, var(--kb-rail, #fff) 42%, transparent);
  z-index: 1;
}
.kb-color::after {
  /* 3 tick notches */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom,
    transparent 28%, rgba(0,0,0,0.35) 28%, rgba(0,0,0,0.35) 30%, transparent 30%,
    transparent 49%, rgba(0,0,0,0.35) 49%, rgba(0,0,0,0.35) 51%, transparent 51%,
    transparent 70%, rgba(0,0,0,0.35) 70%, rgba(0,0,0,0.35) 72%, transparent 72%);
}
.kb-body {
  flex: 1; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  position: relative; z-index: 1;
}
.kb-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kb-name {
  font-size: 18px; font-weight: 800; letter-spacing: 1.3px;
  color: #ffffff; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}
.kb-desc {
  font-size: 12.5px; font-weight: 500;
  color: rgba(255,255,255,0.80); letter-spacing: 0.2px;
}
.kb-time {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 24px; font-weight: 700;
  color: rgba(255,255,255,0.38);
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

/* ---------- Variant color tokens ---------- */
.kiosk-btn-mechanics { --kb-c1: #3b82f6; --kb-c2: #2563eb; --kb-rail: #60a5fa; --kb-shadow: rgba(59,130,246,0.30); }
.kiosk-btn-motion    { --kb-c1: #10b981; --kb-c2: #059669; --kb-rail: #4ade80; --kb-shadow: rgba(16,185,129,0.30); }
.kiosk-btn-optics    { --kb-c1: #f59e0b; --kb-c2: #d97706; --kb-rail: #fbbf24; --kb-shadow: rgba(245,158,11,0.30); }
.kiosk-btn-mixed     { --kb-c1: #8b5cf6; --kb-c2: #7c3aed; --kb-rail: #a78bfa; --kb-shadow: rgba(139,92,246,0.30); }
.kiosk-btn-study     { --kb-c1: #22c55e; --kb-c2: #16a34a; --kb-rail: #86efac; --kb-shadow: rgba(34,197,94,0.30); }
.kiosk-btn-exam      { --kb-c1: #6366f1; --kb-c2: #4f46e5; --kb-rail: #818cf8; --kb-shadow: rgba(99,102,241,0.30); }

/* ---------- Mode-row: unselected = neutralized / desaturated ---------- */
.mode-row .kiosk-btn:not(.is-selected):not(.kiosk-btn-locked) {
  --kb-c1: #2a2a35; --kb-c2: #17171f; --kb-rail: #4a4a5a; --kb-shadow: rgba(0,0,0,0.35);
  opacity: 0.62; filter: saturate(0.4);
}
.mode-row .kiosk-btn:not(.is-selected):not(.kiosk-btn-locked) .kb-color {
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,0.12),
    inset -1px 0 0 rgba(0,0,0,0.35);
}
.mode-row .kiosk-btn:not(.is-selected):not(.kiosk-btn-locked) .kb-name { color: rgba(255,255,255,0.68); }
.mode-row .kiosk-btn:not(.is-selected):not(.kiosk-btn-locked) .kb-desc { color: rgba(255,255,255,0.42); }
.mode-row .kiosk-btn:not(.is-selected):not(.kiosk-btn-locked):hover { opacity: 0.82; filter: saturate(0.6) brightness(1.1); }

/* ---------- Mode-row: selected = inset hairline + halo + pulsing dot ---------- */
.mode-row .kiosk-btn.is-selected {
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,0.38),
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.32),
    0 10px 28px var(--kb-shadow, rgba(0,0,0,0.3)),
    0 0 0 4px color-mix(in srgb, var(--kb-rail, #fff) 20%, transparent);
}
.mode-row .kiosk-btn.is-selected .kb-body::after {
  content: ''; position: absolute; top: 14px; right: 16px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--kb-rail, #fff) 35%, transparent),
    0 0 10px rgba(255,255,255,0.85);
  animation: kbPulse 1.8s ease-in-out infinite;
}
@keyframes kbPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .mode-row .kiosk-btn.is-selected .kb-body::after { animation: none; opacity: 1; }
}

/* ---------- PRO badge ---------- */
.pro-shield-badge {
  display: inline-block; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 4px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #78350f; margin-left: 8px;
  letter-spacing: 0.5px; text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- Quiz screen ---------- */
.quiz-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.quiz-progress {
  font-weight: 600; color: rgba(255,255,255,0.5);
  font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
}
.quiz-timer {
  font-weight: 800; font-size: 18px; color: #a5b4fc;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.35);
  padding: 6px 14px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.quiz-exit {
  background: rgba(239,68,68,0.12);
  color: #fca5a5; border: 1px solid rgba(239,68,68,0.35);
  padding: 8px 16px; border-radius: 8px;
  font-weight: 700; font-size: 12px; cursor: pointer;
  letter-spacing: 1px; font-family: inherit;
}
.quiz-exit:hover { background: rgba(239,68,68,0.22); }

/* ---------- Progress pill strip (clickable, below header) ---------- */
.quiz-progress-strip {
  display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0 8px;
}
.progress-pill {
  width: 32px; height: 28px; border-radius: 6px;
  border: 1.5px solid transparent;
  font-size: 11px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; transition: transform 0.08s, box-shadow 0.1s;
  padding: 0;
}
.progress-pill:hover { transform: scale(1.1); }
.progress-pill:active { transform: scale(0.95); }
.progress-pill.unanswered { background: #1e293b; color: #64748b; border-color: #334155; }
.progress-pill.correct { background: rgba(34,197,94,0.2); color: #4ade80; border-color: rgba(34,197,94,0.5); }
.progress-pill.wrong { background: rgba(239,68,68,0.2); color: #f87171; border-color: rgba(239,68,68,0.5); }
.progress-pill.skipped { background: rgba(245,158,11,0.2); color: #fbbf24; border-color: rgba(245,158,11,0.5); }
.progress-pill.current { box-shadow: 0 0 0 2px #6366f1, 0 0 8px rgba(99,102,241,0.35); }

.quiz-grid-btn {
  background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.35);
  color: #a5b4fc; padding: 6px 12px; border-radius: 8px;
  font-size: 18px; font-weight: 700; cursor: pointer; font-family: inherit;
  line-height: 1; min-width: 36px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.quiz-grid-btn:hover { background: rgba(99,102,241,0.25); }

/* ---------- Question navigation grid overlay ---------- */
.question-grid-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.12s ease-out;
}
.question-grid-modal {
  width: 92vw; max-width: 380px;
  background: rgba(15,23,42,0.98); border-radius: 16px;
  box-shadow: 0 20px 56px rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  padding: 18px 20px;
  animation: slideUp 0.18s ease-out;
}
.qgrid-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.qgrid-title {
  font-size: 11px; font-weight: 800; color: #94a3b8; letter-spacing: 2px;
}
.qgrid-close {
  width: 30px; height: 30px; border: none; border-radius: 6px;
  background: rgba(255,255,255,0.05); color: #94a3b8;
  font-size: 16px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.qgrid-close:hover { background: rgba(255,255,255,0.1); }

.qgrid-legend {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.qgrid-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: #64748b;
}
.qgrid-dot {
  width: 10px; height: 10px; border-radius: 3px;
}
.qgrid-dot.correct { background: #22c55e; }
.qgrid-dot.wrong { background: #ef4444; }
.qgrid-dot.skipped { background: #f59e0b; }
.qgrid-dot.unanswered { background: #334155; border: 1px solid #475569; }

.question-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
}

.grid-item {
  aspect-ratio: 1; border-radius: 8px; border: 2px solid transparent;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit; transition: transform 0.08s;
  min-width: 44px; min-height: 44px;
}
.grid-item:hover { transform: scale(1.08); }
.grid-item:active { transform: scale(0.95); }

.grid-item.unanswered { background: #1e293b; color: #94a3b8; border-color: #334155; }
.grid-item.correct { background: rgba(34,197,94,0.18); color: #4ade80; border-color: rgba(34,197,94,0.5); }
.grid-item.wrong { background: rgba(239,68,68,0.18); color: #f87171; border-color: rgba(239,68,68,0.5); }
.grid-item.skipped { background: rgba(245,158,11,0.18); color: #fbbf24; border-color: rgba(245,158,11,0.5); }
.grid-item.current { box-shadow: 0 0 0 2px #6366f1, 0 0 12px rgba(99,102,241,0.4); }

.quiz-text {
  font-size: 22px; line-height: 1.5;
  margin: 18px 0; padding: 32px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  color: #fff;
}
.quiz-text.quiz-text-with-graphic {
  display: flex; align-items: center; gap: 24px;
}
.quiz-text-with-graphic .quiz-text-inner { flex: 1; }
.quiz-graphic {
  flex: 0 0 auto;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.quiz-graphic-canvas { display: block; }
@media (max-width: 720px) {
  .quiz-text.quiz-text-with-graphic { flex-direction: column; align-items: stretch; }
  .quiz-graphic { align-self: center; }
}

.quiz-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px;
}
.option-card {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 18px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.15s; color: #fff;
}
.option-card:hover {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.35);
  transform: translateY(-1px);
}
.option-letter {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(99,102,241,0.15); color: #a5b4fc;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0; font-size: 15px;
}
.option-text { font-size: 16px; font-weight: 500; color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.option-text.option-graph { display: block; padding: 0; margin: 0; }
.option-text.option-graph svg { display: block; width: 100%; max-width: 200px; height: auto; }

.option-fraction {
  display: inline-flex; flex-direction: column; align-items: center;
  line-height: 1.1; vertical-align: middle; padding: 0 2px;
}
.frac-num {
  font-size: 14px; font-weight: 700; border-bottom: 1.5px solid rgba(255,255,255,0.7);
  padding: 0 3px 2px;
}
.frac-den {
  font-size: 14px; font-weight: 700; padding: 2px 3px 0;
}
.option-card.correct {
  background: rgba(34,197,94,0.18);
  border-color: #22c55e;
}
.option-card.correct .option-letter { background: #22c55e; color: #062a14; }
.option-card.wrong {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.55);
}
.option-card.wrong .option-letter { background: #ef4444; color: #fff; }
.option-card.wrong-dim { opacity: 0.4; }

.quiz-variant-row {
  display: flex; justify-content: flex-end; gap: 12px; margin-top: 18px;
}
.variant-btn {
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.35);
  color: #c7d2fe;
  padding: 10px 20px; border-radius: 10px;
  font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  letter-spacing: 0.5px; text-transform: uppercase; font-size: 12px;
}
.variant-btn:hover { background: rgba(99,102,241,0.22); }
.variant-btn.locked { opacity: 0.55; cursor: not-allowed; }

.skip-btn {
  background: rgba(245,158,11,0.10);
  border: 1px solid rgba(245,158,11,0.38);
  color: #fcd34d;
  padding: 10px 20px; border-radius: 10px;
  font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  letter-spacing: 0.5px; text-transform: uppercase; font-size: 12px;
  transition: background 0.15s ease, transform 0.08s ease;
}
.skip-btn::before {
  content: '⏭';
  font-size: 14px;
  opacity: 0.8;
}
.skip-btn:hover { background: rgba(245,158,11,0.22); }
.skip-btn:active { transform: translateY(1px); }
.skip-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ---------- Explanation panel ---------- */
.explanation-panel {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(15,15,26,0.98);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  padding: 24px 32px; max-height: 60vh; overflow-y: auto;
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  animation: slideUp 0.3s ease-out;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  z-index: 1000;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.explanation-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.explanation-title {
  font-size: 13px; font-weight: 700; color: rgba(255,255,255,0.5);
  letter-spacing: 2px; text-transform: uppercase;
}
.explanation-body { margin-bottom: 20px; }

/* Mathematical steps block (under header, above canvas) */
.math-steps {
  background: linear-gradient(135deg, rgba(30,27,75,0.55), rgba(15,15,26,0.75));
  border: 1px solid rgba(129,140,248,0.35);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25) inset;
}
.math-steps-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
}
.math-steps-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 4px 8px 4px 0;
  cursor: pointer;
  color: inherit;
}
.explanation-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-next-top {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.math-steps-title {
  font: 800 12px/1 "Plus Jakarta Sans", system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c7d2fe;
  opacity: 0.85;
}
.math-steps-chevron {
  color: #a5b4fc;
  font-size: 14px;
  transition: transform 200ms ease;
}
.math-steps.collapsed .math-steps-chevron { transform: rotate(-90deg); }
.math-steps.collapsed .math-steps-list { display: none; }
.math-steps.collapsed { padding-bottom: 4px; }
.math-steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 10px;
}
@media (max-width: 1100px) {
  .math-steps-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .math-steps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .math-steps-list { grid-template-columns: 1fr; gap: 8px; }
  .math-steps { padding: 12px 14px; }
  .math-steps-item { padding: 8px 10px; font-size: 12.5px; }
  .math-steps-formula { font-size: 13.5px; padding: 6px 10px; }
  .math-steps-item.no-formula .math-steps-text { font-size: 14px; }
  .math-steps-num { width: 20px; height: 20px; line-height: 20px; font-size: 11px; }
}

/* Header row wraps on narrow screens so action buttons drop below title */
@media (max-width: 760px) {
  .math-steps-header { flex-wrap: wrap; }
  .math-steps-actions { width: 100%; justify-content: flex-end; }
  .math-steps-actions .btn-primary,
  .math-steps-actions .btn-ghost { padding: 8px 14px; font-size: 13px; }
}

/* Explanation panel + canvas responsive tweaks */
@media (max-width: 900px) {
  .explanation-panel { padding: 14px; }
  .scene-canvas-wrap { aspect-ratio: 16 / 9; }
  .scene-canvas { width: 100%; height: 100%; }
}
@media (max-width: 600px) {
  .explanation-panel { padding: 10px; }
  .explanation-title { font-size: 11px; letter-spacing: 1.4px; }
  .scene-canvas-wrap { aspect-ratio: 4 / 3; }
  .audio-controls { gap: 8px; }
  .audio-time { font-size: 11px; }
}
.math-steps-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(15,23,42,0.45);
  border: 1px solid rgba(129,140,248,0.18);
  border-radius: 10px;
  font: 600 13px/1.4 "Plus Jakarta Sans", system-ui, sans-serif;
  color: #e0e7ff;
  align-self: stretch;
  height: 100%;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 320ms ease, transform 320ms ease, border-color 320ms ease, box-shadow 320ms ease;
}
.math-steps-item.pending { display: none; }
.math-steps-item:not(.pending) {
  border-color: rgba(129,140,248,0.45);
  box-shadow: 0 0 0 1px rgba(129,140,248,0.15), 0 2px 12px rgba(99,102,241,0.18);
}
.math-steps-num {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(129,140,248,0.22);
  border: 1px solid rgba(129,140,248,0.55);
  color: #a5b4fc;
  font: 800 12px/24px "Plus Jakarta Sans", system-ui, sans-serif;
  text-align: center;
  margin-top: 1px;
}
.math-steps-content { flex: 1 1 auto; display: flex; flex-direction: column; gap: 6px; }
.math-steps-text { white-space: pre-line; color: #e0e7ff; }
.math-steps-item.no-formula { align-items: center; }
.math-steps-item.no-formula .math-steps-content { justify-content: center; }
.math-steps-item.no-formula .math-steps-text {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: #facc15;
}
.math-steps-formula {
  align-self: flex-start;
  padding: 8px 14px;
  background: rgba(250,204,21,0.08);
  border: 1px solid rgba(250,204,21,0.35);
  border-radius: 8px;
  color: #facc15;
  font: 800 15px/1.3 "JetBrains Mono", "Plus Jakarta Sans", monospace;
  letter-spacing: 0.02em;
}

.explanation-steps { display: flex; flex-direction: column; gap: 10px; }
.explanation-step {
  padding: 14px 18px;
  background: rgba(30,41,59,0.5);
  border-left: 3px solid rgba(99,102,241,0.35);
  border-radius: 8px;
  opacity: 0.4; transition: all 0.3s;
  color: rgba(255,255,255,0.85);
}
.explanation-step.active {
  opacity: 1;
  border-left-color: #818cf8;
  background: rgba(99,102,241,0.15);
  color: #fff;
}
.explanation-video {
  width: 100%; max-width: 720px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.explanation-footer {
  display: flex; justify-content: flex-end; gap: 12px;
}
.explanation-panel.locked .explanation-body {
  text-align: center; color: rgba(255,255,255,0.5); padding: 24px;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: linear-gradient(135deg, #ff9800, #e67c00);
  color: #fff; border: none;
  padding: 12px 24px; border-radius: 10px;
  font-weight: 700; cursor: pointer;
  font-family: inherit; font-size: 14px;
  letter-spacing: 0.5px; text-transform: uppercase;
  box-shadow: 0 4px 15px rgba(255,152,0,0.25);
  transition: all 0.15s;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 24px; border-radius: 10px;
  font-weight: 600; cursor: pointer;
  font-family: inherit; font-size: 13px;
  letter-spacing: 0.5px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.btn-icon {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; padding: 6px 10px;
  color: rgba(255,255,255,0.5);
}
.btn-icon:hover { color: #fff; }

/* ---------- Results ---------- */
.results-title {
  font-size: 36px; font-weight: 800; text-align: center;
  margin: 12px 0 24px;
  background: linear-gradient(135deg, #93c5fd, #a78bfa, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.results-gauge {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 40px;
  text-align: center; margin-bottom: 18px;
}
.results-gauge-number {
  font-size: 72px; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, #93c5fd, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.results-gauge-sub {
  color: rgba(255,255,255,0.5); margin-top: 8px; font-size: 15px;
  letter-spacing: 1px;
}

.results-category-breakdown {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 24px;
  margin-bottom: 18px;
}
.cat-row {
  display: grid; grid-template-columns: 160px 1fr 60px;
  gap: 14px; align-items: center;
  padding: 10px 0;
}
.cat-row-name {
  font-weight: 600; font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.cat-row-bar {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px; overflow: hidden;
}
.cat-row-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  transition: width 0.6s ease;
}
.cat-row-pct {
  text-align: right; font-weight: 800;
  color: #a5b4fc;
  font-variant-numeric: tabular-nums;
}

.results-wrong-list {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; padding: 24px;
  margin-bottom: 18px;
  color: rgba(255,255,255,0.85);
}
.results-wrong-title {
  margin: 0 0 12px; font-size: 13px;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.results-wrong-ul {
  margin: 0; padding-left: 20px;
  color: rgba(255,255,255,0.7);
}

.results-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* ---------- Intro carousel ---------- */
#screen-intro { max-width: 600px; margin: 0 auto; padding-top: 60px; }
.intro-slide {
  background: rgba(30,41,59,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
}
.intro-slide h2 {
  font-size: 30px; font-weight: 800; margin: 0 0 16px;
  background: linear-gradient(135deg, #93c5fd, #a78bfa, #c4b5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.intro-slide p {
  font-size: 16px; line-height: 1.6;
  color: rgba(255,255,255,0.7);
  margin: 0 0 28px;
}
.intro-slide-dots {
  display: flex; justify-content: center; gap: 8px; margin: 24px 0;
}
.intro-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.2s;
}
.intro-dot.active {
  background: #818cf8;
  width: 24px; border-radius: 4px;
}

/* ---------- Kiosk welcome ---------- */
#screen-kiosk {
  max-width: 600px; margin: 0 auto; padding-top: 60px; text-align: center;
}
.kiosk-logo {
  width: 96px; height: 96px; margin: 0 auto 20px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px rgba(99,102,241,0.4);
  font-size: 48px; font-weight: 800; color: #fff;
}
.kiosk-title {
  font-size: 36px; font-weight: 800; margin: 12px 0 8px;
  letter-spacing: 1px; color: #fff;
}
.kiosk-subtitle {
  color: rgba(255,255,255,0.4);
  margin: 0 0 32px;
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
}
.kiosk-start { padding: 16px 48px; font-size: 16px; }

/* ---------- Error ---------- */
.math-error {
  padding: 24px;
  background: rgba(239,68,68,0.12);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  color: #fca5a5;
}

/* ---------- KaTeX adjustments for dark theme ---------- */
.quiz-text .katex, .explanation-step .katex, .option-text .katex { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .quiz-options { grid-template-columns: 1fr; }
  .cat-row { grid-template-columns: 100px 1fr 50px; }
  #app { padding: 16px 12px; }
}

/* Audio-synced explanation steps */
.anim-step {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255,255,255,0.92);
}
.anim-step.anim-step-hidden { display: none; }
.anim-step.anim-step-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.anim-step.anim-step-given {
  background: rgba(59,130,246,0.12);
  border-left: 3px solid #60a5fa;
}
.anim-step.anim-step-formula {
  background: rgba(99,102,241,0.10);
  border-left: 3px solid #818cf8;
  font-size: 18px;
}
.anim-step.anim-step-result {
  background: rgba(34,197,94,0.14);
  border-left: 3px solid #4ade80;
  font-size: 20px;
  font-weight: 700;
}
.anim-step.anim-step-note {
  background: rgba(245,158,11,0.12);
  border-left: 3px solid #fbbf24;
  font-style: italic;
}
.anim-step .katex { color: inherit; }

/* Audio controls */
.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(15,15,26,0.6);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  margin-top: 16px;
}
.audio-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(99,102,241,0.12);
  color: #c7d2fe;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.audio-btn:hover { background: rgba(99,102,241,0.25); border-color: rgba(99,102,241,0.4); }
.audio-progress {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.audio-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  transition: width 0.1s linear;
}
.audio-time {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  font-variant-numeric: tabular-nums;
  min-width: 60px;
  text-align: right;
}

.lang-toggle {
  display: inline-flex;
  background: rgba(15,15,26,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  margin: 0 8px;
}
.lang-btn {
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.lang-btn:hover { color: rgba(255,255,255,0.8); }
.lang-btn.active {
  background: rgba(99,102,241,0.25);
  color: #c7d2fe;
}

.scene-canvas-wrap {
  margin-bottom: 18px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f0f1a;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.scene-canvas {
  display: block;
  width: 100%;
  height: 320px;
}
@media (max-width: 640px) {
  .scene-canvas { height: 260px; }
}
@media (max-width: 420px) {
  .scene-canvas { height: 220px; }
}

/* formula-strip and anim-step classes removed — all formula rendering now
   lives inside the canvas scene-renderer for audio-synced explanations */

/* ========================================================================= */
/* Progress bar — tri-segment (correct / wrong / unanswered)                   */
/* ========================================================================= */
.progress-triseg {
  display: flex; height: 10px; border-radius: 3px; overflow: hidden;
  background: linear-gradient(to bottom, rgba(0,0,0,0.38), rgba(0,0,0,0.14));
  flex-shrink: 0; font-size: 0; line-height: 0;
  position: relative;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.45),
    inset 0 -1px 0 rgba(255,255,255,0.04),
    inset 0 0 0 1px rgba(255,255,255,0.03);
}
.progress-triseg::before {
  /* 25/50/75% calibration tick marks */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right,
      transparent calc(25% - 0.5px),
      rgba(255,255,255,0.14) calc(25% - 0.5px),
      rgba(255,255,255,0.14) calc(25% + 0.5px),
      transparent calc(25% + 0.5px)),
    linear-gradient(to right,
      transparent calc(50% - 0.5px),
      rgba(255,255,255,0.22) calc(50% - 0.5px),
      rgba(255,255,255,0.22) calc(50% + 0.5px),
      transparent calc(50% + 0.5px)),
    linear-gradient(to right,
      transparent calc(75% - 0.5px),
      rgba(255,255,255,0.14) calc(75% - 0.5px),
      rgba(255,255,255,0.14) calc(75% + 0.5px),
      transparent calc(75% + 0.5px));
  z-index: 0;
}
.progress-triseg.progress-triseg-lg { width: 150px; height: 10px; border-radius: 3px; }
.progress-triseg.progress-triseg-sm {
  width: 110px; height: 6px;
  border-radius: 2px;
}
.progress-triseg.progress-triseg-sm::before { display: none; }
.progress-triseg.empty { opacity: 0.35; }
.progress-triseg > * { font-size: 0 !important; line-height: 0 !important; position: relative; z-index: 1; }

.progress-triseg > .p-correct {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.16) 0 3px,
      transparent 3px 7px),
    linear-gradient(to bottom, #4ade80 0%, #22c55e 55%, #15803d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 0 6px rgba(34,197,94,0.55);
}
.progress-triseg > .p-wrong {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.14) 0 3px,
      transparent 3px 7px),
    linear-gradient(to bottom, #f87171 0%, #ef4444 55%, #b91c1c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 0 6px rgba(239,68,68,0.45);
}
.progress-triseg > .p-unansw { background: transparent; }

/* Small variant: no hatching/ticks/track for sm (inline compact strips) */
.progress-triseg.progress-triseg-sm > .p-correct {
  background: linear-gradient(to bottom, #4ade80, #22c55e 60%, #16a34a);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 0 4px rgba(34,197,94,0.5);
}
.progress-triseg.progress-triseg-sm > .p-wrong {
  background: linear-gradient(to bottom, #f87171, #ef4444 60%, #dc2626);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    0 0 4px rgba(239,68,68,0.4);
}

/* Mod kartı sağ slotu */
.kiosk-btn .kb-progress {
  display: flex; align-items: center;
  padding: 0 14px;
}

/* Grup header sağ slotu */
.category-group-header .group-progress {
  margin-left: 10px;
}

/* Alt kategori satırı sağ slotu */
.category-sub-item .sub-progress {
  margin-left: 10px;
  width: 110px; flex-shrink: 0;
  display: flex; align-items: center;
}
.category-sub-item .sub-progress.empty-slot { visibility: hidden; }

/* Header "İLERLEME" sütunu hizası (category-table-header zaten flexbox) */
.category-table-header span:last-child {
  min-width: 110px;
  text-align: right;
  padding-right: 2px;
}

/* ========================================================================= */
/* Mode pill (popup header)                                                   */
/* ========================================================================= */
.mode-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 4px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.8px;
  margin-right: 8px;
}
.mode-pill .dot { width: 5px; height: 5px; border-radius: 1px; }
.mode-pill.mode-pill-study {
  background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #22c55e;
}
.mode-pill.mode-pill-study .dot { background: #22c55e; }
.mode-pill.mode-pill-exam {
  background: rgba(249,115,22,0.12); border: 1px solid rgba(249,115,22,0.3); color: #f97316;
}
.mode-pill.mode-pill-exam .dot { background: #f97316; }

/* ========================================================================= */
/* Popup option group (zorluk, süre)                                          */
/* ========================================================================= */
.popup-opt-grp { display: flex; gap: 5px; margin-bottom: 10px; }
.popup-opt {
  flex: 1; padding: 7px 6px; border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  text-align: center;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  color: #94a3b8; cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.popup-opt:hover { border-color: rgba(255,255,255,0.2); color: #cbd5e1; }
.popup-opt:focus { outline: none; }
/* Lighter blue-400 + larger offset so the focus ring stays visible on
   the `.on` (blue-500 bg) state. Keyboard-only users need contrast. */
.popup-opt:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.popup-opt.on { background: #3b82f6; border-color: #3b82f6; color: #fff; }

/* ========================================================================= */
/* Popup toggle row (yanlışta hemen göster)                                   */
/* ========================================================================= */
.popup-toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; background: rgba(255,255,255,0.02);
  border-radius: 5px; margin-bottom: 10px;
}
.popup-toggle-row .lbl { font-size: 10px; font-weight: 600; color: #cbd5e1; }
.popup-toggle-row .sub-lbl { font-size: 8px; color: #64748b; margin-top: 2px; }

.popup-toggle {
  width: 32px; height: 18px; background: rgba(255,255,255,0.1);
  border-radius: 10px; position: relative; flex-shrink: 0; cursor: pointer;
  transition: background 0.15s;
}
.popup-toggle:focus { outline: none; }
.popup-toggle:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.popup-toggle.on { background: #22c55e; }
.popup-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: left 0.15s;
}
.popup-toggle.on::after { left: 16px; }

/* popup-section-label zaten var; küçük bir margin düzeltmesi: */
.quiz-popup-body .popup-section-label { margin-top: 12px; }
.quiz-popup-body .popup-section-label:first-child { margin-top: 0; }

/* ---------- Kiosk language toggle (TR / EN) ---------- */
.kiosk-lang-toggle {
  display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.kiosk-lang-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.kiosk-lang-btn:hover { color: rgba(255, 255, 255, 0.85); }
.kiosk-lang-btn.active {
  background: rgba(99, 102, 241, 0.22);
  color: #c7d2fe;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.35);
}

/* ---------- Kiosk info cards (Total Questions / Categories / Variants / Language) ---------- */
.kiosk-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.kiosk-info-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
  position: relative; overflow: hidden;
  min-width: 0;
}
.kiosk-info-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--info-accent, #6366f1);
  opacity: 0.8;
}
.kiosk-info-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}
.kiosk-info-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--info-accent, #6366f1) 14%, transparent);
  color: var(--info-accent, #6366f1);
}
.kiosk-info-icon svg { width: 18px; height: 18px; }
.kiosk-info-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kiosk-info-value {
  font-size: 16px; font-weight: 800;
  color: #f1f5f9;
  letter-spacing: 0.3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kiosk-info-label {
  font-size: 9.5px; font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .kiosk-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .kiosk-info-card { padding: 10px 12px; gap: 10px; }
  .kiosk-info-icon { width: 30px; height: 30px; }
  .kiosk-info-icon svg { width: 16px; height: 16px; }
  .kiosk-info-value { font-size: 15px; }
}
