/* ═══════════════════════════════════════════════════════════════
   Tripper Spiral — Psychedelic Minimalism
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --bg:        #0d0d0d;
  --bg-card:   #161616;
  --bg-card2:  #1e1e1e;
  --primary:   #ff4e1a;
  --primary-glow: rgba(255, 78, 26, 0.35);
  --secondary: #00e5cc;
  --text:      #f0ede6;
  --text-dim:  #888880;
  --border:    #2a2a2a;
  --border-bright: #3a3a3a;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;
  --radius: 6px;
}

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

/* Ensure [hidden] always wins over any display rule */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

button {
  font-family: var(--font-mono);
  cursor: pointer;
  border: none;
  background: none;
}

img { display: block; max-width: 100%; }

/* ── Phase System ── */
.phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}

.phase[hidden] {
  display: none !important;
}

/* ═══════════════════════════════════════
   PHASE 1 — UPLOAD
   ═══════════════════════════════════════ */

/* ── Site Header / Logo ── */
.site-header {
  text-align: center;
  margin-bottom: 3rem;
}

.site-logo {
  display: block;
  margin: 0 auto;
  height: clamp(200px, 36vw, 320px);
  width: auto;
  cursor: pointer;
}

.site-logo.spinning {
  animation: logo-spin 800ms ease-in-out;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.tagline {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 1rem;
}

.change-key-btn {
  margin-top: 0.9rem;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  background: transparent;
  transition: color 0.2s, border-color 0.2s;
}

.change-key-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

/* ── Upload Main ── */
.upload-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
  max-width: 640px;
}

/* ── Drop Zone ── */
.drop-zone {
  width: 100%;
  min-height: 320px;
  border: 1.5px dashed var(--border-bright);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(255, 78, 26, 0.04);
}

.drop-zone.drag-over {
  background: rgba(255, 78, 26, 0.08);
}

/* ── Upload Prompt ── */
.upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem;
  text-align: center;
  pointer-events: none;
}

.upload-icon {
  width: 56px;
  height: 56px;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.drop-zone:hover .upload-icon {
  color: var(--primary);
}

.drop-headline {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text);
}

.drop-sub {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.browse-btn {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: rgba(255, 78, 26, 0.4);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  pointer-events: all;
  transition: color 0.2s;
}

.browse-btn:hover {
  color: var(--secondary);
}

.drop-formats {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-top: 0.3rem;
}

/* ── Preview ── */
.preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
}

.preview-img {
  max-height: 280px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

.change-btn {
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 0.4rem 0.9rem;
  transition: color 0.2s, border-color 0.2s;
}

.change-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

/* ── Upload Error ── */
.upload-error {
  color: var(--primary);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 78, 26, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 78, 26, 0.06);
  width: 100%;
}

/* ── Settings Panel ── */
.settings-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

/* ── Slider ── */
.slider-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.slider-label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.slider-track-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.slider-bound {
  font-size: 0.75rem;
  color: var(--text-dim);
  min-width: 1.5rem;
  text-align: center;
}

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

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 78, 26, 0.2);
  transition: box-shadow 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(255, 78, 26, 0.25);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
}

.steps-help {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 0.04em;
}

/* ── Start Button ── */
.start-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  border: 1.5px solid var(--text-dim);
  border-radius: 3px;
  background: transparent;
  transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.35s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.start-btn:hover::before {
  transform: scaleX(1);
}

.start-btn:hover {
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(255, 78, 26, 0.15);
  transform: translateY(-1px);
}

.btn-text,
.btn-arrow {
  position: relative;
  z-index: 1;
}

.btn-arrow {
  font-size: 1.1rem;
  transition: transform 0.2s;
}

.start-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* ═══════════════════════════════════════
   PHASE 2 — PROCESSING
   ═══════════════════════════════════════ */

.processing-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 3rem 1.5rem 2rem;
}

/* ── Spiral Loader ── */
.spiral-loader {
  width: 100px;
  height: 100px;
}

.spiral-loader svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring {
  transform-box: fill-box;
  transform-origin: center;
}

.ring-outer {
  stroke: var(--primary);
  stroke-dasharray: 200 76;
  animation: spin-cw 2.4s linear infinite;
}

