/* ============================================================================
   LOGIDIAS INTERACTIVE LESSONS CORE — MUSEUM-GRADE VISUAL & PEDAGOGICAL ENGINE
   Inspired by tactile 3D pop-up books, field journals & Ligne Claire stages
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,600;1,6..72,500&display=swap');

:root {
  --ll-bg: #070b14;
  --ll-surface: #0f172a;
  --ll-surface-2: #162036;
  --ll-border: rgba(148, 163, 184, 0.18);
  --ll-text: #f1f5f9;
  --ll-muted: #94a3b8;
  --ll-accent: #38bdf8;
  --ll-accent-2: #818cf8;
  --ll-accent-soft: rgba(56, 189, 248, 0.14);
  --ll-warn: #f59e0b;
  --ll-ok: #10b981;
  --ll-bad: #ef4444;
  --ll-font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ll-font-display: 'Space Grotesk', system-ui, sans-serif;
  --ll-font-serif: 'Newsreader', Georgia, serif;
  --ll-font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ll-nav-h: 44px;
  --ll-pill-bg: rgba(15, 23, 42, 0.88);
  --ll-pill-border: rgba(255, 255, 255, 0.14);
  --ll-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* Theme: Warm Paper / Every Joule Book Aesthetic */
[data-theme="warm-paper"] {
  --ll-bg: #e7ebe4;
  --ll-surface: #faf7f0;
  --ll-surface-2: #f1ece0;
  --ll-border: rgba(92, 77, 56, 0.18);
  --ll-text: #1f2421;
  --ll-muted: #5c635e;
  --ll-accent: #c2410c;
  --ll-accent-2: #0f766e;
  --ll-accent-soft: rgba(194, 65, 12, 0.10);
  --ll-pill-bg: rgba(250, 247, 240, 0.94);
  --ll-pill-border: rgba(92, 77, 56, 0.22);
  --ll-shadow: 0 18px 42px rgba(45, 38, 25, 0.18);
}

/* Theme: Ligne Claire / Bright SVG Mathematics */
[data-theme="ligne-claire"] {
  --ll-bg: #f4f1ea;
  --ll-surface: #ffffff;
  --ll-surface-2: #f8f5ee;
  --ll-border: rgba(30, 41, 59, 0.14);
  --ll-text: #0f172a;
  --ll-muted: #475569;
  --ll-accent: #2563eb;
  --ll-accent-2: #e11d48;
  --ll-accent-soft: rgba(37, 99, 235, 0.10);
  --ll-pill-bg: rgba(255, 255, 255, 0.94);
  --ll-pill-border: rgba(15, 23, 42, 0.14);
  --ll-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

/* Theme: Mission HUD / Aerospace & Driving */
[data-theme="mission-hud"] {
  --ll-bg: #080b10;
  --ll-surface: #11161f;
  --ll-surface-2: #19212e;
  --ll-border: rgba(249, 115, 22, 0.22);
  --ll-text: #f8fafc;
  --ll-muted: #94a3b8;
  --ll-accent: #f97316;
  --ll-accent-2: #38bdf8;
  --ll-accent-soft: rgba(249, 115, 22, 0.15);
  --ll-pill-bg: rgba(17, 22, 31, 0.92);
  --ll-pill-border: rgba(249, 115, 22, 0.30);
}

/* Theme: Brass Desk / Cryptography, Microchip, Climate */
[data-theme="brass-desk"] {
  --ll-bg: #13110e;
  --ll-surface: #1c1915;
  --ll-surface-2: #26221c;
  --ll-border: rgba(217, 169, 78, 0.24);
  --ll-text: #f5efe4;
  --ll-muted: #b5aa99;
  --ll-accent: #e0a63b;
  --ll-accent-2: #38bdf8;
  --ll-accent-soft: rgba(224, 166, 59, 0.15);
  --ll-pill-bg: rgba(28, 25, 21, 0.92);
  --ll-pill-border: rgba(224, 166, 59, 0.32);
}

/* Theme: Lab Clinical / Neural & Fluid Tank */
[data-theme="lab-clinical"] {
  --ll-bg: #06101a;
  --ll-surface: #0c1b2a;
  --ll-surface-2: #13273b;
  --ll-border: rgba(45, 212, 191, 0.22);
  --ll-text: #ecfeff;
  --ll-muted: #8fb3c9;
  --ll-accent: #2dd4bf;
  --ll-accent-2: #f97316;
  --ll-accent-soft: rgba(45, 212, 191, 0.14);
  --ll-pill-bg: rgba(12, 27, 42, 0.92);
  --ll-pill-border: rgba(45, 212, 191, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--ll-bg);
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Main App Shell below 44px logi_nav bar */
.ll-app {
  position: fixed;
  top: var(--ll-nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(330px, 415px);
  background: var(--ll-bg);
  transition: grid-template-columns 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ll-app.stage-expanded {
  grid-template-columns: 1fr 0px;
}
.ll-app.stage-expanded .ll-rail {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border-left: none;
}

/* Left Interactive Stage */
.ll-stage-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ll-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

#ll-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#ll-stage canvas,
#ll-stage svg.ll-svg-stage {
  display: block;
  width: 100%;
  height: 100%;
}

/* Floating Stage Top Overlay (Title + Syllabus + Stamp counter) */
.ll-stage-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
  z-index: 20;
  flex-wrap: wrap;
}

.ll-stage-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 700;
  color: var(--ll-text);
}

.ll-stage-badge .ll-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ll-accent);
  box-shadow: 0 0 10px var(--ll-accent);
}

