/* ============================================================
   MDOM — Matrix Domination | CSS Design System
   Aesthetic: Pixel Art 16bits — Favela Futurista Neon + Ferrugem
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  /* Neon Palette */
  --neon-cyan:      #00ffe7;
  --neon-magenta:   #ff00c8;
  --neon-yellow:    #ffe600;
  --neon-green:     #39ff14;
  --neon-orange:    #ff6b00;
  --neon-red:       #ff1744;
  --neon-blue:      #00b4ff;

  /* Rust/Dark Palette */
  --rust-dark:      #1a0a00;
  --rust-mid:       #3d1a00;
  --rust-light:     #7c3a00;
  --dark-bg:        #050910;
  --panel-bg:       rgba(5, 9, 16, 0.95);
  --panel-border:   rgba(0, 255, 231, 0.3);
  --grid-line:      rgba(0, 255, 231, 0.05);

  /* Typography */
  --font-pixel:     'Press Start 2P', monospace;
  --font-mono:      'Share Tech Mono', monospace;
  --font-hud:       'Orbitron', sans-serif;

  /* Sizing - RESOLUÇÃO AUMENTADA */
  --hud-height-top: 72px;
  --hud-height-bot: 48px;
  --canvas-w:       960px;    /* ↑ de 800px */
  --canvas-h:       640px;    /* ↑ de 480px */
}

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

html, body {
  width: 100%; 
  height: 100%;
  background: var(--dark-bg);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  overflow: hidden;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------- Game Wrapper ---------- */
#game-wrapper {
  width: 100vw; 
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    repeating-linear-gradient(0deg, var(--grid-line) 0px, var(--grid-line) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, var(--grid-line) 0px, var(--grid-line) 1px, transparent 1px, transparent 40px),
    radial-gradient(ellipse at 50% 50%, #0d1a2e 0%, var(--dark-bg) 70%);
}

/* ---------- Screens ---------- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.screen.active { 
  display: flex; 
}

/* ============================================================
   BOOT SCREEN
   ============================================================ */
#boot-screen {
  position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 2px),
    radial-gradient(ellipse at 50% 30%, rgba(0,255,231,0.08) 0%, transparent 60%),
    #050910;
  overflow: hidden;
}

.boot-scanlines {
  position: absolute; 
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.25) 3px,
    rgba(0, 0, 0, 0.25) 4px
  );
  pointer-events: none;
  z-index: 10;
}

.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  z-index: 5;
}

.boot-logo {
  text-align: center;
  animation: bootFadeIn 1.5s ease forwards;
}

.logo-glitch {
  font-family: var(--font-pixel);
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: var(--neon-cyan);
  letter-spacing: 0.3em;
  text-shadow:
    0 0 10px var(--neon-cyan),
    0 0 30px var(--neon-cyan),
    0 0 60px var(--neon-cyan),
    2px  0 0 var(--neon-magenta),
    -2px 0 0 var(--neon-yellow);
  position: relative;
  animation: glitch 4s infinite;
}

.logo-sub {
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: clamp(0.7rem, 2vw, 1.1rem);
  letter-spacing: 0.6em;
  color: var(--neon-magenta);
  text-shadow: 0 0 10px var(--neon-magenta);
  margin-top: 12px;
}

.logo-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.55rem, 1.5vw, 0.8rem);
  color: rgba(0, 255, 231, 0.5);
  margin-top: 16px;
  letter-spacing: 0.1em;
  font-style: italic;
}

.boot-sequence {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
  text-align: left;
  min-height: 120px;
  width: min(540px, 90vw);
  background: rgba(0,255,20,0.04);
  border: 1px solid rgba(57, 255, 20, 0.2);
  padding: 12px 16px;
  border-radius: 2px;
  overflow: hidden;
}

.boot-line {
  white-space: pre-wrap;
  line-height: 1.8;
}

.boot-prompt {
  font-family: var(--font-pixel);
  font-size: clamp(0.5rem, 1.5vw, 0.7rem);
  color: var(--neon-yellow);
  text-shadow: 0 0 10px var(--neon-yellow);
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: 12px;
}

.boot-version {
  position: absolute;
  bottom: 16px; 
  right: 24px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: rgba(0,255,231,0.3);
}

/* ============================================================
   GAME SCREEN
   ============================================================ */
#game-screen {
  width: var(--canvas-w);
  height: calc(var(--canvas-h) + var(--hud-height-top) + var(--hud-height-bot));
  max-width: 100vw;
  max-height: 100vh;
  position: relative;
  border: 1px solid rgba(0,255,231,0.2);
  box-shadow:
    0 0 40px rgba(0, 255, 231, 0.1),
    0 0 80px rgba(0, 255, 231, 0.05),
    inset 0 0 40px rgba(0,0,0,0.5);
}

