/* ═══════════════════════════════════════════════════════════════════════════
   MEME MEMORIES — Archive Excavation System
   Dual-state interface: Surface Archive + Deep Memory
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --win-bg: #c8c0b8;
  --win-bg-light: #d8d0c8;
  --win-bg-dark: #7a7268;
  --win-border-light: #e8e0d8;
  --win-border-dark: #4a4238;
  --win-titlebar: linear-gradient(180deg, #3a4a3a 0%, #8aaa8a 8%, #3a5a3a 90%);
  --win-titlebar-inactive: linear-gradient(180deg, #6a6a60 0%, #a0a098 8%, #6a6a60 90%);
  --win-titlebar-text: #e8f0e8;
  --win-highlight: #3a5a3a;
  --win-highlight-text: #e8f0e8;

  --accent-green: #4ecca3;
  --accent-blue: #6a8a9a;
  --accent-red: #a06060;
  --accent-amber: #c0a060;
  --accent-teal: #5a8a7a;

  --desktop-bg: #4a5a5a;
  --taskbar-bg: linear-gradient(180deg, #b8b0a8 0%, #a8a098 3%, #908880 97%, #787068 100%);
  --taskbar-height: 36px;

  --font-system: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  --shadow-window: 2px 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-button: inset -1px -1px 0 #4a4238, inset 1px 1px 0 #e8e0d8;
  --shadow-button-pressed: inset 1px 1px 0 #4a4238, inset -1px -1px 0 #e8e0d8;

  --transition-fast: 100ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms ease;

  /* Deep Memory overrides (applied via body class) */
  --deep-bg: #0a1210;
  --deep-accent: #4ecca3;
  --deep-dim: #1a2a22;
  --deep-text: #7aaa8a;
  --deep-glow: rgba(78, 204, 163, 0.15);
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-system);
  background: var(--desktop-bg);
  color: #1a1a18;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  cursor: default;
}

::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: repeating-conic-gradient(#b8b0a8 0% 25%, #d8d0c8 0% 50%) 50% / 2px 2px; }
::-webkit-scrollbar-thumb { background: var(--win-bg); border: 1px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light); }
::-webkit-scrollbar-button { background: var(--win-bg); border: 1px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light); display: block; height: 16px; }

:focus { outline: 1px dotted #3a3a30; outline-offset: -2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }

/* ─── CRT / Decay Overlay ───────────────────────────────────────────────── */

.crt-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 10000;
  opacity: 0.04; transition: opacity var(--transition-normal);
}
.crt-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.08) 2px, rgba(0,0,0,0.08) 4px);
}
.crt-overlay.disabled { opacity: 0; }

/* Deep Memory Scanlines — only visible in deep mode */
.deep-scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 10001;
  opacity: 0; transition: opacity 1.5s ease;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 1px,
    rgba(78, 204, 163, 0.03) 1px, rgba(78, 204, 163, 0.03) 2px
  );
  mix-blend-mode: screen;
}
body.deep-memory .deep-scanlines { opacity: 1; }

/* ─── Ambient Status ────────────────────────────────────────────────────── */

.ambient-status {
  position: fixed; top: 6px; right: 12px; z-index: 500;
  font-family: var(--font-mono); font-size: 10px;
  color: rgba(200, 220, 200, 0.5); letter-spacing: 1px;
  pointer-events: none; text-shadow: 0 0 4px rgba(78, 204, 163, 0.2);
}

/* ─── Depth Indicator (visible in deep memory) ──────────────────────────── */

.depth-indicator {
  position: fixed; top: 50%; right: 14px; z-index: 600;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  opacity: 0; pointer-events: none;
  transition: opacity 1s ease 0.5s;
  font-family: var(--font-mono);
}
body.deep-memory .depth-indicator { opacity: 1; }
.depth-bar {
  width: 4px; height: 120px;
  background: rgba(78, 204, 163, 0.15);
  border: 1px solid rgba(78, 204, 163, 0.3);
  position: relative; overflow: hidden;
}
.depth-fill {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 30%; background: var(--accent-green);
  transition: height 2s ease;
  box-shadow: 0 0 8px rgba(78, 204, 163, 0.5);
}
.depth-label {
  font-size: 8px; color: var(--accent-green);
  letter-spacing: 1px; writing-mode: vertical-rl;
  text-orientation: mixed; transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DESKTOP / MEMORY FIELD
   ═══════════════════════════════════════════════════════════════════════════ */

.desktop {
  position: fixed; inset: 0; bottom: var(--taskbar-height);
  background: var(--desktop-bg);
  background-image: url('d23e4130426840f3ad0d23c4bad316d8.jpeg');
  background-size: cover; background-position: center;
  background-color: #3a4a4a;
  transition: filter 1.5s ease, background-color 1.5s ease;
}
.desktop::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(90, 100, 90, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 30%, rgba(70, 80, 90, 0.1) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
  transition: background 1.5s ease;
}

/* ─── Memory Field Layout (replaces old icon grid) ──────────────────────── */

.memory-field {
  position: absolute; inset: 0;
  padding: 20px 24px 80px 24px;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto 1fr;
  grid-template-areas:
    "primary  media   signals"
    "tools    media   signals"
    "buried   excavated excavated";
  gap: 8px;
  align-content: start;
  transition: all 1s ease;
}

.memory-zone {
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  position: relative;
  transition: all 0.8s ease;
}

.zone-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 1.5px;
  color: rgba(200, 220, 200, 0.35);
  text-shadow: 0 0 3px rgba(78, 204, 163, 0.1);
  margin-bottom: 6px;
  padding-left: 2px;
  text-transform: uppercase;
}

.zone-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zone-primary { grid-area: primary; }
.zone-tools   { grid-area: tools; }
.zone-media   { grid-area: media; }
.zone-signals { grid-area: signals; }
.zone-buried  { grid-area: buried; }
.zone-excavated { grid-area: excavated; }

