:root {
  --bg-deep: #0a0a14;
  --bg-panel: #0d1120;
  --bg-card: #111827;
  --accent-cyan: #00f5d4;
  --accent-green: #00ff41;
  --accent-magenta: #ff006e;
  --accent-amber: #fbbf24;
  --text-primary: #e0e7ff;
  --text-dim: #6b7280;
  --border-color: #1e293b;
}

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

html, body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Fira Code', 'Courier New', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(0, 245, 212, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 0, 110, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

/* Scanline overlay */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  mix-blend-mode: multiply;
}

/* CRT bezel */
.crt-bezel {
  background: linear-gradient(145deg, #1a1a2e 0%, #0d0d1a 50%, #1a1a2e 100%);
  border: 3px solid #2a2a4a;
  border-radius: 12px;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 245, 212, 0.05),
    0 4px 20px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.crt-bezel::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 14px;
  background: linear-gradient(45deg, rgba(0, 245, 212, 0.15), transparent 40%, transparent 60%, rgba(255, 0, 110, 0.15));
  z-index: -1;
}

/* Glow text */
.glow-cyan {
  text-shadow: 0 0 7px rgba(0, 245, 212, 0.6), 0 0 20px rgba(0, 245, 212, 0.3);
}

.glow-green {
  text-shadow: 0 0 7px rgba(0, 255, 65, 0.6), 0 0 20px rgba(0, 255, 65, 0.3);
}

.glow-magenta {
  text-shadow: 0 0 7px rgba(255, 0, 110, 0.6), 0 0 20px rgba(255, 0, 110, 0.3);
}

/* Pulsing dot */
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px currentColor; }
  50% { opacity: 0.5; box-shadow: 0 0 12px currentColor, 0 0 20px currentColor; }
}

.status-dot {
  animation: pulse 2s ease-in-out infinite;
}

/* Rules border glow */
@keyframes borderGlow {
  0%, 100% { 
    border-color: rgba(0, 245, 212, 0.3);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.1), inset 0 0 10px rgba(0, 245, 212, 0.05);
  }
  33% { 
    border-color: rgba(255, 0, 110, 0.3);
    box-shadow: 0 0 10px rgba(255, 0, 110, 0.1), inset 0 0 10px rgba(255, 0, 110, 0.05);
  }
  66% { 
    border-color: rgba(251, 191, 36, 0.3);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.1), inset 0 0 10px rgba(251, 191, 36, 0.05);
  }
}

.rules-box {
  animation: borderGlow 4s ease-in-out infinite;
  border: 2px dashed rgba(0, 245, 212, 0.3);
}

/* Button styles */
.retro-btn {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.7rem;
  padding: 8px 16px;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.retro-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  transition: left 0.4s ease;
}

.retro-btn:hover::before {
  left: 100%;
}

.retro-btn:hover {
  transform: translateY(-1px);
}

.retro-btn:active {
  transform: translateY(1px);
}

.btn-cyan {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.btn-cyan:hover {
  background: rgba(0, 245, 212, 0.15);
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.3);
}

.btn-green {
  color: var(--accent-green);
  border-color: var(--accent-green);
}
.btn-green:hover {
  background: rgba(0, 255, 65, 0.15);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.btn-magenta {
  color: var(--accent-magenta);
  border-color: var(--accent-magenta);
}
.btn-magenta:hover {
  background: rgba(255, 0, 110, 0.15);
  box-shadow: 0 0 15px rgba(255, 0, 110, 0.3);
}

.btn-amber {
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}
.btn-amber:hover {
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
}

/* VNC container */
.vnc-container canvas {
  width: 100% !important;
  height: auto !important;
  display: block;
  image-rendering: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: #2a2a4a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a5a;
}

/* Checkbox custom */
.custom-check {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-cyan);
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  flex-shrink: 0;
}

.custom-check:checked {
  background: rgba(0, 245, 212, 0.2);
  border-color: var(--accent-green);
}

.custom-check:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--accent-green);
  font-size: 14px;
  font-weight: bold;
}

/* Flicker animation for error */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
  25%, 75% { opacity: 0.95; }
}

.flicker {
  animation: flicker 0.15s infinite;
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.fade-in-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-4 { animation-delay: 0.4s; opacity: 0; }

/* textarea */
.retro-input {
  font-family: 'Fira Code', monospace;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid #2a2a4a;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.8rem;
  transition: border-color 0.2s;
  outline: none;
  resize: none;
}

.retro-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 245, 212, 0.2);
}

/* info panel */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-in {
  animation: slideIn 0.3s ease-out forwards;
}

/* typing cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.cursor-blink::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--accent-cyan);
  margin-left: 2px;
}