/* ---------- HUD Top ---------- */
#hud-top {
  height: var(--hud-height-top);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 9, 16, 0.97);
  border-bottom: 1px solid var(--panel-border);
  padding: 0 12px;
  gap: 12px;
  position: relative;
  z-index: 20;
}

#hud-top::after {
  content: '';
  position: absolute;
  bottom: 0; 
  left: 0; 
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0.5;
}

.hud-section { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}
.hud-left  { 
  flex: 2; 
}
.hud-center { 
  flex: 1; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
}
.hud-right { 
  flex: 1.5; 
  justify-content: flex-end; 
}

/* Avatar */
.hud-avatar {
  width: 40px; 
  height: 40px;
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  flex-shrink: 0;
  image-rendering: pixelated;
  background: #0d1a2e;
}
#avatar-canvas { 
  width: 40px; 
  height: 40px; 
}

/* Stats */
.hud-stats { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  flex: 1; 
}
.stat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-hud);
  font-size: 0.52rem;
  letter-spacing: 0.05em;
}
.stat-label { 
  width: 78px; 
  color: rgba(0,255,231,0.6); 
  flex-shrink: 0; 
}
.stat-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}
.stat-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.stamina-bar { 
  background: linear-gradient(90deg, #ff6b00, #ffe600); 
  box-shadow: 0 0 6px #ffe600; 
}
.consciousness-bar { 
  background: linear-gradient(90deg, #00b4ff, #00ffe7); 
  box-shadow: 0 0 6px #00ffe7; 
}
.reputation-bar { 
  background: linear-gradient(90deg, #ff00c8, #ff6b00); 
  box-shadow: 0 0 6px #ff00c8; 
}
.stat-val { 
  width: 26px; 
  text-align: right; 
  font-size: 0.6rem; 
  color: var(--neon-cyan); 
}

/* HUD Center */
.hud-title {
  font-family: var(--font-pixel);
  font-size: 0.8rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  letter-spacing: 0.2em;
}
.hud-day {
  font-family: var(--font-hud);
  font-size: 0.55rem;
  color: var(--neon-magenta);
  text-shadow: 0 0 6px var(--neon-magenta);
  letter-spacing: 0.12em;
  margin-top: 4px;
}
.hud-blink { 
  animation: blinkAnim 1s infinite; 
}

/* Resources */
.hud-resources { 
  display: flex; 
  gap: 14px; 
}
.resource-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--font-hud);
  font-size: 0.5rem;
  letter-spacing: 0.05em;
}
.res-icon { 
  font-size: 1.1rem; 
  filter: drop-shadow(0 0 4px var(--neon-yellow)); 
}
.res-label { 
  color: rgba(0,255,231,0.5); 
}
.res-val { 
  font-size: 0.75rem; 
  color: var(--neon-yellow); 
  text-shadow: 0 0 6px var(--neon-yellow); 
}

/* ---------- Canvas Area ---------- */
#canvas-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #030608;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;  /* Mudado de 'cover' para 'contain' para manter proporção */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
}

#canvas-scanlines {
  position: absolute; 
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 5;
}

/* ---------- HUD Bottom ---------- */
#hud-bottom {
  height: var(--hud-height-bot);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(5, 9, 16, 0.97);
  border-top: 1px solid var(--panel-border);
  padding: 0 14px;
  position: relative;
  z-index: 20;
}

#hud-bottom::before {
  content: '';
  position: absolute;
  top: 0; 
  left: 0; 
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0.4;
}

#action-keys {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.key-hint {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: rgba(0,255,231,0.5);
  display: flex;
  align-items: center;
  gap: 4px;
}
kbd {
  background: rgba(0,255,231,0.1);
  border: 1px solid rgba(0,255,231,0.3);
  border-radius: 2px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--neon-cyan);
}

#phase-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-hud);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
}
.phase-step {
  color: rgba(0,255,231,0.3);
  transition: color 0.3s, text-shadow 0.3s;
  cursor: default;
}
.phase-step.active {
  color: var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
}
.phase-step.done {
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
}
.phase-sep { 
  color: rgba(0,255,231,0.2); 
  font-size: 0.75rem; 
}

/* ============================================================
   MOBILE CONTROLS E AJUSTES DE ZOOM
   ============================================================ */
#mobile-controls {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px;
  z-index: 10000;
  pointer-events: none;
}

.mobile-btn {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  background: rgba(0, 255, 255, 0.1);
  border: 2px solid #0ff;
  color: #0ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  border-radius: 50%;
  touch-action: manipulation;
  position: absolute;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 10001;
}