/* Hidden zones (deep-memory only, or terminal-unlocked) */
.hidden-zone {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.hidden-zone.revealed {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ─── Desktop Icons ─────────────────────────────────────────────────────── */

.desktop-icon {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-xs); width: 76px; padding: 6px;
  background: transparent; border: 1px solid transparent;
  border-radius: 2px; cursor: pointer;
  transition: background var(--transition-fast), transform 0.3s ease, opacity 0.5s ease;
}
.desktop-icon:hover { background: rgba(200, 220, 200, 0.12); }
.desktop-icon:focus, .desktop-icon.selected { background: rgba(60, 90, 60, 0.3); border-color: rgba(200, 220, 200, 0.4); }
.desktop-icon:active { transform: scale(0.96); }

.icon-image { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4)); }
.icon-image svg { width: 100%; height: 100%; }

.icon-label {
  font-size: 9px; color: #d8e0d8;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  text-align: center; word-wrap: break-word; max-width: 72px;
  font-family: var(--font-mono); letter-spacing: 0.3px;
}

/* Deep-memory only icons */
.deep-only { opacity: 0.85; }
.icon-corrupted { filter: drop-shadow(0 0 4px rgba(78, 204, 163, 0.3)) saturate(1.5); }
.icon-ghost {
  filter: drop-shadow(0 0 6px rgba(78, 204, 163, 0.2));
  animation: ghost-icon-flicker 4s ease-in-out infinite;
}
@keyframes ghost-icon-flicker {
  0%, 100% { opacity: 0.85; }
  30% { opacity: 0.4; }
  32% { opacity: 0.9; }
  70% { opacity: 0.6; }
  72% { opacity: 0.85; }
}

/* ─── Windows Container ─────────────────────────────────────────────────── */

