/* ===== ai-exhibits-shared.css ===== */
/* =============================================================================
   AI-EXHIBITS: SHARED STYLESHEET
   Reinforcement Learning Educational Materials
   by Dr. Erika Roldán Roa · MPI MiS · 2026
   ============================================================================= */

/* === ROOT VARIABLES === */
:root {
  /* Color palette (neon cyberpunk theme) */
  --bg0: #07060a;
  --bg1: #0b0714;
  --panel: rgba(255, 255, 255, 0.06);
  --stroke: rgba(255, 255, 255, 0.14);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.70);
  --muted2: rgba(255, 255, 255, 0.52);
  
  /* Accent colors */
  --pink: #ff3bd4;
  --cyan: #2ff3ff;
  --lime: #70ff7a;
  --danger: #ff4d6d;
  --amber: #ffd24a;
  --purple: #b278ff;
  
  /* Layout */
  --radius: 18px;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
  
  /* Typography */
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

  /* === DESIGN TOKENS === */
  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  /* Border Radius Scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 999px;

  /* Typography Scale */
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;

  /* Shadows */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.55);

  /* Glow Effects */
  --glow-pink-sm: 0 0 12px rgba(255, 59, 212, 0.25);
  --glow-pink-md: 0 0 24px rgba(255, 59, 212, 0.35);
  --glow-pink-lg: 0 0 40px rgba(255, 59, 212, 0.45);
  --glow-cyan-sm: 0 0 12px rgba(47, 243, 255, 0.25);
  --glow-cyan-md: 0 0 24px rgba(47, 243, 255, 0.35);
  --glow-lime-sm: 0 0 12px rgba(112, 255, 122, 0.25);
  --glow-lime-md: 0 0 24px rgba(112, 255, 122, 0.35);
  --glow-purple-sm: 0 0 12px rgba(178, 120, 255, 0.25);
  --glow-purple-md: 0 0 24px rgba(178, 120, 255, 0.35);

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 500;
  --z-overlay: 1000;
  --z-modal: 10000;
  --z-tooltip: 50000;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 0.12s;
  --duration-normal: 0.2s;
  --duration-slow: 0.35s;
}

/* === RESET & BASE === */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px; /* Base size increased from 14px for better readability */
  min-height: 100vh;
  background:
    radial-gradient(1200px 720px at 18% 12%, rgba(255, 59, 212, 0.20), transparent 55%),
    radial-gradient(900px 540px at 82% 18%, rgba(47, 243, 255, 0.14), transparent 60%),
    radial-gradient(850px 600px at 55% 95%, rgba(112, 255, 122, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

/* === LAYOUT CONTAINERS === */
.wrap {
  width: min(1200px, calc(100vw - 36px));
  margin: 68px auto 56px;
}

.panel {
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 950;
  letter-spacing: 0.3px;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 17px;
}

p {
  margin: 0;
  line-height: 1.45;
}

.mono {
  font-family: var(--mono);
}

.small {
  color: var(--muted2);
  font-size: 14px;
  line-height: 1.45;
}

.muted {
  color: var(--muted);
}

.muted2 {
  color: var(--muted2);
}

/* === BUTTONS === */
button,
a.btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 12px 16px; /* Increased for better touch targets */
  min-height: 44px; /* WCAG minimum touch target */
  border-radius: 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 950;
  font-size: 15px;
  letter-spacing: 0.2px;
  user-select: none;
  transition: transform 0.06s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

button:hover,
a.btn:hover,
.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.22);
}

button:active,
a.btn:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Button variants */
.btn.pink,
button.pink,
.btn.primary,
button.primary {
  border-color: rgba(255, 59, 212, 0.42);
  box-shadow: 0 0 0 4px rgba(255, 59, 212, 0.11);
}

.btn.pink:hover,
button.pink:hover,
.btn.primary:hover,
button.primary:hover {
  border-color: rgba(255, 59, 212, 0.70);
  box-shadow: 0 0 0 4px rgba(255, 59, 212, 0.18);
}

.btn.cyan,
button.cyan {
  border-color: rgba(47, 243, 255, 0.40);
  box-shadow: 0 0 0 4px rgba(47, 243, 255, 0.10);
}

.btn.cyan:hover,
button.cyan:hover {
  border-color: rgba(47, 243, 255, 0.70);
  box-shadow: 0 0 0 4px rgba(47, 243, 255, 0.18);
}

.btn.lime,
button.lime {
  border-color: rgba(112, 255, 122, 0.42);
  box-shadow: 0 0 0 4px rgba(112, 255, 122, 0.10);
}

.btn.lime:hover,
button.lime:hover {
  border-color: rgba(112, 255, 122, 0.70);
  box-shadow: 0 0 0 4px rgba(112, 255, 122, 0.18);
}

.btn.danger,
button.danger {
  border-color: rgba(255, 77, 109, 0.46);
  box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.10);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.24);
}

/* Benchmark button style (purple neon) */
.btn.bench,
button.bench {
  padding: 9px 12px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(178, 120, 255, 0.55);
  background: rgba(178, 120, 255, 0.10);
  color: rgba(235, 215, 255, 0.95);
  box-shadow:
    0 0 10px rgba(178, 120, 255, 0.28),
    inset 0 0 10px rgba(178, 120, 255, 0.10);
}

.btn.bench:hover,
button.bench:hover {
  border-color: rgba(178, 120, 255, 0.85);
  box-shadow:
    0 0 14px rgba(178, 120, 255, 0.38),
    inset 0 0 12px rgba(178, 120, 255, 0.14);
}

