/* ═══════════════════════════════════════════════════════════════
   EMPTY WALL - Premium ASCII Wallpaper Designer
   ═══════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Base palette - sophisticated neutrals */
  --bg: #000000;
  --bg2: #0a0a0a;
  --bg3: #111111;
  --bg4: #1a1a1a;
  --surface: #0d0d0d;
  --surface2: #141414;
  --border: #222222;
  --border2: #333333;
  --border3: #444444;

  /* Text colors - premium greys */
  --text: #ffffff;
  --text2: #a1a1aa;
  --text3: #71717a;
  --text4: #52525b;

  /* Accent - clean white and subtle muted blue */
  --accent: #ffffff;
  --accent2: #a1a1aa;
  --accent-glow: rgba(228, 228, 231, 0.1);

  /* Gradients */
  --gradient-main: linear-gradient(135deg, #ffffff 0%, #a1a1aa 100%);
  --gradient-card: linear-gradient(145deg, #111 0%, #050505 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);

  /* Border radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-full: 9999px;

  /* Shadows - subtle and elegant */
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow2: 0 8px 24px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 15px rgba(255, 255, 255, 0.05);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -1px 0 rgba(0, 0, 0, 0.2);

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset / Light Mode Override ── */
[data-theme="light"] {
  --bg: #fcfcfc;
  --bg2: #ffffff;
  --bg3: #f4f4f5;
  --bg4: #e4e4e7;
  --surface: #ffffff;
  --surface2: #f8f8f8;
  --border: #e4e4e7;
  --border2: #d4d4d8;
  --border3: #a1a1aa;
  --text: #09090b;
  --text2: #52525b;
  --text3: #71717a;
  --text4: #a1a1aa;
  --accent: #09090b;
  --accent2: #52525b;
  --accent-glow: rgba(0, 102, 204, 0.2);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow2: 0 8px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(0, 102, 204, 0.15);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .bg-particles {
  background-color: var(--bg);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition-slow), color var(--transition-slow);
  line-height: 1.4;
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   BACKGROUND - ASCII Grid with Floating Elements
   ═══════════════════════════════════════════════════════════════ */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.3) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES - Glassmorphism
   ═══════════════════════════════════════════════════════════════ */
.glass {
  background: rgba(13, 13, 13, 0.65) !important;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}

[data-theme="light"] .glass {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* ═══════════════════════════════════════════════════════════════
   HEADER - ASCII Terminal Bar
   ═══════════════════════════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0 1rem;
}

[data-theme="light"] .header {
  background: rgba(252, 252, 252, 0.6);
  border-bottom: 1px solid var(--border2);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: bold;
}

.logo-text {
  color: var(--text);
}

.logo-accent {
  color: var(--accent);
}

.logo::before {
  display: none;
}

/* Navigation - ASCII Tabs */
.nav-tabs {
  display: flex;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.nav-tab {
  padding: 0.4rem 1.2rem;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-tab.active::before {
  display: none;
}

.tab-icon {
  font-size: 1rem;
  opacity: 0.8;
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text2);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}

.btn-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-glow);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 96px 2rem 3rem;
  position: relative;
  z-index: 1;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeSlideIn 0.35s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 280px 1fr;
  }
}

@media (max-width: 768px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CONTROLS PANEL - ASCII Terminal Box
   ═══════════════════════════════════════════════════════════════ */
.controls-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow2);
}

.controls-panel::before {
  display: none;
}

/* Section Labels */
.section-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-label::before {
  display: none;
}

.section-label:first-child {
  margin-top: 0;
}

/* Input Groups */
.input-group {
  position: relative;
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 0.4rem;
}

.text-input {
  width: 100%;
  resize: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 0.5rem 0.7rem;
  outline: none;
  transition: all var(--transition);
}

[data-theme="light"] .text-input {
  background: #ffffff;
}

.text-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.char-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.65rem;
  color: var(--text4);
  pointer-events: none;
  font-family: 'IBM Plex Mono', monospace;
}

/* Control Rows */
.control-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.85rem;
}

.control-row label {
  margin: 0;
  min-width: 70px;
  flex-shrink: 0;
}

.control-row select {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  padding: 0.4rem 0.6rem;
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236a6a75' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 22px;
}

[data-theme="light"] .control-row select {
  background-color: #ffffff;
}

.control-row select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

