/* ============================================================
   Etapa · La foto del día (prefijo .fd-)
   ============================================================ */

/* ---------- Dentro de la etapa ---------- */
.fd-stage { flex: 1; min-height: 220px; margin-top: 20px; display: grid; place-items: center; align-content: center; gap: 12px; }
.fd-mini { margin: 0; width: min(62%, 230px); box-shadow: 0 22px 36px -24px rgba(60,40,20,.6); transform: rotate(-1.2deg); }
.fd-mini img { display: block; width: 100%; height: auto; border: 1px solid var(--line, rgba(176,141,87,.42)); }
.fd-state { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted, #877B6E); }
.fd-state.ok { color: var(--acc, #B08D57); }
.fd-state svg { width: 15px; height: 15px; }
.fd-empty { width: 100%; flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; padding: 28px 22px; border: 1px dashed var(--line, rgba(176,141,87,.42)); text-align: center; }
.fd-empty p { margin: 0; max-width: 24ch; font-size: 12.5px; color: var(--muted, #877B6E); }
.fd-empty-ico { display: block; width: 58px; height: 58px; margin: 0 auto; color: var(--acc, #B08D57); }
.fd-empty-ico svg { width: 100%; height: 100%; }

/* ---------- Capa a pantalla completa ---------- */
.fd-overlay {
  position: absolute; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: #1A1612; color: #F3EBDD;
  background-image: radial-gradient(90% 45% at 50% 0%, #2E2620, transparent 70%);
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  animation: fd-in .6s cubic-bezier(.2,.7,.2,1) both;
}
.fd-overlay.is-closing { animation: fd-out .4s ease forwards; pointer-events: none; }
@keyframes fd-in { from { clip-path: circle(0% at 50% 75%); } to { clip-path: circle(150% at 50% 75%); } }
@keyframes fd-out { to { opacity: 0; } }

.fd-top { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 20px) 18px 10px; }
.fd-ib { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.06); color: #E6CC95; cursor: pointer; }
.fd-ib svg { width: 20px; height: 20px; }
.fd-title { display: grid; justify-items: center; gap: 2px; text-align: center; }
.fd-eyebrow { margin: 0; font: 400 9.5px/1.3 'Montserrat', system-ui, sans-serif; letter-spacing: .3em; text-transform: uppercase; color: #D2B377; }
.fd-step { font: italic 400 19px/1.1 'Cormorant Garamond', Georgia, serif; color: #F3EBDD; }

.fd-body {
  --vw: min(100%, 420px, calc((100dvh - 290px) * .8));
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 6px 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
  overflow-y: auto; scrollbar-width: none;
}
.fd-body::-webkit-scrollbar { display: none; }

/* Visor 4:5 */
.fd-view {
  position: relative; flex: none;
  width: var(--vw); aspect-ratio: 4 / 5;
  background: #0E0C0A; border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(210,179,119,.35), 0 26px 50px -26px rgba(0,0,0,.8);
}
.fd-view video, .fd-view img, .fd-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.fd-view video.espejo { transform: scaleX(-1); }
.fd-corner { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(233,201,138,.85); pointer-events: none; }
.fd-corner.tl { top: 12px; left: 12px; border-top-width: 1.5px; border-left-width: 1.5px; }
.fd-corner.tr { top: 12px; right: 12px; border-top-width: 1.5px; border-right-width: 1.5px; }
.fd-corner.bl { bottom: 12px; left: 12px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.fd-corner.br { bottom: 12px; right: 12px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.fd-count { position: absolute; inset: 0; display: grid; place-items: center; font: italic 300 120px/1 'Cormorant Garamond', Georgia, serif; color: #FFF8EA; text-shadow: 0 4px 30px rgba(0,0,0,.5); pointer-events: none; }
.fd-count.on { animation: fd-num 1s ease both; }
@keyframes fd-num { 0% { opacity: 0; transform: scale(1.6); } 25% { opacity: 1; transform: scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }
.fd-flash { position: absolute; inset: 0; background: #FFFFFF; opacity: 0; pointer-events: none; }
.fd-flash.on { animation: fd-flash .5s ease-out both; }
@keyframes fd-flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.fd-nocam { display: grid; place-items: center; background: #221D18; }
.fd-nocam-in { display: grid; gap: 12px; padding: 24px; text-align: center; justify-items: center; }
.fd-nocam-in p { margin: 0 0 6px; max-width: 26ch; font-size: 12.5px; line-height: 1.5; color: #CDBFA8; }
.fd-nocam-in .fd-empty-ico { color: #D2B377; }
.fd-edit canvas.fd-draw { touch-action: none; cursor: crosshair; }

/* Disparador */
.fd-shoot { width: var(--vw, 100%); max-width: 420px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.fd-shoot .fd-chip:first-child { justify-self: start; }
.fd-shoot .fd-chip:last-child { justify-self: end; }
.fd-chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(210,179,119,.45); background: rgba(255,255,255,.05); color: #E6CC95; font: 500 10.5px/1 'Montserrat', system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.fd-chip svg { width: 17px; height: 17px; }
.fd-shutter { width: 76px; height: 76px; padding: 0; border-radius: 50%; border: 2px solid #E6CC95; background: transparent; display: grid; place-items: center; cursor: pointer; }
.fd-shutter span { width: 60px; height: 60px; border-radius: 50%; background: #F3EBDD; box-shadow: inset 0 0 0 2px #D2B377; transition: transform .15s; }
.fd-shutter:active span { transform: scale(.88); }
.fd-link { display: inline-flex; align-items: center; gap: 8px; margin: 2px auto 0; padding: 6px 10px; border: 0; background: none; color: #CDBFA8; font: italic 400 16px/1.2 'Cormorant Garamond', Georgia, serif; text-decoration: underline; text-decoration-color: rgba(210,179,119,.4); text-underline-offset: 4px; cursor: pointer; }
.fd-link svg { width: 16px; height: 16px; color: #D2B377; }
.fd-hint { margin: 0; max-width: 30ch; text-align: center; font: italic 400 16px/1.35 'Cormorant Garamond', Georgia, serif; color: #CDBFA8; }

/* Botones */
.fd-actions { width: var(--vw, 100%); max-width: 420px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fd-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 12px; border: 1px solid #D2B377; background: transparent; color: #F3EBDD;
  font: 400 10px/1.2 'Montserrat', system-ui, sans-serif; letter-spacing: .26em; text-transform: uppercase; cursor: pointer;
}
.fd-btn::after { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(210,179,119,.35); pointer-events: none; }
.fd-btn.solid { background: #D2B377; color: #1A1612; }
.fd-btn.solid::after { border-color: rgba(26,22,18,.25); }
.fd-btn svg { width: 16px; height: 16px; }
.fd-btn:active { transform: scale(.985); }
.fd-btn:focus-visible, .fd-link:focus-visible, .fd-ib:focus-visible, .fd-chip:focus-visible, .fd-shutter:focus-visible, .fd-tool:focus-visible, .fd-color:focus-visible { outline: 1.5px solid #E6CC95; outline-offset: 3px; }

/* Herramientas de dibujo */
.fd-tools { width: var(--vw, 100%); max-width: 420px; display: flex; align-items: center; gap: 8px; }
.fd-colors { flex: 1; display: flex; gap: 7px; }
.fd-color { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid #1A1612; background: var(--c); box-shadow: 0 0 0 1px rgba(210,179,119,.55); cursor: pointer; transition: transform .2s; }
.fd-color.on { transform: scale(1.18); box-shadow: 0 0 0 2px #E6CC95; }
.fd-tool { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(210,179,119,.45); background: rgba(255,255,255,.05); color: #E6CC95; cursor: pointer; }
.fd-tool svg { width: 17px; height: 17px; }
.fd-dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: #E6CC95; transition: width .2s, height .2s; }
.fd-dot.big { width: 13px; height: 13px; }
.fd-label { width: var(--vw, 100%); max-width: 420px; margin: 4px 0 -8px; font: 400 9.5px/1 'Montserrat', system-ui, sans-serif; letter-spacing: .28em; text-transform: uppercase; color: #D2B377; }
.fd-field { position: relative; width: var(--vw, 100%); max-width: 420px; }
.fd-input {
  width: 100%; padding: 12px 40px 12px 2px; border: 0; border-bottom: 1px solid #D2B377; border-radius: 0;
  background: transparent; color: #FFF8EA; font: italic 400 22px/1.2 'Cormorant Garamond', Georgia, serif; outline: none;
  -webkit-user-select: text; user-select: text;
}
.fd-input::placeholder { color: rgba(243,235,221,.4); }
.fd-input:focus { border-bottom-color: #FFF8EA; }
.fd-left { position: absolute; right: 0; bottom: 14px; font: 400 10px/1 'Montserrat', system-ui, sans-serif; color: #9C8E78; font-variant-numeric: tabular-nums; }

/* Hojas (guardando, listo, vista previa) */
.fd-sheet {
  position: relative; width: 100%; max-width: 340px; margin: auto 0;
  padding: 28px 22px 22px; text-align: center;
  background: #FFFDF8; color: #2B2622; border: 1px solid #B08D57;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.8);
  animation: fd-rise .6s cubic-bezier(.2,.7,.2,1) both;
}
.fd-sheet::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(176,141,87,.35); pointer-events: none; }
.fd-sheet h2 { margin: 6px 0 14px; font: italic 300 32px/1.1 'Cormorant Garamond', Georgia, serif; }
.fd-sheet .fd-eyebrow { color: #B08D57; }
.fd-sheet .fd-empty-ico { margin-bottom: 8px; }
.fd-sheet .fd-btn { color: #2B2622; border-color: #B08D57; margin-top: 10px; }
.fd-sheet .fd-btn::after { border-color: rgba(176,141,87,.35); }
.fd-sheet .fd-btn.solid { background: #B08D57; color: #FFFDF8; }
.fd-sheet .fd-btn.solid::after { border-color: rgba(255,255,255,.35); }
.fd-print { display: block; width: 72%; margin: 4px auto 0; height: auto; box-shadow: 0 16px 30px -18px rgba(60,40,20,.6); border: 1px solid rgba(176,141,87,.35); }
.fd-note { margin: 12px 0 4px; font: 300 12px/1.5 'Montserrat', system-ui, sans-serif; color: #877B6E; }
.fd-progress { height: 4px; margin: 6px 10px 0; background: rgba(176,141,87,.2); border-radius: 3px; overflow: hidden; }
.fd-progress i { display: block; height: 100%; background: linear-gradient(90deg, #D4AF6A, #E08FA0); transform: scaleX(.04); transform-origin: left; transition: transform .3s ease; }
.fd-modal { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: rgba(10,8,6,.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fd-fade .3s ease both; overflow-y: auto; }
@keyframes fd-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fd-fade { from { opacity: 0; } }

.fd-toast { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 28px); z-index: 6; margin: 0; padding: 10px 16px; max-width: 86%; transform: translateX(-50%); border-radius: 999px; background: #FFFDF8; color: #2B2622; font-size: 12px; text-align: center; opacity: 0; pointer-events: none; }
.fd-toast.show { animation: fd-toast 3s ease both; }
@keyframes fd-toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .fd-overlay, .fd-sheet, .fd-modal, .fd-count.on, .fd-flash.on, .fd-toast.show { animation-duration: .01ms !important; }
}
