/* =====================================================
   SeeMe! Studio — Responsive Monochrome
   Layout system: Oval / Grid 6 / Grid 4 / Frameless
   v2 — fixed to match live DOM structure + polish pass
===================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: #ffffff;
  overflow-x: hidden;
}

:root {
  --accent: #F5F5F7;
  --bg: #09090B;
  --card: #141418;
  --card2: #1B1B20;
  --border: rgba(255, 255, 255, .10);
  --border-strong: rgba(255, 255, 255, .30);
  --white: #ffffff;
  --gray: #bfbfbf;
  --muted: #77777f;
  --danger: #ff8a8a;
  --radius: 22px;
  --radius-sm: 14px;
  --radius-lg: 26px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.25, 1.15, .4, 1);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 6px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -2;
}

body::before {
  width: 550px;
  height: 550px;
  left: -180px;
  top: -180px;
  background: rgba(255, 255, 255, .08);
  filter: blur(120px);
}

body::after {
  width: 600px;
  height: 600px;
  right: -250px;
  bottom: -250px;
  background: rgba(255, 255, 255, .06);
  filter: blur(140px);
}

/* =====================================================
   MAIN
===================================================== */

.studio {
  width: min(1500px, 94%);
  margin: auto;
  padding: 34px 0 70px;
}

.studio-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}

.back-btn {
  flex: 0 0 auto;
  color: var(--gray);
  text-decoration: none;
  font-weight: 500;
  transition: .25s var(--ease);
}

.back-btn:hover {
  color: #fff;
  transform: translateX(-3px);
}

.header-copy {
  display: flex;
  flex-direction: column;
}

.eyebrow,
.section-kicker {
  font-size: .66rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.studio-header h1 {
  margin-top: 2px;
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.studio-header p {
  margin-top: 6px;
  color: var(--gray);
  font-size: .9rem;
}

/* =====================================================
   MAIN GRID
===================================================== */

.studio-content {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 2px;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .16);
  border-radius: 999px;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =====================================================
   PANELS
===================================================== */

.panel,
.filter-bar,
.camera-card,
.retake-panel,
.result-card {
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.panel {
  padding: 20px;
  border-radius: var(--radius);
  transition: border-color .25s var(--ease);
}

.panel:hover {
  border-color: rgba(255, 255, 255, .16);
}

.panel-heading,
.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.panel-heading > div,
.result-heading > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel h2,
.result-heading h2 {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -.01em;
}

.panel-heading small,
.result-heading > small {
  color: var(--gray);
  font-size: .7rem;
  white-space: nowrap;
}

.hint-text {
  margin: 10px 0 14px;
  color: var(--gray);
  font-size: .74rem;
  line-height: 1.5;
}

/* =====================================================
   PHOTO STYLE
===================================================== */

.layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.layout-card {
  min-height: 112px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  background: var(--card2);
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: .22s var(--ease);
}

.layout-card .card-icon {
  font-size: 1.65rem;
  line-height: 1;
  margin-bottom: 3px;
}

.layout-card strong {
  font-size: .8rem;
  font-weight: 600;
}

.layout-card small {
  color: var(--muted);
  font-size: .66rem;
}

.layout-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .28);
}

.layout-card:active {
  transform: translateY(0px) scale(.98);
}

.layout-card.active {
  background: linear-gradient(145deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .08));
  border-color: rgba(255, 255, 255, .55);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);
}

/* =====================================================
   FRAME / FRAMELESS PANEL
===================================================== */

.panel-frame {
  min-height: 260px;
}

#frameList {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 560px;
  overflow-y: auto;
  margin-top: 16px;
  padding: 2px 3px 3px 0;
  scrollbar-width: thin;
}

#frameList::-webkit-scrollbar {
  width: 6px;
}

#frameList::-webkit-scrollbar-track {
  background: transparent;
}

#frameList::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
}

/* --- Frame thumbnail card (created in JS as .frame-option) --- */

.frame-option {
  position: relative;
  min-width: 0;
  aspect-ratio: 1 / 1.12;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #111114;
  cursor: pointer;
  transition: .2s var(--ease);
}

.frame-option img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #111114;
  pointer-events: none;
}

.frame-option:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .25);
}