/* Button rows */
.btnRow,
.btnrow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* === CARDS === */
.card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.20);
  border-radius: 18px;
  padding: 14px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* === ROLE SYSTEM === */
.roleHud {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9998;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

.rolePill {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.switchRole {
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.86);
  border-bottom: 1px dotted rgba(255, 255, 255, 0.35);
  transition: opacity 0.12s ease, color 0.12s ease;
}

.switchRole:hover {
  opacity: 1;
  color: var(--pink);
  border-bottom-color: rgba(255, 47, 214, 0.7);
}

/* Facilitator-only content */
.facOnly {
  display: none;
}

body[data-role="facilitator"] .facOnly {
  display: block;
}

/* === MODAL / GATE === */
.modalOverlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 10000);
  background: rgba(7, 6, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl, 24px);
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport for mobile */
  opacity: 1;
  transition: opacity var(--duration-normal, 0.2s) var(--ease-out);
  overflow-y: auto;
}

.modalOverlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modalCard {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  margin: auto;
  border: 2px solid rgba(255, 59, 212, 0.35);
  background: linear-gradient(180deg, 
    rgba(18, 14, 28, 0.98) 0%, 
    rgba(7, 6, 10, 0.98) 100%
  );
  border-radius: var(--radius-2xl, 24px);
  padding: var(--space-2xl, 32px);
  box-shadow: 
    0 0 60px rgba(255, 59, 212, 0.15),
    0 32px 80px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow-y: auto;
}

/* Decorative top accent line */
.modalCard::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 32px;
  right: 32px;
  height: 3px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--pink), var(--cyan), var(--lime));
  opacity: 0.7;
  box-shadow: 0 0 20px rgba(255, 59, 212, 0.5);
}

.modalTop {
  text-align: center;
  margin-bottom: var(--space-xl, 24px);
  padding-top: var(--space-md, 12px);
}

.modalKicker {
  display: inline-block;
  font-size: var(--text-xs, 11px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 59, 212, 0.95);
  text-shadow: 0 0 20px rgba(255, 59, 212, 0.6);
  margin-bottom: var(--space-md, 12px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 59, 212, 0.3);
  background: rgba(255, 59, 212, 0.08);
}

.modalCard h2 {
  font-size: var(--text-2xl, 24px);
  font-weight: 900;
  margin: 0 0 var(--space-sm, 8px);
  letter-spacing: 0.3px;
}

.modalSub {
  color: var(--muted);
  font-size: var(--text-base, 15px);
  line-height: 1.55;
  max-width: 400px;
  margin: 0 auto;
}

.modalActions {
  margin-top: var(--space-xl, 24px);
}

