/* ═══════════════════════════════════════════════════════════
   CROP-O-TRON 9000 — Neon Synthwave Arcade Theme
   Colors: deep purple, neon cyan, hot magenta, lime green
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #0d0221;
  --bg-surface: #150535;
  --bg-card: #1a0a3e;
  --cyan: #00f0ff;
  --cyan-dim: rgba(0, 240, 255, 0.15);
  --cyan-glow: rgba(0, 240, 255, 0.4);
  --magenta: #ff2de6;
  --magenta-dim: rgba(255, 45, 230, 0.15);
  --magenta-glow: rgba(255, 45, 230, 0.4);
  --lime: #39ff14;
  --lime-dim: rgba(57, 255, 20, 0.12);
  --lime-glow: rgba(57, 255, 20, 0.3);
  --yellow: #ffe600;
  --yellow-dim: rgba(255, 230, 0, 0.12);
  --text: #e8e0ff;
  --text-dim: rgba(232, 224, 255, 0.55);
  --border: rgba(0, 240, 255, 0.2);
  --border-mag: rgba(255, 45, 230, 0.3);
  --pixel-shadow: 3px 3px 0 rgba(255, 45, 230, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  overflow-x: hidden;
  position: relative;
}

/* ── CRT SCANLINE OVERLAY ──────────────── */

.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.08) 2px,
      rgba(0, 0, 0, 0.08) 4px
    );
}

/* ── PERSPECTIVE GRID BACKGROUND ────────── */

.grid-bg {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45vh;
  background:
    linear-gradient(rgba(255, 45, 230, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.1) 1px, transparent 1px);
  background-size: 60px 40px;
  transform: perspective(400px) rotateX(55deg);
  transform-origin: bottom center;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  animation: gridScroll 4s linear infinite;
}

@keyframes gridScroll {
  0% { background-position: 0 0; }
  100% { background-position: 0 40px; }
}

/* ── FLOATING SPARKLES ───────────────── */

.sparkle {
  position: fixed;
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: sparkleFloat 5s ease-in-out infinite;
  filter: drop-shadow(0 0 6px currentColor);
}

.sparkle-1 { top: 8%; left: 6%; animation-delay: 0s; color: var(--yellow); }
.sparkle-2 { top: 20%; right: 10%; animation-delay: 0.8s; color: var(--cyan); }
.sparkle-3 { top: 45%; left: 3%; animation-delay: 1.6s; color: var(--magenta); }
.sparkle-4 { top: 65%; right: 6%; animation-delay: 2.4s; color: var(--lime); }
.sparkle-5 { top: 35%; right: 4%; animation-delay: 3.2s; color: var(--yellow); }
.sparkle-6 { top: 80%; left: 8%; animation-delay: 4s; color: var(--cyan); }

@keyframes sparkleFloat {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5) rotate(0deg); }
  15% { opacity: 1; transform: translateY(-12px) scale(1.2) rotate(20deg); }
  50% { opacity: 0.8; transform: translateY(-25px) scale(1) rotate(-15deg); }
  85% { opacity: 0.4; transform: translateY(-35px) scale(0.7) rotate(10deg); }
}

#app {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

/* ── HEADER ─────────────────────────────── */

header {
  text-align: center;
  padding: 1rem 0 0.5rem;
}

.hero-logo-wrap {
  display: inline-block;
  position: relative;
  margin-bottom: 0.75rem;
}

.hero-logo {
  width: 220px;
  height: 220px;
  border-radius: 20px;
  object-fit: cover;
  border: 3px solid var(--cyan);
  box-shadow:
    0 0 20px var(--cyan-glow),
    0 0 40px var(--magenta-glow),
    0 0 60px rgba(57, 255, 20, 0.15);
  animation: logoFloat 3s ease-in-out infinite, logoPulse 2s ease-in-out infinite alternate;
  transition: transform 0.3s;
}

