/* ========================================================
   CODE LYOKO: QUEST FOR INFINITY — SUPERCOMPUTER STYLESHEET
   Aesthetic: Factory Supercomputer Holographic Cyber Deck
   ======================================================== */

:root {
  --bg-core: #040812;
  --bg-card: rgba(8, 20, 38, 0.75);
  --bg-card-hover: rgba(14, 34, 64, 0.85);
  --bg-glass: rgba(6, 16, 32, 0.85);
  
  --cyan-core: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.5);
  --cyan-dim: rgba(0, 240, 255, 0.15);
  --cyan-subtle: rgba(0, 240, 255, 0.05);

  --xana-red: #ff003c;
  --xana-glow: rgba(255, 0, 60, 0.6);
  --xana-dim: rgba(255, 0, 60, 0.15);

  --hopper-amber: #ffaa00;
  --aelita-pink: #ff2a85;
  --odd-purple: #9d4edd;
  --ulrich-gold: #e0a96d;
  --yumi-crimson: #c1121f;

  --text-main: #e2f4ff;
  --text-muted: #7fa3c1;
  --text-bright: #ffffff;

  --font-display: 'Orbitron', -apple-system, sans-serif;
  --font-mono: 'Share Tech Mono', monospace;
  --font-body: 'Inter', sans-serif;

  --border-cyan: 1px solid rgba(0, 240, 255, 0.3);
  --border-glow: 0 0 15px rgba(0, 240, 255, 0.25);
  --border-radius: 6px;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.lyoko-theme {
  background-color: var(--bg-core);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  user-select: none;
}

/* Background Cyber Grid */
.hologram-background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.grid-lines {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  perspective: 1000px;
  opacity: 0.7;
}

.radial-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(0, 240, 255, 0.12) 0%, rgba(4, 8, 18, 0.8) 75%);
}

/* CRT Scanline Simulation */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.crt-overlay.active {
  opacity: 0.65;
}

/* Main Supercomputer Layout Shell */
.supercomputer-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1700px;
  margin: 0 auto;
  padding: 12px 18px;
  gap: 12px;
}

/* ========================================================
   TOP HEADER
   ======================================================== */
.factory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: var(--border-cyan);
  box-shadow: var(--border-glow);
  padding: 10px 18px;
  border-radius: var(--border-radius);
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lyoko-eye-logo {
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lyoko-eye-logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 0 10px var(--cyan-core));
}

.eye-outer {
  animation: eyePulse 3s infinite ease-in-out;
}

@keyframes eyePulse {
  0%, 100% { stroke: #00f0ff; filter: drop-shadow(0 0 4px #00f0ff); }
  50% { stroke: #ff2a85; filter: drop-shadow(0 0 8px #ff2a85); }
}

.title-meta .system-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-bright);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.version-tag {
  font-size: 0.65rem;
  background: var(--cyan-dim);
  color: var(--cyan-core);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--cyan-core);
  vertical-align: middle;
  margin-left: 6px;
}

.system-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88;
  animation: blinkFast 2s infinite;
}

@keyframes blinkFast {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.sector-radar-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan-core);
}

.radar-ping {
  width: 8px;
  height: 8px;
  background: var(--cyan-core);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cyan-core);
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% {
    transform: scale(2);
    opacity: 0;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.system-metrics {
  display: flex;
  gap: 10px;
}

.metric-box {
  background: rgba(4, 12, 24, 0.8);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 75px;
}

.metric-title {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
}

.metric-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyan-core);
}

.audio-metric-box {
  border-color: rgba(0, 255, 136, 0.35);
  background: rgba(0, 30, 20, 0.6);
}

.audio-metric-box .metric-val {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

.hud-btn {
  background: var(--cyan-subtle);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan-core);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hud-btn:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-core);
  box-shadow: 0 0 10px var(--cyan-glow);
  transform: translateY(-1px);
}

.hud-btn.active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--cyan-core);
  box-shadow: 0 0 8px var(--cyan-core);
}

.hud-btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
}

.hud-btn-sm {
  padding: 4px 10px;
  font-size: 0.7rem;
}

.hud-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(1);
}

/* ========================================================
   NAVIGATION TABS
   ======================================================== */