.modalHint {
  text-align: center;
  font-size: var(--text-sm, 13px);
  color: var(--muted2);
  margin-bottom: var(--space-lg, 16px);
  padding: var(--space-md, 12px);
  border-radius: var(--radius-md, 12px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.modalBtns {
  display: flex;
  gap: var(--space-md, 12px);
  justify-content: center;
  flex-wrap: wrap;
}

.primaryBtn {
  padding: 14px 28px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 59, 212, 0.6);
  background: linear-gradient(135deg, 
    rgba(255, 59, 212, 0.2) 0%, 
    rgba(255, 59, 212, 0.1) 100%
  );
  color: rgba(255, 255, 255, 0.98);
  font-weight: 900;
  font-size: var(--text-base, 15px);
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 
    0 0 30px rgba(255, 59, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all var(--duration-fast) var(--ease-out);
  min-height: 48px;
}

.primaryBtn:hover {
  border-color: rgba(255, 59, 212, 0.9);
  background: linear-gradient(135deg, 
    rgba(255, 59, 212, 0.3) 0%, 
    rgba(255, 59, 212, 0.15) 100%
  );
  box-shadow: 
    0 0 40px rgba(255, 59, 212, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.primaryBtn:active {
  transform: translateY(0);
  transition-duration: 0.05s;
}

.roleBtn {
  padding: 12px 20px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-weight: 700;
  font-size: var(--text-sm, 13px);
  transition: all var(--duration-fast) var(--ease-out);
  min-height: 44px;
}

.roleBtn:hover {
  border-color: rgba(47, 243, 255, 0.55);
  background: rgba(47, 243, 255, 0.1);
  box-shadow: var(--glow-cyan-sm);
  transform: translateY(-1px);
}

.roleBtn.active {
  border-color: rgba(47, 243, 255, 0.8);
  background: rgba(47, 243, 255, 0.18);
  color: rgba(255, 255, 255, 0.98);
  box-shadow: var(--glow-cyan-md);
}

/* === TYPEWRITER EFFECT === */
.typeBox {
  width: 100%;
  box-sizing: border-box;
  white-space: pre-wrap;
  line-height: 1.35;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.10);
  min-height: 1.6em;
  font-family: var(--mono);
}

.typeBoxWide {
  width: 100%;
  box-sizing: border-box;
  min-height: 12.5em;
  max-width: none;
}

.typewriter {
  white-space: pre-wrap;
}

.cursor {
  display: inline-block;
  margin-left: 2px;
  opacity: 1;
  animation: cursorBlink 0.9s steps(1, end) infinite;
  text-shadow: 0 0 6px rgba(255, 79, 216, 0.45);
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

.cursor.hidden {
  display: none;
}

.missionGlow {
  color: rgba(255, 59, 212, 0.98);
  text-shadow: 0 0 12px rgba(255, 59, 212, 0.55);
}

.goalGlowText {
  color: #ff4fd8;
  text-shadow:
    0 0 6px rgba(255, 79, 216, 0.85),
    0 0 18px rgba(255, 79, 216, 0.55);
  font-weight: 700;
}

/* === FOOTER & AUTHORS === */
.footer {
  margin-top: 14px;
  text-align: center;
  color: var(--muted2);
  font-size: 12px;
}

#aiExhibitsAuthors {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 50;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 47, 214, 0.45);
  opacity: 0.95;
  white-space: nowrap;
}

/* === ACCESSIBILITY === */
/* Focus visible for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--pink);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* =============================================================================
   UNIFIED TOOLTIP SYSTEM
   Beautiful, consistent tooltips across the entire application
   ============================================================================= */

/* =============================================================================
   TOOLTIPS · managed by app/tooltips.js (floating element .rl-tip)
   The pseudo-element-based tooltips that used to be attached to every
   [data-tooltip] are suppressed here because they had viewport-overflow
   problems on edge-positioned triggers. The JS version measures + clamps.
   ============================================================================= */
[data-tooltip] {
  cursor: help;
}
[data-tooltip]::after,
[data-tooltip]::before { content: none !important; }

.rl-tip {
  position: absolute;
  z-index: 50000;
  top: -9999px;
  left: 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(7, 6, 10, 0.97);
  border: 1px solid rgba(255, 59, 212, 0.45);
  box-shadow:
    0 0 20px rgba(255, 59, 212, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.95);
  font: 500 13px/1.45 var(--sans, system-ui, sans-serif);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease-out;
}
.rl-tip.measuring { visibility: hidden; }
.rl-tip.on { opacity: 1; }
.rl-tip-body { display: block; }

.rl-tip-arrow {
  position: absolute;
  left: var(--rl-tip-arrow-x, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
}
.rl-tip[data-placement="top"] .rl-tip-arrow {
  top: 100%;
  border-top-color: rgba(255, 59, 212, 0.45);
}
.rl-tip[data-placement="bottom"] .rl-tip-arrow {
  bottom: 100%;
  border-bottom-color: rgba(255, 59, 212, 0.45);
}

/* Style variants — mirror the old [data-tooltip-style] values. */
.rl-tip[data-style="info"] { border-color: rgba(47, 243, 255, 0.45); box-shadow: 0 0 20px rgba(47,243,255,0.2), 0 8px 32px rgba(0,0,0,0.65); }
.rl-tip[data-style="info"][data-placement="top"] .rl-tip-arrow { border-top-color: rgba(47,243,255,0.45); }
.rl-tip[data-style="info"][data-placement="bottom"] .rl-tip-arrow { border-bottom-color: rgba(47,243,255,0.45); }

.rl-tip[data-style="success"] { border-color: rgba(112, 255, 122, 0.45); box-shadow: 0 0 20px rgba(112,255,122,0.2), 0 8px 32px rgba(0,0,0,0.65); }
.rl-tip[data-style="success"][data-placement="top"] .rl-tip-arrow { border-top-color: rgba(112,255,122,0.45); }
.rl-tip[data-style="success"][data-placement="bottom"] .rl-tip-arrow { border-bottom-color: rgba(112,255,122,0.45); }

.rl-tip[data-style="bench"] { border-color: rgba(178, 120, 255, 0.5); box-shadow: 0 0 20px rgba(178,120,255,0.25), 0 8px 32px rgba(0,0,0,0.65); }
.rl-tip[data-style="bench"][data-placement="top"] .rl-tip-arrow { border-top-color: rgba(178,120,255,0.5); }
.rl-tip[data-style="bench"][data-placement="bottom"] .rl-tip-arrow { border-bottom-color: rgba(178,120,255,0.5); }

.rl-tip[data-style="gods"] {
  background: linear-gradient(135deg, rgba(7,6,10,0.97), rgba(255,59,212,0.12));
  border-color: rgba(255, 59, 212, 0.7);
  box-shadow: 0 0 30px rgba(255,59,212,0.35), 0 8px 32px rgba(0,0,0,0.65);
}
.rl-tip[data-style="gods"][data-placement="top"] .rl-tip-arrow { border-top-color: rgba(255,59,212,0.7); }
.rl-tip[data-style="gods"][data-placement="bottom"] .rl-tip-arrow { border-bottom-color: rgba(255,59,212,0.7); }

/* Old pseudo-element block below is kept for reference but neutralised
   by `content: none !important` above. */
[data-tooltip] {
  position: relative;
}

/* Pseudo-element rules (now disabled via content:none) */
[data-tooltip]._old-after-disabled::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: var(--z-tooltip, 50000);
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);

  /* Appearance */
  padding: 10px 14px;
  border-radius: var(--radius-md, 12px);
  background: rgba(7, 6, 10, 0.97);
  border: 1px solid rgba(255, 59, 212, 0.45);
  box-shadow:
    0 0 20px rgba(255, 59, 212, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* Typography — allow wrapping so long labels don't overflow the viewport. */
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--sans);
  font-size: var(--text-sm, 13px);
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: min(320px, calc(100vw - 32px));
  width: max-content;

  /* Animation */
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--duration-fast, 0.12s) var(--ease-out),
    transform var(--duration-fast, 0.12s) var(--ease-out);
}

/* Tooltip arrow */
[data-tooltip]::before {
  content: "";
  position: absolute;
  z-index: var(--z-tooltip, 50000);
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  
  /* Arrow shape */
  border: 6px solid transparent;
  border-top-color: rgba(255, 59, 212, 0.45);
  
  /* Animation */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast, 0.12s) var(--ease-out);
}