.hero-logo:hover {
  transform: scale(1.05) rotate(2deg);
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes logoPulse {
  0% { box-shadow: 0 0 20px var(--cyan-glow), 0 0 40px var(--magenta-glow); }
  100% { box-shadow: 0 0 30px var(--magenta-glow), 0 0 60px var(--cyan-glow), 0 0 80px rgba(57, 255, 20, 0.2); }
}

.hero-h1 {
  font-family: 'Press Start 2P', cursive;
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin: 0.5rem 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Glitch text effect */
.glitch {
  color: var(--cyan);
  position: relative;
  text-shadow:
    0 0 10px var(--cyan-glow),
    0 0 20px var(--cyan-glow);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch::before {
  color: var(--magenta);
  animation: glitchTop 3s ease-in-out infinite;
  clip-path: inset(0 0 65% 0);
}

.glitch::after {
  color: var(--lime);
  animation: glitchBottom 3.5s ease-in-out infinite;
  clip-path: inset(60% 0 0 0);
}

@keyframes glitchTop {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, -1px); }
  94% { transform: translate(3px, 1px); }
  96% { transform: translate(-1px, -2px); }
  98% { transform: translate(2px, 0); }
}

@keyframes glitchBottom {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(2px, 1px); }
  93% { transform: translate(-3px, -1px); }
  95% { transform: translate(1px, 2px); }
  97% { transform: translate(-2px, 0); }
}

.hero-9000 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--magenta);
  text-shadow:
    0 0 10px var(--magenta-glow),
    0 0 30px var(--magenta-glow);
  animation: neonFlicker 4s ease-in-out infinite;
}

@keyframes neonFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  96% { opacity: 0.7; }
  97% { opacity: 1; }
}

.hero-sub {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--lime);
  letter-spacing: 0.2em;
  text-shadow: 0 0 10px var(--lime-glow);
  margin-bottom: 0.5rem;
}

.hero-desc {
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.7;
  max-width: 460px;
  margin: 0.5rem auto 1rem;
}

.hero-desc strong {
  color: var(--cyan);
}

.hero-desc em {
  color: var(--lime);
  font-style: normal;
  font-weight: 700;
  font-size: 0.78rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── BADGES ──────────────────────────── */

.badge-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  animation: badgePop 0.5s ease backwards;
}

.badge:nth-child(1) { animation-delay: 0.1s; }
.badge:nth-child(2) { animation-delay: 0.25s; }
.badge:nth-child(3) { animation-delay: 0.4s; }

@keyframes badgePop {
  from { opacity: 0; transform: scale(0.5) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.badge-private {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  text-shadow: 0 0 8px var(--cyan-glow);
}

.badge-fast {
  background: var(--yellow-dim);
  color: var(--yellow);
  border: 1.5px solid rgba(255, 230, 0, 0.4);
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.4);
}

.badge-precise {
  background: var(--magenta-dim);
  color: var(--magenta);
  border: 1.5px solid rgba(255, 45, 230, 0.4);
  text-shadow: 0 0 8px var(--magenta-glow);
}

/* ── HOW IT WORKS ─────────────────────── */

.how-it-works {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.how-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 0 10px var(--cyan-dim);
  transition: all 0.25s;
}

.how-step:hover {
  border-color: var(--cyan);
  transform: translateY(-3px);
  box-shadow: 0 0 20px var(--cyan-glow), 0 5px 20px rgba(0, 0, 0, 0.4);
}

.how-num {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.75rem;
  color: var(--bg);
  background: var(--cyan);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.how-text {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 700;
}

.how-arrow {
  color: var(--yellow);
  font-size: 1.1rem;
  animation: arrowBounce 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 230, 0, 0.5));
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* ── CARDS ──────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow:
    0 0 15px var(--cyan-dim),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
  display: none;
  animation: cardSlideIn 0.4s ease;
}

.card.active {
  display: block;
}

@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── DROP ZONE ─────────────────────────── */

#dropzone {
  border: 3px dashed var(--magenta);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  outline: none;
  background: var(--magenta-dim);
  position: relative;
  overflow: hidden;
}

#dropzone::after {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    transparent 0deg,
    rgba(0, 240, 255, 0.1) 60deg,
    transparent 120deg,
    rgba(255, 45, 230, 0.08) 240deg,
    transparent 300deg
  );
  animation: dropzoneSweep 6s linear infinite;
  pointer-events: none;
}

@keyframes dropzoneSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

#dropzone:hover,
#dropzone:focus-visible,
#dropzone.dragover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--cyan);
  box-shadow:
    0 0 30px var(--cyan-glow),
    0 0 60px var(--magenta-dim),
    inset 0 0 30px var(--cyan-dim);
  transform: scale(1.02);
}

