/* photobooth.css — Fun Coding SMAN 107 MPLS Kiosk */
/* Design: dark committed, neon accent, touch-first, retro-modern */

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

:root {
  /* Palette — premium deep slate-blue matching the landing page theme */
  --bg:       #070a13;       /* deep slate-black background */
  --surface:  #0f1524;       /* slate blue surface */
  --surface2: #192239;       /* medium slate blue surface */
  --border:   #253352;       /* subtle dark blue border */
  --neon:     #52a1d5;       /* bright sky blue accent */
  --neon-dim: #1b587a;       /* landing page primary blue */
  --ink:      #f3f4f6;       /* light gray ink */
  --ink-mid:  #9ca3af;       /* mid gray ink */
  --ink-dim:  #4b5563;       /* dim gray ink */
  --red:      #f87171;
  --white:    #ffffff;

  /* Type */
  --display: 'Barlow Condensed', sans-serif;
  --body:    'Space Grotesk', sans-serif;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index scale */
  --z-overlay: 10;
  --z-modal:   20;
  --z-flash:   30;
  --z-toast:   40;
}

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

html {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }

/* ─── SCREENS ─────────────────────────────────────────── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100dvh;
  padding: 24px;
}
.screen.active { display: flex; }

/* ─── SCREEN 1: TEMPLATE PICKER ──────────────────────── */
#screen-pick {
  gap: 24px;
}

.pick-header {
  text-align: center;
  padding-top: 16px;
}

.pick-eyebrow {
  font-family: var(--display);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--neon);
  text-transform: uppercase;
}

.pick-title {
  font-family: var(--display);
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 0.95;
  color: var(--ink);
  text-wrap: balance;
  margin-top: 4px;
}

.pick-subtitle {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--ink-mid);
  max-width: 50ch;
  margin-inline: auto;
  line-height: 1.6;
}

/* Filter selector on pick screen */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-mid);
  font-size: 0.82rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--neon-dim);
  color: var(--ink);
}

.filter-btn.selected {
  border-color: var(--neon);
  background: color-mix(in srgb, var(--neon) 12%, var(--surface));
  color: var(--neon);
}

/* ─── RETRO ROTARY PICKER LAYOUT ──────────────────────── */
/* ─── RETRO ROTARY PICKER LAYOUT ──────────────────────── */
.picker-layout {
  display: flex;
  flex-direction: row;
  height: 100dvh;
  width: 100vw;
  max-width: 100%;
  margin: 0;
  padding: 20px 40px; /* ponytail: reduced padding to fit smaller screens */
  gap: 30px; /* ponytail: reduced gap to save vertical/horizontal space */
  align-items: center;
  justify-content: center;
}

/* Left: Showcase Card (75% screen area) */
.picker-left {
  flex: 2.8;
  display: flex;
  justify-content: center;
  align-items: center;
  border-right: 1.5px solid var(--border);
  height: 100%;
  padding-right: 30px; /* ponytail: reduced padding */
}

#showcase-img {
  max-height: 85vh; /* ponytail: fit screen vertically perfectly */
  width: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #ffffff; /* ponytail: white background so transparent template slots show as white */
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  animation: float-img 6s ease-in-out infinite;
}

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

#showcase-img.changing {
  opacity: 0.15;
  transform: scale(0.95);
}

/* Right: Header Text & Rotary Selector (25% screen area) */
.picker-right {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding-top: 20px;
  padding-bottom: 20px;
  position: relative;
  overflow: visible;
}

.pick-header-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
  width: 100%;
  padding-right: 20px;
}

.pick-eyebrow {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--neon);
  text-transform: uppercase;
}

.pick-title-right {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.6rem); /* ponytail: reduced font clamp */
  font-weight: 950;
  line-height: 0.95;
  color: var(--ink);
  text-transform: uppercase;
}

.pick-subtitle-right {
  font-size: 0.88rem;
  color: var(--ink-mid);
  line-height: 1.5;
  max-width: 25ch;
  margin-top: 6px;
}

.rotary-wrapper {
  position: fixed;
  right: -180px;   /* ponytail: exactly half the width off-screen = perfect half-circle */
  top: 50%;
  transform: translateY(-50%);
  width: 360px;    /* ponytail: reduced from 480px */
  height: 360px;   /* ponytail: reduced from 480px */
  --radius: 130px; /* ponytail: reduced from 175px */
  z-index: 10;
  touch-action: none; /* Disable browser gesture conflicts for smooth dragging */
  user-select: none;  /* Prevent text highlighting during drag */
}

