@import url('https://fonts.googleapis.com/css2?family=Creepster&family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-deep:        #07060b;
  --bg-surface:     #0e0d15;
  --bg-elevated:    #15132a;
  --bg-terminal:    #0a0910;
  --text-primary:   #c8bfe0;
  --text-dim:       #6b6490;
  --text-faint:     #342f50;
  --ghost-green:    #39ff8e;
  --spectral-white: #e8e0ff;
  --phantom-purple: #8855cc;
  --deep-violet:    #4a2d7a;
  --evp-amber:      #dda040;
  --static-blue:    #3a6baa;
  --danger-red:     #cc3c4c;
  --ecto-cyan:      #40ddcc;
  --grid-line:      #1e1a35;
  --border-subtle:  #252040;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, .phase-title {
  font-family: 'Creepster', cursive;
  letter-spacing: 0.05em;
  color: var(--ghost-green);
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

/* Layout */
.ghost-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
}

.ghost-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ghost-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 20px rgba(57, 255, 142, 0.3);
}

.ghost-header .phase-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--phantom-purple);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.ghost-header .phase-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Panels */
.ghost-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.ghost-panel--elevated {
  background: var(--bg-elevated);
}

.ghost-panel--terminal {
  background: var(--bg-terminal);
  font-family: 'IBM Plex Mono', monospace;
}

.ghost-panel__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--phantom-purple);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* Buttons */
.ghost-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--ghost-green);
  background: transparent;
  color: var(--ghost-green);
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.ghost-btn:hover {
  background: rgba(57, 255, 142, 0.1);
  box-shadow: 0 0 15px rgba(57, 255, 142, 0.2);
}

.ghost-btn:active {
  transform: scale(0.97);
}

.ghost-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn--danger {
  border-color: var(--danger-red);
  color: var(--danger-red);
}

.ghost-btn--danger:hover {
  background: rgba(204, 60, 76, 0.1);
  box-shadow: 0 0 15px rgba(204, 60, 76, 0.2);
}

.ghost-btn--secondary {
  border-color: var(--phantom-purple);
  color: var(--phantom-purple);
}

.ghost-btn--secondary:hover {
  background: rgba(136, 85, 204, 0.1);
}

/* Inputs */
.ghost-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s ease;
  width: 100%;
}

.ghost-input:focus {
  border-color: var(--phantom-purple);
}

.ghost-input::placeholder {
  color: var(--text-faint);
}

/* Sliders */
.ghost-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.ghost-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ghost-green);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(57, 255, 142, 0.4);
  cursor: pointer;
}

.ghost-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ghost-green);
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 8px rgba(57, 255, 142, 0.4);
  cursor: pointer;
}

/* Feedback */
.ghost-feedback {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  text-align: center;
  display: none;
}

.ghost-feedback--success {
  display: block;
  background: rgba(57, 255, 142, 0.08);
  border: 1px solid rgba(57, 255, 142, 0.3);
  color: var(--ghost-green);
}

.ghost-feedback--error {
  display: block;
  background: rgba(204, 60, 76, 0.08);
  border: 1px solid rgba(204, 60, 76, 0.3);
  color: var(--danger-red);
}

.ghost-feedback--info {
  display: block;
  background: rgba(136, 85, 204, 0.08);
  border: 1px solid rgba(136, 85, 204, 0.3);
  color: var(--phantom-purple);
}

.ghost-feedback--warn {
  display: block;
  background: rgba(221, 160, 64, 0.08);
  border: 1px solid rgba(221, 160, 64, 0.3);
  color: var(--evp-amber);
}

/* Timer / Readout */
.ghost-readout {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2rem;
  font-weight: 600;
  color: var(--ghost-green);
  text-align: center;
  text-shadow: 0 0 12px rgba(57, 255, 142, 0.4);
  letter-spacing: 0.05em;
}

/* Progress bar */
.ghost-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-terminal);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem 0;
}

.ghost-progress-bar__fill {
  height: 100%;
  background: var(--ghost-green);
  border-radius: 2px;
  transition: width 0.3s ease;
  box-shadow: 0 0 6px rgba(57, 255, 142, 0.4);
}

/* Canvas container */
.ghost-canvas-wrap {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* SVG container */
.ghost-svg-wrap {
  background: var(--bg-terminal);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* Phase navigation footer */
.ghost-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* Counter */
.ghost-counter {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  z-index: 50;
  pointer-events: none;
}

/* Void overlay (scan-line texture) */
.void-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(74, 45, 122, 0.015) 2px,
    rgba(74, 45, 122, 0.015) 4px
  );
}

/* Transition mask */
.ghost-transition-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.ghost-transition-mask.active {
  opacity: 1;
  pointer-events: all;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Selection */
::selection { background: rgba(136, 85, 204, 0.3); color: var(--spectral-white); }
