*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --bg-primary:    #F0F0F5;
  --bg-secondary:  #FFFFFF;
  --bg-elevated:   #FFFFFF;
  --bg-overlay:    rgba(255, 255, 255, 0.82);


  --text-primary:   #000000;
  --text-secondary: #86868B;
  --text-tertiary:  #AEAEB2;


  --accent:         #3478F6;
  --accent-light:   rgba(52, 120, 246, 0.10);
  --accent-glow:    rgba(52, 120, 246, 0.35);
  --green:          #30D158;
  --red:            #FF3B30;


  --card-bg:        #FFFFFF;
  --card-border:    rgba(0, 0, 0, 0.04);
  --card-shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --card-shadow:    0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --card-shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.04);


  --radius-xs:  8px;
  --radius-sm:  14px;
  --radius-md:  20px;
  --radius-lg:  28px;
  --radius-xl:  40px;


  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:  0.15s;
  --t-med:   0.25s;
  --t-slow:  0.4s;


  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}


::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track {
  background: transparent;
  margin: 8px 0;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.32);
  border: 2px solid transparent;
  background-clip: padding-box;
}


@keyframes dockSlideIn {
  0%   { opacity: 0; transform: translateY(-24px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.vixel-header {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  margin: 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px 0 24px;
  height: 56px;
  width: min(94vw, 880px);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(200%) blur(30px);
  -webkit-backdrop-filter: saturate(200%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 100px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.07),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform var(--t-slow) var(--spring),
              opacity var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease);
  animation: dockSlideIn 0.6s var(--spring) both;
}
.vixel-header:hover {
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.vixel-header.hidden-header {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-brand .logo {
  height: 34px;
  object-fit: contain;
}
.header-brand .logo-fallback {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.header-actions { display: flex; gap: 8px; align-items: center; }


.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 22px; height: 22px; }


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 20px;
  border: none;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--accent-light);
  color: var(--accent);
}
.btn-secondary:hover { background: rgba(52,120,246,0.16); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid rgba(0,0,0,0.08);
}
.btn-outline:hover { background: rgba(0,0,0,0.03); }


.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  padding: 80px 24px 24px;
  overflow: hidden;
}
.upload-area.hidden { display: none; }

.upload-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: min(480px, 92vw);
  padding: 60px 48px;
  background: var(--card-bg);
  border: 2px dashed rgba(52,120,246,0.25);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all var(--t-med) var(--ease);
}
.upload-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-lg);
  transform: translateY(-4px);
}
.upload-card.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.02);
}
.upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.upload-icon-wrap .icon { width: 32px; height: 32px; stroke-width: 1.8; }

.upload-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.upload-sub {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.6;
}


.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--bg-primary);
  transition: opacity 0.55s var(--ease);
  touch-action: none;
  isolation: isolate;
}
.loading-overlay.fade-out { opacity: 0; pointer-events: none; }
.loading-overlay.hidden   { display: none; }

.spinner-wrap {
  position: relative;
  width: 80px;
  height: 80px;
}
.spinner-ring {
  width: 100%;
  height: 100%;
  border: 3px solid rgba(52,120,246,0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.spinner-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.loading-label {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.loading-counter {
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -2px;
  line-height: 1;
}
.loading-sub {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 300px;
  text-align: center;
}


.gallery-container {
  display: none;
  padding: 88px 24px 100px;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.gallery-container.visible { display: block; opacity: 1; }

.gallery-top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.gallery-info-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  flex: 1;
}
.gallery-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.gallery-meta {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: all var(--t-med) var(--ease);
}
.selection-bar.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.sel-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
}


.frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}


.frame-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--card-shadow-sm);
  cursor: pointer;
  transition: transform var(--t-med) var(--spring), box-shadow var(--t-med) var(--ease);
  aspect-ratio: 16/9;
}
.frame-card:hover {
  transform: scale(1.025);
  box-shadow: var(--card-shadow);
}
.frame-card:active { transform: scale(0.975); }

.frame-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform var(--t-med) var(--ease);
}


.frame-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--t-fast) var(--ease);
  opacity: 1;
}
.frame-card:hover .frame-check {
  border-color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.35);
}
.frame-check .icon { width: 14px; height: 14px; stroke: transparent; stroke-width: 3; }