.ring-mid {
  stroke: var(--secondary);
  stroke-dasharray: 120 68;
  animation: spin-ccw 1.7s linear infinite;
}

.ring-inner {
  stroke: var(--primary);
  stroke-dasharray: 56 45;
  animation: spin-cw 1.1s linear infinite;
  opacity: 0.7;
}

@keyframes spin-cw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes spin-ccw {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

.progress-text {
  font-size: 0.82rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1; }
}

/* ═══════════════════════════════════════
   FILMSTRIP (shared)
   ═══════════════════════════════════════ */

.filmstrip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 1.5rem 1.5rem 2rem;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}

.filmstrip::-webkit-scrollbar {
  height: 4px;
}

.filmstrip::-webkit-scrollbar-track {
  background: transparent;
}

.filmstrip::-webkit-scrollbar-thumb {
  background: var(--border-bright);
  border-radius: 2px;
}

/* ── Frame Cards ── */
.frame-card {
  flex: 0 0 160px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

/* Contact-sheet alternating tilt */
.frame-card:nth-child(4n+1) { transform: rotate(-1.8deg) translateY(2px); }
.frame-card:nth-child(4n+2) { transform: rotate(1.2deg) translateY(-1px); }
.frame-card:nth-child(4n+3) { transform: rotate(-0.8deg) translateY(3px); }
.frame-card:nth-child(4n+4) { transform: rotate(2deg) translateY(0px); }

.frame-card:hover {
  transform: rotate(0deg) translateY(-6px) scale(1.04) !important;
  border-color: var(--primary);
  box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 0 1px var(--primary);
  z-index: 10;
}

.frame-card.active {
  border-color: var(--secondary) !important;
  box-shadow: 0 0 0 2px var(--secondary), 0 8px 24px rgba(0,0,0,0.5) !important;
}

.frame-card img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.frame-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  padding: 0.5rem;
  border-top: 1px solid var(--border);
}

/* Original frame highlight */
.frame-original {
  border-color: var(--primary) !important;
}

.frame-original .frame-label {
  color: var(--primary);
}

/* Failed frame */
.frame-failed {
  cursor: default;
  opacity: 0.5;
}

.frame-error {
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 0.75rem;
}

.frame-error-icon {
  font-size: 1.2rem;
  color: rgba(255, 78, 26, 0.5);
}

.frame-error-detail {
  font-size: 0.6rem;
  color: var(--text-dim);
  line-height: 1.4;
  word-break: break-word;
}

/* Incoming frame animation */
@keyframes frame-arrive {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
  }
}

.frame-card {
  animation: frame-arrive 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ═══════════════════════════════════════
   PHASE 3 — REVEAL
   ═══════════════════════════════════════ */

.reveal-top {
  padding: 2rem 1.5rem 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.flipbook-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 520px;
}

/* ── Flipbook Display ── */
.flipbook-display {
  position: relative;
  width: 100%;
  height: clamp(300px, 48vw, 520px);
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
}

/* Two images stacked — crossfade between them, no gap */
.flipbook-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.flipbook-img.flipbook-active {
  opacity: 1;
}

.flipbook-badge {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 3px;
  border: 1px solid var(--border-bright);
}

/* ── Flipbook Controls ── */
.flipbook-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-bright);
  border-radius: 50%;
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.ctrl-btn svg {
  width: 16px;
  height: 16px;
}

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

.ctrl-play {
  width: 52px;
  height: 52px;
  border-color: var(--primary);
  color: var(--primary);
}

.ctrl-play svg {
  width: 18px;
  height: 18px;
}

.ctrl-play:hover {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
}

/* ── Speed Control ── */
.speed-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.speed-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.speed-select {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.speed-select:focus {
  border-color: var(--secondary);
}

/* ── Filmstrip Reveal ── */
.filmstrip-reveal {
  margin-top: 0.5rem;
}

/* ── Reveal Footer ── */
.reveal-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: fit-content;
  margin: 1rem auto 0;
  position: relative;
}

.keep-trippin-btn {
  color: var(--text);
  border: 1.5px solid var(--secondary);
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: color 0.25s, border-color 0.25s, box-shadow 0.35s, transform 0.2s;
}

