/* ==========================================================================
   NINOALGA.UK - ARTISTIC INDIE MODERN / NEON CYBER-MINIMALIST DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700;800&family=Outfit:wght@500;700;800;900&family=Space+Grotesk:wght@600;700;800&display=swap');

:root {
  /* Color Palette */
  --bg: #080B11;                     /* Void Midnight Slate */
  --bg-secondary: #0D121D;           /* Deep Navy Surface */
  --surface-card: rgba(17, 25, 40, 0.75); /* Glassmorphic Card */
  --surface-border: rgba(255, 255, 255, 0.09);
  --surface-hover: rgba(255, 255, 255, 0.14);

  --text: #F9FAFB;                   /* Bright Chalk */
  --text-muted: #9CA3AF;             /* Muted Slate */
  --text-dim: #6B7280;               /* Dimmed Gray */

  /* Vibrant Indie Neon Accents */
  --primary: #00FF9D;                /* Acid Emerald Neon */
  --primary-gradient: linear-gradient(135deg, #00FF9D 0%, #00E5FF 100%);
  --primary-glow: rgba(0, 255, 157, 0.35);

  --secondary: #8B5CF6;              /* Electric Violet */
  --secondary-gradient: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
  --secondary-glow: rgba(139, 92, 246, 0.35);

  --accent: #F43F5E;                 /* Rose Crimson */
  --accent-glow: rgba(244, 63, 94, 0.35);

  --cyan: #00E5FF;
  --yellow: #FACC15;

  /* Typography */
  --font-heading: 'Outfit', 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Geometry & Elevation */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 255, 157, 0.05);
  --shadow-neon: 0 0 25px var(--primary-glow);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(0, 255, 157, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(244, 63, 94, 0.06) 0%, transparent 50%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.15;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #fff;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 17, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0.5rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-border);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.logo-text:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-neon);
}

.logo-text .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulse-dot 2s infinite alternate;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.4); opacity: 1; }
}

.brand-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.badge-header a {
  color: var(--text-muted);
}

.badge-header:hover, .badge-header a:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(0, 255, 157, 0.08);
}

.pwa-install-btn {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--bg);
  background: var(--primary);
  border: none;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 0 15px var(--primary-glow);
  transition: var(--transition-bounce);
}

.pwa-install-btn.visible {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pwa-install-btn:hover {
  transform: translateY(-2px) scale(1.03);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
}

.nav-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: var(--transition);
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-btn.active {
  color: var(--primary);
  background: rgba(0, 255, 157, 0.1);
  border-color: rgba(0, 255, 157, 0.3);
}

/* --------------------------------------------------------------------------
   HERO & INTRO SECTIONS
   -------------------------------------------------------------------------- */
.hero {
  padding: 2.25rem 0 2rem;
  text-align: center;
  position: relative;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 255, 157, 0.08);
  border: 1px solid rgba(0, 255, 157, 0.25);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  background: linear-gradient(180deg, #FFFFFF 0%, #9CA3AF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title .gradient-text {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-chip strong {
  color: #fff;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   TOOLS GRID & CARDS
   -------------------------------------------------------------------------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0;
}

.tool-card {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 255, 157, 0.3);
  box-shadow: 0 20px 40px -10px rgba(0, 255, 157, 0.15);
}

.tool-card:hover::before {
  opacity: 1;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-icon {
  font-size: 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
}

.status-tag {
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  background: rgba(0, 255, 157, 0.1);
  border: 1px solid rgba(0, 255, 157, 0.25);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.card-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.btn-card {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--bg);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 20px var(--primary-glow);
  transition: var(--transition-bounce);
}

.btn-card:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   ADSENSE & MONETIZATION EMBED SLOTS (CLEAN & HIGH VISIBILITY)
   -------------------------------------------------------------------------- */
.adsense-container {
  background: rgba(13, 18, 29, 0.4);
  backdrop-filter: blur(16px);
  border: 1px dashed rgba(0, 255, 157, 0.2);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  margin: 2rem 0;
  text-align: center;
  position: relative;
  min-height: 90px;
  overflow: hidden;
}

.adsense-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.5rem;
}

ins.adsbygoogle {
  background: transparent !important;
  border-radius: var(--radius-md);
  margin: 0 auto;
}