.frame-card.selected .frame-check {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(52,120,246,0.5);
}
.frame-card.selected .frame-check .icon { stroke: #fff; }
.frame-card.selected img { transform: scale(0.94); }
.frame-card.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2.5px solid var(--accent);
  border-radius: var(--radius-sm);
  pointer-events: none;
}


.frame-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.frame-idx {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.frame-ts {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}


.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
  touch-action: none;
}
.lightbox.active { opacity: 1; pointer-events: auto; }

.lightbox-img {
  max-width: 94vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}


.lb-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(rgba(0,0,0,0.55), transparent);
  pointer-events: none;
  z-index: 2;
}
.lightbox.active .lb-top > * { pointer-events: auto; }

.lb-frame-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}
.lb-counter {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-timestamp {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.lb-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.lb-icon-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }


.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
  z-index: 2;
}
.lb-arrow:hover { background: rgba(255,255,255,0.18); color: #fff; transform: translateY(-50%) scale(1.08); }
.lb-arrow.prev { left: 20px; }
.lb-arrow.next { right: 20px; }


.lb-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 28px 28px;
  background: linear-gradient(transparent, rgba(0,0,0,0.65));
  pointer-events: none;
  z-index: 2;
}
.lightbox.active .lb-bottom > * { pointer-events: auto; }


.scrub-container {
  width: min(650px, 88vw);
  display: flex;
  align-items: center;
  gap: 10px;
}
.scrub-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  touch-action: none;
}
.scrub-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;

}
.scrub-thumb {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);

}
.scrub-track:hover .scrub-thumb {
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  width: 20px;
  height: 20px;
}

.lb-dl-btn {
  height: 38px;
  padding: 0 22px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--t-fast) var(--ease);
}
.lb-dl-btn:hover { background: rgba(255,255,255,0.16); }
.lb-dl-btn:active { transform: scale(0.96); }


.meta-panel {
  position: absolute;
  top: 72px;
  right: 24px;
  width: 240px;
  background: rgba(28,28,30,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: all var(--t-med) var(--ease);
  z-index: 10;
}
.meta-panel.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
}
.meta-row:last-child { border-bottom: none; }
.meta-label { color: rgba(255,255,255,0.5); font-weight: 500; }
.meta-value { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }


.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all var(--t-med) var(--spring);
}
.scroll-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.scroll-top:hover {
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-3px) scale(1.05);
}
.scroll-top:active { transform: scale(0.94); }
.scroll-top.lb-hidden { display: none; }


.zip-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  min-width: 280px;
  background: var(--text-primary);
  border-radius: 100px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-slow) var(--spring);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  white-space: nowrap;
}
.zip-toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  height: 48px;
}
.zip-toast-bar {
  height: 3px;
  background: rgba(255,255,255,0.1);
  width: 100%;
}
.zip-toast-fill {
  height: 100%;
  width: 0%;
  background: #30D158;
  border-radius: 0 2px 2px 0;
  transition: width 0.15s linear;
}
.zip-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


.lb-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lb-icon-btn.playing {
  background: var(--accent);
  color: #fff;
}


.donate-btn {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #FF3B6F;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  transition: all var(--t-med) var(--spring);
}
.donate-btn .icon { width: 20px; height: 20px; }
.donate-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(255, 59, 111, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.7);
}
.donate-btn:active { transform: scale(0.95); }
.donate-btn.lb-hidden { display: none; }


.donate-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.donate-overlay.active {
  opacity: 1;
  pointer-events: auto;
}


.donate-modal {
  position: relative;
  width: min(380px, 90vw);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: scale(0.92) translateY(12px);
  transition: transform var(--t-med) var(--spring), opacity var(--t-med) var(--ease);
}
.donate-overlay.active .donate-modal {
  transform: scale(1) translateY(0);
}
.donate-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.donate-close .icon { width: 16px; height: 16px; }
.donate-close:hover { background: rgba(0, 0, 0, 0.1); color: var(--text-primary); }

.donate-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.donate-sub {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}
.donate-badge-link { transition: transform var(--t-fast) var(--ease); }
.donate-badge-link:hover { transform: scale(1.05); }
.donate-badge {
  height: 40px;
  object-fit: contain;
  border: none;
}
.donate-qr-link {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease);
}
.donate-qr-link:hover { transform: scale(1.03); }
.donate-qr {
  width: min(200px, 60vw);
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}



@media (max-width: 1024px) {
  .frames-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
  .gallery-container { padding: 80px 20px 80px; }
  .gallery-title { font-size: 24px; }
}


