:root {
  color-scheme: dark;
  --bg: #101114;
  --text: #f4f0e8;
  --gold: #d8b45d;
  --gold-dim: rgba(216, 180, 93, 0.18);
  --gold-glow: rgba(216, 180, 93, 0.35);
  --card-bg: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-hover: rgba(216, 180, 93, 0.12);
  --card-hover-border: rgba(216, 180, 93, 0.5);
}
/*less gaw team*/
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  overflow: hidden;
}

/* ── Scene ─────────────────────────────── */
.app {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
}

.camera-frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0c0f;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#scene {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.status {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: rgba(244, 240, 232, 0.45);
  font-size: 0.7rem;
  pointer-events: none;
  letter-spacing: 0.03em;
}

/* ── Pendant Selection Overlay ──────────── */
#pendant-select {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  background: #000000;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#pendant-select.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.select-header {
  text-align: center;
}

.select-header h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text);
}

.select-header p {
  margin-top: 8px;
  font-size: 0.88rem;
  color: rgba(244, 240, 232, 0.5);
  letter-spacing: 0.04em;
}

.select-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.pendant-card {
  cursor: pointer;
  width: 160px;
  padding: 28px 20px 24px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  user-select: none;
}

.pendant-card:hover {
  transform: translateY(-6px);
  background: var(--card-hover);
  border-color: var(--card-hover-border);
  box-shadow: 0 12px 36px var(--gold-glow);
}

.pendant-card:active {
  transform: translateY(-2px);
}

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid rgba(216, 180, 93, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.card-label {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text);
}

.card-sub {
  font-size: 0.72rem;
  color: rgba(244, 240, 232, 0.4);
  text-align: center;
  line-height: 1.5;
}