/* Show on hover and focus */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus::after,
[data-tooltip]:focus::before {
  opacity: 1;
}

[data-tooltip]::after {
  transform: translateX(calc(-50% + var(--tt-shift, 0px))) translateY(4px);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus::after {
  transform: translateX(calc(-50% + var(--tt-shift, 0px))) translateY(0);
}

/* Bottom position variant */
[data-tooltip-pos="bottom"]::after {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translateX(calc(-50% + var(--tt-shift, 0px))) translateY(-4px);
}

[data-tooltip-pos="bottom"]::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: rgba(255, 59, 212, 0.45);
}

[data-tooltip-pos="bottom"]:hover::after,
[data-tooltip-pos="bottom"]:focus::after {
  transform: translateX(calc(-50% + var(--tt-shift, 0px))) translateY(0);
}

/* Left position variant */
[data-tooltip-pos="left"]::after {
  bottom: auto;
  left: auto;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
}

[data-tooltip-pos="left"]::before {
  bottom: auto;
  left: auto;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: rgba(255, 59, 212, 0.45);
}

[data-tooltip-pos="left"]:hover::after,
[data-tooltip-pos="left"]:focus::after {
  transform: translateY(-50%) translateX(0);
}

/* Right position variant */
[data-tooltip-pos="right"]::after {
  bottom: auto;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
}

[data-tooltip-pos="right"]::before {
  bottom: auto;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: rgba(255, 59, 212, 0.45);
}

[data-tooltip-pos="right"]:hover::after,
[data-tooltip-pos="right"]:focus::after {
  transform: translateY(-50%) translateX(0);
}

/* Multiline tooltip - wrap text */
[data-tooltip-wrap]::after {
  white-space: normal;
  max-width: 280px;
  text-align: left;
}

/* === TOOLTIP VARIANTS === */

/* Cyan variant (for info/help) */
[data-tooltip-style="info"]::after {
  border-color: rgba(47, 243, 255, 0.45);
  box-shadow: 
    0 0 20px rgba(47, 243, 255, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.65);
}
[data-tooltip-style="info"]::before {
  border-top-color: rgba(47, 243, 255, 0.45);
}

/* Lime variant (for success) */
[data-tooltip-style="success"]::after {
  border-color: rgba(112, 255, 122, 0.45);
  box-shadow: 
    0 0 20px rgba(112, 255, 122, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.65);
}
[data-tooltip-style="success"]::before {
  border-top-color: rgba(112, 255, 122, 0.45);
}

/* Purple variant (for benchmarks) */
[data-tooltip-style="bench"]::after {
  border-color: rgba(178, 120, 255, 0.5);
  box-shadow: 
    0 0 20px rgba(178, 120, 255, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.65);
}
[data-tooltip-style="bench"]::before {
  border-top-color: rgba(178, 120, 255, 0.5);
}

/* God's Number special highlight */
[data-tooltip-style="gods"]::after {
  background: linear-gradient(135deg, 
    rgba(7, 6, 10, 0.97), 
    rgba(255, 59, 212, 0.12)
  );
  border-color: rgba(255, 59, 212, 0.7);
  box-shadow: 
    0 0 30px rgba(255, 59, 212, 0.35),
    0 8px 32px rgba(0, 0, 0, 0.65);
}
[data-tooltip-style="gods"]::before {
  border-top-color: rgba(255, 59, 212, 0.7);
}

/* Disabled state - no tooltip */
[data-tooltip=""]:hover::after,
[data-tooltip=""]:hover::before {
  opacity: 0;
}

/* Touch device handling - show on tap */
@media (hover: none) and (pointer: coarse) {
  [data-tooltip]:focus::after,
  [data-tooltip]:focus::before {
    opacity: 1;
  }
  
  [data-tooltip]:focus::after {
    transform: translateX(-50%) translateY(0);
  }
}

/* Hide tooltips when element is in a scrolling container being scrolled */
.scrolling [data-tooltip]::after,
.scrolling [data-tooltip]::before {
  opacity: 0 !important;
}

/* === RESPONSIVE === */
@media (max-width: 980px) {
  body {
    font-size: 15px;
  }
  
  h1 {
    font-size: 22px;
  }
  
  h2 {
    font-size: 17px;
  }
  
  .wrap {
    width: calc(100vw - 24px);
    margin: 56px auto 40px;
  }
}

@media (max-width: 640px) {
  .roleHud {
    top: 8px;
    right: 8px;
    padding: 8px 10px;
    font-size: 12px;
  }

  #aiExhibitsAuthors {
    font-size: 10px;
    bottom: 8px;
    right: 8px;
  }
}

/* === AUTHOR CREDIT inside role gate (discreet, bottom of modal) === */
.gateAuthor {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 18px 16px;
}
.gateAuthor sup { font-size: 0.8em; }