.adsense-content {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1rem;
}

.adsense-content strong {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.adsense-content span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   TOOL PAGE WORKSPACE & CANVAS EDITOR
   -------------------------------------------------------------------------- */
.tool-header-box {
  margin-bottom: 2rem;
  text-align: center;
}

.tool-page-title {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.4rem;
}

.tool-page-subtitle {
  font-size: 0.9rem;
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.75rem;
  align-items: start;
}

.main-tool-panel {
  width: 100%;
}

/* Dropzone Minimalista */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px dashed rgba(0, 255, 157, 0.25);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  box-shadow: var(--shadow-card);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(0, 255, 157, 0.04);
  box-shadow: 0 0 35px rgba(0, 255, 157, 0.15);
  transform: translateY(-2px);
}

.dropzone-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.dropzone-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.dropzone-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  color: var(--bg);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px var(--primary-glow);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-upload:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
}

/* Status Panel Loader */
.status-panel {
  display: none;
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.status-panel.active {
  display: block;
}

.loading-spinner-box {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.glitch-loader {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(0, 255, 157, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.status-message {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.status-details {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.progress-bar-container {
  width: 100%;
  max-width: 440px;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin: 0 auto 0.75rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
  box-shadow: 0 0 15px var(--primary);
}

.progress-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

/* Error Panel */
.error-panel {
  display: none;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
}

.error-panel.active {
  display: block;
}

.error-title {
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.error-msg {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Result Panel & Editor */
.result-panel {
  display: none;
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.result-panel.active {
  display: block;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.result-meta {
  display: flex;
  gap: 0.5rem;
}

.meta-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.meta-chip.res-highlight {
  color: var(--primary);
  border-color: rgba(0, 255, 157, 0.3);
  background: rgba(0, 255, 157, 0.08);
}

/* View Phase Tabs */
.view-phase-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--surface-border);
}

.phase-tab-btn {
  flex: 1;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.phase-tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(13, 18, 29, 0.8);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

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

.toolbar-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  margin-right: 0.2rem;
}

.tool-btn {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tool-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.tool-btn.active {
  color: var(--bg);
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 800;
  box-shadow: 0 0 12px var(--primary-glow);
}

.brush-size-slider {
  accent-color: var(--primary);
  cursor: pointer;
}

/* Preview Canvas Container */
.preview-container {
  position: relative;
  width: 100%;
  min-height: 480px;
  max-height: 650px;
  background-color: #0d1117;
  background-image: 
    linear-gradient(45deg, #161b22 25%, transparent 25%), 
    linear-gradient(-45deg, #161b22 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #161b22 75%), 
    linear-gradient(-45deg, transparent 75%, #161b22 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
}

#editor-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.05s ease-out;
}

.bg-guide-layer {
  position: absolute;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform-origin: center center;
}

/* Brush Cursor Overlay */
#brush-cursor {
  position: fixed;
  pointer-events: none;
  border: 2px solid var(--primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 99999;
  box-shadow: 0 0 10px var(--primary-glow);
}

#brush-cursor.erase-mode {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Comparison Slider */
.comparison-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  overflow: hidden;
}

.img-result {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}

.img-original-container {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid var(--primary);
}

.img-original {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  object-fit: contain;
}

.comparison-slider-handle {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 4px;
  background: var(--primary);
  cursor: ew-resize;
  transform: translateX(-50%);
  z-index: 10;
  box-shadow: 0 0 10px var(--primary);
}

.slider-button {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  background: var(--primary);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Result Action Buttons */
.result-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-download {
  flex: 2;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bg);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 25px var(--primary-glow);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-download:hover {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.1);
}

.btn-reset {
  flex: 1;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   SIDEBAR & WIDGET CARDS
   -------------------------------------------------------------------------- */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 90px;
}

.widget-card {
  background: var(--surface-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.widget-list li {
  line-height: 1.45;
}

.widget-list strong {
  color: #fff;
}

/* --------------------------------------------------------------------------
   FOOTER
   -------------------------------------------------------------------------- */
.footer {
  margin-top: auto;
  background: rgba(8, 11, 17, 0.95);
  border-top: 1px solid var(--surface-border);
  padding: 3.5rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 460px;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.footer-credits {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-links-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-links-list {
  list-style: none;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   NATIVE APP MOBILE NAVIGATION BAR & PERFECT RESPONSIVE SCALING
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  .container {
    padding: 0 0.85rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero {
    padding: 2rem 0 1.5rem;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.15;
  }

  .hero-desc {
    font-size: 0.95rem;
    padding: 0 0.5rem;
  }

  /* Native App Bottom Tab Bar - Perfectly Centered & Balanced */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 9999;
    background: rgba(8, 11, 17, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--surface-border);
    padding: 0.35rem 0.5rem;
    padding-bottom: max(0.35rem, env(safe-area-inset-bottom, 0.35rem));
    justify-content: space-evenly;
    align-items: center;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
    width: 100%;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.4rem 0.25rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    text-align: center;
    min-height: 48px;
    max-width: 120px;
    margin: 0 auto;
  }

  .mobile-nav-item .nav-icon {
    font-size: 1.3rem;
    line-height: 1;
    display: block;
  }

  .mobile-nav-item span {
    display: block;
    white-space: nowrap;
  }

  .mobile-nav-item.active {
    color: var(--primary);
    background: rgba(0, 255, 157, 0.1);
    font-weight: 800;
  }

  .mobile-nav-item.install-tab {
    color: #38BDF8;
  }

  body {
    padding-top: 68px;
    padding-bottom: 80px;
  }

  /* Fixed Header on Mobile Top */
  .header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 999;
    width: 100%;
    background: rgba(8, 11, 17, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  }

  .nav-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding: 0.4rem 0.75rem;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-links {
    display: none;
  }

  .brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }

  .logo-text {
    font-size: 1.05rem;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
  }

  .brand-links {
    display: flex;
    align-items: center;
    gap: 0.3rem;
  }

  .badge-header {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.28rem 0.55rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
  }

  /* Tool Workspace Mobile Adaptation */
  .tool-header-box {
    margin-bottom: 1.25rem;
    padding: 0 0.25rem;
  }

  .tool-page-title {
    font-size: 1.75rem;
  }

  .tool-page-subtitle {
    font-size: 0.75rem;
    letter-spacing: 0;
    line-height: 1.4;
  }

  .tool-workspace {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: 100%;
  }

  .main-tool-panel {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Dropzone Mobile Touch Setup */
  .dropzone {
    padding: 2.25rem 1rem;
    border-radius: var(--radius-lg);
    width: 100%;
    box-sizing: border-box;
  }

  .dropzone-title {
    font-size: 1.2rem;
  }

  .dropzone-subtitle {
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
  }

  .btn-upload {
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-size: 0.92rem;
    min-height: 48px;
  }

  /* Result Panel & Editor Toolbar Touch Scroll */
  .result-panel {
    padding: 1rem;
    border-radius: var(--radius-lg);
    width: 100%;
    box-sizing: border-box;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .result-title {
    font-size: 1.15rem;
  }

  .result-meta {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .phase-tab-btn {
    font-size: 0.78rem;
    padding: 0.5rem 0.5rem;
  }

  /* Mobile Floating Touch Toolbar */
  .editor-toolbar {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem;
    gap: 0.6rem;
    border-radius: var(--radius-full);
    background: rgba(13, 18, 29, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    margin-bottom: 0.75rem;
  }

  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-group {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .tool-btn {
    min-height: 42px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
  }

  .preview-container {
    width: 100%;
    min-height: 300px;
    max-height: 48vh;
    border-radius: var(--radius-md);
  }

  .canvas-viewport {
    width: 100%;
    min-height: 300px;
  }

  .comparison-wrapper {
    min-height: 300px;
  }

  .result-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }

  .btn-download {
    width: 100%;
    min-height: 48px;
    font-size: 1rem;
  }

  .btn-reset {
    width: 100%;
    min-height: 44px;
    font-size: 0.9rem;
  }

  .sidebar-panel {
    gap: 1.25rem;
  }

  .widget-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .nav-wrapper {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .logo-text {
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
  }

  .brand-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .badge-header {
    display: inline-flex;
    font-size: 0.62rem;
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-full);
  }

  .tool-page-title {
    font-size: 1.5rem;
  }
}