/* Range Sliders */
input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border2);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.control-row label span {
  color: var(--text2);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   COLOR PALETTE - Premium Swatches
   ═══════════════════════════════════════════════════════════════ */
.color-palette {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}

.color-swatch::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.color-swatch.active::after {
  border-color: var(--text);
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch[data-color="gradient-cyan"] {
  background: linear-gradient(135deg, #00d4ff, #0099cc);
}

.color-swatch[data-color="gradient-purple"] {
  background: linear-gradient(135deg, #9333ea, #ec4899);
}

.color-swatch[data-color="gradient-fire"] {
  background: linear-gradient(135deg, #f97316, #eab308);
}

.color-swatch[data-color="gradient-green"] {
  background: linear-gradient(135deg, #22c55e, #10b981);
}

.color-swatch[data-color="solid-white"] {
  background: linear-gradient(135deg, #f8f8f8, #e0e0e0);
  border: 1px solid var(--border);
}

.color-swatch[data-color="solid-gold"] {
  background: linear-gradient(135deg, #fbbf24, #f97316);
}

.color-swatch[data-color="rainbow"] {
  background: conic-gradient(from 0deg, #ff0000, #ff8800, #ffff00, #00ff00, #00ffff, #0088ff, #8800ff, #ff0088, #ff0000);
}

/* ═══════════════════════════════════════════════════════════════
   CHARSET BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.charset-group {
  display: flex;
  gap: 6px;
  flex: 1;
}

.charset-btn {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text2);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0;
  cursor: pointer;
  transition: all var(--transition);
}

[data-theme="light"] .charset-btn {
  background: rgba(0, 0, 0, 0.04);
}

.charset-btn.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.charset-btn:hover:not(.active) {
  border-color: var(--border2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════════
   QR IMAGE PICKER
   ═══════════════════════════════════════════════════════════════ */
.qr-image-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all var(--transition);
}

[data-theme="light"] .qr-image-picker {
  background: rgba(0, 0, 0, 0.03);
}

.qr-image-picker:hover {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(0, 212, 255, 0.05);
}

.qr-image-picker div {
  min-width: 0;
}

.qr-image-picker strong,
.qr-image-picker span {
  display: block;
}

.qr-image-picker strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-image-picker span {
  color: var(--text4);
  font-size: 0.65rem;
  margin-top: 0.2rem;
}

/* ═══════════════════════════════════════════════════════════════
   TOGGLES - Premium Switches
   ═══════════════════════════════════════════════════════════════ */
.toggle-row {
  justify-content: space-between;
  padding: 0.3rem 0;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-full);
  background: var(--bg4);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--text2);
  transition: all var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle input:checked+.toggle-slider {
  background: var(--text);
  border-color: transparent;
}

.toggle input:checked+.toggle-slider::before {
  transform: translate(20px, -50%);
  background: var(--bg);
  box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   CONTROL SECTIONS - Collapsible Groups
   ═══════════════════════════════════════════════════════════════ */
.control-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.control-section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 0.25rem;
}

.section-header .section-label {
  margin: 0;
}

.section-toggle {
  font-size: 0.65rem;
  color: var(--text4);
  transition: transform var(--transition);
}

.control-section.collapsed .section-toggle {
  transform: rotate(-90deg);
}

.control-section.collapsed .section-content {
  display: none;
}

.section-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.5rem;
}

.control-row.full-width {
  flex-direction: column;
  align-items: stretch;
}

.control-row.full-width label {
  width: 100%;
  margin-bottom: 0.35rem;
}

.control-row.full-width select {
  width: 100%;
}

.toggles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════
   ACTION STACK - Buttons
   ═══════════════════════════════════════════════════════════════ */
.action-stack {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.btn-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text);
  border-radius: var(--radius-xs);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .btn-sm:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

#originalBtn {
  border-color: var(--text3);
}

#originalBtn:hover {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

.btn-wide {
  justify-content: center;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   OUTPUT PANEL
   ═══════════════════════════════════════════════════════════════ */
.output-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.output-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text4);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.output-label::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.toolbar-actions {
  display: flex;
  gap: 0.5rem;
}

/* Output Container - ASCII Terminal */
.output-container {
  min-height: 500px;
  padding: 1rem;
  overflow: auto;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  box-shadow: var(--shadow-inner);
}

.output-container::before {
  display: none;
}

.wallpaper-canvas {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-xs);
  position: relative;
  z-index: 1;
}

/* Safe Zone Overlay */
.safe-zone-overlay {
  position: absolute;
  inset: 1rem;
  pointer-events: none;
  border: 1px dashed var(--accent);
  opacity: 0.6;
  z-index: 10;
}

.safe-zone-overlay>div {
  position: absolute;
  border: 1px dashed var(--accent);
  background: rgba(0, 212, 255, 0.05);
}

/* Style Gallery */
.style-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  cursor: pointer;
  transition: all var(--transition);
}

.gallery-card:hover {
  border-color: var(--border3);
  transform: translateY(-4px);
  box-shadow: var(--shadow2);
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gallery-card span {
  display: block;
  padding: 0.6rem;
  color: var(--text2);
  font-size: 0.7rem;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ASCII Output */
.ascii-output {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  font-size: 11px;
  line-height: 1.15;
  white-space: pre;
  color: var(--text);
  position: relative;
  z-index: 1;
  padding-top: 1.5rem;
}

/* Blinking cursor effect */
.ascii-output::after {
  content: '_';
  animation: blink 1s step-end infinite;
  color: var(--text4);
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.output-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  color: var(--text4);
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .upload-zone {
  border: 1px dashed rgba(0, 0, 0, 0.15);
  background: rgba(0, 0, 0, 0.02);
}

.upload-zone:hover {
  border-color: var(--accent);
  border-style: solid;
  background: var(--surface);
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  outline: 2px solid rgba(255, 255, 255, 0.1);
}

.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  filter: grayscale(0.3);
}

.upload-text {
  font-size: 0.85rem;
  color: var(--text2);
  font-weight: 500;
}

.upload-text small {
  display: block;
  font-size: 0.72rem;
  color: var(--text4);
  margin-top: 0.4rem;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text3);
  text-align: center;
  font-size: 0.85rem;
  gap: 1rem;
  position: relative;
  font-family: 'IBM Plex Mono', monospace;
}

.upload-placeholder::before {
  display: none;
}

.upload-placeholder::after {
  content: 'drag & drop supported';
  display: block;
  color: var(--text4);
  font-size: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER - ASCII Terminal
   ═══════════════════════════════════════════════════════════════ */
.site-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text4);
  font-size: 0.65rem;
  font-family: 'IBM Plex Mono', monospace;
  position: relative;
}

.site-footer::before {
  display: none;
}

.site-footer span::before {
  display: none;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--border2);
  border-radius: 1px;
}

/* ═══════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(8px);
  z-index: 20;
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.8rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════════════════════════
   ERROR STATE
   ═══════════════════════════════════════════════════════════════ */
.error-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 11, 0.9);
  z-index: 20;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
}