.supercomputer-nav {
  display: flex;
  gap: 8px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: var(--border-cyan);
  padding: 6px 10px;
  border-radius: var(--border-radius);
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.nav-tab:hover {
  color: var(--cyan-core);
  background: rgba(0, 240, 255, 0.08);
}

.nav-tab.active {
  color: var(--text-bright);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 102, 255, 0.15));
  border: 1px solid var(--cyan-core);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.tab-icon {
  font-size: 0.95rem;
}

/* ========================================================
   BODY / TAB PANELS
   ======================================================== */
.supercomputer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
  display: flex;
}

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

/* ========================================================
   TAB 1: EMULATOR & SCANNER LAYOUT
   ======================================================== */
.emulator-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

@media (max-width: 1100px) {
  .emulator-layout {
    grid-template-columns: 1fr;
  }
}

.screen-frame {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: var(--border-cyan);
  box-shadow: var(--border-glow);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 240, 255, 0.05);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}

.screen-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan-core);
  letter-spacing: 0.5px;
}

.screen-quick-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.disc-status-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(0, 240, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #8be9fd;
}

#turboBtn {
  transition: all 0.25s ease;
}

#turboBtn.active {
  background: rgba(255, 183, 0, 0.25) !important;
  border-color: #ffb700 !important;
  color: #ffb700 !important;
  box-shadow: 0 0 14px rgba(255, 183, 0, 0.6) !important;
  font-weight: 700;
}

/* Canvas PS2 Viewport */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 720px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout paint;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

#outputCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.fs-overlay-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 25;
  background: rgba(4, 12, 24, 0.8);
  border: 1px solid #00f0ff;
  color: #00f0ff;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease, background 0.2s, transform 0.2s;
  backdrop-filter: blur(4px);
}

.canvas-wrapper:hover .fs-overlay-btn { opacity: 1; }
.fs-overlay-btn:hover { background: #00f0ff; color: #000; transform: scale(1.08); }

.canvas-wrapper:fullscreen,
.canvas-wrapper:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  background: #000 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

.canvas-wrapper:fullscreen #outputCanvas,
.canvas-wrapper:-webkit-full-screen #outputCanvas {
  width: auto !important;
  height: 100vh !important;
  aspect-ratio: 4 / 3 !important;
  max-width: 100vw !important;
  object-fit: contain !important;
  margin: auto !important;
}

/* Splash Screen on Canvas */
.splash-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(6, 18, 38, 0.94) 0%, rgba(2, 6, 14, 0.98) 85%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  z-index: 10;
  transition: opacity 0.5s ease;
}

.scanner-portal {
  position: relative;
  width: 110px;
  height: 110px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-rings .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--cyan-core);
}

.ring-1 { animation: rotateRight 14s linear infinite; }
.ring-2 { inset: 10px; border: 1px solid rgba(0, 240, 255, 0.4); animation: rotateLeft 9s linear infinite; }
.ring-3 { inset: 20px; border: 2px solid var(--cyan-core); border-top-color: transparent; animation: rotateRight 5s linear infinite; }

@keyframes rotateRight { 100% { transform: rotate(360deg); } }
@keyframes rotateLeft { 100% { transform: rotate(-360deg); } }

.lyoko-emblem-large {
  width: 50px;
  height: 50px;
  filter: drop-shadow(0 0 12px var(--cyan-core));
}

.splash-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-shadow: 0 0 15px var(--cyan-glow);
}

.splash-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 24px;
}

.boot-options-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 480px;
}

.primary-boot-btn {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3) 0%, rgba(0, 102, 255, 0.4) 100%);
  border: 1px solid var(--cyan-core);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  padding: 14px 20px;
  border-radius: var(--border-radius);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: var(--transition-smooth);
}

.primary-boot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.45) 0%, rgba(0, 102, 255, 0.55) 100%);
}

.primary-boot-btn .btn-icon {
  font-size: 1.6rem;
  color: var(--cyan-core);
  filter: drop-shadow(0 0 6px var(--cyan-core));
}

.primary-boot-btn .btn-main {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.primary-boot-btn .btn-sub {
  display: block;
  font-size: 0.72rem;
  color: #d0f0ff;
}

/* ========================================================
   HEROIC SINGLE ONE-CLICK BOOT BUTTON (120+ FPS & AUTO-BOOT)
   ======================================================== */
.single-boot-container {
  max-width: 540px !important;
}

.heroic-boot-btn {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.4) 0%, rgba(0, 102, 255, 0.6) 50%, rgba(255, 0, 128, 0.3) 100%) !important;
  border: 2px solid var(--cyan-core) !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5), inset 0 0 15px rgba(0, 240, 255, 0.3) !important;
  padding: 18px 24px !important;
  border-radius: 10px !important;
  transform: translateY(0);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.heroic-boot-btn:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 0 45px rgba(0, 240, 255, 0.9), inset 0 0 25px rgba(0, 240, 255, 0.6) !important;
  border-color: #ffffff !important;
}