#dropzone.dragover {
  transform: scale(1.04);
  border-color: var(--lime);
  box-shadow:
    0 0 40px var(--lime-glow),
    inset 0 0 40px var(--lime-dim);
}

.drop-icon {
  font-size: 3.5rem;
  margin-bottom: 0.75rem;
  animation: dropBounce 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 8px var(--magenta-glow));
}

@keyframes dropBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-12px) rotate(-8deg); }
  60% { transform: translateY(-5px) rotate(5deg); }
}

.drop-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--magenta);
  margin-bottom: 0.25rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 10px var(--magenta-glow);
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
}

.drop-hint strong {
  color: var(--cyan);
}

.drop-formats {
  font-size: 0.7rem;
  color: var(--lime);
  font-weight: 700;
  margin-top: 0.75rem;
  letter-spacing: 0.12em;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px var(--lime-glow);
}

.drop-note {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 0.75rem;
  font-style: italic;
  opacity: 0.6;
  position: relative;
  z-index: 1;
}

/* ── CROP WORKSPACE ──────────────────── */

.crop-workspace {
  position: relative;
  background: #0a0014;
  border-radius: 8px;
  border: 2px solid var(--border-mag);
  overflow: visible;
  margin-bottom: 0.75rem;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 0 20px var(--magenta-dim), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.crop-workspace img {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.crop-overlay {
  position: absolute;
  border: 2px dashed var(--cyan);
  cursor: move;
  z-index: 2;
  box-shadow: 0 0 12px var(--cyan-glow), inset 0 0 12px var(--cyan-dim);
}

/* Rule of thirds grid — explicit lines at 1/3 and 2/3 */
.crop-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      transparent calc(33.33% - 0.5px), rgba(0, 240, 255, 0.3) calc(33.33% - 0.5px), rgba(0, 240, 255, 0.3) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px),
      transparent calc(66.66% - 0.5px), rgba(0, 240, 255, 0.3) calc(66.66% - 0.5px), rgba(0, 240, 255, 0.3) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)
    ),
    linear-gradient(to bottom,
      transparent calc(33.33% - 0.5px), rgba(0, 240, 255, 0.3) calc(33.33% - 0.5px), rgba(0, 240, 255, 0.3) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px),
      transparent calc(66.66% - 0.5px), rgba(0, 240, 255, 0.3) calc(66.66% - 0.5px), rgba(0, 240, 255, 0.3) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)
    );
  pointer-events: none;
}

/* Crop handles — positioned inward so they stay inside overflow:hidden */
.crop-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--magenta);
  border: 2px solid #fff;
  border-radius: 3px;
  z-index: 3;
  box-shadow: 0 0 8px var(--magenta-glow), 0 0 16px var(--magenta-dim);
  transition: transform 0.15s, box-shadow 0.15s;
}

/* Corners — square brackets style */
.crop-handle[data-handle="nw"] { top: -2px; left: -2px; cursor: nwse-resize; border-radius: 3px 0 3px 0; }
.crop-handle[data-handle="ne"] { top: -2px; right: -2px; cursor: nesw-resize; border-radius: 0 3px 0 3px; }
.crop-handle[data-handle="se"] { bottom: -2px; right: -2px; cursor: nwse-resize; border-radius: 3px 0 3px 0; }
.crop-handle[data-handle="sw"] { bottom: -2px; left: -2px; cursor: nesw-resize; border-radius: 0 3px 0 3px; }

/* Edge midpoints — small pills */
.crop-handle[data-handle="n"]  { top: -2px; left: 50%; transform: translateX(-50%); cursor: ns-resize; width: 30px; height: 6px; border-radius: 3px; }
.crop-handle[data-handle="s"]  { bottom: -2px; left: 50%; transform: translateX(-50%); cursor: ns-resize; width: 30px; height: 6px; border-radius: 3px; }
.crop-handle[data-handle="e"]  { top: 50%; right: -2px; transform: translateY(-50%); cursor: ew-resize; width: 6px; height: 30px; border-radius: 3px; }
.crop-handle[data-handle="w"]  { top: 50%; left: -2px; transform: translateY(-50%); cursor: ew-resize; width: 6px; height: 30px; border-radius: 3px; }

.crop-handle:hover {
  background: var(--cyan);
  border-color: #fff;
  box-shadow: 0 0 12px var(--cyan-glow), 0 0 24px var(--cyan-dim);
}