/* === LANGUAGE PICKER inside role gate (first-visit choice) === */
.gateLangRow {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 14px 18px 4px;
}
.gateLangBtn {
  font: 700 12px/1 var(--sans);
  letter-spacing: 0.4px;
  color: rgba(255,255,255,0.85);
  background: rgba(7, 6, 10, 0.6);
  border: 1px solid rgba(47, 243, 255, 0.30);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.gateLangBtn:hover {
  border-color: rgba(47, 243, 255, 0.75);
  box-shadow: 0 0 12px rgba(47, 243, 255, 0.25);
}
.gateLangBtn.active {
  border-color: rgba(255, 59, 212, 0.85);
  background: rgba(255, 59, 212, 0.12);
  color: #fff;
  box-shadow: 0 0 14px rgba(255, 59, 212, 0.35);
}
/* While role gate is open, hide the bottom-left selector to avoid two choosers. */
body:has(#roleGate[aria-hidden="false"]) .langSelectorWrap { display: none; }

/* === LANGUAGE SELECTOR (i18n) ===
   Top-left, positioned well below page titles so they don't clash. */
.langSelectorWrap {
  position: fixed;
  top: 100px;
  left: 14px;
  z-index: 9997;
  pointer-events: auto;
}
.langSelector {
  font: 600 12px/1 var(--sans);
  color: var(--text);
  background: rgba(7, 6, 10, 0.88);
  border: 1px solid rgba(47, 243, 255, 0.35);
  border-radius: 999px;
  padding: 6px 26px 6px 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(47,243,255,0.7) 50%),
                    linear-gradient(135deg, rgba(47,243,255,0.7) 50%, transparent 50%);
  background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.langSelector:hover {
  border-color: rgba(47, 243, 255, 0.65);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 12px rgba(47, 243, 255, 0.18);
}
.langSelector:focus-visible {
  outline: 2px solid rgba(47, 243, 255, 0.8);
  outline-offset: 2px;
}
.langSelector option { background: #0b0714; color: var(--text); padding: 6px; }
@media (max-width: 640px) {
  .langSelectorWrap { top: 10px; left: 10px; }
}

/* ===== ai-exhibits-hub.css ===== */
/* =============================================================================
   AI-EXHIBITS: HUB/LOBBY STYLES
   Mission selection and briefing interface
   ============================================================================= */

/* === LOBBY LAYOUT === */
.lobby {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.puzzleGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

/* === MISSION CARDS === */
.pCard {
  background: linear-gradient(180deg, rgba(255, 59, 212, 0.08), rgba(47, 243, 255, 0.04));
  border: 1px solid rgba(255, 59, 212, 0.22);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.pCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

.pHead {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.pTitle {
  font-weight: 800;
  letter-spacing: 0.3px;
  text-align: center;
  width: 100%;
  margin-bottom: 8px;
  font-size: 16px;
}

.pSub {
  font-size: 13px;
  color: var(--muted);
}

/* === MINI PUZZLE WIDGET === */
.miniWrap {
  display: flex;
  justify-content: center;
  padding: 10px 0 8px;
  align-items: center;
  height: 260px;
}

.miniPuzzle {
  --cell: 54px;
  display: grid;
  gap: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 10px;
}

.miniTile {
  width: var(--cell);
  height: var(--cell);
  min-height: 44px; /* Touch target compliance */
  border-radius: 12px;
  border: 1px solid rgba(255, 59, 212, 0.35);
  background: rgba(18, 18, 24, 0.92);
  color: var(--text);
  font-weight: 800;
  font-size: 20px;
  cursor: pointer;
  transition: box-shadow 0.12s ease, transform 0.06s ease;
  display: grid;
  place-items: center;
}

.miniTile:hover {
  box-shadow: 0 0 24px rgba(255, 59, 212, 0.16);
  transform: scale(1.05);
}

.miniTile:active {
  transform: scale(0.98);
}

.miniBlank {
  opacity: 0.16;
  border-style: dashed;
  cursor: default;
}

.miniBlank:hover {
  transform: none;
  box-shadow: none;
}

/* === PUZZLE CONTROLS === */
.pControls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pStats {
  margin-top: 8px;
  line-height: 1.35;
  font-size: 13px;
}

.pLinks {
  margin-top: auto;
  padding-top: 10px;
}

/* Benchmark buttons container */
.pBench {
  display: flex;
  gap: var(--space-sm, 8px);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--space-md, 12px);
  padding: var(--space-md, 12px);
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md, 12px);
  border: 1px solid rgba(178, 120, 255, 0.15);
}

/* Benchmark button base - beautiful purple neon */
.pBench .btn.bench {
  position: relative;
  padding: 8px 14px;
  min-height: 40px;
  min-width: 48px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid rgba(178, 120, 255, 0.5);
  background: linear-gradient(135deg,
    rgba(178, 120, 255, 0.12) 0%,
    rgba(178, 120, 255, 0.06) 100%
  );
  color: rgba(235, 215, 255, 0.95);
  font-weight: 700;
  font-size: var(--text-sm, 13px);
  cursor: pointer;
  transition: all var(--duration-fast, 0.12s) var(--ease-out);
  box-shadow: 
    0 0 12px rgba(178, 120, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pBench .btn.bench:hover {
  border-color: rgba(178, 120, 255, 0.8);
  background: linear-gradient(135deg,
    rgba(178, 120, 255, 0.22) 0%,
    rgba(178, 120, 255, 0.12) 100%
  );
  box-shadow: 
    0 0 20px rgba(178, 120, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.pBench .btn.bench:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.05s;
}

/* God's Number button - special highlight */
.pBench .btn.bench.gods-number,
.pBench .btn.bench[data-bench="6"][data-target="mini-2x2"],
.pBench .btn.bench[data-bench="5"][data-target="mini-2x3"],
.pBench .btn.bench[data-bench="5"][data-target="mini-3x3"] {
  border: 2px solid rgba(255, 59, 212, 0.6);
  background: linear-gradient(135deg,
    rgba(255, 59, 212, 0.18) 0%,
    rgba(255, 200, 100, 0.1) 100%
  );
  color: rgba(255, 255, 255, 0.98);
  box-shadow: 
    0 0 20px rgba(255, 59, 212, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: godsNumberPulse 2.5s ease-in-out infinite;
}

.pBench .btn.bench.gods-number:hover,
.pBench .btn.bench[data-bench="6"][data-target="mini-2x2"]:hover,
.pBench .btn.bench[data-bench="5"][data-target="mini-2x3"]:hover,
.pBench .btn.bench[data-bench="5"][data-target="mini-3x3"]:hover {
  border-color: rgba(255, 59, 212, 0.9);
  box-shadow: 
    0 0 30px rgba(255, 59, 212, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: none;
}

@keyframes godsNumberPulse {
  0%, 100% { 
    box-shadow: 
      0 0 20px rgba(255, 59, 212, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% { 
    box-shadow: 
      0 0 30px rgba(255, 59, 212, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}

/* Difficulty progression colors (optional - gradient from cool to warm) */
.pBench .btn.bench[data-bench="1"] { --bench-accent: 200; }
.pBench .btn.bench[data-bench="2"] { --bench-accent: 230; }
.pBench .btn.bench[data-bench="3"] { --bench-accent: 260; }
.pBench .btn.bench[data-bench="4"] { --bench-accent: 280; }
.pBench .btn.bench[data-bench="5"]:not([data-target="mini-2x2"]) { --bench-accent: 300; }

/* Completed benchmark indicator */
.pBench .btn.bench.completed {
  background: linear-gradient(135deg,
    rgba(112, 255, 122, 0.15) 0%,
    rgba(112, 255, 122, 0.08) 100%
  );
  border-color: rgba(112, 255, 122, 0.5);
}

.pBench .btn.bench.completed::after {
  content: "✓";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  background: var(--lime);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 900;
  color: #000;
  display: grid;
  place-items: center;
  box-shadow: 0 0 8px rgba(112, 255, 122, 0.5);
}

/* === BRIEFING CARD === */
.brief.card {
  border: 1px solid rgba(255, 59, 212, 0.25);
  grid-column: 1 / -1; /* Span full row in grid layout */
  width: 100%;
}

.typeBlock {
  width: 100%;
  display: block;
  box-sizing: border-box;
}

.typeSection {
  width: 100%;
  display: block;
  box-sizing: border-box;
  min-width: 0;
}

.typeHeader {
  margin-bottom: 6px;
}

/* === GLOSSARY / MISSION INTEL === */
.glossary.card {
  grid-column: 1 / -1; /* Span full row */
}

.vocabWrap {
  margin-top: 12px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(255, 59, 212, 0.35);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 59, 212, 0.08), rgba(0, 0, 0, 0));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22), 0 12px 30px rgba(0, 0, 0, 0.45);
}

.vocabTitle {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 59, 212, 0.95);
  text-shadow: 0 0 16px rgba(255, 59, 212, 0.55);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.vocabChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.chip {
  cursor: pointer;
  user-select: none;
  padding: 8px 10px;
  min-height: 40px; /* Touch target */
  border-radius: 999px;
  border: 1px solid rgba(255, 59, 212, 0.35);
  background: rgba(12, 16, 26, 0.55);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip:hover {
  border-color: rgba(255, 59, 212, 0.65);
  box-shadow: 0 0 18px rgba(255, 59, 212, 0.22);
  transform: translateY(-1px);
}

.chip.active {
  background: rgba(255, 59, 212, 0.14);
  border-color: rgba(255, 59, 212, 0.85);
  color: #fff;
  text-shadow: 0 0 14px rgba(255, 59, 212, 0.55);
  box-shadow: 0 0 20px rgba(255, 59, 212, 0.18);
}

.vocabPanel {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.92);
  line-height: 1.6;
  font-size: 15px;
  margin-top: 10px;
}

.vocabPanel.hidden {
  display: none;
}

.vocabPanel .mono {
  font-weight: 800;
}

.vocabPanel .kicker {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(47, 243, 255, 0.25);
  color: rgba(47, 243, 255, 0.95);
  background: rgba(47, 243, 255, 0.08);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* === AGENT BOX === */
.agentBox {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(47, 243, 255, 0.20);
  border-radius: 14px;
  padding: 10px;
}

.agentTitle {
  color: var(--cyan);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.agentText {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(240, 240, 255, 0.92);
  line-height: 1.35;
}

/* === FACILITATOR CARD === */
.facCard {
  border: 1px solid rgba(47, 243, 255, 0.24);
}

/* === GATE SPECIFIC === */
.gateBody {
  margin: var(--space-xl, 24px) 0;
}

.gateLead {
  font-size: var(--text-lg, 17px);
  font-weight: 900;
  text-align: center;
  color: rgba(47, 243, 255, 0.95);
  text-shadow: 0 0 20px rgba(47, 243, 255, 0.55);
  margin-bottom: var(--space-lg, 16px);
  padding: var(--space-sm, 8px) var(--space-lg, 16px);
  display: inline-block;
  width: 100%;
  border-radius: var(--radius-full, 999px);
  background: rgba(47, 243, 255, 0.08);
  border: 1px solid rgba(47, 243, 255, 0.25);
}

.gatePrompt {
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg, 16px);
  padding: var(--space-xl, 24px);
  text-align: center;
}

.gateQ {
  font-size: var(--text-lg, 17px);
  font-weight: 800;
  margin-bottom: var(--space-md, 12px);
  color: rgba(255, 255, 255, 0.98);
  line-height: 1.4;
}

.gateP {
  font-size: var(--text-base, 15px);
  line-height: 1.6;
  color: var(--muted);
  max-width: 380px;
  margin: 0 auto;
}

/* === BRAND LOGO === */
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logoBox {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(255, 47, 214, 0.28);
  flex-shrink: 0;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 980px) {
  .vocabTitle {
    font-size: 12px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .pTitle {
    font-size: 15px;
  }
  
  .pBench {
    gap: var(--space-xs, 4px);
    padding: var(--space-sm, 8px);
  }
  
  .pBench .btn.bench {
    padding: 6px 10px;
    font-size: 12px;
    min-width: 40px;
  }
}

@media (max-width: 640px) {
  .miniWrap {
    height: 200px;
  }
  
  .miniPuzzle {
    --cell: 44px;
    gap: 6px;
    padding: 8px;
  }
  
  .chip {
    font-size: 12px;
    padding: 7px 9px;
  }
  
  /* Stack benchmark buttons in 2 rows on mobile */
  .pBench {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xs, 4px);
  }
  
  .pBench .btn.bench {
    padding: 8px 6px;
    font-size: 11px;
    min-width: unset;
  }
  
  /* Gate improvements on mobile */
  .gatePrompt {
    padding: var(--space-lg, 16px);
  }
  
  .gateQ {
    font-size: var(--text-base, 15px);
  }
  
  .gateP {
    font-size: var(--text-sm, 13px);
  }
}

@media (max-width: 380px) {
  .miniPuzzle {
    --cell: 38px;
    gap: 4px;
  }
  
  .pBench .btn.bench {
    padding: 6px 4px;
    font-size: 10px;
  }
}


/* ===== ai-exhibits-tutorial.css ===== */
/* =============================================================================
   AI-EXHIBITS: TUTORIAL SYSTEM
   Beautiful, game-like overlay tutorial with contextual tooltips
   ============================================================================= */

/* === TUTORIAL OVERLAY === */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(7, 6, 10, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.tutorial-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Tutorial card - glassmorphism with neon edges */
.tutorial-card {
  position: relative;
  width: min(680px, 100%);
  background: linear-gradient(
    135deg,
    rgba(255, 59, 212, 0.08) 0%,
    rgba(47, 243, 255, 0.06) 50%,
    rgba(112, 255, 122, 0.06) 100%
  );
  border: 2px solid rgba(255, 59, 212, 0.35);
  border-radius: 24px;
  padding: 40px 36px 32px;
  box-shadow: 
    0 0 60px rgba(255, 59, 212, 0.25),
    0 20px 80px rgba(0, 0, 0, 0.70),
    inset 0 0 40px rgba(255, 59, 212, 0.05);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.tutorial-overlay.active .tutorial-card {
  transform: scale(1);
}

/* Neon top border accent */
.tutorial-card::before {
  content: "";
  position: absolute;
  left: 36px;
  right: 36px;
  top: 20px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink), var(--cyan), var(--lime));
  opacity: 0.85;
  filter: blur(1px);
  box-shadow: 0 0 20px rgba(255, 59, 212, 0.55);
}

/* Tutorial header */
.tutorial-header {
  text-align: center;
  margin-bottom: 32px;
}

.tutorial-mission {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(47, 243, 255, 0.95);
  text-shadow: 0 0 16px rgba(47, 243, 255, 0.55);
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(47, 243, 255, 0.35);
  background: rgba(47, 243, 255, 0.08);
}

.tutorial-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.98);
  text-shadow: 0 0 30px rgba(255, 59, 212, 0.45);
  margin: 0 0 12px;
  line-height: 1.2;
}

.tutorial-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
  margin: 0;
}

/* Tutorial content - animated text */
.tutorial-content {
  min-height: 200px;
  margin-bottom: 28px;
}

.tutorial-step {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tutorial-step.active {
  display: block;
  animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tutorial-step-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.tutorial-step-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 59, 212, 0.18), rgba(47, 243, 255, 0.12));
  border: 2px solid rgba(255, 59, 212, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 0 24px rgba(255, 59, 212, 0.35);
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    box-shadow: 0 0 24px rgba(255, 59, 212, 0.35);
  }
  50% {
    box-shadow: 0 0 36px rgba(255, 59, 212, 0.55);
  }
}

.tutorial-step-label {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 59, 212, 0.85);
  margin-bottom: 6px;
}

.tutorial-step-title {
  font-size: 20px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  line-height: 1.3;
}

.tutorial-text {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.tutorial-text strong {
  color: rgba(255, 59, 212, 0.95);
  font-weight: 700;
}

.tutorial-text code {
  font-family: var(--mono);
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(47, 243, 255, 0.95);
}

/* Tutorial controls */
.tutorial-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.tutorial-progress {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tutorial-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.3s ease;
}

.tutorial-dot.active {
  width: 28px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  border-color: rgba(255, 59, 212, 0.75);
  box-shadow: 0 0 12px rgba(255, 59, 212, 0.45);
}

.tutorial-dot.completed {
  background: rgba(112, 255, 122, 0.55);
  border-color: rgba(112, 255, 122, 0.75);
}

.tutorial-buttons {
  display: flex;
  gap: 10px;
}

.tutorial-btn {
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tutorial-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.tutorial-btn:active {
  transform: translateY(0);
}

.tutorial-btn.primary {
  background: linear-gradient(135deg, rgba(255, 59, 212, 0.25), rgba(47, 243, 255, 0.20));
  border-color: rgba(255, 59, 212, 0.55);
  color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 20px rgba(255, 59, 212, 0.25);
}

.tutorial-btn.primary:hover {
  background: linear-gradient(135deg, rgba(255, 59, 212, 0.35), rgba(47, 243, 255, 0.28));
  border-color: rgba(255, 59, 212, 0.75);
  box-shadow: 0 0 28px rgba(255, 59, 212, 0.40);
}

.tutorial-btn-icon {
  font-size: 16px;
}

/* Skip button */
.tutorial-skip {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tutorial-skip:hover {
  background: rgba(255, 77, 109, 0.15);
  border-color: rgba(255, 77, 109, 0.45);
  color: rgba(255, 255, 255, 0.95);
}

/* Keyboard hint */
.tutorial-hint {
  text-align: center;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.05em;
}

.tutorial-hint kbd {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  margin: 0 4px;
}

/* === CONTEXTUAL TOOLTIPS === */
.context-tooltip {
  position: absolute;
  z-index: 999998;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(7, 6, 10, 0.96);
  border: 1px solid rgba(255, 59, 212, 0.45);
  box-shadow: 
    0 0 30px rgba(255, 59, 212, 0.35),
    0 12px 40px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.context-tooltip.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.context-tooltip-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(7, 6, 10, 0.96);
  border: 1px solid rgba(255, 59, 212, 0.45);
  transform: rotate(45deg);
  z-index: -1;
}

.context-tooltip-arrow.top {
  bottom: -7px;
  left: 50%;
  margin-left: -6px;
  border-top: none;
  border-left: none;
}

.context-tooltip-arrow.bottom {
  top: -7px;
  left: 50%;
  margin-left: -6px;
  border-bottom: none;
  border-right: none;
}

.context-tooltip-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(47, 243, 255, 0.85);
  margin-bottom: 6px;
}

.context-tooltip-text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.90);
  margin: 0;
}

.context-tooltip-dismiss {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* Highlight effect for elements being explained */
.tutorial-highlight {
  position: relative;
  z-index: 999997;
}

.tutorial-highlight::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  border: 2px solid rgba(255, 59, 212, 0.65);
  box-shadow: 
    0 0 24px rgba(255, 59, 212, 0.45),
    inset 0 0 24px rgba(255, 59, 212, 0.15);
  pointer-events: none;
  animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% {
    box-shadow: 
      0 0 24px rgba(255, 59, 212, 0.45),
      inset 0 0 24px rgba(255, 59, 212, 0.15);
  }
  50% {
    box-shadow: 
      0 0 36px rgba(255, 59, 212, 0.65),
      inset 0 0 36px rgba(255, 59, 212, 0.25);
  }
}

/* === COACH PANEL === */
.coach-panel {
  position: fixed;
  left: -360px;
  top: 80px;
  width: 340px;
  max-height: calc(100vh - 160px);
  background: linear-gradient(
    135deg,
    rgba(7, 6, 10, 0.95) 0%,
    rgba(11, 7, 20, 0.95) 100%
  );
  border: 1px solid rgba(47, 243, 255, 0.35);
  border-left: none;
  border-radius: 0 18px 18px 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  z-index: 99998;
  transition: left 0.35s ease;
  overflow: hidden;
}

.coach-panel.open {
  left: 0;
}

.coach-panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coach-panel-title {
  font-size: 16px;
  font-weight: 800;
  color: rgba(47, 243, 255, 0.95);
  text-shadow: 0 0 16px rgba(47, 243, 255, 0.45);
  margin: 0;
}

.coach-panel-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s ease;
}

.coach-panel-close:hover {
  background: rgba(255, 77, 109, 0.15);
  border-color: rgba(255, 77, 109, 0.45);
  color: rgba(255, 255, 255, 0.95);
}

.coach-panel-content {
  padding: 18px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
}

.coach-tip {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  margin-bottom: 12px;
}

.coach-tip-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(112, 255, 122, 0.85);
  margin-bottom: 6px;
}

.coach-tip-text {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

/* Coach toggle button */
.coach-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 120px;
  background: linear-gradient(135deg, rgba(47, 243, 255, 0.18), rgba(255, 59, 212, 0.14));
  border: 1px solid rgba(47, 243, 255, 0.35);
  border-left: none;
  border-radius: 0 16px 16px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  z-index: 99997;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(47, 243, 255, 0.85);
  transition: all 0.2s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coach-toggle:hover {
  width: 56px;
  background: linear-gradient(135deg, rgba(47, 243, 255, 0.28), rgba(255, 59, 212, 0.22));
  box-shadow: 0 0 30px rgba(47, 243, 255, 0.35);
}

.coach-toggle.hidden {
  left: -60px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .tutorial-card {
    padding: 32px 24px 24px;
  }
  
  .tutorial-title {
    font-size: 22px;
  }
  
  .tutorial-step-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  
  .tutorial-text {
    font-size: 15px;
  }
  
  .coach-panel {
    width: 100%;
    left: -100%;
    border-radius: 0;
  }
  
  .coach-panel.open {
    left: 0;
  }
  
  .coach-toggle {
    display: none;
  }
}

/* === COMPLETION CELEBRATION === */
.tutorial-complete {
  text-align: center;
  padding: 20px 0;
}

.tutorial-complete-icon {
  font-size: 72px;
  margin-bottom: 20px;
  animation: celebrationPop 0.6s ease;
}

@keyframes celebrationPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tutorial-complete-title {
  font-size: 26px;
  font-weight: 900;
  color: rgba(112, 255, 122, 0.95);
  text-shadow: 0 0 30px rgba(112, 255, 122, 0.55);
  margin: 0 0 12px;
}

.tutorial-complete-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 24px;
}