.keep-trippin-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.keep-trippin-btn:hover:not(:disabled)::before {
  transform: scaleX(1);
}

.keep-trippin-btn:hover:not(:disabled) {
  color: #000;
  border-color: var(--primary);
  box-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(255, 78, 26, 0.15);
  transform: translateY(-1px);
}

.keep-trippin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Continue Overlay ── */
.continue-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10;
  border-radius: 3px;
}

.continue-overlay[hidden] {
  display: none !important;
}

.continue-overlay .spiral-loader {
  width: 60px;
  height: 60px;
}

.continue-progress-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0;
}

/* ── Reveal Actions ── */
.reveal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.action-btn {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.75rem 1.75rem;
  border-radius: 3px;
  transition: color 0.2s, background 0.2s, border-color 0.2s, box-shadow 0.3s;
}

.share-btn {
  color: var(--primary);
  border: 1.5px solid var(--primary);
  background: transparent;
}

.share-btn:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 30px var(--primary-glow);
}

.restart-btn {
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  background: transparent;
  flex: 1;
}

.restart-btn:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

/* ── Share Options (revealed on button click) ── */
.share-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  flex: 1;
}

.share-btn {
  width: 100%;
}

.share-options {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

.share-option-btn {
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  background: transparent;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.share-option-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Frame download button (appears on active card) ── */
.frame-download-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%); /* sits in image area, not label */
  width: 38px;
  height: 38px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, background 0.15s;
  z-index: 5;
  cursor: pointer;
  color: var(--text);
}

.frame-download-btn svg {
  width: 15px;
  height: 15px;
}

.frame-card.active .frame-download-btn {
  opacity: 1;
  pointer-events: auto;
}

.frame-download-btn:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #000;
}


/* ═══════════════════════════════════════
   API KEY MODAL
   ═══════════════════════════════════════ */

.apikey-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}

.apikey-overlay[hidden] {
  display: none !important;
}

.apikey-box {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.apikey-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.apikey-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.7;
}

.apikey-desc a {
  color: var(--secondary);
  text-decoration: none;
}

.apikey-desc a:hover {
  text-decoration: underline;
}

.apikey-privacy {
  font-size: 0.7rem;
  color: #555;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.apikey-input-row {
  display: flex;
  gap: 0.5rem;
}

.apikey-input {
  flex: 1;
  background: #111;
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.6rem 0.9rem;
  outline: none;
  letter-spacing: 0.04em;
  transition: border-color 0.2s;
}

.apikey-input:focus {
  border-color: var(--secondary);
}

.apikey-toggle {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 0 0.9rem;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.apikey-toggle:hover {
  color: var(--text);
  border-color: var(--text-dim);
}

.apikey-error {
  font-size: 0.75rem;
  color: var(--primary);
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(255, 78, 26, 0.3);
  border-radius: 3px;
  background: rgba(255, 78, 26, 0.06);
}

.apikey-save-btn {
  align-self: flex-start;
}

.apikey-about {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.apikey-about[hidden] {
  display: none !important;
}

.apikey-about-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text);
  margin: 0;
}

.apikey-about-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin: 0;
}

.about-video-wrap {
  position: relative;
  cursor: pointer;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  line-height: 0;
}

#about-video {
  width: 100%;
  display: block;
}

.about-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.38);
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.about-video-play svg {
  width: 52px;
  height: 52px;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

.about-video-wrap.playing .about-video-play {
  opacity: 0;
}

/* ═══════════════════════════════════════
   ERROR OVERLAY
   ═══════════════════════════════════════ */

.error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.error-overlay[hidden] {
  display: none !important;
}

.error-box {
  background: var(--bg-card);
  border: 1px solid rgba(255, 78, 26, 0.4);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 420px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,78,26,0.2);
}

.error-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.error-message {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ═══════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════ */

/* Grain texture overlay (subtle) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9999;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .upload-main {
    gap: 1.25rem;
  }

  .frame-card {
    flex: 0 0 130px;
  }

  .frame-card img {
    height: 100px;
  }

  .flipbook-controls {
    gap: 0.5rem;
  }

  .reveal-footer {
    width: 100%;
    padding: 0 1rem;
    box-sizing: border-box;
  }

  .reveal-actions {
    flex-direction: column;
  }
}