/* ── CROP INFO ───────────────────────── */

.crop-info {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text);
  text-align: center;
  padding: 0.5rem;
  background: var(--bg-surface);
  border: 2px solid var(--cyan);
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 0 10px var(--cyan-dim);
}

.crop-info span {
  color: var(--lime);
  font-size: 0.95rem;
  text-shadow: 0 0 8px var(--lime-glow);
}

/* ── SETTING GROUPS ──────────────────── */

.setting-group {
  margin-bottom: 1.25rem;
}

.setting-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 6px var(--cyan-dim);
}

.setting-optional {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.5;
  color: var(--text-dim);
  text-shadow: none;
}

/* ── RATIO BUTTONS ──────────────────── */

.ratio-btns {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ratio-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.45rem 0.65rem;
  background: var(--bg-surface);
  color: var(--text-dim);
  border: 2px solid rgba(255, 45, 230, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.ratio-btn:hover {
  border-color: var(--magenta);
  color: var(--magenta);
  box-shadow: 0 0 10px var(--magenta-dim);
}

.ratio-btn.active {
  background: var(--magenta-dim);
  color: var(--magenta);
  border-color: var(--magenta);
  box-shadow: 0 0 15px var(--magenta-dim);
  text-shadow: 0 0 6px var(--magenta-glow);
}

/* ── FORMAT BUTTONS ───────────────────── */

.format-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.format-btn {
  font-family: 'Space Mono', monospace;
  padding: 0.75rem 0.5rem;
  background: var(--bg-surface);
  color: var(--text-dim);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}

.format-btn:hover {
  border-color: var(--cyan);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--cyan-dim), 0 5px 20px rgba(0, 0, 0, 0.3);
}

.format-btn.active {
  background: var(--cyan-dim);
  color: var(--text);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-dim);
}

.format-name {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  color: var(--cyan);
  margin-bottom: 0.25rem;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.format-btn.active .format-name {
  color: #fff;
  text-shadow: 0 0 10px var(--cyan-glow);
}

.format-desc {
  display: block;
  font-size: 0.55rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* ── QUALITY ──────────────────────────── */

.quality-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.quality-row input[type="range"] {
  flex: 1;
}

.quality-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-family: 'Space Mono', monospace;
  min-width: 3rem;
  text-align: center;
}

.quality-display {
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  color: var(--magenta);
  text-shadow: 0 0 15px var(--magenta-glow);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--magenta-dim), var(--cyan), var(--lime));
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--magenta);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--magenta-glow);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px var(--magenta-glow);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--magenta);
  border: 3px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--magenta-glow);
}

/* ── BUTTONS ──────────────────────────── */

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.7rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.4s;
}

.btn:hover::after {
  transform: translateX(100%);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--magenta), #b800e6);
  color: #fff;
  border-color: var(--magenta);
  box-shadow: 0 0 15px var(--magenta-dim), 0 4px 15px rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 30px var(--magenta-glow), 0 4px 20px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-dim);
  border-color: var(--border);
}

.btn-secondary:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-dim);
  transform: translateY(-2px);
}

/* ── PROGRESS ─────────────────────────── */

.processing-status {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--cyan);
  text-align: center;
  margin-bottom: 1rem;
  text-shadow: 0 0 10px var(--cyan-glow);
  animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--magenta), var(--cyan), var(--lime));
  border-radius: 12px;
  transition: width 0.3s ease;
  position: relative;
  box-shadow: 0 0 15px var(--cyan-glow);
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.2s ease-in-out infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ── DONE ─────────────────────────────── */

.done-icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 0.5rem;
  animation: donePopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  filter: drop-shadow(0 0 10px var(--lime-glow));
}