.ll-stage-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.ll-syllabus-select {
  appearance: none;
  padding: 6px 28px 6px 12px;
  border-radius: 999px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  background-image: linear-gradient(45deg, transparent 50%, var(--ll-muted) 50%), linear-gradient(135deg, var(--ll-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.ll-stamps-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  font-family: var(--ll-font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-accent);
  backdrop-filter: blur(12px);
}

/* Floating Stage Live Telemetry HUD (bottom-left above pill) */
.ll-stage-hud {
  position: absolute;
  left: 16px;
  bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 20;
  pointer-events: none;
  max-width: calc(100% - 32px);
}

.ll-hud-chip {
  pointer-events: auto;
  padding: 6px 11px;
  border-radius: 12px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 82px;
}
.ll-hud-chip-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ll-muted);
}
.ll-hud-chip-val {
  font-family: var(--ll-font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ll-accent);
}

/* Tactile Affordance Cue */
.ll-cue-banner {
  position: absolute;
  top: 56px;
  left: 16px;
  z-index: 19;
  padding: 5px 11px;
  border-radius: 10px;
  background: var(--ll-accent-soft);
  border: 1px solid var(--ll-accent);
  color: var(--ll-text);
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

/* 3D-Projected Crisp HTML Callout Pins (iamtechartist signature) */
.ll-callout-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 15;
}
.ll-callout-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  will-change: transform, left, top;
  transition: opacity 0.2s ease;
}
.ll-callout-tag {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  backdrop-filter: blur(10px);
  font-family: var(--ll-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ll-text);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
.ll-callout-stem {
  width: 1px;
  height: 14px;
  background: var(--ll-accent);
  opacity: 0.72;
}
.ll-callout-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ll-accent);
  box-shadow: 0 0 8px var(--ll-accent);
}

/* Cinema Studio Vignette + On-Stage Live Interactive Control Pod (v5) */
.ll-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  background: radial-gradient(ellipse at 50% 45%, transparent 56%, rgba(0, 0, 0, 0.28) 100%);
}
body.ll-theme-warm .ll-stage::after,
body.ll-theme-paper .ll-stage::after {
  background: radial-gradient(ellipse at 50% 45%, transparent 62%, rgba(92, 72, 48, 0.14) 100%);
}
.ll-stage-quick-ctrl {
  position: absolute;
  right: 16px;
  bottom: 72px;
  z-index: 22;
  width: min(260px, calc(50% - 24px));
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ll-stage-quick-ctrl:empty { display: none; }
.ll-stage-quick-ctrl .ll-control-row { gap: 4px; }
.ll-stage-quick-ctrl .ll-control-label { font-size: 10.5px; }
.ll-stage-quick-ctrl .ll-btn-row { gap: 5px; }
.ll-stage-quick-ctrl .ll-action-btn { padding: 5px 8px; font-size: 11px; }
@media (max-width: 820px) {
  .ll-stage-quick-ctrl { display: none; }
}

/* Bottom Floating Glass Pill (Every Joule / Rotational Motion signature) */
.ll-bottom-pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--ll-pill-bg);
  border: 1px solid var(--ll-pill-border);
  backdrop-filter: blur(16px);
  box-shadow: var(--ll-shadow);
  max-width: calc(100% - 24px);
}

.ll-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  min-width: 32px;
  padding: 0 9px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.ll-pill-btn:hover {
  background: var(--ll-accent-soft);
  color: var(--ll-accent);
}
.ll-pill-btn:active { transform: scale(0.95); }
.ll-pill-btn.active {
  background: var(--ll-accent);
  color: #0b1120;
}