/* Shimmer line under title */
.select-header h1::after {
  content: '';
  display: block;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 10px auto 0;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════
   Picture Frame Panel
═══════════════════════════════════════════ */
.tangna-frame-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  width: min(400px, 92vw);
  height: 100vh;
  padding: 2.5rem 1.75rem 2rem;
  background: linear-gradient(165deg, rgba(10, 8, 5, 0.97) 0%, rgba(20, 15, 8, 0.98) 100%);
  border-left: 1px solid rgba(216, 180, 93, 0.35);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
  transform: translateX(110%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  overflow-y: auto;
  will-change: transform;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.tangna-frame-panel.is-open {
  transform: translateX(0);
  pointer-events: all;
}

.tfp-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(216, 180, 93, 0.4);
  background: rgba(216, 180, 93, 0.08);
  color: #f5e4a8;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.tfp-close:hover {
  background: rgba(216, 180, 93, 0.22);
  border-color: var(--gold);
}

.tfp-body {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tfp-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.tfp-preview {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border: 2px solid rgba(216, 180, 93, 0.4);
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.tfp-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border: 1px solid rgba(216, 180, 93, 0.55);
  color: #f5e4a8;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  background: rgba(216, 180, 93, 0.1);
  border-radius: 4px;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.tfp-upload-btn:hover {
  background: rgba(216, 180, 93, 0.22);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(216, 180, 93, 0.18);
}

.tfp-hint {
  font-size: 0.73rem;
  font-weight: 300;
  color: rgba(244, 240, 232, 0.4);
  text-align: center;
  line-height: 1.6;
  max-width: 280px;
}

/* ── Mobile: bottom sheet ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tangna-frame-panel {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100vw;
    height: 72vh;
    border-left: none;
    border-top: 1px solid rgba(216, 180, 93, 0.35);
    border-radius: 20px 20px 0 0;
    transform: translateY(110%);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.65);
    padding: 2.2rem 1.25rem 2rem;
  }

  .tangna-frame-panel.is-open {
    transform: translateY(0);
  }

  /* Drag handle indicator */
  .tangna-frame-panel::before {
    content: '';
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 4px;
    background: rgba(216, 180, 93, 0.28);
    border-radius: 2px;
  }
}

/* Photo upload step */
.photo-upload-step {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.photo-upload-step.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.photo-upload-inner {
  width: min(100%, 760px);
  display: grid;
  justify-items: center;
  gap: 28px;
}

.photo-upload-heading {
  text-align: center;
}

.photo-upload-heading h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.photo-upload-heading p {
  margin-top: 8px;
  color: rgba(244, 240, 232, 0.48);
  font-size: 0.86rem;
}

.photo-upload-grid {
  display: grid;
  /* Default is horizontal (for heart and metal) */
  grid-template-columns: repeat(2, minmax(160px, 240px));
  gap: 20px;
  justify-content: center;
}

/* Clock layout: Upload 1 on top, Upload 2 on bottom */
#photo-upload-step[data-layout="baseclock"] .photo-upload-grid {
  grid-template-columns: minmax(180px, 240px);
}

.photo-upload-frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(216, 180, 93, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 8px rgba(216, 180, 93, 0.08), 0 16px 42px rgba(0, 0, 0, 0.36);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.photo-upload-frame:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: rgba(216, 180, 93, 0.1);
}

.photo-upload-frame img {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: cover;
  opacity: 0;
}

.photo-upload-frame.has-image img {
  opacity: 1;
}

.photo-upload-frame span {
  position: relative;
  z-index: 1;
  padding: 10px 14px;
  color: #f5e4a8;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(216, 180, 93, 0.32);
  border-radius: 4px;
}

.photo-upload-frame.has-image span {
  opacity: 0;
}

.photo-upload-frame.is-loading span {
  opacity: 1;
}

.photo-upload-frame.is-loading span::before {
  content: 'Loading ';
}

.photo-upload-start {
  min-width: 150px;
  height: 44px;
  border: 1px solid rgba(216, 180, 93, 0.72);
  border-radius: 4px;
  background: rgba(216, 180, 93, 0.16);
  color: #f5e4a8;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.photo-upload-start:not(:disabled):hover {
  transform: translateY(-2px);
  background: rgba(216, 180, 93, 0.28);
}

.photo-upload-start:disabled {
  cursor: default;
  opacity: 0.38;
}

@media (max-width: 560px) {

  /* On very small screens, force clock to stay vertical */
  #photo-upload-step[data-layout="baseclock"] .photo-upload-grid {
    grid-template-columns: minmax(160px, 220px);
  }

  /* But keep heart and metal side-by-side so they don't break the user's mental model */
  #photo-upload-step:not([data-layout="baseclock"]) .photo-upload-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 12px;
  }
}

