:root {
  --bg: #f5f1eb;
  --panel: #fffdfb;
  --ink: #1a1b1d;
  --muted: #5f6673;
  --line: #e9e3dc;
  --shadow: rgba(16, 24, 40, 0.08);
  --primary: #171b22;
  --primary-soft: #f4f0ec;
  --success: #127b5c;
  --success-soft: #e9f8f1;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100vh;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.ldr-app {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.02);
}

.ldr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--ink);
  font-size: 22px;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
}

.brand-wrap strong {
  font-size: 16px;
}

.brand-wrap span {
  font-size: 12px;
  color: var(--muted);
}

.ldr-main {
  padding: 20px 18px 24px;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.hero-block {
  text-align: center;
  padding: 20px 14px 8px;
}

.hero-icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 26px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  font-size: 38px;
}

.hero-icon svg {
  width: 38px;
  height: 38px;
}

.hero-block h1 {
  margin: 0;
  font-size: clamp(2.3rem, 8vw, 3.5rem);
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.hero-block p {
  color: var(--muted);
  line-height: 1.6;
  margin: 18px auto 0;
  max-width: 420px;
}

.action-card,
.status-card,
.email-box,
.result-wrapper {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 10px 28px var(--shadow);
}

.action-card {
  padding: 22px 18px;
  margin-top: 18px;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.text-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.primary-btn {
  background: var(--primary);
  color: white;
}

.secondary-btn,
.ghost-btn {
  background: var(--primary-soft);
  color: var(--ink);
}

.text-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.join-btn-accent {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--success);
  color: #fff;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.join-btn-accent:hover {
  transform: translateY(-1px);
  background: #0e6249;
}

.cancel-btn-danger {
  width: 100%;
  min-height: 54px;
  margin-top: 30px;
  border: 1px solid #dc2626;
  border-radius: 16px;
  background: transparent;
  color: #b91c1c;
  padding: 10px;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.cancel-btn-danger:hover {
  transform: translateY(-1px);
  background: #dc2626;
  color: #fff;
}

.new-session-btn-accent {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--success);
  color: #fff;
  font-weight: 700;
  transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.new-session-btn-accent:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #0e6249;
}

.new-session-btn-accent:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.text-btn:hover {
  transform: translateY(-1px);
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 13px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.join-box label,
.email-box label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 14px;
}

.join-box input,
.email-box input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d9d1c9;
  border-radius: 14px;
  padding: 0 16px;
  background: #fff;
  font-size: 16px;
  outline: none;
}

.join-box input:focus,
.email-box input:focus {
  border-color: var(--ink);
}

.join-box button {
  margin-top: 12px;
}

.status-card {
  padding: 26px 20px;
  text-align: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f4f3f5;
  color: var(--muted);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.status-pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.status-card h2 {
  margin: 18px 0 12px;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  line-height: 1.1;
}

.room-code {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: #f4f0ec;
  color: var(--ink);
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  min-height: 70px;
}

.muted-text,
.info-text {
  color: var(--muted);
  margin: 12px 0 0;
  line-height: 1.5;
}

.status-card .text-btn {
  margin-top: 18px;
}

.frame-picker {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.frame-picker-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.frame-picker-heading strong {
  font-size: 16px;
}

.frame-picker-heading span,
.frame-picker-message {
  color: var(--muted);
  font-size: 12px;
}

.frame-picker-message {
  margin: 7px 0 12px;
  line-height: 1.45;
}

.frame-picker-message-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.frame-picker-message-row .frame-picker-message {
  flex: 1;
}

.frame-loading-spinner {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid #d8e9e2;
  border-top-color: var(--success);
  border-radius: 50%;
  animation: processing-spin 0.8s linear infinite;
}

.frame-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.frame-skeleton {
  aspect-ratio: 180 / 312;
  border-radius: 14px;
  background: #e5e0d9;
  animation: frame-skeleton-pulse 1.2s ease-in-out infinite;
}

.frame-skeleton:nth-child(2n) {
  animation-delay: 0.15s;
}

.frame-skeleton:nth-child(3n) {
  animation-delay: 0.3s;
}

.frame-option {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: #f5f1eb;
  color: var(--ink);
  text-align: left;
}

.frame-option:disabled {
  cursor: default;
  opacity: 0.9;
}

.frame-option.selectable:hover,
.frame-option.selected {
  border-color: var(--success);
}

.frame-option img {
  display: block;
  width: 100%;
  aspect-ratio: 180 / 312;
  object-fit: cover;
  background: #eeeae5;
}

.frame-option-name {
  display: block;
  padding: 7px 8px 8px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.frame-selected-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--success);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 360px) {
  .frame-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.capture-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-bottom: 12px;
}

.capture-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.capture-header-actions .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 72px;
  min-height: 42px;
  padding: 0 12px;
  white-space: nowrap;
  border: 1px solid #d5cec5;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.06);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.capture-header-actions .control-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.capture-header-actions .ghost-btn:hover {
  background: #ebe5de;
  border-color: #bdb3a8;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.1);
  transform: translateY(-1px);
}