.mobile-btn:active {
  background: rgba(0, 255, 255, 0.4);
  transform: scale(0.9);
}

#btn-up { bottom: 140px; left: 80px; }
#btn-down { bottom: 40px; left: 80px; }
#btn-left { bottom: 90px; left: 30px; }
#btn-right { bottom: 90px; left: 130px; }

#btn-interact { bottom: 90px; right: 30px; width: 75px; height: 75px; font-size: 14px; }
#btn-mdom { 
  bottom: 170px; 
  right: 40px; 
  border-radius: 5px; 
  width: 60px; 
  height: 40px; 
  background: rgba(255, 0, 200, 0.2);
  border-color: #ff00c8;
  color: #ff00c8;
  z-index: 10002;
}

@media (max-width: 1024px) {
  #mobile-controls {
    display: block !important;
  }
  
  #game-wrapper {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    touch-action: none;
  }

  /* ZOOM para mobile - compensar resolução maior */
  #game-screen {
    transform: scale(1.2);
    transform-origin: center center;
  }

  #canvas-wrap {
    width: 100%;
    height: calc(100% - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  #game-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  
  #action-keys {
    display: none !important;
  }
  
  #hud-top {
    padding: 5px;
  }

  /* Ajustes finos para mobile */
  .hud-title {
    font-size: 0.7rem;
  }
  
  .stat-label {
    font-size: 0.4rem;
    width: 60px;
  }
  
  .resource-item {
    font-size: 0.4rem;
  }
}

/* Telas muito pequenas */
@media (max-width: 400px) {
  #game-screen {
    transform: scale(1.0);  /* Volta ao normal em telas muito pequenas */
  }
  
  .mobile-btn {
    width: 50px;
    height: 50px;
    font-size: 8px;
  }
  
  #btn-interact {
    width: 65px;
    height: 65px;
    font-size: 12px;
  }
  
  #btn-mdom {
    width: 50px;
    height: 35px;
    font-size: 8px;
    bottom: 150px;
    right: 30px;
  }
}

/* ============================================================
   OVERLAYS (mantidos iguais)
   ============================================================ */
.overlay {
  position: fixed; 
  inset: 0;
  background: rgba(3, 6, 8, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: overlayIn 0.25s ease;
}
.overlay.hidden { 
  display: none; 
}

.overlay-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow:
    0 0 30px rgba(0,255,231,0.15),
    inset 0 0 30px rgba(0,0,0,0.5);
  border-radius: 4px;
  width: min(560px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  animation: panelSlideIn 0.3s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(0,255,231,0.04);
}

.panel-title {
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  letter-spacing: 0.12em;
}

.close-btn {
  background: transparent;
  border: 1px solid rgba(255, 0, 200, 0.4);
  color: var(--neon-magenta);
  font-size: 1rem;
  width: 28px; 
  height: 28px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-btn:hover {
  background: rgba(255,0,200,0.15);
  box-shadow: 0 0 8px var(--neon-magenta);
}

/* ========== MDOM Panel ========== */
.mdom-panel { 
  border-color: rgba(0,255,231,0.4); 
}

.mdom-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* MDOM Eye */
.mdom-eye-container {
  position: relative;
  width: 100px; 
  height: 100px;
}
.mdom-eye {
  width: 100px; 
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #001a33 0%, #000508 100%);
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 20px rgba(0,255,231,0.1);
  position: relative;
  overflow: hidden;
  animation: eyePulse 3s infinite;
}
.eye-iris {
  position: absolute;
  width: 50px; 
  height: 50px;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #0066aa 0%, #003366 50%, #001133 100%);
  border: 1px solid rgba(0,255,231,0.5);
  animation: irisRotate 6s linear infinite;
}
.eye-pupil {
  position: absolute;
  width: 20px; 
  height: 20px;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #111 0%, #000 100%);
  box-shadow: 0 0 6px rgba(0,255,231,0.4);
  z-index: 2;
}
.eye-scan {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(0,255,231,0.15) 0%, transparent 50%);
  animation: eyeScan 2s linear infinite;
}

.mdom-status {
  text-align: center;
  width: 100%;
}
.status-label {
  font-family: var(--font-hud);
  font-size: 0.6rem;
  color: rgba(0,255,231,0.5);
  letter-spacing: 0.15em;
  margin-bottom: 6px;
}
.status-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
}