@media (max-width: 768px) {
  .frames-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
  .vixel-header { padding: 0 5px 0 18px; height: 48px; width: min(96vw, 720px); top: 10px; }
  .header-brand .logo { height: 28px; }
  .gallery-container { padding: 72px 12px 80px; }
  .gallery-title { font-size: 20px; }
  .gallery-meta { font-size: 12px; }
  .frame-card { border-radius: var(--radius-xs); }
  .lb-arrow { width: 36px; height: 36px; }
  .lb-arrow .icon { width: 16px; height: 16px; }
  .lb-arrow.prev { left: 8px; }
  .lb-arrow.next { right: 8px; }
  .lb-top { padding: 14px 16px; }
  .lb-bottom { padding: 14px 16px 20px; gap: 10px; }
  .lb-counter { font-size: 14px; }
  .lb-timestamp { font-size: 12px; }
  .scrub-container { width: 92vw; }
  .upload-card { padding: 44px 28px; border-radius: var(--radius-md); }
  .scroll-top { width: 44px; height: 44px; bottom: 20px; right: 16px; }
  .meta-panel { right: 12px; width: 200px; top: 64px; }
  .lightbox-img { max-width: 98vw; max-height: 78vh; border-radius: 4px; }
  .lb-controls-row { gap: 8px; }
  .lb-dl-btn { height: 34px; padding: 0 16px; font-size: 12px; }
  .lb-icon-btn { width: 34px; height: 34px; }
  .zip-toast { min-width: 240px; border-radius: 80px; }
  .zip-toast-content { padding: 0 20px; height: 42px; font-size: 13px; }
}


@media (max-width: 480px) {
  .frames-grid { grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .gallery-top-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .gallery-title { font-size: 18px; }
  .btn { height: 34px; padding: 0 14px; font-size: 12px; }
  .btn .icon { width: 14px; height: 14px; }
  .vixel-header { padding: 0 7px 0 16px; }
  .header-actions { gap: 6px; }
  .upload-card { padding: 36px 20px; width: 100%; border-radius: 16px; }
  .upload-title { font-size: 18px; }
  .upload-sub { font-size: 12px; }
  .upload-icon-wrap { width: 56px; height: 56px; border-radius: 16px; }
  .upload-icon-wrap .icon { width: 24px; height: 24px; }
  .lb-top { padding: 10px 12px; }
  .lb-bottom { padding: 10px 12px 16px; gap: 8px; }
  .lb-counter { font-size: 13px; }
  .lb-arrow { width: 30px; height: 30px; }
  .lb-arrow .icon { width: 14px; height: 14px; }
  .lb-arrow.prev { left: 4px; }
  .lb-arrow.next { right: 4px; }
  .lightbox-img { max-width: 100vw; max-height: 75vh; border-radius: 0; }
  .scroll-top { bottom: 16px; right: 12px; width: 40px; height: 40px; }
  .loading-counter { font-size: 32px; }
  .loading-label { font-size: 15px; }
  .frame-strip { padding: 20px 6px 5px; }
  .frame-idx, .frame-ts { font-size: 10px; }
  .scrub-container { width: 95vw; }
  .scrub-thumb { width: 14px; height: 14px; }
  .selection-bar { gap: 6px; }
  .sel-count { font-size: 12px; }
  ::-webkit-scrollbar { width: 4px; height: 4px; }
}


@media (max-width: 360px) {
  .frames-grid { grid-template-columns: repeat(2, 1fr); gap: 3px; }
  .gallery-container { padding: 68px 8px 60px; }
  .vixel-header { height: 44px; padding: 0 5px 0 14px; width: min(98vw, 360px); top: 8px; }
  .header-brand .logo { height: 22px; }
}


@media (min-width: 1440px) {
  .frames-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .gallery-container { max-width: 1600px; margin: 0 auto; }
}

@media (min-width: 1920px) {
  .frames-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
  .gallery-container { max-width: 2000px; }
  .lightbox-img { max-height: 88vh; }
}


@media (max-height: 500px) and (orientation: landscape) {
  .lightbox-img { max-height: 70vh; }
  .lb-top { padding: 8px 16px; }
  .lb-bottom { padding: 8px 16px 12px; gap: 6px; }
  .lb-arrow { width: 32px; height: 32px; }
  .upload-area { min-height: auto; padding: 20px; }
  .upload-card { padding: 28px 24px; }
}