.capture-header-actions .ghost-btn:active {
  background: #ded6cd;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
  transform: scale(0.97);
}

.capture-header-actions .ghost-btn.is-muted {
  background: #fff1ee;
  border-color: #e2a59d;
  color: #9b2c23;
  box-shadow: 0 2px 6px rgba(155, 44, 35, 0.1);
}

.capture-header .status-pill {
  min-width: 0;
  flex: 1 1 auto;
  text-align: center;
}

.capture-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.capture-status-group .status-pill {
  flex: 1 1 auto;
}

.session-time-limit.warning {
  background: #fff1ee;
  color: #9b2c23;
}

.rtc-debug-text {
  display: none;
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.04);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.rtc-debug-text.is-debug-visible {
  display: block;
}

.camera-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.camera-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.panel-video-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  max-height: 420px;
  aspect-ratio: 700 / 449;
  border-radius: 26px;
  overflow: hidden;
  background: #eeeae5;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px var(--shadow);
}

#cameraVideo,
#partnerVideo {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
  background: #d9d9d9;
}

#partnerVideo {
  display: none;
}

#partnerVideo.active {
  display: block;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2rem, 8vw, 4rem);
  color: rgba(26, 27, 29, 0.28);
  background: #f3f3f3;
}

.camera-placeholder svg {
  width: 1em;
  height: 1em;
}

.panel-video-wrap.hidden-placeholder .camera-placeholder {
  display: none;
}

.partner-empty {
  background: #f1f1f1;
}

.partner-placeholder {
  color: rgba(80, 60, 160, 0.7);
  background: #efefef;
}

#partnerVideo.active + .camera-placeholder,
#partnerVideo.active + .partner-placeholder {
  display: none;
}

.camera-label {
  margin: 0 auto;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 21, 24, 0.94);
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.microphone-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.82);
  color: #f3f4f6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.mic-icon {
  display: inline-flex;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

.mic-icon svg {
  width: 100%;
  height: 100%;
}

.microphone-badge.muted {
  background: rgba(106, 13, 13, 0.82);
}

.capture-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.result-wrapper {
  padding: 20px 16px 18px;
  text-align: center;
}

.result-wrapper h2 {
  margin: 0 0 18px;
}

.result-frame {
  width: min(100%, 300px);
  margin: 0 auto;
  overflow: hidden;
}

.payment-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #ead9bd;
  border-radius: 16px;
  background: #fff8ea;
  text-align: left;
}

.payment-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.payment-panel-heading span {
  font-weight: 800;
  white-space: nowrap;
}

.payment-status-text {
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.payment-panel .secondary-btn {
  min-height: 48px;
}

.payment-panel.is-paid {
  border-color: #b9e4d2;
  background: var(--success-soft);
}

.payment-panel.is-paid .payment-status-text {
  color: var(--success);
  font-weight: 700;
}

#resultCanvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.result-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  background: rgba(17, 17, 17, 0.94);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

#syncCountdownOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 18, 0.62);
  backdrop-filter: blur(2.5px);
  color: #fff9d6;
  font-size: clamp(3rem, 18vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.72);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 10;
  border-radius: 26px;
  text-shadow: 0 0 18px rgba(255, 211, 85, 0.9);
}

#syncCountdownOverlay.show {
  opacity: 1;
  transform: scale(1);
}

.processing-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 10, 18, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9998;
}

.processing-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.processing-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: min(100%, 260px);
  padding: 24px 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.processing-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #d8e9e2;
  border-top-color: var(--success);
  border-radius: 50%;
  animation: processing-spin 0.8s linear infinite;
}

