﻿@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Mono:wght@300;400;500&family=Unbounded:wght@200;300;400;500;600;700;800;900&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --bg-primary: #050810;
  --bg-secondary: #070b18;
  --bg-tertiary: #0a1020;
  --bg-card: rgba(5, 8, 18, 0.92);
  --bg-card-hover: rgba(8, 14, 28, 0.95);
  --bg-input: rgba(2, 4, 10, 0.85);
  --border-color: rgba(60, 120, 255, 0.08);
  --border-hover: rgba(60, 120, 255, 0.15);
  --text-primary: #d0d8f0;
  --text-secondary: #7080a8;
  --text-muted: #384868;
  --accent: #6080e0;
  --accent-hover: #4060c0;
  --accent-green: #5080a0;
  --accent-red: #804050;
  --accent-yellow: #807040;
  --accent-purple: #7060a0;
  --accent-cyan: #4080a0;
  --accent-pink: #805070;
  --accent-orange: #806040;
  --shadow: 0 0 0 1px rgba(60, 120, 255, 0.06);
  --shadow-lg: 0 0 0 1px rgba(60, 120, 255, 0.1);
  --radius: 0;
  --radius-sm: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --transition: all 0.25s ease;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'DM Mono', 'JetBrains Mono', monospace;
  --font-display: 'Unbounded', sans-serif;
  --font-tech: 'Orbitron', monospace;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  cursor: none;
}

::selection {
  background: #1a3060;
  color: #a0b0e0;
}

/* â”€â”€ NOISE OVERLAY â”€â”€ */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99990;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.01;
  background-size: 200px;
}

/* â”€â”€ SCAN LINE â”€â”€ */
.scan-line {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(60, 120, 255, 0.03);
  z-index: 99989;
  animation: scanDown 10s linear infinite;
  pointer-events: none;
}

@keyframes scanDown {
  0% { top: -2px; }
  100% { top: 100%; }
}

/* â”€â”€ SCROLL PROGRESS â”€â”€ */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 1px;
  background: #4060c0;
  z-index: 9999;
  width: 0%;
  transition: width 0.05s;
  pointer-events: none;
}

/* â”€â”€ CUSTOM CURSOR â”€â”€ */
#cursorDot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #6080d0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: transform 0.1s;
}

#cursorRing {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(60, 120, 255, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99997;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, border-color 0.25s;
}

#cursorRing.big {
  width: 60px;
  height: 60px;
  border-color: rgba(60, 120, 255, 0.15);
}

#cursorRing.text-mode {
  width: 4px;
  height: 28px;
  border-radius: 2px;
  border-color: #6080d0;
}

/* â”€â”€ GLITCH TEXT â”€â”€ */
.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch-text::before {
  animation: glitchT1 3s infinite linear alternate-reverse;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  color: rgba(60,120,255,0.2);
}

.glitch-text::after {
  animation: glitchT2 3s infinite linear alternate-reverse;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  color: rgba(60,120,255,0.12);
}

@keyframes glitchT1 {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  92% { transform: translate(-3px, 2px); opacity: 1; }
  94% { transform: translate(3px, -1px); opacity: 1; }
  96% { transform: translate(-1px, 3px); opacity: 1; }
  98% { transform: translate(2px, -2px); opacity: 1; }
}

@keyframes glitchT2 {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  92% { transform: translate(3px, -2px); opacity: 1; }
  94% { transform: translate(-3px, 1px); opacity: 1; }
  96% { transform: translate(1px, -3px); opacity: 1; }
  98% { transform: translate(-2px, 2px); opacity: 1; }
}

/* â”€â”€ OUTLINE TEXT â”€â”€ */
.outline-text {
  -webkit-text-stroke: 1px #8098d0;
  color: transparent;
  transition: color 0.3s;
}

.outline-text:hover {
  color: #8098d0;
}

/* â”€â”€ GLOW TEXT â”€â”€ */
@keyframes textGlow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 30px rgba(60,120,255,0.2); }
}