/* Glowing neon active pointer pointing to selected template */
.rotary-wrapper::after {
  content: '▶';
  position: absolute;
  left: -37px; /* ponytail: adjusted pointer alignment to match smaller dial diameter */
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--neon);
  text-shadow: 0 0 12px var(--neon);
  z-index: 5;
  pointer-events: none;
  animation: pulse-pointer 1s ease-in-out infinite;
}

@keyframes pulse-pointer {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%       { transform: translateY(-50%) translateX(-4px); }
}

.rotary-disc {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(25, 34, 57, 0.15), rgba(10, 14, 24, 0.75));
  border: 3px solid rgba(255, 255, 255, 0.07);
  box-shadow: 
    15px 15px 35px rgba(0, 0, 0, 0.8),
    inset 4px 4px 8px rgba(255, 255, 255, 0.08),
    inset -4px -4px 12px rgba(0, 0, 0, 0.9);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

/* Disable transitions during manual drag/spin for zero latency interaction */
.rotary-disc.dragging,
.rotary-disc.dragging .dial-hole {
  transition: none !important;
}

.rotary-disc::before {
  content: '';
  position: absolute;
  inset: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.05), 1px 1px 2px rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.dial-hole {
  position: absolute;
  width: 44px; /* ponytail: reduced from 52px */
  height: 44px; /* ponytail: reduced from 52px */
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1b2234, #0b0e16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 900;
  color: var(--ink-mid);
  font-size: 1.1rem; /* ponytail: reduced from 1.3rem */
  cursor: pointer;
  left: 50%;
  top: 50%;
  margin-left: -22px; /* ponytail: half of 44px */
  margin-top: -22px;  /* ponytail: half of 44px */
  border: 2px solid rgba(255, 255, 255, 0.05);
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.9), 
    inset -3px -3px 6px rgba(255, 255, 255, 0.02),
    2px 2px 4px rgba(0, 0, 0, 0.6);
  transform: rotate(var(--angle)) translate(var(--radius)) rotate(var(--self-rotation, calc(-1 * var(--angle))));
  transition: border-color 0.2s, color 0.2s, background-color 0.2s, box-shadow 0.25s, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dial-hole:hover {
  border-color: var(--neon);
  color: var(--white);
  box-shadow: 
    inset 3px 3px 6px rgba(0, 0, 0, 0.9), 
    inset -3px -3px 6px rgba(255, 255, 255, 0.02),
    0 0 8px rgba(82, 161, 213, 0.4);
}

.dial-hole.selected {
  border-color: #ffffff;
  background: radial-gradient(circle at 35% 35%, var(--neon), var(--neon-dim));
  color: #070a13;
  box-shadow: 
    0 0 15px var(--neon),
    inset 2px 2px 4px rgba(255, 255, 255, 0.6),
    inset -2px -2px 4px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

.rotary-hub {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 190px; /* ponytail: reduced from 250px */
  height: 190px; /* ponytail: reduced from 250px */
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #131b2d, #070b13);
  border: 4px solid rgba(255, 255, 255, 0.05);
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.8), 
    inset 4px 4px 10px rgba(255, 255, 255, 0.04), 
    inset -4px -4px 10px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  overflow: hidden;
}

.btn-start-rotary {
  width: 120px; /* ponytail: reduced from 160px */
  height: 120px; /* ponytail: reduced from 160px */
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--neon), var(--neon-dim));
  color: var(--bg);
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 
    0 8px 20px rgba(0, 0, 0, 0.6),
    inset 3px 3px 6px rgba(255, 255, 255, 0.4), 
    inset -3px -3px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center; /* icon perfectly centered inside the full circle */
  font-size: 2.2rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, background-color 0.2s;
}

.btn-start-rotary:hover:not(:disabled) {
  transform: scale(1.05);
  background: radial-gradient(circle at 35% 35%, #7ec2ef, #4392c6);
  box-shadow: 
    0 12px 28px rgba(0, 0, 0, 0.7),
    0 0 15px rgba(82, 161, 213, 0.4),
    inset 3px 3px 6px rgba(255, 255, 255, 0.5), 
    inset -3px -3px 6px rgba(0, 0, 0, 0.4);
  color: var(--bg);
}

.btn-start-rotary:active:not(:disabled) {
  transform: scale(0.96) translateY(2px);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.5),
    inset 2px 2px 4px rgba(0, 0, 0, 0.4),
    inset -2px -2px 4px rgba(255, 255, 255, 0.1);
}

.btn-start-rotary:disabled {
  background: radial-gradient(circle at 50% 50%, #0d121c, #07090e);
  border-color: rgba(255, 255, 255, 0.02);
  color: var(--ink-dim);
  box-shadow: 
    inset 4px 4px 8px rgba(0, 0, 0, 0.6), 
    inset -4px -4px 8px rgba(255, 255, 255, 0.02);
  cursor: not-allowed;
}

/* CTA bar at bottom of pick screen */
.pick-cta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}