.windows-container {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 3;
}
.windows-container > * { pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   WINDOW CHROME — Standard Window
   ═══════════════════════════════════════════════════════════════════════════ */

.window {
  position: absolute; min-width: 280px; min-height: 150px;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  box-shadow: var(--shadow-window);
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(0.95);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}
.window.visible { opacity: 1; transform: scale(1); }
.window.minimized { opacity: 0; transform: scale(0.8) translateY(100px); pointer-events: none; }
.window.maximized { top: 0 !important; left: 0 !important; width: 100% !important; height: calc(100vh - var(--taskbar-height)) !important; }

.window-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  height: 26px; padding: 2px 4px;
  background: var(--win-titlebar); color: var(--win-titlebar-text);
  font-weight: bold; font-size: 12px; cursor: default; flex-shrink: 0;
}
.window:not(.focused) .window-titlebar { background: var(--win-titlebar-inactive); }
.window-titlebar.error { background: linear-gradient(180deg, #6a4040 0%, #c08060 8%, #6a4040 90%); }

.titlebar-left { display: flex; align-items: center; gap: var(--space-sm); overflow: hidden; }
.window-icon { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.window-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3px; }
.titlebar-buttons { display: flex; gap: 2px; }

.titlebar-btn {
  width: 20px; height: 20px; background: var(--win-bg);
  border: 1px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-size: 12px; font-weight: bold; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #2a2a28;
}
.titlebar-btn:hover { background: var(--win-bg-light); }
.titlebar-btn:active { border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark); }
.titlebar-btn.close-btn:hover { background: #8a5040; color: white; }

.window-body {
  flex: 1; overflow: auto; background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
  margin: 2px;
}

.window::after {
  content: ''; position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, var(--win-bg-dark) 50%, var(--win-bg-dark) 60%, transparent 60%, transparent 70%, var(--win-bg-dark) 70%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WINDOW TYPE: Fragment (smaller, damaged chrome, single close button)
   ═══════════════════════════════════════════════════════════════════════════ */

.window-fragment {
  min-width: 220px; min-height: 100px;
  max-width: 380px; max-height: 320px;
  border-color: #6a5a4a #3a2a1a #3a2a1a #6a5a4a;
  background: #c0b8a8;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.5), inset 0 0 30px rgba(0,0,0,0.05);
}
.fragment-titlebar {
  background: linear-gradient(180deg, #5a4a3a 0%, #8a7a6a 8%, #5a4a3a 90%) !important;
  height: 22px;
}
.fragment-badge {
  font-size: 7px; letter-spacing: 1px;
  background: rgba(160, 96, 96, 0.5); color: #f0e0d0;
  padding: 1px 5px; margin-left: 8px;
  font-family: var(--font-mono);
}
.fragment-body {
  background: #d0c8b8 !important;
  font-family: var(--font-mono); font-size: 11px;
  position: relative;
}
.fragment-body::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(0,0,0,0.02) 3px, rgba(0,0,0,0.02) 4px);
}
.window-fragment::after { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   WINDOW TYPE: Thread (stacked post blocks, reconstruction status)
   ═══════════════════════════════════════════════════════════════════════════ */

.window-thread {
  min-width: 360px; min-height: 300px;
  border-color: #4a6a5a #1a3a2a #1a3a2a #4a6a5a;
  background: #1a2a22;
}
.thread-titlebar {
  background: linear-gradient(180deg, #1a3a2a 0%, #3a6a4a 8%, #1a3a2a 90%) !important;
}
.thread-badge {
  font-size: 7px; letter-spacing: 1px;
  background: rgba(78, 204, 163, 0.3); color: #c8e0d0;
  padding: 1px 5px; margin-left: 8px;
  font-family: var(--font-mono);
}
.thread-body {
  background: #0c1810 !important;
  border-color: #0a1a10 #2a4a32 #2a4a32 #0a1a10 !important;
  padding: 0;
}
.thread-statusbar {
  display: flex; justify-content: space-between;
  padding: 3px 8px;
  background: #1a2a22;
  font-family: var(--font-mono); font-size: 9px;
  color: var(--accent-green); letter-spacing: 0.5px;
  border-top: 1px solid #2a4a32;
}
.thread-progress { animation: blink-status 1.5s step-end infinite; }
@keyframes blink-status { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.integrity-value { color: var(--accent-amber); }

/* Thread post blocks */
.thread-post {
  padding: 10px 12px;
  border-bottom: 1px solid #1a2a22;
  font-family: var(--font-mono); font-size: 11px;
  color: #8aaa8a;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  position: relative;
}
.thread-post.revealed {
  opacity: 1; transform: translateY(0);
}
.thread-post-header {
  font-size: 9px; color: #5a7a5a;
  margin-bottom: 4px; letter-spacing: 0.3px;
}
.thread-post-header .post-id { color: var(--accent-green); }
.thread-post-body { line-height: 1.6; }
.thread-post-body .greentext { color: #789922; }
.thread-post.corrupted {
  color: #4a5a4a;
  background: repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0,0,0,0.15) 2px, rgba(0,0,0,0.15) 4px);
}
.thread-post.corrupted::after {
  content: '[DATA CORRUPTED]';
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 9px; color: var(--accent-red); letter-spacing: 2px;
  background: rgba(12, 24, 16, 0.9); padding: 2px 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WINDOW TYPE: Scan Result (animated progress, staged reveal)
   ═══════════════════════════════════════════════════════════════════════════ */

.window-scan {
  min-width: 320px; min-height: 200px;
  max-width: 450px;
  border-color: #3a5a6a #1a2a3a #1a2a3a #3a5a6a;
  background: #0a1018;
}
.scan-titlebar {
  background: linear-gradient(180deg, #1a2a3a 0%, #3a5a6a 8%, #1a2a3a 90%) !important;
}
.scan-body {
  background: #080c10 !important;
  border-color: #0a0e12 #1a2a3a #1a2a3a #0a0e12 !important;
  padding: 10px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent-blue);
}
.scan-output {
  min-height: 100px; white-space: pre-wrap;
  line-height: 1.6;
}
.scan-output .scan-line {
  opacity: 0; transform: translateX(-5px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.scan-output .scan-line.revealed { opacity: 1; transform: translateX(0); }
.scan-output .scan-found { color: var(--accent-green); font-weight: bold; }
.scan-output .scan-warn { color: var(--accent-amber); }
.scan-output .scan-fail { color: var(--accent-red); }
.scan-progress-bar {
  height: 6px; margin-top: 10px;
  background: #0a1018; border: 1px solid #1a2a3a;
  overflow: hidden;
}
.scan-progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  transition: width 0.3s ease;
  box-shadow: 0 0 8px rgba(106, 138, 154, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   WINDOW TYPE: Ghost (flickering, semi-transparent, unstable)
   ═══════════════════════════════════════════════════════════════════════════ */

.window-ghost {
  border-color: rgba(78, 204, 163, 0.3) rgba(78, 204, 163, 0.1) rgba(78, 204, 163, 0.1) rgba(78, 204, 163, 0.3);
  background: rgba(10, 18, 16, 0.85);
  box-shadow: 0 0 20px rgba(78, 204, 163, 0.1), 2px 2px 8px rgba(0,0,0,0.5);
  animation: ghost-window-flicker 6s ease-in-out infinite;
}
@keyframes ghost-window-flicker {
  0%, 100% { opacity: 0.9; }
  15% { opacity: 0.5; }
  16% { opacity: 0.95; }
  50% { opacity: 0.85; }
  80% { opacity: 0.4; }
  82% { opacity: 0.9; }
}
.window-ghost .window-titlebar {
  background: linear-gradient(180deg, rgba(78, 204, 163, 0.2) 0%, rgba(78, 204, 163, 0.1) 100%) !important;
}
.window-ghost .window-body {
  background: rgba(10, 18, 16, 0.9) !important;
  border-color: rgba(78, 204, 163, 0.15) !important;
  color: var(--deep-text);
  font-family: var(--font-mono); font-size: 11px;
  padding: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TASKBAR — Surface Mode
   ═══════════════════════════════════════════════════════════════════════════ */

.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--taskbar-height);
  background: var(--taskbar-bg);
  border-top: 1px solid var(--win-border-light);
  display: flex; align-items: center;
  z-index: 9000;
  transition: all 0.8s ease;
}
.taskbar-surface {
  display: flex; align-items: center;
  width: 100%; padding: 2px 4px; gap: var(--space-xs);
  transition: opacity 0.5s ease;
}
.taskbar-surface.hidden { display: none; }

.start-button {
  display: flex; align-items: center; gap: var(--space-sm);
  height: 28px; padding: 2px 8px;
  background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-weight: bold; font-size: 11px; cursor: pointer;
  font-family: var(--font-mono); letter-spacing: 0.5px;
  transition: all var(--transition-fast);
}
.start-button:hover { background: var(--win-bg-light); }
.start-button:active, .start-button.active {
  border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
  padding: 3px 7px 1px 9px;
}
.start-icon { width: 18px; height: 18px; }

.taskbar-divider { width: 2px; height: 24px; background: var(--win-border-dark); box-shadow: 1px 0 0 var(--win-border-light); margin: 0 2px; }

.taskbar-windows { flex: 1; display: flex; gap: 2px; overflow-x: auto; padding: 0 4px; }
.taskbar-item {
  display: flex; align-items: center; gap: var(--space-sm);
  height: 26px; min-width: 120px; max-width: 200px;
  padding: 2px 8px; background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-size: 10px; font-family: var(--font-mono); cursor: pointer; overflow: hidden;
}
.taskbar-item:hover { background: var(--win-bg-light); }
.taskbar-item.active { border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark); background: repeating-conic-gradient(var(--win-bg) 0% 25%, var(--win-bg-light) 0% 50%) 50% / 2px 2px; }
.taskbar-item-icon { font-size: 14px; flex-shrink: 0; }
.taskbar-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.system-tray {
  display: flex; align-items: center; gap: var(--space-sm);
  height: 28px; padding: 2px 8px; background: var(--win-bg);
  border: 1px solid; border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark);
}
.tray-status { font-size: 9px; font-family: var(--font-mono); color: #5a6a5a; letter-spacing: 0.5px; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-icon { width: 20px; height: 20px; background: none; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 2px; color: #2a2a28; }
.tray-icon:hover { background: rgba(0,0,0,0.1); }
.tray-icon svg { width: 16px; height: 16px; }
.tray-icon.muted .volume-on { display: none; }
.tray-icon.muted .volume-off { display: block !important; }
.clock { font-size: 11px; font-family: var(--font-mono); padding: 0 4px; min-width: 48px; text-align: center; color: #3a3a30; }

/* ═══════════════════════════════════════════════════════════════════════════
   TASKBAR — Deep Memory Recovery Strip
   ═══════════════════════════════════════════════════════════════════════════ */

.taskbar-deep {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0 8px;
  transition: opacity 0.5s ease;
}
.taskbar-deep.hidden { display: none; }

.recovery-strip {
  display: flex; align-items: center; gap: 12px;
}
.recovery-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: bold;
  color: var(--accent-green); letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(78, 204, 163, 0.4);
  animation: label-pulse 3s ease-in-out infinite;
}
@keyframes label-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.recovery-sectors {
  display: flex; gap: 3px;
  font-family: var(--font-mono); font-size: 10px;
}
.sector {
  color: #1a3a2a;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.sector.active {
  color: var(--accent-green);
  text-shadow: 0 0 4px rgba(78, 204, 163, 0.6);
}
.sector.scanned { color: #2a5a3a; }
.recovery-status {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--accent-amber); letter-spacing: 1px;
  animation: blink-status 2s step-end infinite;
}

.deep-tray {
  display: flex; align-items: center; gap: 8px;
}
.fragments-found {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--accent-green); letter-spacing: 0.5px;
}
.deep-clock {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent-green);
  text-shadow: 0 0 4px rgba(78, 204, 163, 0.3);
}

/* Deep Memory taskbar transform */
body.deep-memory .taskbar {
  background: linear-gradient(180deg, #0a1a10 0%, #0c1c12 50%, #081008 100%);
  border-top: 1px solid #1a3a2a;
}
body.deep-memory .taskbar .taskbar-divider {
  background: #1a3a2a; box-shadow: 1px 0 0 #0a1a0a;
}

/* ═══════════════════════════════════════════════════════════════════════════
   START MENU
   ═══════════════════════════════════════════════════════════════════════════ */

.start-menu {
  position: fixed; bottom: calc(var(--taskbar-height) + 2px); left: 2px;
  width: 210px; background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  box-shadow: 4px 4px 10px rgba(0,0,0,0.35);
  display: flex; z-index: 9500;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}
.start-menu.open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.start-menu-sidebar {
  width: 24px;
  background: linear-gradient(180deg, #2a3a2a 0%, #5a7a5a 100%);
  display: flex; align-items: flex-end; padding-bottom: var(--space-sm);
}
.sidebar-text {
  color: #c8e0c8; font-weight: bold; font-size: 14px;
  writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
  letter-spacing: 2px; font-family: var(--font-mono);
}
.start-menu-content { flex: 1; padding: var(--space-xs) 0; }
.start-menu-item {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; padding: var(--space-sm) var(--space-md);
  background: transparent; border: none;
  font-size: 11px; font-family: var(--font-mono); text-align: left; cursor: pointer; color: #2a2a28;
}
.start-menu-item:hover, .start-menu-item:focus { background: var(--win-highlight); color: var(--win-highlight-text); }
.start-menu-item.shutdown:hover { background: #6a4040; }
.menu-icon { width: 16px; height: 16px; flex-shrink: 0; }
.start-menu-item .submenu-arrow { margin-left: auto; font-size: 8px; }
.start-menu-divider { height: 1px; background: var(--win-border-dark); margin: var(--space-xs) var(--space-md); box-shadow: 0 1px 0 var(--win-border-light); }

.submenu {
  position: fixed; left: 214px; bottom: calc(var(--taskbar-height) + 2px);
  width: 200px; background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  box-shadow: 4px 4px 10px rgba(0,0,0,0.35);
  padding: var(--space-xs) 0; z-index: 9501;
  opacity: 0; pointer-events: none; transition: opacity var(--transition-fast);
}
.submenu.open { opacity: 1; pointer-events: auto; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; opacity: 0; pointer-events: none; transition: opacity var(--transition-normal);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  box-shadow: 4px 4px 14px rgba(0,0,0,0.45);
  min-width: 280px; max-width: 90vw;
}
.modal .window-titlebar { cursor: default; }
.modal-body { padding: var(--space-lg); text-align: center; }

.shutdown-icon { font-size: 48px; margin-bottom: var(--space-md); }
.shutdown-text { font-size: 16px; font-weight: bold; margin-bottom: var(--space-sm); font-family: var(--font-mono); }
.shutdown-subtext { font-size: 11px; color: #6a6a60; margin-bottom: var(--space-lg); font-family: var(--font-mono); }
.shutdown-buttons, .error-buttons { display: flex; gap: var(--space-md); justify-content: center; }
.error-content { display: flex; align-items: flex-start; gap: var(--space-md); text-align: left; margin-bottom: var(--space-lg); }
.error-icon { font-size: 32px; }

.image-viewer-modal { max-width: 80vw; max-height: 80vh; }
.image-viewer-body { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); padding: var(--space-lg); background: #1a1a18; }
.image-viewer-body img { max-width: 100%; max-height: 60vh; object-fit: contain; }
.image-controls { display: flex; align-items: center; gap: var(--space-md); color: #c8c0b8; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.win-button {
  padding: var(--space-sm) var(--space-lg); background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-size: 12px; cursor: pointer; font-family: var(--font-mono); transition: all var(--transition-fast);
}
.win-button:hover { background: var(--win-bg-light); }
.win-button:active { border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark); }
.win-button.primary { font-weight: bold; outline: 1px solid #3a3a30; outline-offset: -4px; }
.win-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════════════
   EXCAVATE / SURFACE BUTTONS (replaces old flowstate btn)
   ═══════════════════════════════════════════════════════════════════════════ */

.dive-btn {
  position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 36px 8px;
  background: linear-gradient(180deg, #0c1a10 0%, #1a3a22 50%, #0c1a10 100%);
  border: 1px solid #2a5a3a;
  color: var(--accent-green); cursor: pointer;
  font-family: var(--font-mono);
  box-shadow: 0 0 20px rgba(78, 204, 163, 0.15), inset 0 1px 0 rgba(78, 204, 163, 0.2);
  transition: all 0.3s ease;
}
.dive-btn:hover {
  background: linear-gradient(180deg, #1a2a1a 0%, #2a4a32 50%, #1a2a1a 100%);
  box-shadow: 0 0 30px rgba(78, 204, 163, 0.25), inset 0 1px 0 rgba(78, 204, 163, 0.3);
  transform: translateX(-50%) scale(1.03);
}
.dive-btn:active { transform: translateX(-50%) scale(0.97); }
.dive-btn.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) scale(0.8); }
.dive-icon { font-size: 16px; line-height: 1; animation: dive-arrow-bounce 2s ease-in-out infinite; }
@keyframes dive-arrow-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.dive-text { font-size: 12px; font-weight: bold; letter-spacing: 3px; }
.dive-sub { font-size: 8px; letter-spacing: 1px; opacity: 0.5; margin-top: 2px; }

.surface-btn {
  position: fixed; bottom: 56px; left: 50%; transform: translateX(-50%);
  z-index: 9998;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 28px 6px;
  background: linear-gradient(180deg, #1a2a22 0%, #0a1810 100%);
  border: 1px solid var(--accent-green);
  color: var(--accent-green); cursor: pointer;
  font-family: var(--font-mono);
  box-shadow: 0 0 15px rgba(78, 204, 163, 0.2);
  transition: all 0.3s ease;
}
.surface-btn:hover {
  box-shadow: 0 0 25px rgba(78, 204, 163, 0.3);
  transform: translateX(-50%) scale(1.03);
}
.surface-btn.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) scale(0.8); }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: FOUND_NOTE / Notepad
   ═══════════════════════════════════════════════════════════════════════════ */

.notepad-content { display: flex; flex-direction: column; height: 100%; background: #f5f0e8; }
.notepad-menubar { display: flex; gap: var(--space-md); padding: var(--space-xs) var(--space-sm); background: var(--win-bg); border-bottom: 1px solid var(--win-border-dark); font-size: 12px; }
.notepad-menubar span { cursor: pointer; }
.notepad-menubar span:hover { background: var(--win-highlight); color: var(--win-highlight-text); }
.notepad-text { flex: 1; padding: var(--space-md); font-family: var(--font-mono); font-size: 12px; line-height: 1.7; overflow: auto; color: #2a2a28; }
.notepad-text p { margin: 0; }
.notepad-text .file-header { font-size: 10px; color: #8a8a80; letter-spacing: 0.3px; }
.notepad-text .typewriter { font-size: 15px; color: #3a5a3a; font-weight: bold; }

.readme-cta { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px dashed #c0b8a8; }
.ca-display { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.ca-display label { font-weight: bold; font-size: 10px; color: #6a6a60; letter-spacing: 0.3px; }
.ca-display input { padding: var(--space-sm); border: 1px solid var(--win-border-dark); font-family: var(--font-mono); font-size: 11px; background: #ece8e0; }

.copy-ca-btn {
  padding: var(--space-md) var(--space-xl);
  background: linear-gradient(180deg, #5a8a5a 0%, #3a6a3a 100%);
  border: 2px solid; border-color: #7aaa7a #2a4a2a #2a4a2a #7aaa7a;
  color: #e8f0e8; font-weight: bold; font-size: 13px;
  cursor: pointer; font-family: var(--font-mono); letter-spacing: 0.5px;
  transition: all var(--transition-fast);
}
.copy-ca-btn:hover { background: linear-gradient(180deg, #6a9a6a 0%, #4a7a4a 100%); }
.copy-ca-btn .copied-text { display: none; }
.copy-ca-btn.copied .copy-text { display: none; }
.copy-ca-btn.copied .copied-text { display: inline; }
.copy-ca-btn.copied { background: linear-gradient(180deg, #6a8a9a 0%, #4a6a7a 100%); }

.cta-buttons { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.cta-btn {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md); background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-size: 11px; text-decoration: none; color: #2a2a28; cursor: pointer;
  font-family: var(--font-mono); transition: all var(--transition-fast);
}
.cta-btn img { width: 16px; height: 16px; object-fit: contain; }
.cta-btn:hover { background: var(--win-bg-light); }

.notepad-statusbar {
  display: flex; justify-content: space-between;
  padding: var(--space-xs) var(--space-sm); background: var(--win-bg);
  border-top: 1px solid var(--win-border-dark);
  font-size: 10px; color: #6a6a60; font-family: var(--font-mono);
}
.nostalgia-mode { color: var(--accent-green); font-weight: bold; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: Signal Board
   ═══════════════════════════════════════════════════════════════════════════ */

.links-content { padding: var(--space-lg); background: #f0ece4; }
.links-content h2 { margin-bottom: var(--space-xs); font-size: 14px; font-family: var(--font-mono); color: #3a3a30; }
.links-subtitle { font-size: 10px; color: #8a8a80; margin-bottom: var(--space-lg); font-family: var(--font-mono); }
.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: var(--space-lg); }
.link-item {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-sm);
  padding: var(--space-md); background: transparent; border: 1px solid transparent;
  text-decoration: none; color: #2a2a28; cursor: pointer; transition: all var(--transition-fast);
}
.link-item:hover { background: rgba(60, 90, 60, 0.1); border-color: var(--win-highlight); }
.link-icon {
  font-size: 32px; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--win-bg); border: 1px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
}
.link-icon img { width: 100%; height: 100%; object-fit: contain; }
.link-item span { font-size: 10px; text-align: center; font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: Music / Tape Deck
   ═══════════════════════════════════════════════════════════════════════════ */

.music-player { background: linear-gradient(180deg, #1a1a18 0%, #0c1a0c 100%); padding: var(--space-md); min-height: 280px; }
.tape-label { text-align: center; padding: var(--space-xs) var(--space-sm); margin-bottom: var(--space-sm); background: #2a2a28; border: 1px solid #3a3a38; }
.tape-label-text { font-family: var(--font-mono); font-size: 9px; color: #6a7a6a; letter-spacing: 2px; }
.player-display { background: #0a0a08; border: 2px solid; border-color: #000 #3a3a38 #3a3a38 #000; padding: var(--space-sm); margin-bottom: var(--space-md); }
.player-display canvas { width: 100%; height: 60px; display: block; }
.track-info { display: flex; justify-content: space-between; color: #4ecca3; font-family: var(--font-mono); font-size: 10px; margin-top: var(--space-sm); }
.player-progress { margin-bottom: var(--space-md); }

.progress-bar, .volume-bar {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; background: #0a0a08;
  border: 1px solid #3a3a38; cursor: pointer;
}
.progress-bar::-webkit-slider-thumb, .volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 16px; background: #4ecca3;
  border: 1px solid; border-color: #7ee8c0 #2d8a6e #2d8a6e #7ee8c0; cursor: pointer;
}
.volume-bar { width: 80px; }

.player-controls { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.player-btn {
  width: 36px; height: 36px;
  background: linear-gradient(180deg, #2a3a2a 0%, #1a2a1a 100%);
  border: 2px solid; border-color: #4a5a4a #0a1a0a #0a1a0a #4a5a4a;
  color: #c8e0c8; font-size: 14px; cursor: pointer; transition: all var(--transition-fast);
}
.player-btn.play-btn {
  width: 48px; height: 48px; font-size: 18px;
  background: linear-gradient(180deg, #4a6a4a 0%, #3a5a3a 100%);
  border-color: #6a8a6a #1a3a1a #1a3a1a #6a8a6a;
}
.player-btn.playing { background: linear-gradient(180deg, #4ecca3 0%, #3db892 100%); border-color: #7ee8c0 #2d8a6e #2d8a6e #7ee8c0; }
.volume-control { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; }
.volume-icon { color: #6a7a6a; }

.playlist { background: #0a0a08; border: 1px solid #3a3a38; }
.playlist-header { padding: var(--space-sm); background: #1a1a18; color: #5a6a5a; font-size: 9px; text-transform: uppercase; letter-spacing: 1px; font-family: var(--font-mono); }
.playlist-empty-text { padding: var(--space-sm) var(--space-md); color: #4a5a4a; font-size: 10px; font-family: var(--font-mono); line-height: 1.6; }
.audio-error { text-align: center; color: #5a6a5a; padding: var(--space-lg); font-family: var(--font-mono); }
.audio-error .small { font-size: 10px; margin-top: var(--space-sm); }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: Memory Scan / Calculator
   ═══════════════════════════════════════════════════════════════════════════ */

.calculator-content { padding: var(--space-lg); background: var(--win-bg); }
.calc-header { text-align: center; margin-bottom: var(--space-lg); }
.calc-header h2 { font-size: 13px; margin-bottom: var(--space-xs); font-family: var(--font-mono); }
.calc-subtitle { font-size: 10px; color: #7a7a70; font-style: italic; font-family: var(--font-mono); }
.calc-inputs { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-lg); }
.calc-field { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); }
.calc-field label { font-size: 11px; font-family: var(--font-mono); }
.calc-field input { width: 80px; padding: var(--space-sm); border: 1px solid; border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark); font-family: var(--font-mono); text-align: right; background: #ece8e0; }
.calc-buttons { display: flex; gap: var(--space-md); justify-content: center; margin-bottom: var(--space-lg); }
.calc-btn { min-width: 100px; }
.calc-result { background: #f0ece4; border: 2px solid; border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark); padding: var(--space-md); text-align: center; font-family: var(--font-mono); }
.result-level { font-size: 13px; font-weight: bold; margin-bottom: var(--space-sm); }
.result-level span { color: var(--accent-green); }
.result-dose { font-size: 11px; color: #6a6a60; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: Gallery / Excavation Board
   ═══════════════════════════════════════════════════════════════════════════ */

.gallery-content { background: #1a1a18; min-height: 300px; }

.gallery-toolbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 6px 10px; gap: 8px;
  background: #0c0c0a;
  border-bottom: 1px solid #2a2a28;
  font-family: var(--font-mono);
}
.gallery-toolbar-left { display: flex; align-items: center; gap: 12px; }
.gallery-title { font-size: 10px; color: var(--accent-green); letter-spacing: 1.5px; font-weight: bold; }
.gallery-filters { display: flex; gap: 2px; }
.gallery-filter {
  padding: 2px 8px; background: transparent; border: 1px solid #2a2a28;
  font-family: var(--font-mono); font-size: 8px; color: #5a5a58;
  cursor: pointer; letter-spacing: 0.5px; transition: all 0.2s ease;
}
.gallery-filter:hover { border-color: #4a4a48; color: #8a8a88; }
.gallery-filter.active { border-color: var(--accent-green); color: var(--accent-green); background: rgba(78, 204, 163, 0.08); }
.gallery-toolbar-right { display: flex; align-items: center; gap: 8px; }
.gallery-status { font-size: 8px; color: #4a4a48; }

.upload-btn {
  padding: 3px 8px; background: #1a2a1a; border: 1px solid #2a4a2a;
  cursor: pointer; font-size: 9px; font-family: var(--font-mono);
  color: var(--accent-green); letter-spacing: 0.5px; transition: all 0.2s ease;
}
.upload-btn:hover { background: #2a3a2a; }

/* Excavation Board Layout */
.excavation-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 8px;
}
.excavation-card {
  position: relative;
  aspect-ratio: 1;
  background: #0c0c0a;
  border: 1px solid #2a2a28;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
}
.excavation-card:hover { border-color: var(--accent-green); }
.excavation-card img { width: 100%; height: 100%; object-fit: cover; }

.excavation-card .artifact-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 3px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  font-family: var(--font-mono); font-size: 7px;
  color: #8a8a80; letter-spacing: 0.3px;
}
.excavation-card .artifact-status {
  position: absolute; top: 3px; right: 3px;
  font-family: var(--font-mono); font-size: 6px;
  padding: 1px 4px; letter-spacing: 0.5px;
}
.artifact-status.recovered { background: rgba(78, 204, 163, 0.2); color: var(--accent-green); border: 1px solid rgba(78, 204, 163, 0.3); }
.artifact-status.damaged { background: rgba(192, 160, 96, 0.2); color: var(--accent-amber); border: 1px solid rgba(192, 160, 96, 0.3); }
.artifact-status.missing { background: rgba(160, 96, 96, 0.2); color: var(--accent-red); border: 1px solid rgba(160, 96, 96, 0.3); }
.artifact-status.buried { background: rgba(90, 138, 122, 0.2); color: var(--accent-teal); border: 1px solid rgba(90, 138, 122, 0.3); }

.excavation-card.card-missing {
  background: repeating-linear-gradient(45deg, #0c0c0a, #0c0c0a 4px, #111110 4px, #111110 8px);
}
.excavation-card.card-missing .placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 14px; color: #2a2a28; opacity: 0.5;
}
.excavation-card.card-buried {
  filter: brightness(0.4) saturate(0.3);
  border-style: dashed;
}
.excavation-card.card-buried:hover { filter: brightness(0.7) saturate(0.6); }

.gallery-empty-note {
  padding: var(--space-md); font-size: 11px; color: #4a4a48;
  text-align: center; line-height: 1.6; font-family: var(--font-mono);
}
.gallery-empty-note a { color: var(--accent-green); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: About / Incident Log
   ═══════════════════════════════════════════════════════════════════════════ */

.about-content { padding: var(--space-xl); background: linear-gradient(180deg, #f0ece4 0%, #e8e4dc 100%); text-align: center; }
.about-header { margin-bottom: var(--space-xl); }
.about-logo { font-size: 48px; margin-bottom: var(--space-md); }
.about-header h1 { font-size: 24px; color: #3a5a3a; margin-bottom: var(--space-sm); font-family: var(--font-mono); letter-spacing: 1px; }
.about-header .tagline { font-size: 12px; color: #6a6a60; font-style: italic; font-family: var(--font-mono); }
.about-header .tagline-ticker { font-size: 14px; color: var(--accent-green); font-weight: bold; font-family: var(--font-mono); margin-top: var(--space-xs); }
.about-body { margin-bottom: var(--space-xl); }
.incident-report { background: #f5f0e8; border: 1px dashed #b0a898; padding: var(--space-lg); text-align: left; display: inline-block; font-family: var(--font-mono); font-size: 11px; line-height: 1.8; color: #4a4a40; }
.incident-report .report-header { font-weight: bold; color: #3a5a3a; font-size: 12px; margin-bottom: var(--space-sm); letter-spacing: 1px; }
.about-body p { font-size: 12px; line-height: 1.8; font-family: var(--font-mono); }
.rules { background: var(--win-bg); padding: var(--space-lg); border: 2px solid; border-color: var(--win-border-dark) var(--win-border-light) var(--win-border-light) var(--win-border-dark); text-align: left; display: inline-block; font-family: var(--font-mono); }
.rules h3 { font-size: 12px; margin-bottom: var(--space-sm); color: #3a5a3a; }
.rules p { font-size: 11px; margin: var(--space-xs) 0; color: #4a4a40; }
.about-footer { font-size: 10px; color: #8a8a80; font-family: var(--font-mono); }
.about-footer .credits { margin-top: var(--space-sm); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: Terminal / Archive Console
   ═══════════════════════════════════════════════════════════════════════════ */

.terminal-content {
  background: #0a0c0a; color: #a0b0a0;
  font-family: var(--font-mono); font-size: 12px;
  padding: var(--space-sm); min-height: 250px;
  display: flex; flex-direction: column;
}
.terminal-output { flex: 1; overflow-y: auto; white-space: pre-wrap; word-wrap: break-word; }
.terminal-output p { margin: 0; line-height: 1.5; }
.terminal-output .terminal-header { color: #5a7a5a; }
.terminal-output .command { color: #4ecca3; }
.terminal-output .response { color: #8aa08a; }
.terminal-output .error { color: #c08060; }
.terminal-output .lore { color: #a0a060; font-style: italic; }
.terminal-output .system { color: #5a8a7a; }
.terminal-output .excavation { color: var(--accent-green); font-weight: bold; }
.terminal-input-line { display: flex; align-items: center; margin-top: var(--space-sm); }
.prompt { color: #4ecca3; margin-right: var(--space-sm); flex-shrink: 0; font-size: 11px; }
.terminal-input { flex: 1; background: transparent; border: none; color: #c8e0c8; font-family: inherit; font-size: inherit; outline: none; caret-color: #4ecca3; }

/* ═══════════════════════════════════════════════════════════════════════════
   CONTENT: Settings
   ═══════════════════════════════════════════════════════════════════════════ */

.settings-content { padding: var(--space-lg); background: var(--win-bg); }
.settings-content h2 { font-size: 13px; margin-bottom: var(--space-xs); font-family: var(--font-mono); }
.settings-subtitle { font-size: 10px; color: #7a7a70; margin-bottom: var(--space-lg); font-family: var(--font-mono); }
.settings-group { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-xl); }
.setting-item { display: flex; align-items: center; gap: var(--space-md); font-size: 11px; cursor: pointer; font-family: var(--font-mono); }
.setting-item input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.settings-actions { display: flex; gap: var(--space-md); flex-wrap: wrap; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST & FLOATING ERRORS
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed; bottom: calc(var(--taskbar-height) + 12px); right: 12px;
  display: flex; flex-direction: column; gap: 8px; z-index: 12000;
}
.toast {
  background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  padding: var(--space-sm) var(--space-md);
  font-size: 11px; font-family: var(--font-mono);
  box-shadow: 2px 2px 6px rgba(0,0,0,0.25);
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}
.toast.visible { opacity: 1; transform: translateY(0); }

.floating-error {
  position: fixed; z-index: 9800;
  min-width: 300px; max-width: 380px;
  background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  box-shadow: 4px 4px 12px rgba(0,0,0,0.4);
  opacity: 0; transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.floating-error.visible { opacity: 1; transform: scale(1); }
.floating-error .error-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 5px;
  background: linear-gradient(180deg, #5a6a5a 0%, #8aaa8a 8%, #5a6a5a 90%);
  color: #e8f0e8; font-weight: bold; font-size: 11px; font-family: var(--font-mono);
}
.floating-error .error-titlebar span { display: flex; align-items: center; gap: 6px; }
.floating-error .error-close {
  width: 18px; height: 18px; background: var(--win-bg);
  border: 1px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.floating-error .error-close:hover { background: #8a5040; color: #fff; }
.floating-error .error-body { display: flex; align-items: flex-start; gap: 12px; padding: 14px; }
.floating-error .error-icon { font-size: 28px; flex-shrink: 0; }
.floating-error .error-message { font-size: 11px; line-height: 1.5; font-family: var(--font-mono); color: #3a3a30; }
.floating-error .error-buttons { display: flex; justify-content: center; gap: 8px; padding: 0 14px 14px; }
.floating-error .error-btn {
  padding: 4px 20px; background: var(--win-bg);
  border: 2px solid; border-color: var(--win-border-light) var(--win-border-dark) var(--win-border-dark) var(--win-border-light);
  font-size: 11px; cursor: pointer; font-family: var(--font-mono);
}
.floating-error .error-btn:hover { background: var(--win-bg-light); }

/* ═══════════════════════════════════════════════════════════════════════════
   DEEP MEMORY STATE — Complete visual overhaul
   ═══════════════════════════════════════════════════════════════════════════ */

body.deep-memory { transition: all 1.5s ease; }

body.deep-memory .desktop {
  filter: saturate(0.4) brightness(0.5) contrast(1.1);
  background-color: #0a1210;
}
body.deep-memory .desktop::after {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(78, 204, 163, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(40, 80, 60, 0.1) 0%, transparent 40%),
    linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.4) 100%);
}

/* Deep Memory vignette */
body.deep-memory::after {
  content: ''; position: fixed; inset: 0;
  pointer-events: none; z-index: 9999;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 10, 8, 0.6) 100%);
}

body.deep-memory .crt-overlay {
  opacity: 0.08;
  background: linear-gradient(180deg, rgba(78, 204, 163, 0.02) 0%, rgba(40, 80, 60, 0.04) 50%, rgba(78, 204, 163, 0.02) 100%);
}

/* Memory field reconfigures in deep memory */
body.deep-memory .memory-field {
  grid-template-columns: 1fr 1.5fr 1fr;
  grid-template-areas:
    "buried  primary  tools"
    "buried  media    signals"
    "excavated excavated excavated";
  padding-top: 30px;
}

body.deep-memory .zone-label {
  color: rgba(78, 204, 163, 0.5);
  text-shadow: 0 0 6px rgba(78, 204, 163, 0.3);
}

body.deep-memory .memory-zone {
  border-color: rgba(78, 204, 163, 0.08);
  background: rgba(0, 20, 16, 0.3);
  border-radius: 0;
}

body.deep-memory .icon-label {
  color: #7aaa8a;
  text-shadow: 0 0 4px rgba(78, 204, 163, 0.3), 1px 1px 2px rgba(0,0,0,0.8);
}

body.deep-memory .desktop-icon:hover {
  background: rgba(78, 204, 163, 0.1);
}

body.deep-memory .ambient-status {
  color: rgba(78, 204, 163, 0.6);
  animation: deep-status-pulse 4s ease-in-out infinite;
}
@keyframes deep-status-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Deep Memory window modifications */
body.deep-memory .window-standard {
  box-shadow: 0 0 15px rgba(78, 204, 163, 0.08), 2px 2px 10px rgba(0,0,0,0.5);
}
body.deep-memory .window-standard .window-titlebar {
  background: linear-gradient(180deg, #1a2a22 0%, #2a4a32 8%, #1a2a22 90%);
}

/* Deep Memory clock */
body.deep-memory .clock { animation: deep-clock-flicker 3s ease-in-out infinite; }
@keyframes deep-clock-flicker {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.3; }
  42% { opacity: 0.9; }
  80% { opacity: 0.5; }
}

/* Floating physics in deep memory */
body.deep-memory .desktop-icon.floating-physics {
  transition: none !important;
}

body.deep-memory .window.floating {
  position: fixed !important; z-index: 200;
}

/* Ghost window spawns in deep memory */
body.deep-memory .floating-error {
  border-color: rgba(78, 204, 163, 0.3) rgba(78, 204, 163, 0.1) rgba(78, 204, 163, 0.1) rgba(78, 204, 163, 0.3);
  background: rgba(10, 18, 16, 0.95);
}
body.deep-memory .floating-error .error-titlebar {
  background: linear-gradient(180deg, #1a2a22 0%, #2a4a32 8%, #1a2a22 90%);
}
body.deep-memory .floating-error .error-message { color: var(--deep-text); }
body.deep-memory .floating-error .error-btn {
  background: #1a2a22; border-color: #2a4a32;
  color: var(--accent-green);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root { --taskbar-height: 48px; }

  .memory-field {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "primary tools"
      "media   signals"
      "buried  excavated";
    padding: 12px;
  }
  body.deep-memory .memory-field {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "buried  primary"
      "media   tools"
      "signals excavated";
  }

  .zone-items { gap: 4px; }
  .desktop-icon { width: 64px; padding: 4px; }
  .icon-image { width: 36px; height: 36px; }
  .icon-label { font-size: 7px; max-width: 60px; }

  .window {
    position: fixed !important; top: 0 !important; left: 0 !important;
    width: 100% !important; height: calc(100vh - var(--taskbar-height)) !important;
    border: none;
  }
  .window::after { display: none; }
  .titlebar-btn.minimize-btn, .titlebar-btn.maximize-btn { display: none; }

  .start-menu { width: calc(100vw - 16px); left: 8px; }
  .submenu { position: fixed; left: 8px; right: 8px; bottom: auto; top: 8px; width: auto; }
  .taskbar-windows { display: none; }

  .excavation-board { grid-template-columns: repeat(3, 1fr); }
  .cta-buttons { flex-direction: column; }
  .links-grid { grid-template-columns: repeat(2, 1fr); }
  .tray-status { display: none; }
  .ambient-status { display: none; }
  .depth-indicator { display: none; }

  .dive-btn, .surface-btn { bottom: 54px; padding: 6px 20px 5px; }
  .dive-text { font-size: 10px; letter-spacing: 2px; }
}

@media (max-width: 480px) {
  .memory-field { grid-template-columns: 1fr; grid-template-areas: "primary" "tools" "media" "signals" "buried" "excavated"; }
  .excavation-board { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Reduced Motion ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
body.reduced-motion *, body.reduced-motion *::before, body.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media print {
  .taskbar, .start-menu, .crt-overlay, .modal-overlay, .ambient-status, .depth-indicator, .deep-scanlines { display: none !important; }
  .desktop { position: static; background: #fff; }
  .window { position: static !important; page-break-inside: avoid; }
}
