/* camara.css — Efecto "Cámara con foto": superpone la carta sobre una FOTO. */
.cam-screen { position: fixed; inset: 0; background: #0b0d10; overflow: hidden; }

/* La foto subida (solo en memoria) */
.cam-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #0b0d10; display: none; }
.cam-photo.show { display: block; }

/* Capa de interacción (arrastrar/pellizcar) */
.cam-stage { position: absolute; inset: 0; touch-action: none; }

/* Marco de la carta superpuesta */
.card-frame {
  position: absolute; left: 50%; top: 44%;
  width: min(62vw, 300px); aspect-ratio: 5 / 7;
  transform: translate(-50%, -50%);
  will-change: transform;
}
.card-frame.hidden { display: none; }
.card-frame::before {                          /* guía de alineación */
  content: ""; position: absolute; inset: -3px; border: 2.5px solid #22ff99; border-radius: 12px;
  box-shadow: 0 0 14px rgba(34,255,153,.5); opacity: .9; transition: opacity .3s;
}
.card-frame.revealed::before { opacity: 0; }

.card-holder {                                 /* la carta (oculta hasta revelar) */
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
  opacity: 0; will-change: opacity, transform, filter;
}
/* Efecto FANTASMA: aparece etérea (desenfoque -> nítida + brillo) y queda al 60%. */
.card-frame.revealed .card-holder {
  animation: ghostIn 1.1s ease forwards, ghostFloat 3.4s ease-in-out 1.15s infinite;
}
.card-holder svg { width: 100%; height: 100%; display: block; }
.card-scan { display: none; }

@keyframes ghostIn {
  0%   { opacity: 0;   transform: scale(1.08); filter: blur(7px); }
  55%  { opacity: .7; }
  100% { opacity: .6;  transform: scale(1);    filter: blur(0) drop-shadow(0 0 14px rgba(180,230,255,.6)); }
}
@keyframes ghostFloat {
  0%   { opacity: .6; transform: translateY(0)    scale(1);     filter: drop-shadow(0 0 14px rgba(180,230,255,.55)); }
  50%  { opacity: .5; transform: translateY(-4px) scale(1.004); filter: drop-shadow(0 0 18px rgba(180,230,255,.75)); }
  100% { opacity: .6; transform: translateY(0)    scale(1);     filter: drop-shadow(0 0 14px rgba(180,230,255,.55)); }
}

/* UI inferior */
.cam-ui {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0));
}
.cam-status { color: #fff; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); min-height: 16px; text-align: center; }
.cam-hint { color: rgba(255,255,255,.82); font-size: 12px; text-align: center; max-width: 340px; line-height: 1.4; }
.cam-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }

.cam-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 22px; border: none; border-radius: 24px; font-size: 14px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #6c5ce7, #1a73e8); box-shadow: 0 8px 20px rgba(0,0,0,.35); cursor: pointer;
  text-decoration: none; -webkit-user-select: none; user-select: none;
}
.cam-btn:active { transform: translateY(1px); }
.cam-btn[disabled] { opacity: .5; cursor: default; }
.cam-btn.ghost { background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.cam-mini {
  width: 44px; height: 44px; border-radius: 50%; border: none; color: #fff; font-size: 18px; font-weight: 700;
  background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cam-error {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; padding: 30px;
  text-align: center; color: #fff; background: #111; font-size: 15px; line-height: 1.5; z-index: 5; white-space: pre-line;
}
.cam-error.show { display: flex; }


/* ----- Fase de ESCANEO (8 s antes del revelado) ----- */
.card-frame.scanning::before { animation: framePulse 1s ease-in-out infinite; }
@keyframes framePulse {
  0%, 100% { opacity: .7; box-shadow: 0 0 10px rgba(34,255,153,.45); }
  50%      { opacity: 1;  box-shadow: 0 0 22px rgba(34,255,153,.9); }
}
.card-scan-fx { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; opacity: 0; pointer-events: none; }
.card-frame.scanning .card-scan-fx { opacity: 1; }
.card-scan-fx::after {                 /* rejilla de escáner */
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(34,255,153,.10) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(90deg, rgba(34,255,153,.10) 0 1px, transparent 1px 14px);
}
.card-scan-fx::before {                 /* línea láser que barre */
  content: ""; position: absolute; left: 0; right: 0; top: -12%; height: 12%;
  background: linear-gradient(to bottom, rgba(34,255,153,0), rgba(34,255,153,.95), rgba(34,255,153,0));
  box-shadow: 0 0 16px rgba(34,255,153,.85);
  animation: scanSweep 1.5s linear infinite;
}
@keyframes scanSweep { 0% { top: -12%; } 100% { top: 100%; } }