/* ==========================================================================
   CAPTURE ROW — last-capture thumbnail · shutter (tap = photo, hold = video) · flip
   ========================================================================== */

.capture-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
}
.capture-row > :first-child { justify-self: start; }
.capture-row > :last-child  { justify-self: end; }

/* ---------- Shutter ---------- */
.capture {
  position: relative;
  width: var(--capture-size); height: var(--capture-size);
  border-radius: 50%;
  display: grid; place-items: center;
  touch-action: none;
}
.capture__ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(244, 242, 238, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 8px 30px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(255, 255, 255, 0.15);
  transition: transform 0.4s var(--spring), border-color 0.3s;
}
.capture__core {
  position: relative;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ffffff 0%, #f1eee7 55%, #d6d0c4 100%);
  box-shadow: inset 0 -4px 10px rgba(0, 0, 0, 0.14);
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), border-radius 0.4s var(--ease-out),
              background 0.3s, transform 0.3s var(--spring), box-shadow 0.3s;
}
.capture:active .capture__core { transform: scale(0.9); }

.capture.is-recording .capture__ring { transform: scale(1.12); border-color: rgba(255, 255, 255, 0.35); }
.capture.is-recording .capture__core {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--danger);
  box-shadow: none;
}

/* Progress ring (0 → 15 s) */
.capture__progress {
  position: absolute; inset: -9px;
  width: calc(100% + 18px); height: calc(100% + 18px);
  transform: rotate(-90deg);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.capture__progress circle { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.capture.is-recording .capture__progress { opacity: 1; }

/* Timer pill above the shutter */
.rec-timer {
  position: absolute;
  bottom: calc(100% + 18px); left: 50%;
  transform: translate(-50%, 6px);
  padding: 5px 10px 5px 22px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
  pointer-events: none;
}
.rec-timer::before {
  content: "";
  position: absolute; left: 10px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px;
  border-radius: 50%;
  background: var(--danger);
  animation: rec-dot 1s steps(2) infinite;
}
.capture.is-recording .rec-timer { opacity: 1; transform: translate(-50%, 0); }
@keyframes rec-dot { 50% { opacity: 0.2; } }

/* ---------- Last capture thumbnail ---------- */
.thumb {
  width: 46px; height: 46px;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  transition: transform 0.4s var(--spring);
}
.thumb:active { transform: scale(0.9); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-new { animation: thumb-pop 0.6s var(--spring); }
@keyframes thumb-pop { from { transform: scale(0.4); } to { transform: scale(1); } }

#btn-flip.is-spinning svg { animation: flip-spin 0.6s var(--ease-out); }
@keyframes flip-spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }

/* ---------- Shutter flash ---------- */
.shutter-flash {
  position: absolute; inset: 0; z-index: 45;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.shutter-flash.is-firing { animation: shutter 0.55s var(--ease-out); }
@keyframes shutter { from { opacity: 0.85; } to { opacity: 0; } }

/* Places button sits beside the last-capture thumbnail */
.capture-row__left { justify-self: start; display: flex; align-items: center; gap: 12px; }