.ll-pill-divider {
  width: 1px;
  height: 18px;
  background: var(--ll-border);
  margin: 0 2px;
}

.ll-pill-title {
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ll-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  cursor: pointer;
}

/* Right Pedagogical Rail */
.ll-rail {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--ll-surface);
  border-left: 1px solid var(--ll-border);
  overflow: hidden;
  transition: opacity 0.25s ease;
}

.ll-rail-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--ll-border);
  flex-shrink: 0;
}

.ll-unit-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ll-unit-num {
  font-family: var(--ll-font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ll-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ll-course-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ll-course-tag.on-course {
  background: rgba(16, 185, 129, 0.16);
  color: var(--ll-ok);
  border: 1px solid rgba(16, 185, 129, 0.35);
}
.ll-course-tag.beyond {
  background: rgba(148, 163, 184, 0.14);
  color: var(--ll-muted);
  border: 1px solid var(--ll-border);
}

.ll-unit-title {
  margin: 0;
  font-family: var(--ll-font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ll-text);
}

/* Learn | Try | Check Tabs */
.ll-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 20px;
  background: var(--ll-surface-2);
  border-bottom: 1px solid var(--ll-border);
  flex-shrink: 0;
}

.ll-tab {
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ll-muted);
  font-family: var(--ll-font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ll-tab:hover {
  color: var(--ll-text);
  background: rgba(128, 128, 128, 0.08);
}
.ll-tab.active {
  background: var(--ll-accent);
  color: #0b1120;
  box-shadow: 0 4px 14px var(--ll-accent-soft);
}
[data-theme="warm-paper"] .ll-tab.active,
[data-theme="ligne-claire"] .ll-tab.active {
  color: #ffffff;
}

/* Rail Body Scrollable */
.ll-rail-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ll-rail-body::-webkit-scrollbar { width: 6px; }
.ll-rail-body::-webkit-scrollbar-thumb {
  background: var(--ll-border);
  border-radius: 99px;
}

.ll-story {
  font-size: 14px;
  line-height: 1.62;
  color: var(--ll-text);
  margin: 0;
}
[data-theme="warm-paper"] .ll-story {
  font-family: var(--ll-font-serif);
  font-size: 15.5px;
}

/* Cards inside rail */
.ll-card {
  background: var(--ll-surface-2);
  border: 1px solid var(--ll-border);
  border-radius: 14px;
  padding: 13px 15px;
}

.ll-card-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ll-accent);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Predict & Lift-the-Flap WHY? */
.ll-predict-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.ll-predict-btn {
  text-align: left;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--ll-border);
  background: var(--ll-surface);
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ll-predict-btn:hover {
  border-color: var(--ll-accent);
}
.ll-predict-btn.selected {
  border-color: var(--ll-accent);
  background: var(--ll-accent-soft);
}

.ll-flap-btn {
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px dashed var(--ll-accent);
  background: var(--ll-accent-soft);
  color: var(--ll-text);
  font-family: var(--ll-font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.ll-flap-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}
.ll-flap-content {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ll-surface);
  border-left: 3px solid var(--ll-accent);
  font-size: 13px;
  line-height: 1.55;
  animation: llFadeIn 0.25s ease;
}

/* Live Why Right Now & Maths */
.ll-math-box {
  font-family: var(--ll-font-mono);
  font-size: 12.5px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--ll-border);
  color: var(--ll-accent);
  margin-top: 6px;
  line-height: 1.5;
}
[data-theme="warm-paper"] .ll-math-box,
[data-theme="ligne-claire"] .ll-math-box {
  background: rgba(15, 23, 42, 0.05);
}

/* Try Controls */
.ll-control-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.ll-slider-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ll-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
.ll-slider-val {
  font-family: var(--ll-font-mono);
  color: var(--ll-accent);
}
.ll-slider {
  width: 100%;
  accent-color: var(--ll-accent);
  cursor: pointer;
}

.ll-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ll-action-btn {
  flex: 1;
  min-width: 90px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--ll-border);
  background: var(--ll-surface);
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ll-action-btn:hover {
  border-color: var(--ll-accent);
  color: var(--ll-accent);
}
.ll-action-btn.primary {
  background: var(--ll-accent);
  color: #0b1120;
  border-color: var(--ll-accent);
}
[data-theme="warm-paper"] .ll-action-btn.primary,
[data-theme="ligne-claire"] .ll-action-btn.primary {
  color: #ffffff;
}
.ll-action-btn.active {
  background: var(--ll-accent-soft);
  border-color: var(--ll-accent);
  color: var(--ll-accent);
}