.pick-filter-label {
  font-size: 0.8rem;
  color: var(--ink-dim);
  flex-shrink: 0;
}

.spacer { flex: 1; }

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 99px;
  background: var(--neon);
  color: var(--bg);
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--neon) 30%, transparent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--neon) 40%, transparent);
}

.btn-primary:active { transform: scale(0.97); }

.btn-primary:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--ink-mid);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}

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

/* ─── SCREEN 2: CAMERA ────────────────────────────────── */
#screen-camera {
  gap: 0;
  padding: 0;
  position: relative;
  background: var(--bg);
}

.camera-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  height: 100dvh;
  overflow: hidden;
}

/* Left: the template frame area */
.camera-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050508;
  overflow: hidden;
}

.stage-inner {
  position: relative;
  background: #ffffff; /* Solid white photo paper background behind transparent template slots */
  /* sized by JS based on template aspect ratio */
}

/* The live video sits behind the template overlay */
#live-video {
  /* Positioned and sized dynamically by JS positionOverSlot() */
  transform: scaleX(-1);
}

/* Slot placeholder (before capture) */
.slot-placeholder {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1.5px dashed rgba(255,255,255,0.18);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  pointer-events: none;
  transition: opacity 0.3s;
}

.slot-placeholder.active-slot {
  border-color: var(--neon);
  background: rgba(212, 255, 71, 0.05);
  color: var(--neon);
  animation: pulse-slot 1.4s ease-in-out infinite;
}

@keyframes pulse-slot {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--neon) 0%, transparent); }
  50%       { box-shadow: 0 0 0 6px color-mix(in srgb, var(--neon) 12%, transparent); }
}

.slot-placeholder.done-slot {
  border-color: transparent;
  background: transparent;
}

/* Frozen photo canvas elements per slot */
.slot-frozen {
  position: absolute;
  pointer-events: none;
}

/* Template PNG overlay — sits on top of everything */
.template-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: var(--z-overlay);
}

/* Countdown bubble */
#countdown-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  pointer-events: none;
  opacity: 0;
}

.countdown-num {
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 5rem); /* Resized to fit nicely inside individual slots */
  font-weight: 900;
  color: var(--white);
  text-shadow: 0 0 40px rgba(212,255,71,0.6), 0 4px 32px rgba(0,0,0,0.8);
  transform: scale(1.4);
  transition: transform 0.25s var(--ease-out), opacity 0.25s;
}

/* Flash overlay */
#flash-overlay {
  position: absolute;
  inset: 0;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
  z-index: var(--z-flash);
  transition: opacity 0.08s;
}

/* Right: controls panel */
.camera-panel {
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  gap: 20px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}

.panel-title {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
}

.panel-sub {
  font-size: 0.82rem;
  color: var(--ink-mid);
  margin-top: 4px;
}

/* Shot progress indicators */
.shots-track {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.shot-dot.done {
  background: var(--neon);
  border-color: var(--neon);
}

.shot-dot.active {
  background: transparent;
  border-color: var(--neon);
  animation: pulse-dot 1s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.4); box-shadow: 0 0 6px var(--neon); }
}

/* Filter picker in camera panel */
.panel-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 99px; /* premium capsule shape */
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink-mid);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  line-height: 1.2;
}

.filter-chip:hover {
  border-color: var(--neon);
  color: var(--ink);
  background: var(--surface2);
  transform: translateY(-1px);
}

.filter-chip.selected {
  border-color: var(--neon);
  background: color-mix(in srgb, var(--neon) 12%, var(--surface));
  color: var(--ink);
  box-shadow: 0 0 16px color-mix(in srgb, var(--neon) 12%, transparent);
}

.filter-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
  transition: transform 0.2s var(--ease-out);
}

.filter-chip.selected .filter-indicator {
  transform: scale(1.15);
}

/* Color indicator gradients for filters */
.filter-indicator.normal {
  background: conic-gradient(from 180deg, #ff4500, #ff8c00, #ffd700, #92fe9d, #00c6ff, #0072ff, #a770ef, #ff0844);
}
.filter-indicator.peach {
  background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}
.filter-indicator.noir {
  background: linear-gradient(135deg, #111111 0%, #aaaaaa 100%);
}
.filter-indicator.retro {
  background: linear-gradient(135deg, #a88b56 0%, #eed29b 100%);
}
.filter-indicator.cyber {
  background: linear-gradient(135deg, #ff007f 0%, #00f0ff 100%);
}
.filter-indicator.golden {
  background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
}

.filter-chip.locked {
  pointer-events: none;
  opacity: 0.4;
}

.filter-locked-notice {
  font-size: 0.75rem;
  color: var(--neon-dim);
  text-align: center;
  padding: 6px;
  background: color-mix(in srgb, var(--neon) 6%, var(--surface));
  border-radius: 6px;
  display: none;
}

.filter-locked-notice.visible { display: block; }

.spacer-push { flex: 1; }

.capture-btn-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-capture {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  background: var(--neon);
  color: var(--bg);
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--neon) 30%, transparent);
}

.btn-capture:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--neon) 40%, transparent);
}