.heroic-boot-btn:active {
  transform: translateY(1px) scale(0.99) !important;
}

.pulse-icon {
  font-size: 2rem !important;
  animation: heroPulse 1.4s ease-in-out infinite;
  display: inline-block;
}

@keyframes heroPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px var(--cyan-core)); }
  50% { transform: scale(1.22); filter: drop-shadow(0 0 18px #00ffff); }
  100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--cyan-core)); }
}

.heroic-boot-btn .btn-main {
  font-size: 1.15rem !important;
  font-weight: 900 !important;
  letter-spacing: 1.5px !important;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8) !important;
}

.heroic-boot-btn .btn-sub {
  font-size: 0.76rem !important;
  letter-spacing: 0.5px !important;
  color: #e0f8ff !important;
  margin-top: 4px;
}

.boot-quick-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.75rem;
}

.subtle-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  transition: color 0.2s;
  padding: 4px 6px;
}

.subtle-link-btn:hover {
  color: var(--cyan-core);
  text-shadow: 0 0 6px var(--cyan-core);
}

.subtle-sep {
  color: rgba(255, 255, 255, 0.25);
}

.subtle-info {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.btn-secondary-action {
  background: linear-gradient(135deg, rgba(255, 183, 0, 0.15) 0%, rgba(255, 102, 0, 0.25) 100%) !important;
  border-color: rgba(255, 183, 0, 0.5) !important;
}

.btn-secondary-action:hover {
  box-shadow: 0 0 30px rgba(255, 183, 0, 0.5) !important;
  border-color: #ffb700 !important;
}

.or-separator {
  position: relative;
  text-align: center;
}

.or-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(0, 240, 255, 0.2);
}

.or-separator span {
  position: relative;
  background: #061122;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
}

.file-drop-area {
  border: 1px dashed rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.03);
  border-radius: var(--border-radius);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.file-drop-area:hover, .file-drop-area.drag-over {
  border-color: var(--cyan-core);
  background: rgba(0, 240, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.file-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.drop-icon { font-size: 1.3rem; }
.drop-text { font-size: 0.78rem; color: var(--text-main); }
.drop-hint { font-size: 0.68rem; color: var(--text-muted); font-family: var(--font-mono); }

/* Boot Progress */
.boot-progress-box {
  width: 100%;
  max-width: 480px;
  margin-top: 14px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f0ff, #0077ff);
  box-shadow: 0 0 12px var(--cyan-core);
  transition: width 0.2s ease;
}

.progress-status-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan-core);
  margin-top: 8px;
}

/* Screen Footer Deck */
.screen-footer-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(0, 240, 255, 0.05);
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.deck-label { color: var(--text-muted); }
.deck-val { color: var(--cyan-core); font-weight: 700; margin-left: 4px; }
.deck-sep { margin: 0 8px; color: rgba(0, 240, 255, 0.25); }

.gamepad-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}

.gamepad-status.connected {
  color: #00ff88;
}

.deck-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: 6px;
  transition: var(--transition-smooth);
}

.deck-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-core);
  color: var(--cyan-core);
}

/* ========================================================
   SIDEBAR TELEMETRY & CARDS
   ======================================================== */
.scanner-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cyber-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: var(--border-cyan);
  border-radius: var(--border-radius);
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--cyan-core);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.title-bullet {
  color: var(--cyan-core);
  font-size: 0.65rem;
}