/* ── Letter Writing Step ──────────────────────────────────────────────── */
.letter-write-step {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.letter-write-step.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.letter-write-inner {
  width: min(100%, 520px);
  display: grid;
  justify-items: center;
  gap: 20px;
}

.letter-write-heading {
  text-align: center;
}

.letter-write-heading h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.letter-write-heading p {
  margin-top: 8px;
  color: rgba(244, 240, 232, 0.48);
  font-size: 0.86rem;
}

.letter-write-textarea {
  width: 100%;
  min-height: 200px;
  padding: 18px 20px;
  resize: vertical;
  border: 1px solid rgba(216, 180, 93, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 8px rgba(216, 180, 93, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
}

.letter-write-textarea::placeholder {
  color: rgba(244, 240, 232, 0.32);
}

.letter-write-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.letter-write-confirm {
  min-width: 150px;
  height: 44px;
  border: 1px solid rgba(216, 180, 93, 0.72);
  border-radius: 4px;
  background: rgba(216, 180, 93, 0.16);
  color: #f5e4a8;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.letter-write-confirm:not(:disabled):hover {
  transform: translateY(-2px);
  background: rgba(216, 180, 93, 0.28);
}

.letter-write-confirm:disabled {
  cursor: default;
  opacity: 0.38;
}

/* ── Letter Paper Popup (shown by tapping envelope/letter/open in-scene) ── */
.letter-paper-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.letter-paper-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.letter-paper-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.letter-paper {
  position: relative;
  width: min(100%, 480px);
  max-height: 74vh;
  overflow-y: auto;
  padding: 44px 38px;
  background: #f6efdd;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(0, 0, 0, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(0, 0, 0, 0.03) 0%, transparent 40%);
  border-radius: 3px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  transform: scale(0.96) translateY(6px);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.letter-paper-overlay.is-open .letter-paper {
  transform: scale(1) translateY(0);
}

.letter-paper-text {
  color: #2a2218;
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.letter-paper-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: rgba(42, 34, 24, 0.55);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.letter-paper-close:hover {
  color: #2a2218;
  transform: scale(1.1);
}

@media (max-width: 560px) {
  .letter-write-textarea {
    min-height: 160px;
  }

  .letter-paper {
    padding: 34px 24px;
  }
}

/* ── Scene Open Button ────────────────────────────────────────────────── */
#scene-open-btn {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 90;
  padding: 0.85rem 2.8rem;
  border: 1px solid rgba(216, 180, 93, 0.7);
  border-radius: 6px;
  background: rgba(216, 180, 93, 0.12);
  color: #f5e4a8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.25s ease,
    box-shadow 0.25s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#scene-open-btn.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
  animation: btn-pulse-glow 2.8s ease-in-out infinite;
}

#scene-open-btn:hover {
  background: rgba(216, 180, 93, 0.28);
  border-color: var(--gold);
  box-shadow: 0 0 32px rgba(216, 180, 93, 0.35);
  animation: none;
  transform: translateX(-50%) translateY(-2px);
}

#scene-open-btn:active {
  transform: translateX(-50%) translateY(0);
}

#scene-open-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

@keyframes btn-pulse-glow {

  0%,
  100% {
    box-shadow: 0 0 12px rgba(216, 180, 93, 0.15);
  }

  50% {
    box-shadow: 0 0 32px rgba(216, 180, 93, 0.4), 0 0 60px rgba(216, 180, 93, 0.12);
  }
}

/* ══════════════════════════════════════════════════════════════
   Photo Cropper Modal
══════════════════════════════════════════════════════════════ */

.pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.32s ease;
}

.pc-overlay.pc-visible {
  opacity: 1;
}

.pc-modal {
  width: min(540px, 96vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(160deg, rgba(14, 11, 7, 0.98) 0%, rgba(22, 17, 9, 0.99) 100%);
  border: 1px solid rgba(216, 180, 93, 0.32);
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(216, 180, 93, 0.08);
  user-select: none;
}

/* ── Header ── */
.pc-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.pc-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.pc-hint {
  font-size: 0.7rem;
  color: rgba(244, 240, 232, 0.38);
  letter-spacing: 0.04em;
}

/* ── Stage (the interactive photo area) ── */
.pc-stage-wrap {
  display: flex;
  justify-content: center;
}

.pc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 440px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(216, 180, 93, 0.2);
  cursor: grab;
  background: #0a0806;
  touch-action: none;
}

.pc-stage:active {
  cursor: grabbing;
}

/* The photo canvas fills the whole stage */
.pc-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The SVG overlay sits on top, shows the frame "hole" */
.pc-shape-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pc-shape-border {
  filter: drop-shadow(0 0 3px rgba(216, 180, 93, 0.5));
}

/* ── Control buttons (rotate / zoom / reset) ── */
.pc-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pc-ctrl-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 180, 93, 0.3);
  border-radius: 8px;
  background: rgba(216, 180, 93, 0.07);
  color: #f5e4a8;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.pc-ctrl-btn svg {
  width: 18px;
  height: 18px;
}