/* Try Mission Checklist */
.ll-checklist {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ll-check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--ll-surface);
  border: 1px solid var(--ll-border);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ll-check-item.done {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}
.ll-check-box {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1.5px solid var(--ll-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 900;
  margin-top: 1px;
}
.ll-check-item.done .ll-check-box {
  background: var(--ll-ok);
  border-color: var(--ll-ok);
  color: #ffffff;
}

/* Check Quiz */
.ll-q-card {
  background: var(--ll-surface-2);
  border: 1px solid var(--ll-border);
  border-radius: 14px;
  padding: 13px 15px;
}
.ll-q-text {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0 0 9px;
  line-height: 1.4;
}
.ll-q-opt {
  width: 100%;
  text-align: left;
  padding: 8px 11px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid var(--ll-border);
  background: var(--ll-surface);
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ll-q-opt:hover:not(:disabled) { border-color: var(--ll-accent); }
.ll-q-opt.correct {
  border-color: var(--ll-ok);
  background: rgba(16, 185, 129, 0.16);
}
.ll-q-opt.wrong {
  border-color: var(--ll-bad);
  background: rgba(239, 68, 68, 0.14);
}
.ll-q-fb {
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--ll-surface);
  color: var(--ll-muted);
}

/* Stamp Celebration */
.ll-stamp-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid var(--ll-ok);
  background: rgba(16, 185, 129, 0.12);
  animation: llStampPop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}

/* Preloader / Audio Consent Splash */
.ll-splash {
  position: fixed;
  top: var(--ll-nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  background: var(--ll-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.ll-splash.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ll-splash-card {
  max-width: 540px;
  width: 100%;
  background: var(--ll-surface);
  border: 1px solid var(--ll-border);
  border-radius: 26px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--ll-shadow);
}

.ll-splash-eqs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.ll-splash-eq {
  font-family: var(--ll-font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ll-accent-soft);
  color: var(--ll-accent);
  border: 1px solid var(--ll-border);
}

.ll-splash-icon {
  font-size: 46px;
  margin-bottom: 10px;
  line-height: 1;
}
.ll-splash-title {
  font-family: var(--ll-font-display);
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
}
.ll-splash-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ll-muted);
  margin: 0 0 22px;
}

.ll-splash-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.ll-splash-btn {
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--ll-font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--ll-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ll-splash-btn:hover { transform: translateY(-1px); }
.ll-splash-btn.primary {
  background: var(--ll-accent);
  color: #0b1120;
  border-color: var(--ll-accent);
  box-shadow: 0 8px 24px var(--ll-accent-soft);
}
[data-theme="warm-paper"] .ll-splash-btn.primary,
[data-theme="ligne-claire"] .ll-splash-btn.primary {
  color: #ffffff;
}
.ll-splash-btn.secondary {
  background: var(--ll-surface-2);
  color: var(--ll-text);
}

/* Modal (Contents & Teacher Guide) */
.ll-modal-backdrop {
  position: fixed;
  top: var(--ll-nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 800;
  background: rgba(2, 6, 23, 0.65);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ll-modal-backdrop.open { display: flex; }

.ll-modal {
  width: 100%;
  max-width: 680px;
  max-height: 82vh;
  background: var(--ll-surface);
  border: 1px solid var(--ll-border);
  border-radius: 22px;
  box-shadow: var(--ll-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ll-modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ll-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ll-modal-head h3 {
  margin: 0;
  font-family: var(--ll-font-display);
  font-size: 18px;
}
.ll-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.ll-toc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ll-surface-2);
  border: 1px solid var(--ll-border);
  cursor: pointer;
  text-align: left;
  color: var(--ll-text);
  font-family: var(--ll-font-ui);
  transition: border-color 0.15s ease, transform 0.12s ease;
}
.ll-toc-row:hover {
  border-color: var(--ll-accent);
  transform: translateX(2px);
}
.ll-toc-row.current {
  border-color: var(--ll-accent);
  background: var(--ll-accent-soft);
}

@keyframes llFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes llStampPop {
  0% { transform: scale(0.86); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 960px) {
  .ll-app {
    grid-template-columns: 1fr;
    grid-template-rows: 48% 52%;
  }
  .ll-app.stage-expanded {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 0px;
  }
  .ll-rail {
    border-left: none;
    border-top: 1px solid var(--ll-border);
  }
  .ll-pill-title { max-width: 130px; }
  .ll-stage-hud { bottom: 64px; }
}