.processing-card p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.processing-dots {
  display: inline-flex;
  gap: 5px;
  height: 8px;
}

.processing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: processing-pulse 1s ease-in-out infinite;
}

.processing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.processing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

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

@keyframes processing-pulse {
  0%, 100% {
    transform: scale(0.65);
    opacity: 0.45;
  }

  50% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes frame-skeleton-pulse {
  0%, 100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 420px) {
  .action-card,
  .status-card,
  .email-box,
  .result-wrapper {
    border-radius: 18px;
  }

  .capture-actions,
  .photo-status {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .capture-header {
    gap: 6px;
  }

  .capture-header-actions {
    gap: 6px;
  }

  .capture-header-actions .ghost-btn {
    min-width: 0;
    min-height: 40px;
    padding: 0 8px;
    font-size: 12px;
  }

  .capture-header-actions .control-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .capture-header .status-pill {
    padding: 7px 8px;
    font-size: 12px;
  }

  .camera-grid {
    gap: 8px;
  }
}

@media (max-width: 340px) {
  .capture-header {
    align-items: flex-start;
  }

  .capture-header-actions {
    gap: 4px;
  }

  .capture-header-actions .ghost-btn {
    min-height: 38px;
    padding: 0 6px;
    font-size: 11px;
  }

  .capture-header-actions .control-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .capture-header .status-pill {
    padding: 6px;
    font-size: 11px;
  }

  .camera-grid {
    gap: 6px;
  }
}

.copy-hint {
  color: #667085;
  font-size: 13px;
}

.waiting-animation {
  margin: 45px 0 20px;
}

.pulse-circle {
  width: 110px;
  height: 110px;
  margin: auto;
  border-radius: 50%;
  background: #f2f4f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 45px;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16,24,40,.14);
  }

  70% {
    box-shadow: 0 0 0 25px rgba(16,24,40,0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16,24,40,0);
  }
}

#waitingMessage {
  color: #667085;
}

.text-btn {
  margin-top: 30px;
  border: 0;
  background: transparent;
  color: #667085;
  padding: 10px;
}


/* =========================
   PHOTO
========================= */

.photo-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid #eaecf0;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.92));
  backdrop-filter: blur(6px);
}

.timer-wrap {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-left: auto;
}

.timer-wrap span {
  font-size: 11px;
  color: #667085;
  letter-spacing: 1px;
}

.timer-wrap strong {
  font-size: 27px;
}

.finish-btn {
  min-height: 45px;
  padding: 0 18px;
  border: 1px solid #d0d5dd;
  background: white;
  border-radius: 12px;
  font-weight: 700;
}

.photo-content {
  padding: 32px 22px 60px;
}

.photo-content > h1 {
  font-size: clamp(30px, 7vw, 46px);
  line-height: .98;
  letter-spacing: -2px;
  margin: 0 0 28px;
  color: #101828;
}

.camera-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.camera-card {
  border-radius: 24px;
  background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(16,24,40,.08);
  border: 1px solid rgba(16,24,40,.04);
  min-width: 0;
}

.camera-card video,
.camera-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eef2f7;
}

/* =========================
   PARTNER LIVE VIDEO
========================= */

#partnerVideo{
  display:none;
}

#partnerVideo.active{
  display:block;
}

#partnerPhoto{
  display:none;
}

#partnerPhoto.show{
  display:block;
}

.partner-card img {
  display: none;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  color: #98a2b3;
}

.camera-placeholder svg {
  width: 1em;
  height: 1em;
}

.mic-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.camera-label {
  position: absolute;
  left: 13px;
  bottom: 13px;
  padding: 8px 13px;
  background: rgba(20, 21, 24, 0.94);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  z-index: 3;
}

.photo-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: clamp(65px, 16vw, 120px);
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,.2);
  opacity: 0;
  pointer-events: none;
}

.template-section {
  margin-top: 34px;
}

.section-label {
  font-size: 12px;
  color: #667085;
  letter-spacing: 2px;
  font-weight: 700;
  margin-bottom: 10px;
}

.template-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f2f4f7;
  border-radius: 13px;
  padding: 4px;
}

.template-tab {
  height: 43px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: #667085;
}

.template-tab.active {
  background: white;
  color: #101828;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(16,24,40,.08);
}

.templates {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 13px 0 5px;
}

