/* ============ Fonts ============ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-var-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/space-grotesk-latin.woff2") format("woff2");
}

/* ============ Tokens ============ */
:root {
  --bg: #0d1321;
  --bg-2: #121a2e;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #e6ecf7;
  --text-dim: #93a1bb;
  --text-mute: #6b7a96;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --cyan: #22d3ee;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.4);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.45);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ============ Reset / Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

/* ============ App Shell ============ */
.app {
  position: relative;
  min-height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 15% 0%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(50% 40% at 90% 10%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(60% 50% at 50% 100%, rgba(139, 92, 246, 0.12), transparent 60%),
    var(--bg);
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    );
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 55%);
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.6),
    transparent 55%
  );
}

/* ============ Header ============ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-3);
  filter: drop-shadow(0 0 12px rgba(34, 211, 238, 0.55));
}

.logo h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-solid {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-solid:hover:not(:disabled) {
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.55);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-3);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.14);
  border-color: var(--danger);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.link-btn {
  color: var(--accent-3);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.link-btn:hover {
  background: rgba(34, 211, 238, 0.12);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.icon-btn.active {
  color: var(--accent-3);
  border-color: var(--accent-3);
  background: rgba(34, 211, 238, 0.12);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ============ Status Badge ============ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  transition: all 0.25s ease;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-mute);
  transition: background 0.25s ease;
}

.status-badge[data-state="live"] {
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.1);
}

.status-badge[data-state="live"] .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse-dot 2s infinite;
}

.status-badge[data-state="starting"] {
  color: #fde68a;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

.status-badge[data-state="starting"] .status-dot {
  background: var(--warning);
  animation: blink 1s infinite;
}

.status-badge[data-state="recording"] {
  color: #fecaca;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.1);
}

.status-badge[data-state="recording"] .status-dot {
  background: var(--danger);
  animation: blink 1s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* ============ Main Column ============ */
.main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============ Camera Area ============ */
.camera-area {
  width: 100%;
}

.camera-frame {
  position: relative;
  aspect-ratio: var(--ar, 16 / 9);
  width: 100%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  isolation: isolate;
}

.player {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* ============ Camera Overlay ============ */
.camera-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(99, 102, 241, 0.18), transparent 70%),
    rgba(8, 12, 22, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.35s ease;
}

.camera-overlay[data-state="off"] {
  opacity: 1;
}

.camera-overlay[data-state="starting"] {
  opacity: 1;
}

.camera-overlay[data-state="live"] {
  opacity: 0;
  pointer-events: none;
}

.camera-overlay[data-state="error"] {
  background: rgba(12, 8, 16, 0.88);
}

.overlay-icon {
  width: 64px;
  height: 64px;
  color: var(--accent-3);
  opacity: 0.9;
  filter: drop-shadow(0 0 18px rgba(34, 211, 238, 0.5));
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 420px;
}

.overlay-content h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.overlay-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-dim);
  max-width: 380px;
}

.overlay-content .btn {
  margin-top: 8px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface-3);
  border-top-color: var(--accent-3);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

/* ============ Camera Dock ============ */
.cam-actions {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(13, 19, 33, 0.65);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.round-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--text);
  transition:
    background 0.18s ease,
    transform 0.12s ease,
    border-color 0.18s ease;
}

.round-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--border-strong);
}

.round-btn:active:not(:disabled) {
  transform: scale(0.92);
}

.round-btn svg {
  width: 22px;
  height: 22px;
}

.round-btn.active {
  background: rgba(34, 211, 238, 0.22);
  border-color: var(--accent-3);
  color: var(--accent-3);
}

.shutter-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid var(--border-strong);
  transition: transform 0.12s ease, background 0.18s ease;
}

.shutter-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.24);
}

.shutter-btn:active:not(:disabled) {
  transform: scale(0.9);
}

.shutter-core {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #dbe4f5);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.12s ease;
}

.record-btn.recording {
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--danger);
  color: var(--danger);
}

.record-btn.recording svg {
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8));
}

.record-btn.recording svg rect {
  fill: var(--danger);
  stroke: var(--danger);
}

/* ============ Rec Indicator ============ */
.rec-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(13, 19, 33, 0.7);
  border: 1px solid rgba(239, 68, 68, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fecaca;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
  animation: blink 1.2s infinite;
}

.rec-timer {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #fff;
}