.glow-text {
  animation: textGlow 4s ease-in-out infinite;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(60, 100, 200, 0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(60, 100, 200, 0.4); }

/* ===== SPLASH SCREEN ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.splash.hidden {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.splash-content {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: splashIn 1s ease;
}

@keyframes splashIn {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.splash-icon {
  margin-bottom: 1.5rem;
}

.splash-logo {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 0 40px rgba(60,120,255,0.08));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.splash-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6080e0, #3060b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.3rem;
}

.splash-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.splash-loader {
  width: 280px;
  height: 3px;
  background: rgba(40,80,200,0.12);
  border-radius: 3px;
  margin: 0 auto 0.8rem;
  overflow: hidden;
}

.splash-loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4060c0, #2040a0);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.splash-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

.splash-version {
  font-size: 0.7rem;
  color: rgba(60,120,255,0.15);
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* ===== PARTICLE BACKGROUND ===== */
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}

/* ===== APP CONTAINER ===== */
.app-container {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
  opacity: 1;
  transition: opacity 0.6s ease;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.sidebar-header {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: #8098d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  color: #020510;
  font-weight: 900;
  flex-shrink: 0;
}

.sidebar-logo h1 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.sidebar-logo .subtitle {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.03);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.nav-btn:hover::before { opacity: 1; }
.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.nav-btn.active {
  background: rgba(40,80,200,0.12);
  color: #8098d0;
  border: 1px solid rgba(60,120,255,0.2);
  margin: 0 0.3rem;
  width: calc(100% - 0.6rem);
}

.nav-btn.active::before { opacity: 1; }

.nav-svg {
  flex-shrink: 0;
  opacity: 0.5;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.nav-btn.active .nav-svg {
  opacity: 1;
  color: #8098d0;
}

.nav-btn span {
  position: relative;
  z-index: 1;
}

.sidebar-footer {
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5080c0;
  display: inline-block;
  animation: pulse 2s infinite;
  box-shadow: 0 0 8px rgba(60, 120, 200, 0.3);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.sidebar-stats {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: contentFadeIn 0.6s ease 0.3s forwards;
}

@keyframes contentFadeIn {
  to { opacity: 1; }
}

.tab-content {
  display: none;
  animation: tabIn 0.35s ease;
}

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

.tab-content.active { display: block; }

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.tab-header-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.tab-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  padding: 0.15rem 0.6rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
}

.badge-green { color: var(--grey8); border-color: var(--border); }
.badge-purple { color: var(--grey8); border-color: var(--border); }
.badge-yellow { color: var(--grey7); border-color: var(--border); }

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.btn:hover { color: #8098d0; border-color: var(--border-hover); }
.btn:active { opacity: 0.8; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.7rem; }
.btn-lg { padding: 0.7rem 1.5rem; font-size: 0.82rem; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover { background: rgba(255,255,255,0.04); color: var(--text-secondary); border-color: var(--border); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover { border-color: var(--border-hover); color: #8098d0; }

.btn-primary {
  background: #2040a0;
  color: #c0d0f0;
  border-color: #3060c0;
}

.btn-primary:hover { background: #3060c0; color: #e0e8ff; border-color: #4060d0; }

.btn-icon {
  padding: 0.4rem 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.btn-icon:hover { color: #8098d0; border-color: var(--border-hover); }

.btn-icon:hover { border-color: var(--border-hover); color: #8098d0; background: rgba(255,255,255,0.04); }

/* Preset group */
.preset-group {
  display: flex;
  gap: 2px;
  background: rgba(40, 80, 180, 0.06);
  padding: 2px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.preset-group .btn-ghost {
  border: none;
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
}

.preset-group .btn-ghost:hover {
  background: var(--border);
  color: var(--accent);
}

.divider-vert {
  width: 1px;
  height: 24px;
  background: var(--border-color);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-hover);
}

.form-input::placeholder { color: var(--text-muted); opacity: 0.5; }

select.form-input { cursor: pointer; }

.form-row {
  display: flex;
  gap: 0.8rem;
}

.form-row .form-group { flex: 1; }

.input-group {
  display: flex;
  gap: 0.3rem;
}

.input-group .form-input { flex: 1; }

.input-suffix {
  display: flex;
  align-items: center;
  position: relative;
}

.input-suffix .form-input { padding-right: 3.2rem; }

.suffix {
  position: absolute;
  right: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
  font-family: var(--font-mono);
}

.gradient-pick-group {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.gradient-pick-group input[type="color"],
.color-swatch-sm {
  width: 32px;
  height: 32px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: none;
}

.gradient-pick-group input[type="color"]:hover,
.color-swatch-sm:hover { border-color: var(--accent); }

.gradient-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== TOGGLE ===== */
.toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 18px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--grey4);
  transition: var(--transition);
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background: var(--grey7);
  transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
  background: #2040a0;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: #6080d0;
}

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: visible;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.002), transparent);
  pointer-events: none;
}

.glass-card:hover {
  border-color: rgba(60,100,200,0.3);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-header svg { opacity: 0.6; }

.card-body { position: relative; z-index: 1; }

/* ===== EDITOR GRID ===== */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.editor-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  transition: var(--transition);
}

.editor-card:hover {
  border-color: rgba(60,100,200,0.3);
}

.editor-card h3 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge {
  background: #1a3070;
  color: #8090d0;
  font-size: 0.6rem;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ===== LINES ===== */
.lines-container {
  min-height: 180px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 2px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(100,116,139,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  color: rgba(100,116,139,0.4);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.empty-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.scoreboard-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 0.35rem;
  cursor: grab;
  transition: var(--transition);
  animation: lineAppear 0.25s ease;
}

@keyframes lineAppear {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.scoreboard-line:hover {
  border-color: rgba(255,255,255,0.08);
  background: var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.scoreboard-line.dragging {
  opacity: 0.4;
  border-color: var(--accent);
  transform: scale(0.97);
}

.scoreboard-line.drag-over {
  border-color: var(--accent-green);
  background: rgba(34,197,94,0.06);
  transform: scale(1.01);
  box-shadow: 0 0 16px rgba(34,197,94,0.1);
}

.line-drag {
  cursor: grab;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0 0.15rem;
  opacity: 0.4;
  user-select: none;
}

.line-num {
  color: var(--text-muted);
  font-size: 0.68rem;
  min-width: 22px;
  text-align: right;
  font-family: var(--font-mono);
  opacity: 0.5;
}

.line-text-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.15rem 0.35rem;
  min-width: 0;
  border-radius: 4px;
}

.line-text-input:focus {
  outline: none;
  background: rgba(0,0,0,0.3);
  box-shadow: inset 0 0 0 1px var(--border);
}

.line-color-btn {
  padding: 0.15rem 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.7rem;
  opacity: 0.4;
  transition: var(--transition);
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.line-color-btn:hover { opacity: 1; background: var(--border); }

.line-delete-btn {
  padding: 0.15rem 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-red);
  font-size: 0.85rem;
  opacity: 0.3;
  transition: var(--transition);
  border-radius: 4px;
  font-family: var(--font-sans);
  line-height: 1;
}

.line-delete-btn:hover { opacity: 1; background: rgba(239,68,68,0.1); }

.line-actions {
  display: flex;
  gap: 0.1rem;
}

/* ===== TOOLS ===== */
.tools-card { grid-column: 1 / -1; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.4rem;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.tool-btn:hover {
  border-color: rgba(255,255,255,0.08);
  background: var(--border);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tool-btn svg { opacity: 0.5; }

.tool-btn span {
  font-size: 0.78rem;
  font-weight: 500;
}

.tool-btn small {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tool-btn-danger:hover {
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.05);
}

.tool-btn-danger:hover svg { color: var(--accent-red); opacity: 0.8; }

/* ===== MINI PREVIEW ===== */
.mini-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
  min-height: 180px;
}

.mc-scoreboard {
  background: linear-gradient(135deg, rgba(0,0,0,0.9), rgba(15,15,25,0.95));
  border: 1px solid rgba(42,42,58,0.8);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  min-width: 170px;
  font-family: var(--font-mono);
  box-shadow: 0 4px 24px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
}

.mc-title {
  text-align: center;
  font-size: 0.78rem;
  font-weight: bold;
  padding-bottom: 0.35rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid rgba(51,51,51,0.6);
  color: #FFAA00;
  text-shadow: 0 0 12px rgba(255,170,0,0.2);
}

.mc-lines { display: flex; flex-direction: column; gap: 0.15rem; }
.mc-line { font-size: 0.72rem; color: #aaa; white-space: pre; }

/* ===== PREVIEW TAB ===== */
.preview-container { display: flex; justify-content: center; }

.preview-screen {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
}

.mc-full-preview {
  background: linear-gradient(180deg, rgba(20,20,40,0.95), rgba(10,10,25,0.98));
  border-radius: 10px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(42,42,58,0.5);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5);
}

.mc-full-preview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-purple), transparent);
  opacity: 0.4;
}

.mc-header {
  color: rgba(255,255,255,0.7);
  font-size: 0.68rem;
  padding: 0.3rem 0.6rem;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,0.04);
}

.mc-sidebar { display: flex; justify-content: flex-end; }

.mc-scoreboard-lg {
  background: linear-gradient(135deg, rgba(0,0,0,0.88), rgba(15,15,30,0.93));
  border: 1px solid rgba(42,42,58,0.7);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  min-width: 210px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.mc-title-lg {
  text-align: center;
  font-size: 0.85rem;
  font-weight: bold;
  padding-bottom: 0.45rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid rgba(51,51,51,0.5);
  color: #FFAA00;
  text-shadow: 0 0 15px rgba(255,170,0,0.2);
}

.mc-lines-lg { display: flex; flex-direction: column; gap: 0.2rem; }
.mc-line-lg { font-size: 0.78rem; color: #bbb; white-space: pre; }

.mc-chat { margin-top: auto; }

.mc-chat-msg {
  color: rgba(170,170,170,0.8);
  font-size: 0.7rem;
  padding: 0.15rem 0;
}

.msg-prefix { color: var(--text-muted); }

.mc-chat-line {
  height: 1px;
  background: rgba(255,255,255,0.04);
  margin: 0.3rem 0;
}

.mc-chat-input {
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
  color: rgba(255,255,255,0.5);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== PLACEHOLDERS ===== */
.ph-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.ph-cat-btn {
  padding: 0.3rem 0.65rem;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--transition);
}

.ph-cat-btn:hover, .ph-cat-btn.active {
  border-color: var(--border-hover);
  color: #8098d0;
  background: rgba(255,255,255,0.04);
}

.ph-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.4rem;
}

.ph-item {
  padding: 0.6rem 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.ph-item:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.ph-item code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.ph-item small {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Search */
.search-wrap {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
}

.search-wrap .search-input {
  padding-left: 2.2rem;
  min-width: 260px;
}

/* ===== COMMANDS ===== */
.commands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.5rem;
}

.cmd-card {
  padding: 0.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.cmd-card:hover {
  border-color: var(--border-hover);
  background: rgba(255,255,255,0.04);
}

.cmd-card code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #8098d0;
  margin-bottom: 0.2rem;
}

.cmd-card p { font-size: 0.7rem; color: var(--text-muted); }

.cmd-card .cmd-aliases {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  opacity: 0.7;
}

.cmd-card .cmd-aliases code {
  display: inline;
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ===== EXPORT ===== */
.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.export-grid .editor-card:last-child { grid-column: 1 / -1; }

.code-block {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 380px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-secondary);
}

.export-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.file-list {
  display: flex;
  flex-direction: column;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.checkbox-label:hover { color: var(--text-primary); }

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-label span { font-family: var(--font-mono); font-size: 0.78rem; }

/* ===== COLOR PICKER MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.show { display: flex; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0;
  text-transform: none;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 6px;
  display: flex;
  transition: var(--transition);
}

.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.modal-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.mc-colors-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.mc-color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.mc-color-swatch:hover {
  transform: scale(1.15);
  border-color: #fff;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.mc-color-swatch .mc-color-code {
  position: absolute;
  bottom: -1.1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
}

.color-section {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
}

.color-section h4 {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.format-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.format-btn {
  padding: 0.2rem 0.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-mono);
}

.format-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--border);
}

.custom-color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-color-row input[type="color"] {
  width: 44px;
  height: 34px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: none;
}

.gradient-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gradient-controls input[type="color"] {
  width: 36px;
  height: 30px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  padding: 2px;
  background: none;
}

.gradient-result {
  display: flex;
  gap: 2px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  min-height: 28px;
}

.gradient-step {
  flex: 1;
  height: 22px;
  min-width: 18px;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition);
}

.gradient-step:hover { transform: scaleY(1.4); z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.gradient-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  width: 100%;
  text-align: center;
  padding: 0.3rem 0;
}

/* ===== CONTEXT MENU ===== */
.context-menu {
  display: none;
  position: fixed;
  z-index: 3000;
  background: rgba(5, 10, 25, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0.3rem;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  animation: ctxIn 0.15s ease;
}

@keyframes ctxIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu.show { display: block; }

.ctx-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.7rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}

.ctx-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }

.ctx-item svg { opacity: 0.5; }
.ctx-item:hover svg { opacity: 0.8; }

.ctx-danger:hover { background: rgba(239,68,68,0.1); color: var(--accent-red); }
.ctx-danger:hover svg { color: var(--accent-red); }

.ctx-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.2rem 0;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 5000;
}

.toast {
  padding: 0.65rem 1.1rem;
  background: rgba(5, 10, 25, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.35s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 200px;
}

@keyframes toastIn {
  from { transform: translateX(100%) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

.toast.success { border-color: rgba(34,197,94,0.3); }
.toast.error { border-color: rgba(239,68,68,0.3); }
.toast.info { border-color: rgba(255,255,255,0.08); }

/* ===== ANIMATIONS TAB ===== */
.animations-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.4rem;
}

.anim-card {
  padding: 0.9rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.anim-card:hover {
  border-color: rgba(168,85,247,0.3);
  background: rgba(168,85,247,0.03);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.anim-card h4 {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.anim-card small {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .editor-grid { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .sidebar-logo > div:not(.logo-mark) { display: none; }
  .sidebar-logo .logo-mark { margin: 0 auto; }
  .nav-btn span:not(.nav-icon) { display: none; }
  .nav-btn { justify-content: center; padding: 0.7rem; }
  .nav-svg { margin: 0; }
  .sidebar-footer { flex-direction: column; gap: 0.3rem; align-items: center; }
  .sidebar-stats { display: none; }
}

@media (max-width: 600px) {
  .main-content { padding: 1rem; }
  .sidebar { display: none; }
  .form-row { flex-direction: column; gap: 0; }
  .tab-header { flex-direction: column; align-items: flex-start; }
  .mc-colors-grid { grid-template-columns: repeat(4, 1fr); }
  .search-wrap .search-input { min-width: 100%; }
  .preset-group { width: 100%; }
  .header-actions { width: 100%; }
}

/* ===== GRADIENT TEXT UTILITY ===== */
.gradient-text {
  background: linear-gradient(90deg, #FFAA00, #FF5555);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== ESCAPEX MONOCHROME BACKGROUND ===== */
.bg-escapex {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-escapex-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(60, 120, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 120, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-escapex-glow {
  position: absolute;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(40, 100, 220, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.bg-escapex-glow2 {
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(40, 100, 220, 0.02) 0%, transparent 70%);
  pointer-events: none;
}

/* Ensure app content sits above background */
.bg-particles { z-index: 1; }
.glow-orb { z-index: 1; }
.bg-escapex { z-index: 0; }
.app-container { position: relative; z-index: 2; }

/* ── BACK TO TOP ── */
#backToTop {
  position: fixed;
  bottom: 24px;
  left: 290px;
  z-index: 999;
  width: 40px;
  height: 40px;
  background: transparent;
  color: #4060a0;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

#backToTop.show { opacity: 1; transform: translateY(0); }
#backToTop:hover { color: #8090d0; border-color: var(--border-hover); }

/* ===== CODE EDITOR LAYOUT ===== */
.code-editor-layout {
  display: grid;
  grid-template-columns: 180px 1fr 220px;
  gap: 0.8rem;
  height: calc(100vh - 140px);
  min-height: 400px;
}

.code-files {
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  margin-top: 0.3rem;
}

.code-file-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.code-file-item:hover {
  background: var(--border);
  color: var(--text-primary);
}

.code-file-item.active {
  background: var(--border);
  color: var(--accent);
}

.code-file-item .file-icon {
  opacity: 0.5;
  flex-shrink: 0;
}

.code-file-item.active .file-icon { opacity: 0.8; color: var(--accent); }

.code-file-item .file-badge {
  margin-left: auto;
  font-size: 0.55rem;
  padding: 0.05rem 0.3rem;
  border-radius: 10px;
  background: rgba(100,116,139,0.15);
  color: var(--text-muted);
}

.code-editor-main {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-editor-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0,0,0,0.15);
  overflow-x: auto;
  flex-shrink: 0;
}

.code-tab {
  padding: 0.45rem 0.9rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.code-tab:hover {
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
}

.code-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--border);
}

.code-editor-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.code-lines {
  padding: 0.7rem 0;
  min-width: 40px;
  text-align: right;
  padding-right: 0.6rem;
  border-right: 1px solid var(--border-color);
  background: rgba(0,0,0,0.15);
  user-select: none;
  overflow: hidden;
  flex-shrink: 0;
}

.code-line-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.6;
  color: rgba(100,116,139,0.4);
  padding: 0 0.3rem;
}

.code-textarea {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  padding: 0.7rem 1rem;
  resize: none;
  outline: none;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.code-textarea:focus {
  box-shadow: inset 0 0 0 1px var(--border);
}

.code-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.3;
}

.code-preview {
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-preview-body {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.code-preview-errors {
  font-size: 0.65rem;
  color: var(--accent-red);
  font-family: var(--font-mono);
  padding: 0.3rem 0;
  max-height: 60px;
  overflow-y: auto;
}

/* ===== ANIMATED GRADIENT BORDERS ===== */
.glass-card.gradient-border {
  position: relative;
  background-clip: padding-box;
  border: 1px solid transparent;
}

.glass-card.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple), var(--accent-cyan), var(--accent));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderRotate 4s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-card.gradient-border:hover::before {
  opacity: 0.6;
}

@keyframes borderRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== FLOATING GLOW ORBS ===== */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.04;
  animation: orbFloat 12s ease-in-out infinite;
}

.glow-orb:nth-child(1) {
  width: 200px; height: 200px;
  background: #1a3060;
  top: -10%; left: -5%;
  animation-delay: 0s;
}

.glow-orb:nth-child(2) {
  width: 180px; height: 180px;
  background: #102050;
  bottom: -5%; right: -5%;
  animation-delay: -3s;
}

.glow-orb:nth-child(3) {
  width: 150px; height: 150px;
  background: #0a1840;
  top: 50%; left: 50%;
  animation-delay: -6s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ===== ENHANCED GLASS ===== */
.glass-card.glass-deep {
  background: rgba(15, 20, 35, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.06);
}

.glass-card.glass-deep::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

/* ===== RESPONSIVE CODE EDITOR ===== */
@media (max-width: 1100px) {
  .code-editor-layout {
    grid-template-columns: 140px 1fr;
    grid-template-rows: 1fr auto;
  }
  .code-preview { display: none; }
}

@media (max-width: 700px) {
  .code-editor-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .code-files { display: none; }
}

/* ===== KEYBOARD SHORTCUT HINT ===== */
.kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.62rem;
  font-family: var(--font-sans);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
}

/* ===== LOADING SHIMMER ===== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