.btn-capture:active { transform: scale(0.97); }
.btn-capture:disabled { opacity: 0.3; pointer-events: none; }

.btn-back-small {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--ink-dim);
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.2s, border-color 0.2s;
}

.btn-back-small:hover {
  color: var(--ink-mid);
  border-color: var(--ink-dim);
}

/* ─── SCREEN 3: REGISTRATION & PREVIEW ───────────────── */
#screen-register {
  gap: 24px;
  max-width: 900px;
  margin-inline: auto;
  width: 100%;
}

.reg-header {
  text-align: center;
}

.reg-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 900;
  color: var(--ink);
}

.reg-sub {
  font-size: 0.9rem;
  color: var(--ink-mid);
  margin-top: 8px;
}

.reg-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
  flex: 1;
}

/* Strip preview in reg screen */
.strip-preview-wrap {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 24px;
}

.strip-preview-wrap canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Form */
.reg-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.field input {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  transition: border-color 0.2s;
  outline: none;
}

.field input::placeholder { color: var(--ink-dim); }

.field input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--neon) 12%, transparent);
}

.field-error {
  font-size: 0.78rem;
  color: var(--red);
  display: none;
}

.field-error.visible { display: block; }

.submit-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.upload-status {
  font-size: 0.82rem;
  color: var(--ink-mid);
  text-align: center;
  min-height: 20px;
}

/* ─── SCREEN 4: SUCCESS ───────────────────────────────── */
#screen-success {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
}

.success-icon {
  font-size: 4rem;
  animation: pop-in 0.5s var(--ease-spring) both;
}

@keyframes pop-in {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.success-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 900;
  color: var(--neon);
  line-height: 1;
}

.success-sub {
  font-size: 1rem;
  color: var(--ink-mid);
  max-width: 38ch;
  line-height: 1.6;
}

.success-timer {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin-top: 8px;
}

/* ─── FLASH ANIMATION ─────────────────────────────────── */
.flash-white {
  animation: flash 0.35s ease-out;
}

@keyframes flash {
  0%  { opacity: 0.9; }
  100% { opacity: 0; }
}

/* ─── SCREEN TRANSITIONS ──────────────────────────────── */
.screen {
  animation: screen-in 0.35s var(--ease-out) both;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── RESPONSIVE: narrow tablet / landscape ───────────── */
@media (max-width: 768px) {
  .camera-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .camera-panel {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    max-height: 220px;
    overflow-y: auto;
  }

  .panel-title, .panel-sub { display: none; }

  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .spacer-push { display: none; }

  .capture-btn-wrap {
    flex-direction: row;
    align-items: center;
    width: 100%;
  }

  .reg-body {
    grid-template-columns: 1fr;
  }

  .strip-preview-wrap {
    width: 140px;
    margin-inline: auto;
    position: static;
  }

  .picker-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-bottom: 24px;
  }

  #showcase-img {
    max-height: 45vh; /* ponytail: size down template image on mobile to prevent overflow */
    width: auto;
  }

  .rotary-wrapper {
    width: 310px;
    height: 310px;
    right: -155px; /* Offset exactly half of the mobile dial width off-screen */
    --radius: 105px;
  }

  .rotary-wrapper::after {
    left: -25px; /* ponytail: adjust pointer left on mobile */
  }

  .rotary-disc::before {
    inset: 38px;
  }

  .dial-hole {
    width: 42px;
    height: 42px;
    margin-left: -21px;
    margin-top: -21px;
    font-size: 1.05rem;
  }

  .rotary-hub {
    width: 160px;
    height: 160px;
  }

  .rotary-hub::after {
    font-size: 0.9rem;
    transform: translateX(-25px);
  }

  .btn-start-rotary {
    width: 110px;
    height: 110px;
    padding-left: 15px; /* Centers the scaled 26px icon in the 55px visible half-circle */
  }

  .btn-start-rotary svg {
    width: 26px !important;
    height: 26px !important;
  }
}

/* ─── REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .screen, .btn-primary, .btn-capture, .template-card {
    animation: none;
    transition: none;
  }

  @keyframes pulse-slot { }
  @keyframes pulse-dot  { }
}