/* ============ Flash Overlay ============ */
.flash-overlay {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.flash-overlay.flashing {
  animation: flash 0.5s ease-out;
}

@keyframes flash {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

/* ============ Filter Strip ============ */
.filter-strip {
  position: relative;
  width: 100%;
}

.filter-strip::before,
.filter-strip::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 10px;
  width: 44px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.filter-strip::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

.filter-strip::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.filter-strip.can-scroll-left::before,
.filter-strip.can-scroll-right::after {
  opacity: 1;
}

.filter-buttons {
  display: flex;
  gap: 10px;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  cursor: grab;
}

.filter-buttons.can-scroll {
  cursor: grab;
}

.filter-buttons.dragging {
  cursor: grabbing;
  user-select: none;
  scroll-snap-type: none;
}

.filter-buttons::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 74px;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

.filter-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-strong);
}

.filter-btn:active {
  transform: scale(0.95);
}

.filter-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.chip-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--swatch, #94a3b8);
  border: 2px solid var(--border-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.chip-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-btn.active .chip-label {
  color: var(--text);
}

/* ============ Controls Panel ============ */
.controls {
  width: 100%;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.slider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px 28px;
}

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

.slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slider-head label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}

.slider-head output {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-3);
  background: rgba(34, 211, 238, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent-3) 0%,
    var(--accent) var(--fill, 50%),
    var(--surface-3) var(--fill, 50%)
  );
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.12s ease;
}

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

input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: grab;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--accent-3) 0%,
    var(--accent) var(--fill, 50%),
    var(--surface-3) var(--fill, 50%)
  );
}

input[type="range"]:focus-visible {
  box-shadow: none;
}

.hint-text {
  margin: 18px 0 0;
  font-size: 0.78rem;
  color: var(--text-mute);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 2px 6px;
}

/* ============ Gallery ============ */
.gallery-section {
  width: 100%;
}

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.gallery-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-title h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.count-badge {
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-3);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.3);
  padding: 2px 10px;
  border-radius: 999px;
}

.gallery-actions {
  display: flex;
  gap: 10px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 16px;
  color: var(--text-mute);
  font-size: 0.9rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.gallery-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #000;
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-type {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 3px 8px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.item-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 12, 22, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gallery-media:hover .item-actions,
.gallery-media:focus-within .item-actions {
  opacity: 1;
}

.action-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 19, 33, 0.85);
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition:
    background 0.16s ease,
    transform 0.12s ease;
}

.action-btn:hover {
  background: var(--surface-3);
  transform: scale(1.08);
}

.action-btn:active {
  transform: scale(0.94);
}

.action-btn svg {
  width: 19px;
  height: 19px;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.85);
  border-color: var(--danger);
}

.gallery-item figcaption {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 0.76rem;
  color: var(--text-dim);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}

/* ============ Footer ============ */
.footer {
  margin-top: auto;
  text-align: center;
  padding-top: 12px;
}

.footer p {
  margin: 4px 0;
  font-size: 0.82rem;
  color: var(--text-mute);
}

.footer a {
  color: var(--accent-3);
  text-decoration: none;
  font-weight: 600;
}

.footer a:hover {
  text-decoration: underline;
}

/* ============ Toasts ============ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: rgba(19, 26, 44, 0.96);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.toast-success::before {
  background: var(--success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
}

.toast-error::before {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.toast-info::before {
  background: var(--accent-3);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
}

.toast.hide {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 8, 14, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: modal-pop 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.14);
  color: var(--danger);
}

.modal-icon svg {
  width: 28px;
  height: 28px;
}

.modal h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal p {
  margin: 0 0 22px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .btn {
  flex: 1;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ============ Accessibility: reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============ Responsive ============ */
@media (max-width: 720px) {
  .app {
    gap: 18px;
    padding: 14px;
    padding-bottom: 28px;
  }

  .header-actions {
    gap: 8px;
  }

  .btn {
    height: 40px;
    padding: 0 14px;
    font-size: 0.85rem;
  }

  .cam-actions {
    bottom: 12px;
    gap: 10px;
    padding: 8px 12px;
  }

  .round-btn {
    width: 42px;
    height: 42px;
  }

  .shutter-btn {
    width: 58px;
    height: 58px;
  }

  .shutter-core {
    width: 46px;
    height: 46px;
  }

  .filter-btn {
    width: 66px;
  }

  .panel {
    padding: 16px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