.frame-option:active {
  transform: translateY(0);
}

.frame-option.active {
  border-color: #fff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .12),
    0 10px 25px rgba(0, 0, 0, .35);
}

.frame-number {
  position: absolute;
  right: 6px;
  top: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
  transition: .2s var(--ease);
}

.frame-option.active .frame-number {
  background: #fff;
  color: #09090B;
  border-color: #fff;
}

/* --- Empty state (created in JS as .empty-frame-state) --- */

.empty-frame-state {
  grid-column: 1 / -1;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 20px;
  color: var(--gray);
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 16px;
  text-align: center;
}

.empty-frame-state strong {
  color: #fff;
  font-size: .85rem;
  font-weight: 650;
}

.empty-frame-state span {
  max-width: 220px;
  font-size: .7rem;
  color: var(--muted);
  line-height: 1.5;
}

/* --- Frameless variant options (JS: .frame-option.frameless-option) --- */

.frameless-option {
  aspect-ratio: auto;
  min-height: 140px;
  padding: 14px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--card2);
  border-radius: 16px;
}

.frameless-option:hover {
  border-color: rgba(255, 255, 255, .28);
}

.frameless-option.active {
  background: rgba(255, 255, 255, .1);
  border-color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .3);
}

.frameless-mini-preview {
  position: relative;
  width: 56px;
  aspect-ratio: 900 / 1200;
  padding: 3px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}

.frameless-option[data-variant="frameless4"] .frameless-mini-preview,
.frameless-option[data-variant="frameless8"] .frameless-mini-preview {
  aspect-ratio: 900 / 1600;
}

.frameless-mini-preview span {
  position: absolute;
  background: #17171b;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.frameless-label {
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
}

/* =====================================================
   CUSTOMIZE
===================================================== */

.toggle-row {
  margin-top: 15px;
  padding-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: #fff;
  font-size: .82rem;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
}

.toggle-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  width: 42px;
  height: 24px;
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card2);
  transition: .25s var(--ease);
}

.toggle-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gray);
  transition: .25s var(--ease);
}

.toggle-switch input:checked + .toggle-track {
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .25);
}

.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: #fff;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-group label {
  color: var(--gray);
  font-size: .74rem;
  font-weight: 500;
}

.field-group input {
  width: 100%;
  padding: 11px 13px;
  outline: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  background: var(--card2);
  font-size: .82rem;
  transition: .2s var(--ease);
}

.field-group input::placeholder {
  color: #66666d;
}

.field-group input:focus {
  border-color: rgba(255, 255, 255, .4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

/* =====================================================
   FILTER
===================================================== */

.filter-bar {
  padding: 14px 16px 11px;
  border-radius: 18px;
}

.filter-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.filter-bar-header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.filter-bar-header strong {
  font-size: .84rem;
}

.filter-bar-header small {
  color: var(--gray);
  font-size: .7rem;
}

.filter-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}

.filter-strip::-webkit-scrollbar {
  height: 5px;
}

.filter-strip::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .18);
  border-radius: 999px;
}

.filter-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  background: var(--card2);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 500;
  white-space: nowrap;
  transition: .2s var(--ease);
}

.filter-chip:hover {
  border-color: rgba(255, 255, 255, .25);
}

.filter-chip.active {
  border-color: rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .13);
}

.chip-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #777;
}

.filter-chip.active .chip-dot {
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .8);
}

/* =====================================================
   CAMERA
===================================================== */

.camera-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #050506;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

#livePreview {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: block;
  background: #050506;
}

.camera-topbar,
.camera-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.camera-topbar {
  top: 0;
  padding: 16px 18px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .65), transparent);
}

.camera-bottom-bar {
  bottom: 0;
  padding: 20px 18px 14px;
  color: rgba(255, 255, 255, .78);
  font-size: .68rem;
  background: linear-gradient(to top, rgba(0, 0, 0, .65), transparent);
}

.camera-mode,
.camera-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px);
  font-size: .66rem;
  font-weight: 600;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px #fff;
  animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.camera-status {
  color: #ddd;
  letter-spacing: .1em;
}

.sr-only-video {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#countdown {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: clamp(5rem, 12vw, 9rem);
  font-weight: 700;
  text-shadow: 0 8px 30px rgba(0, 0, 0, .7);
  background: rgba(0, 0, 0, .18);
}