/* Scanner Chambers */
.scanner-chambers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.chamber {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 4px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.chamber.active {
  border-color: var(--cyan-core);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.chamber-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

.chamber-hero {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-bright);
  margin: 3px 0;
}

.chamber-bar {
  width: 80%;
  height: 4px;
  background: rgba(0, 240, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.chamber-bar .fill {
  height: 100%;
  background: var(--cyan-core);
}

/* Skidbladnir */
.skid-display {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skid-wireframe {
  height: 40px;
  background: rgba(0, 102, 255, 0.08);
  border: 1px solid rgba(0, 102, 255, 0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.skid-navipods {
  display: flex;
  gap: 8px;
}

.skid-navipods .pod {
  background: var(--cyan-dim);
  border: 1px solid var(--cyan-core);
  color: var(--cyan-core);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: bold;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.skid-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.skid-stats .stat-row {
  display: flex;
  justify-content: space-between;
}

.skid-stats strong {
  color: #00ff88;
}

/* Quick Controls Mini Grid */
.keys-grid-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.key-badge {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 4px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  font-size: 0.68rem;
}

.key-badge span { color: var(--text-muted); font-size: 0.62rem; }
.key-badge strong { color: var(--cyan-core); font-family: var(--font-mono); font-size: 0.72rem; }

/* ========================================================
   TAB 2: GUERREROS DE LYOKO (CHARACTS GRID)
   ======================================================== */
.section-title-wrap {
  margin-bottom: 8px;
}

.cyber-heading {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-bright);
  letter-spacing: 1.5px;
  text-shadow: 0 0 10px var(--cyan-glow);
}

.cyber-subheading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.hero-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--border-radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.hero-card:hover {
  transform: translateY(-3px);
  border-color: var(--cyan-core);
  box-shadow: 0 8px 24px rgba(0, 240, 255, 0.2);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  padding-bottom: 8px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.hero-card.odd .hero-name { color: var(--odd-purple); }
.hero-card.ulrich .hero-name { color: var(--ulrich-gold); }
.hero-card.yumi .hero-name { color: var(--yumi-crimson); }
.hero-card.aelita .hero-name { color: var(--aelita-pink); }

.hero-role {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.hero-stat-pill {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 4px;
  padding: 6px;
  text-align: center;
}

.hero-stat-pill .s-lbl {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.hero-stat-pill .s-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cyan-core);
  font-family: var(--font-mono);
}

.hero-abilities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ability-item {
  background: rgba(4, 14, 28, 0.7);
  border-left: 3px solid var(--cyan-core);
  padding: 8px 10px;
  border-radius: 0 4px 4px 0;
  font-size: 0.78rem;
}

.ability-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.75rem;
}

.ability-details {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========================================================
   TAB 3: CAMPAÑA (GAME.CFG)
   ======================================================== */
.campaign-chapters-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chapter-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: var(--border-cyan);
  border-radius: var(--border-radius);
  padding: 16px;
}

.chapter-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--cyan-core);
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.phases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.phase-item {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 4px;
  padding: 10px 12px;
  transition: var(--transition-smooth);
}

.phase-item:hover {
  background: rgba(0, 240, 255, 0.09);
  border-color: var(--cyan-core);
}

.phase-item-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.phase-levels {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ========================================================
   TAB 4: BESTIARIO (MONSTERS.CFG)
   ======================================================== */
.monsters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.monster-card {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 0, 60, 0.3);
  border-radius: var(--border-radius);
  padding: 14px;
  transition: var(--transition-smooth);
  position: relative;
}

.monster-card:hover {
  transform: translateY(-2px);
  border-color: var(--xana-red);
  box-shadow: 0 4px 18px var(--xana-dim);
}

.monster-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--xana-red);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.monster-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.m-stat {
  background: rgba(255, 0, 60, 0.06);
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
}

.m-stat span { color: var(--text-muted); }
.m-stat strong { color: #ff88a3; }

/* ========================================================
   TAB 5: TERMINAL JEREMY
   ======================================================== */
.terminal-container {
  background: #02060e;
  border: var(--border-cyan);
  border-radius: var(--border-radius);
  box-shadow: var(--border-glow);
  display: flex;
  flex-direction: column;
  height: 540px;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.08);
  border-bottom: 1px solid rgba(0, 240, 255, 0.2);
  padding: 8px 14px;
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-dot.red { background: #ff5f56; }
.term-dot.yellow { background: #ffbd2e; }
.term-dot.green { background: #27c93f; }

.term-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--cyan-core);
  margin-left: 6px;
}

.terminal-output {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-line {
  line-height: 1.4;
  word-break: break-word;
}

.prompt-sys { color: #8be9fd; font-weight: bold; }
.prompt-user { color: #50fa7b; }
.prompt-err { color: #ff5555; }
.prompt-tip { color: var(--hopper-amber); }

.terminal-input-row {
  display: flex;
  align-items: center;
  background: rgba(0, 240, 255, 0.04);
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  padding: 8px 12px;
  gap: 8px;
}

.prompt-arrow {
  color: var(--cyan-core);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: bold;
}

#terminalInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #fff;
}

/* ========================================================
   TAB 6: DUALSHOCK 2 CONTROLS
   ======================================================== */
.controls-panel-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 900px) {
  .controls-panel-layout {
    grid-template-columns: 1fr;
  }
}

.ds2-schematic {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ds2-body {
  position: relative;
  width: 380px;
  height: 240px;
  background: #11141c;
  border: 2px solid #2a3346;
  border-radius: 40px 40px 60px 60px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: space-between;
  padding: 30px 20px 20px 20px;
}

.ds2-dpad {
  position: relative;
  width: 90px;
  height: 90px;
}

.pad-key {
  position: absolute;
  width: 28px;
  height: 28px;
  background: #242b3b;
  border: 1px solid #3c4863;
  color: #8da4c4;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition-smooth);
}

.pad-key:active, .pad-key.pressed {
  background: var(--cyan-core);
  color: #000;
  box-shadow: 0 0 10px var(--cyan-core);
}

.pad-up { top: 0; left: 31px; }
.pad-down { bottom: 0; left: 31px; }
.pad-left { top: 31px; left: 0; }
.pad-right { top: 31px; right: 0; }
.pad-center { top: 31px; left: 31px; background: #1c222e; border: none; }

.ds2-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ds2-logo {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: bold;
  color: #5d7092;
  letter-spacing: 1px;
}

.center-buttons {
  display: flex;
  gap: 14px;
}

.small-btn {
  background: #202736;
  border: 1px solid #3c4863;
  color: #8da4c4;
  padding: 4px 6px;
  border-radius: 10px;
  font-size: 0.55rem;
  font-family: var(--font-mono);
  cursor: pointer;
}

.small-btn:active, .small-btn.pressed {
  background: var(--cyan-core);
  color: #000;
}

.analog-mode-btn {
  background: #1c222e;
  border: 1px solid #ff003c;
  color: #ff003c;
  font-size: 0.55rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.ds2-actions {
  position: relative;
  width: 90px;
  height: 90px;
}

.action-triangle { top: 0; left: 31px; color: #2ecc71; }
.action-cross { bottom: 0; left: 31px; color: #3498db; }
.action-square { top: 31px; left: 0; color: #e74c3c; }
.action-circle { top: 31px; right: 0; color: #e67e22; }

.ds2-sticks {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
}

.analog-stick {
  width: 54px;
  height: 54px;
  background: #0d1017;
  border: 2px solid #283347;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stick-cap {
  width: 36px;
  height: 36px;
  background: radial-gradient(circle, #2d384e 0%, #171d29 100%);
  border: 1px solid #435475;
  border-radius: 50%;
  transition: transform 0.05s ease;
}

.ds2-shoulders {
  position: absolute;
  top: -12px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
}

.shoulder-group {
  display: flex;
  gap: 6px;
}

.shoulder-btn {
  background: #1e2533;
  border: 1px solid #3c4863;
  color: #8da4c4;
  padding: 2px 8px;
  border-radius: 4px 4px 0 0;
  font-size: 0.6rem;
  cursor: pointer;
}

.shoulder-btn:active, .shoulder-btn.pressed {
  background: var(--cyan-core);
  color: #000;
}

/* Mapping Table */
.mapping-table-wrap {
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  border: var(--border-cyan);
  border-radius: var(--border-radius);
  padding: 18px;
}

.cyber-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.8rem;
}

.cyber-table th {
  text-align: left;
  padding: 8px 10px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--cyan-core);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
}

.cyber-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(0, 240, 255, 0.08);
}

.cyber-table kbd {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* ========================================================
   FLOATING TOUCH CONTROLLER (MOBILE & TOUCH)
   ======================================================== */
.floating-touch-pad {
  position: fixed;
  bottom: 40px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1000;
}

.touch-dpad, .touch-actions {
  pointer-events: auto;
  position: relative;
  width: 130px;
  height: 130px;
}

.touch-btn {
  position: absolute;
  width: 42px;
  height: 42px;
  background: rgba(8, 24, 48, 0.85);
  border: 1px solid var(--cyan-core);
  color: var(--cyan-core);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  backdrop-filter: blur(8px);
}

/* ========================================================
   FOOTER
   ======================================================== */
.factory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass);
  border: var(--border-cyan);
  padding: 8px 14px;
  border-radius: var(--border-radius);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #02060e;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-core);
}