.pc-ctrl-btn:hover {
  background: rgba(216, 180, 93, 0.18);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.pc-ctrl-btn:active {
  transform: translateY(0);
  background: rgba(216, 180, 93, 0.28);
}

/* ── Confirm / Cancel actions ── */
.pc-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.pc-btn {
  height: 40px;
  padding: 0 1.4rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
}

.pc-cancel {
  border: 1px solid rgba(244, 240, 232, 0.15);
  background: transparent;
  color: rgba(244, 240, 232, 0.55);
}

.pc-cancel:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pc-confirm {
  border: 1px solid rgba(216, 180, 93, 0.65);
  background: rgba(216, 180, 93, 0.15);
  color: #f5e4a8;
}

.pc-confirm:hover {
  background: rgba(216, 180, 93, 0.28);
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(216, 180, 93, 0.22);
}

.pc-confirm:active {
  transform: translateY(0);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS  (all UI layers)
══════════════════════════════════════════════════════════════ */

/* ── Small tablets / large phones (≤ 640px) ── */
@media (max-width: 640px) {

  /* ── Pendant selection screen ── */
  #pendant-select {
    gap: 24px;
    padding: 20px 16px;
  }

  .select-header h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .select-header p {
    font-size: 0.82rem;
  }

  .select-cards {
    gap: 12px;
    /* Force a single row on wide-enough phones; wrap on narrow ones */
    flex-wrap: wrap;
  }

  .pendant-card {
    width: clamp(100px, 28vw, 145px);
    padding: 20px 12px 18px;
    gap: 10px;
    border-radius: 14px;
    /* Bigger tap target feel */
    -webkit-tap-highlight-color: transparent;
  }

  .card-icon {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }

  .card-label {
    font-size: 0.78rem;
  }

  .card-sub {
    font-size: 0.65rem;
  }

  /* ── Photo upload screen ── */
  .photo-upload-step {
    padding: 16px 12px;
  }

  .photo-upload-inner {
    gap: 20px;
  }

  .photo-upload-heading h2 {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
  }

  .photo-upload-heading p {
    font-size: 0.8rem;
  }

  /* Default 2-col (heart/metal): shrink to fit */
  .photo-upload-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 12px;
    width: 100%;
  }

  /* Clock single-col: cap height so it fits without scroll */
  #photo-upload-step[data-layout="baseclock"] .photo-upload-grid {
    grid-template-columns: minmax(140px, 260px);
  }

  .photo-upload-frame {
    border-radius: 10px;
    /* Smaller inset glow so it doesn't look cramped */
    box-shadow: inset 0 0 0 5px rgba(216, 180, 93, 0.08), 0 8px 24px rgba(0, 0, 0, 0.36);
  }

  .photo-upload-frame span {
    font-size: 0.68rem;
    padding: 8px 10px;
    letter-spacing: 0.1em;
  }

  .photo-upload-start {
    min-width: 120px;
    height: 48px;
    /* Bigger tap target */
    font-size: 0.76rem;
  }

  /* ── Open button ── */
  #scene-open-btn {
    bottom: 24px;
    padding: 0.9rem 2rem;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
  }

  /* ── Photo cropper modal ── */
  .pc-overlay {
    align-items: flex-end;
    /* Sheet slides up from bottom on mobile */
  }

  .pc-modal {
    width: 100%;
    max-height: 94dvh;
    padding: 14px 12px 20px;
    gap: 12px;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    overflow-y: auto;
  }

  .pc-hint {
    font-size: 0.65rem;
  }

  .pc-stage {
    max-width: 100%;
  }

  .pc-controls {
    gap: 8px;
  }

  .pc-ctrl-btn {
    width: 44px;
    height: 44px;
    /* 44px minimum touch target */
  }

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

  .pc-actions {
    flex-direction: row;
    /* Keep side-by-side on phone — saves vertical space */
    gap: 10px;
  }

  .pc-btn {
    flex: 1;
    height: 48px;
    font-size: 0.76rem;
  }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {

  .pendant-card {
    width: clamp(88px, 30vw, 120px);
    padding: 16px 10px 14px;
  }

  .card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .card-label {
    font-size: 0.72rem;
  }

  .card-sub {
    display: none;
    /* Too small — hide sub-label */
  }

  .photo-upload-grid {
    gap: 8px;
  }

  .photo-upload-frame span {
    font-size: 0.6rem;
    padding: 6px 8px;
  }

  .pc-modal {
    padding: 12px 10px 16px;
  }

  .pc-ctrl-btn {
    width: 40px;
    height: 40px;
  }

  .pc-actions {
    flex-direction: column;
  }
}