#countdown.show {
  display: flex;
}

.countdown-pop {
  animation: countdownPop .35s var(--ease-spring);
}

@keyframes countdownPop {
  0% { transform: scale(.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

@keyframes flashPulse {
  0% { opacity: .95; }
  100% { opacity: 0; }
}

.camera-flash.flash-active {
  animation: flashPulse .42s ease-out;
}

/* =====================================================
   ACTION
===================================================== */

.camera-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.shot-counter {
  min-height: 64px;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .035);
}

.shot-counter span {
  display: flex;
  flex-direction: column;
  font-size: .8rem;
  font-weight: 550;
}

.shot-counter small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .64rem;
  font-weight: 400;
}

.shot-counter strong {
  font-size: 1.15rem;
}

#startBtn,
#downloadBtn {
  border: 0;
  border-radius: 18px;
  padding: 0 25px;
  color: #09090B;
  background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(255, 255, 255, .62));
  font-weight: 650;
  cursor: pointer;
  transition: .22s var(--ease);
}

#startBtn {
  min-width: 210px;
}

#startBtn:hover:not(:disabled),
#downloadBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(255, 255, 255, .12);
}

#startBtn:active:not(:disabled),
#downloadBtn:active:not(:disabled) {
  transform: translateY(0);
}

#startBtn:disabled,
#downloadBtn:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =====================================================
   RETAKE PANEL (created dynamically in JS)
===================================================== */

.retake-panel {
  padding: 20px;
  border-radius: var(--radius);
  animation: fadeUp .35s var(--ease);
}

.retake-header h3 {
  font-size: 1rem;
  font-weight: 650;
}

.retake-header p {
  margin-top: 4px;
  color: var(--gray);
  font-size: .76rem;
}

.retake-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.retake-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #111114;
  cursor: pointer;
  transition: .2s var(--ease);
}

.retake-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.retake-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, .35);
}

.retake-number {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.retake-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 0 7px;
  text-align: center;
  color: #fff;
  font-size: .64rem;
  font-weight: 650;
  letter-spacing: .02em;
  background: linear-gradient(to top, rgba(0, 0, 0, .75), transparent);
  opacity: 0;
  transform: translateY(4px);
  transition: .2s var(--ease);
}

.retake-card:hover .retake-label,
.retake-card:focus-visible .retake-label {
  opacity: 1;
  transform: translateY(0);
}

/* =====================================================
   RESULT
===================================================== */

.result-card {
  padding: 20px;
  border-radius: var(--radius);
  animation: fadeUp .35s var(--ease);
}

.result-stage {
  margin-top: 18px;
  padding: 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 180px;
  border-radius: 18px;
  background:
    linear-gradient(45deg, #111 25%, transparent 25%),
    linear-gradient(-45deg, #111 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #111 75%),
    linear-gradient(-45deg, transparent 75%, #111 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

#photostrip {
  width: min(100%, 430px);
  height: auto;
  display: block;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .4);
}

.result-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

#downloadBtn {
  min-height: 52px;
}

/* =====================================================
   ANIMATION
===================================================== */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel,
.filter-bar,
.camera-card {
  animation: fadeUp .4s var(--ease);
}

/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1200px) {
  .studio {
    width: min(1000px, 94%);
  }

  .studio-content {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
    position: static;
    max-height: none;
    overflow-y: visible;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .workspace {
    order: 1;
  }

  .panel-frame {
    grid-column: span 2;
  }

  #frameList {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-height: 420px;
  }
}

/* =====================================================
   SMALL TABLET
===================================================== */