.error-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.error-message {
  font-size: 0.85rem;
  color: var(--text2);
  max-width: 300px;
}

.error-retry {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-xs);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
}

.error-retry:hover {
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

/* ═══════════════════════════════════════════════════════════════
   TOAST - Notifications
   ═══════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: var(--shadow2);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), var(--surface2));
}

.toast.error {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), var(--surface2));
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .main {
    padding: 80px 1rem 2rem;
  }

  .header {
    padding: 0 1rem;
  }

  .header-inner {
    height: 56px;
  }

  .logo-text {
    display: none;
  }

  .nav-tabs {
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px;
    border-radius: var(--radius-full) var(--radius-full) 0 0;
  }

  .nav-tab {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
  }

  .controls-panel {
    position: static;
    padding: 1.25rem;
  }

  .control-row {
    flex-wrap: wrap;
  }

  .control-row label {
    width: 100%;
    margin-bottom: 0.35rem;
  }

  .control-row select,
  .control-row input[type="range"] {
    flex: 1 1 auto;
  }

  .color-swatch {
    width: 26px;
    height: 26px;
  }

  .charset-btn {
    font-size: 0.65rem;
  }

  .output-container {
    min-height: 300px;
    padding: 1rem;
  }

  .ascii-output {
    font-size: 8px;
  }

  .style-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-stack {
    grid-template-columns: 1fr;
  }

  .site-footer {
    padding: 2rem 1rem 1.5rem;
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 70px 0.75rem 1.5rem;
  }

  .header {
    padding: 0 0.75rem;
  }

  .controls-panel {
    padding: 1rem;
    border-radius: var(--radius-sm);
  }

  .section-label {
    font-size: 0.6rem;
  }

  .btn-sm {
    padding: 0.5rem 0.8rem;
    font-size: 0.72rem;
  }

  .output-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .upload-placeholder {
    min-height: 250px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border3);
}

/* ═══════════════════════════════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════════════════════════════ */
::selection {
  background: var(--accent);
  color: white;
}