.template-option {
  flex: 0 0 70px;
  height: 110px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fafc, #eef2f7);
  padding: 7px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.template-option.selected {
  border-color: #101828;
  box-shadow: 0 10px 22px rgba(16,24,40,.08);
}

.template-option:hover {
  transform: translateY(-1px);
}

.template-preview {
  width: 100%;
  height: 100%;
  display: grid;
  gap: 3px;
}

.template-preview.vertical {
  grid-template-rows: repeat(4,1fr);
}

.template-preview.square {
  grid-template-columns: repeat(2,1fr);
  grid-template-rows: repeat(2,1fr);
}

.template-preview i {
  display: block;
  background: #d0d5dd;
  border-radius: 3px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.control-btn {
  height: 55px;
  border: 0;
  border-radius: 15px;
  background: #f2f4f7;
  color: #344054;
  font-weight: 700;
  transition: .2s ease;
}

.shutter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  margin: 30px auto 10px;
  border-radius: 50%;
  border: 7px solid #eaecf0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  box-shadow: 0 14px 28px rgba(16,24,40,.12);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.shutter-btn span {
  width: 58px;
  height: 58px;
  background: #101828;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.08);
}

.shutter-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(16,24,40,.14);
}

.shutter-btn:active {
  transform: scale(.94);
}

.shutter-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
}

.shutter-btn.busy {
  transform: scale(.97);
  box-shadow: 0 8px 20px rgba(16,24,40,.08);
}

.photo-progress {
  text-align: center;
  color: #667085;
  font-size: 13px;
}

.photo-progress strong {
  color: #101828;
}


/* =========================
   RESULT
========================= */

.result-header {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 20px;
  border-bottom: 1px solid #eaecf0;
}

.result-header h2 {
  font-size: 18px;
}

.result-content {
  padding: 30px 22px 50px;
  text-align: center;
}

.result-card {
  width: min(100%, 460px);
  margin: auto;
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid rgba(16,24,40,.06);
  box-shadow: 0 18px 36px rgba(15,23,42,.08);
}

.result-card canvas {
  border-radius: 16px;
  overflow: hidden;
  display: block;
  background: white;
}

#resultCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: white;
}

.result-content h1 {
  margin: 28px 0 8px;
  font-size: 31px;
}

.result-content p {
  color: #667085;
  margin-bottom: 25px;
}

.result-content .secondary-btn {
  margin-top: 10px;
}


/* =========================
   MODAL
========================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(16,24,40,.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(100%, 650px);
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 26px 26px 0 0;
  padding: 28px 24px 30px;
  position: relative;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 18px;
  border: 0;
  background: #f2f4f7;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 24px;
}

.modal-icon {
  font-size: 35px;
}

.modal-card h2 {
  font-size: 25px;
}

.modal-card ol {
  padding-left: 22px;
}

.modal-card li {
  margin-bottom: 18px;
}

.modal-card li p {
  color: #667085;
  line-height: 1.55;
  margin: 5px 0 0;
}


/* =========================
   TOAST
========================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 25px;
  transform: translate(-50%, 120px);
  background: #101828;
  color: white;
  padding: 13px 18px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 200;
  transition: .3s;
  max-width: calc(100% - 30px);
  text-align: center;
}

.toast.show {
  transform: translate(-50%, 0);
}

.hidden {
  display: none !important;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 520px) {

  .topbar {
    height: 64px;
    padding: 0 14px;
  }

  .screen {
    min-height: calc(100vh - 64px);
  }

  .hero {
    padding: 45px 22px 30px;
  }

  .action-card {
    margin: 0 14px 30px;
    padding: 18px;
  }

  .photo-header {
    padding: 12px 14px;
  }

  .photo-header .status-pill {
    font-size: 12px;
  }

  .timer-wrap strong {
    font-size: 21px;
  }

  .finish-btn {
    min-height: 40px;
    padding: 0 13px;
  }

  .photo-content {
    padding: 27px 14px 45px;
  }

  .camera-grid {
    gap: 8px;
  }

  .camera-card {
    border-radius: 17px;
  }

  .camera-label {
    left: 8px;
    bottom: 8px;
  }

  .mic-badge {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .controls {
    gap: 8px;
  }

  .waiting-container {
    padding: 45px 16px;
  }

  .room-code {
    font-size: 31px;
  }
}

#resultFramePickerHost .frame-picker {
  margin-top: 24px;
  text-align: left;
}