@media (max-width: 820px) {
  .studio {
    width: 94%;
    padding-top: 24px;
  }

  .studio-header {
    margin-bottom: 22px;
  }

  .studio-header h1 {
    font-size: 2rem;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .panel-frame {
    grid-column: auto;
  }

  #frameList {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .retake-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 600px) {
  .studio {
    width: 94%;
    padding: 18px 0 40px;
  }

  .studio-header {
    align-items: flex-start;
    gap: 12px;
    flex-direction: column;
  }

  .studio-header h1 {
    font-size: 1.75rem;
  }

  .studio-header p {
    font-size: .78rem;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .layout-card {
    min-height: 98px;
  }

  .layout-grid {
    gap: 7px;
  }

  .layout-card .card-icon {
    font-size: 1.35rem;
  }

  #frameList {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    max-height: 380px;
  }

  .frame-option {
    border-radius: 10px;
  }

  .frame-number {
    width: 18px;
    height: 18px;
    right: 5px;
    top: 5px;
    font-size: .58rem;
  }

  .frameless-option {
    min-height: 118px;
    padding: 10px 8px;
  }

  .camera-card {
    border-radius: 18px;
  }

  #livePreview {
    aspect-ratio: 4 / 3;
  }

  .camera-topbar {
    padding: 10px;
  }

  .camera-bottom-bar {
    padding: 14px 10px 10px;
  }

  .camera-bottom-bar span:first-child {
    max-width: 70%;
    font-size: .6rem;
  }

  .camera-mode,
  .camera-status {
    padding: 5px 8px;
    font-size: .58rem;
  }

  .camera-action {
    grid-template-columns: 1fr;
  }

  #startBtn {
    width: 100%;
    min-height: 56px;
    min-width: 0;
  }

  .shot-counter {
    min-height: 58px;
  }

  .filter-bar {
    border-radius: 16px;
    padding: 12px;
  }

  .filter-chip {
    padding: 8px 11px;
    font-size: .67rem;
  }

  .retake-panel,
  .result-card {
    padding: 15px;
    border-radius: 18px;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .retake-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .result-stage {
    padding: 10px;
  }

  #downloadBtn {
    width: 100%;
    min-height: 52px;
  }
}

/* =====================================================
   VERY SMALL PHONES
===================================================== */

@media (max-width: 380px) {
  .layout-card {
    min-height: 90px;
    padding: 10px 6px;
  }

  .layout-card strong {
    font-size: .72rem;
  }

  .layout-card small {
    font-size: .58rem;
  }

  #frameList {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .retake-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =====================================================
   REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* =====================================================
   TIMER OPTIONS
   ===================================================== */

.timer-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}


/* Individual timer button */

.timer-option {
    position: relative;

    min-height: 42px;
    padding: 10px 12px;

    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.68);

    font-family: "Poppins", sans-serif;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* Hover */

.timer-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;

    transform: translateY(-1px);
}


/* Active timer */

.timer-option.active {
    background: #ffffff;
    border-color: #ffffff;

    color: #09090B;

    box-shadow:
        0 4px 14px rgba(255, 255, 255, 0.12);
}


/* Small press animation */

.timer-option:active {
    transform: scale(0.96);
}


/* Keyboard accessibility */

.timer-option:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}


/* =====================================================
   TIMER SECTION LABEL
   ===================================================== */

.timer-setting {
    margin-top: 16px;
}


.timer-setting-label {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 8px;

    font-size: 12px;
    font-weight: 600;

    color: rgba(255, 255, 255, 0.72);
}


.timer-setting-label small {
    font-size: 10px;
    font-weight: 500;

    color: rgba(255, 255, 255, 0.38);
}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 768px) {

    .timer-options {
        gap: 6px;
    }

    .timer-option {
        min-height: 40px;
        padding: 9px 8px;

        border-radius: 10px;

        font-size: 11px;
    }

}


/* =====================================================
   SMALL MOBILE
   ===================================================== */

@media (max-width: 480px) {

    .timer-options {
        gap: 6px;
    }

    .timer-option {
        min-height: 38px;

        padding: 8px 6px;

        font-size: 10px;
    }

}

/* =====================================================
   FRAME PANEL - PREVENT OVERLAPPING
===================================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar > .panel {
    flex-shrink: 0;
}

.panel-frame {
    position: relative;
    overflow: hidden;
}


/* Frame thumbnails have their own scroll area */
.panel-frame #frameList {
    max-height: 390px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    padding-bottom: 4px;
}


/* Scrollbar */
.panel-frame #frameList::-webkit-scrollbar {
    width: 5px;
}

.panel-frame #frameList::-webkit-scrollbar-track {
    background: transparent;
}

.panel-frame #frameList::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.panel-frame #frameList::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}


/* Firefox */
.panel-frame #frameList {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}