@keyframes donePopIn {
  from { transform: scale(0) rotate(-180deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.done-title {
  font-family: 'Press Start 2P', cursive;
  font-size: 1.1rem;
  color: var(--lime);
  text-align: center;
  margin-bottom: 0.25rem;
  text-shadow: 0 0 15px var(--lime-glow), 0 0 30px var(--lime-dim);
  animation: titleBounce 0.8s ease backwards 0.2s;
}

@keyframes titleBounce {
  0% { transform: translateY(20px); opacity: 0; }
  60% { transform: translateY(-5px); }
  100% { transform: translateY(0); opacity: 1; }
}

.done-stats {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.done-stats span {
  color: var(--cyan);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  text-shadow: 0 0 8px var(--cyan-glow);
}

.result-preview {
  text-align: center;
  margin-bottom: 1.25rem;
}

.result-preview img {
  max-width: 100%;
  max-height: 300px;
  border: 2px solid var(--cyan);
  border-radius: 8px;
  box-shadow: 0 0 20px var(--cyan-dim), 0 0 40px var(--magenta-dim);
  object-fit: contain;
  background: #0a0014;
}

/* ── FOOTER ───────────────────────────── */

footer {
  margin-top: auto;
  padding: 2rem 0 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.footer-walrus {
  font-size: 2rem;
  margin-bottom: 0.25rem;
  animation: footerBob 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px var(--cyan-glow));
}

@keyframes footerBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-3deg); }
  75% { transform: translateY(-4px) rotate(3deg); }
}

.footer-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.footer-sub a {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 700;
  text-shadow: 0 0 6px var(--cyan-dim);
}

.footer-sub a:hover {
  text-decoration: underline;
  text-shadow: 0 0 10px var(--cyan-glow);
}

/* ── SPONSOR BAR ─────────────────────── */

.sponsor-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}

.sponsor-bar .sponsor-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.5;
  white-space: nowrap;
}

.sponsor-bar .sponsor-inline {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  opacity: 0.3;
  padding: 0.3rem 1.5rem;
  border: 1px dashed var(--border);
  border-radius: 4px;
}

/* ── SEO SECTION ─────────────────────── */

.seo-section {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 0 10px var(--cyan-dim);
  margin-top: 0.5rem;
}

.seo-section h2 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--cyan);
  margin-bottom: 0.75rem;
  text-shadow: 0 0 8px var(--cyan-dim);
}

.seo-section h3 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--magenta);
  margin: 1rem 0 0.5rem;
  text-shadow: 0 0 6px var(--magenta-dim);
}

.seo-section p {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.7;
}

.seo-section strong {
  color: var(--cyan);
}

.seo-section ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seo-section li {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.6;
  padding-left: 1.5rem;
  position: relative;
}

.seo-section li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--lime);
  font-family: 'Press Start 2P', cursive;
  font-size: 0.5rem;
  top: 3px;
  text-shadow: 0 0 6px var(--lime-glow);
}

.seo-section li strong {
  color: var(--cyan);
}

/* ── HUB NAV ─────────────────────────── */

.hub-nav {
  width: 100%;
  max-width: 540px;
  margin: 0 auto 0.5rem;
  position: relative;
  z-index: 1;
}

.hub-back {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--cyan);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 6px;
  transition: all 0.25s;
  letter-spacing: 0.05em;
}

.hub-back:hover {
  border-color: var(--cyan);
  background: var(--cyan-dim);
  box-shadow: 0 0 15px var(--cyan-dim);
  transform: translateY(-1px);
}

/* ── RESPONSIVE ───────────────────────── */

@media (max-width: 500px) {
  .how-it-works {
    gap: 0.3rem;
  }
  .how-step {
    padding: 0.4rem 0.5rem;
  }
  .how-text {
    font-size: 0.6rem;
  }
  .hero-logo {
    width: 170px;
    height: 170px;
  }
}

@media (max-width: 400px) {
  .hero-desc {
    font-size: 0.78rem;
  }
  .card {
    padding: 1rem;
  }
  .btn {
    font-size: 0.75rem;
    padding: 0.6rem 0.75rem;
  }
  .hero-h1 {
    font-size: 0.75rem;
  }
  .hero-9000 {
    font-size: 1.2rem;
  }
  .hero-logo {
    width: 150px;
    height: 150px;
  }
  .how-arrow {
    display: none;
  }
  .how-it-works {
    flex-wrap: wrap;
  }
  /* Bigger touch targets on mobile */
  .crop-handle[data-handle="nw"],
  .crop-handle[data-handle="ne"],
  .crop-handle[data-handle="se"],
  .crop-handle[data-handle="sw"] { width: 20px; height: 20px; }
  .crop-handle[data-handle="n"],
  .crop-handle[data-handle="s"] { width: 36px; height: 8px; }
  .crop-handle[data-handle="e"],
  .crop-handle[data-handle="w"] { width: 8px; height: 36px; }
}