.mdom-message-box {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(0,255,231,0.15);
  border-radius: 2px;
  padding: 12px;
  max-height: 120px;
  overflow-y: auto;
}
.mdom-messages { 
  display: flex; 
  flex-direction: column; 
  gap: 6px; 
}
.mdom-msg {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-left: 2px solid;
  animation: msgFadeIn 0.4s ease;
}
.mdom-msg.hint     { 
  color: var(--neon-cyan);    
  border-color: var(--neon-cyan); 
}
.mdom-msg.warning  { 
  color: var(--neon-yellow);  
  border-color: var(--neon-yellow); 
}
.mdom-msg.silence  { 
  color: rgba(255,255,255,0.3); 
  border-color: rgba(255,255,255,0.1); 
  font-style: italic; 
}
.mdom-msg.reward   { 
  color: var(--neon-green);   
  border-color: var(--neon-green); 
}
.mdom-msg.direct   { 
  color: var(--neon-magenta); 
  border-color: var(--neon-magenta); 
  font-weight: bold; 
}

.mdom-metrics {
  display: flex;
  gap: 12px;
  width: 100%;
}
.metric-card {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(0,255,231,0.1);
  border-radius: 3px;
  padding: 10px;
  text-align: center;
}
.metric-title {
  font-family: var(--font-hud);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}
.metric-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.metric-bar { 
  height: 100%; 
  border-radius: 2px; 
  transition: width 0.6s ease; 
  width: 0%; 
}
.coherence-bar  { 
  background: linear-gradient(90deg, #00b4ff, #00ffe7); 
  box-shadow: 0 0 4px #00ffe7; 
}
.dispersion-bar { 
  background: linear-gradient(90deg, #ff6b00, #ffe600); 
  box-shadow: 0 0 4px #ffe600; 
}
.naivety-bar { 
  background: linear-gradient(90deg, #ff00c8, #ff1744); 
  box-shadow: 0 0 4px #ff1744; 
}
.metric-val {
  font-family: var(--font-hud);
  font-size: 0.65rem;
  color: var(--neon-cyan);
}

/* ========== Mission Panel ========== */
.mission-panel { 
  border-color: rgba(255,230,0,0.4); 
}
.mission-list { 
  padding: 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}
.mission-card {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,230,0,0.2);
  border-radius: 3px;
  padding: 14px;
  position: relative;
  transition: border-color 0.2s;
}
.mission-card:hover { 
  border-color: rgba(255,230,0,0.5); 
}
.mission-card.completed { 
  border-color: rgba(57,255,20,0.4); 
  opacity: 0.7; 
}
.mission-card.completed::after {
  content: '✓ CONCLUÍDA';
  position: absolute;
  top: 10px; 
  right: 12px;
  font-family: var(--font-hud);
  font-size: 0.5rem;
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
}
.mission-title {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--neon-yellow);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.mission-desc {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.5;
  margin-bottom: 8px;
}
.mission-reward {
  font-family: var(--font-hud);
  font-size: 0.55rem;
  color: var(--neon-green);
  letter-spacing: 0.1em;
}
.mission-progress {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hud);
  font-size: 0.5rem;
  color: rgba(255,255,255,0.4);
}
.mission-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.mission-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-yellow), var(--neon-orange));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ========== Dialogue Box ========== */
#dialogue-box {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 95vw);
  background: rgba(5, 9, 16, 0.98);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0,255,231,0.2), inset 0 0 15px rgba(0,0,0,0.5);
  border-radius: 3px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  z-index: 200;
  animation: dialogueIn 0.3s ease;
}
#dialogue-box.hidden { 
  display: none; 
}

.dialogue-portrait {
  width: 64px; 
  height: 64px;
  flex-shrink: 0;
  border: 1px solid rgba(0,255,231,0.4);
  background: #0d1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.dialogue-content { 
  flex: 1; 
}
.dialogue-name {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 6px var(--neon-cyan);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}
.dialogue-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  min-height: 40px;
}
.dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.dialogue-choice-btn {
  background: rgba(0,255,231,0.06);
  border: 1px solid rgba(0,255,231,0.25);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 12px;
  cursor: pointer;
  text-align: left;
  border-radius: 2px;
  transition: all 0.2s;
}
.dialogue-choice-btn:hover {
  background: rgba(0,255,231,0.15);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0,255,231,0.3);
  padding-left: 18px;
}
.dialogue-continue {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: rgba(0,255,231,0.5);
  margin-top: 10px;
  text-align: right;
}

/* ========== Notifications ========== */
#notification-area {
  position: fixed;
  top: 80px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}
.notification {
  background: rgba(5, 9, 16, 0.97);
  border-left: 3px solid var(--neon-cyan);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.85);
  min-width: 220px;
  max-width: 300px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.5);
  animation: notifSlideIn 0.3s ease forwards;
  position: relative;
}
.notification.success { 
  border-color: var(--neon-green); 
}
.notification.warning { 
  border-color: var(--neon-yellow); 
}
.notification.danger { 
  border-color: var(--neon-red); 
}
.notification.mdom { 
