/* La Carta Mágica: escritorio de madera oscurecido, pergamino (columna izquierda, 60 %) donde "escribe" la pluma mágica y panel de vidrio
   (columna derecha, 40 %) con micrófono, texto, paleta de estampillas y mensaje. Móvil primero: una sola columna; desde 768 px, dos columnas.
   Paleta de NaviFiesta (verde #12402A, dorado #C9A24A/#E6C46C, crema). Letra de la carta: Caveat (OFL, propia en /fuentes). */
@font-face { font-family: "Work Sans"; src: url("/fuentes/work-sans.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("/fuentes/im-fell-english.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("/fuentes/im-fell-english-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("/fuentes/caveat.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root { --madera: #1A0F08; --verde: #12402A; --oro: #C9A24A; --oro-claro: #E6C46C; --crema: #FFFDF8; --tinta: #3A2312; --pergamino: #f4e4bc; --curva: cubic-bezier(0.23, 1, 0.32, 1); --letra: "Caveat", "Segoe Script", "Bradley Hand", cursive; }
* { box-sizing: border-box; }
.carta-pagina { margin: 0; background: var(--madera); color: var(--crema); font-family: "Work Sans", system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
.carta { position: relative; min-height: 100vh; min-height: 100dvh; padding: 0 14px max(28px, env(safe-area-inset-bottom)); overflow-x: hidden; }

/* Fondo: la mesa de madera, desenfocada y oscurecida para que resalten la carta y los controles */
.carta-fondo { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--madera); }
.carta-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(4px) brightness(0.7); transform: scale(1.06); }
.carta-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(2px) brightness(0.8); transition: opacity 1200ms ease; }
.carta-video.sonando { opacity: 1; }
.carta-velo { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, rgba(20, 10, 5, 0.38), rgba(14, 7, 3, 0.8)); }
.carta > .carta-barra, .carta > .carta-escena { position: relative; z-index: 1; }   /* ojo: NO a las capas fijas (video final, pergamino volando, efectos) */

.carta-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 0 12px; }
.carta-volver { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28); color: var(--crema); text-decoration: none; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.carta-volver:focus-visible, .carta-saltar:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 3px; }
.carta-barra-titulo { margin: 0; font-family: "IM Fell English", Georgia, serif; font-style: italic; font-size: 1.2rem; color: var(--oro-claro); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }

/* Cuadrícula principal */
.carta-escena { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; width: 100%; max-width: 560px; margin: 0 auto; }
.carta-escena > * { min-width: 0; }

/* ---------- El pergamino ---------- */
.carta-pergamino { position: relative; margin-top: 30px; filter: drop-shadow(0 24px 20px rgba(0, 0, 0, 0.55)); transform: rotate(-0.6deg); transform-origin: 50% 50%; transition: transform 900ms var(--curva), opacity 700ms ease; }
.carta-papel { position: relative; display: flex; flex-direction: column; min-height: 330px; padding: 62px 24px 150px; color: var(--tinta);
  background-color: var(--pergamino);
  background-image:
    radial-gradient(ellipse at 50% 45%, rgba(255, 246, 214, 0.55) 0%, rgba(255, 246, 214, 0) 55%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 52%, rgba(122, 72, 22, 0.42) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='b'><feTurbulence type='fractalNoise' baseFrequency='0.011' numOctaves='3' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.46  0 0 0 0 0.29  0 0 0 0 0.09  0 0 0 0.9 -0.18'/></filter><rect width='100%25' height='100%25' filter='url(%23b)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.22  0 0 0 0 0.08  0 0 0 0.5 -0.08'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  /* bordes rasgados */
  clip-path: polygon(0% 0.56%, 3% 0.37%, 6% 0.92%, 9% 0.28%, 12% 0.79%, 15% 0.6%, 18% 0.26%, 21% 0.76%, 24% 0.24%, 27% 0.68%, 30% 0.28%, 33% 0.3%, 36% 0.67%, 39% 1.11%, 42% 0.34%, 45% 0.45%, 48% 0.89%, 51% 1.24%, 54% 0.83%, 57% 0.64%, 60% 1.27%, 63% 0.25%, 66% 1.14%, 69% 0.52%, 72% 0.36%, 75% 0.33%, 78% 0.54%, 81% 1.1%, 84% 0.4%, 87% 0.84%, 90% 0.9%, 93% 0.61%, 96% 0.8%, 99% 0.27%, 99.84% 4%, 99.69% 8%, 99.22% 12%, 99.47% 16%, 99.59% 20%, 99.31% 24%, 99.45% 28%, 99.6% 32%, 99.11% 36%, 99.2% 40%, 99.66% 44%, 99.33% 48%, 99.37% 52%, 99.02% 56%, 99.17% 60%, 99.61% 64%, 98.92% 68%, 99.78% 72%, 99.48% 76%, 99.14% 80%, 99.75% 84%, 99.41% 88%, 99.86% 92%, 99.23% 96%, 100% 98.96%, 97% 99.17%, 94% 98.84%, 91% 99.45%, 88% 99.04%, 85% 99.15%, 82% 99.16%, 79% 99.3%, 76% 98.88%, 73% 98.76%, 70% 99.28%, 67% 99.07%, 64% 99.73%, 61% 99.03%, 58% 99.09%, 55% 98.71%, 52% 98.9%, 49% 99.49%, 46% 99.38%, 43% 99.06%, 40% 99.78%, 37% 99.29%, 34% 99.62%, 31% 99.67%, 28% 99.74%, 25% 98.95%, 22% 99.66%, 19% 99.53%, 16% 99.37%, 13% 98.84%, 10% 99.71%, 7% 99.31%, 4% 99.2%, 1% 98.83%, 0.92% 96%, 0.96% 92%, 0.38% 88%, 0.52% 84%, 0.46% 80%, 0.98% 76%, 1.06% 72%, 0.25% 68%, 0.28% 64%, 0.33% 60%, 0.33% 56%, 0.58% 52%, 0.69% 48%, 0.36% 44%, 0.1% 40%, 0.52% 36%, 0.47% 32%, 0.67% 28%, 1.05% 24%, 0.79% 20%, 0.62% 16%, 0.72% 12%, 0.78% 8%, 0.15% 4%); }

.carta-saludo { margin: 0 0 4px; font-family: var(--letra); font-weight: 700; font-size: clamp(2.2rem, 9vw, 2.9rem); line-height: 1.05; color: #5B2D14; }
.carta-pergamino[data-vacia="1"] .carta-saludo { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* solo para lectores de pantalla mientras se ve el texto tenue */
.carta-vacio { margin: 0; font-family: var(--letra); font-weight: 500; font-size: clamp(1.7rem, 6.6vw, 2rem); line-height: 1.2; color: rgba(58, 35, 18, 0.42); }
.carta-vacio[hidden] { display: none; }
.carta-lineas { margin: 0; padding: 0; list-style: none; }
.carta-lineas li { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 4px; font-family: var(--letra); font-weight: 500; font-size: clamp(1.75rem, 6.6vw, 2rem); line-height: 1.15; color: #2D1A0B; }
.carta-lineas li::before { content: "✦"; flex: none; font-size: 0.6em; color: #B8862B; }
.carta-lineas .texto { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.carta-cursor { display: inline-block; width: 2px; height: 0.9em; vertical-align: text-bottom; background: rgba(58, 35, 18, 0.6); }
.carta-quitar { flex: none; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 50%; background: transparent; color: #8A5A2B; font-size: 1.1rem; cursor: pointer; opacity: 0.65; }
.carta-quitar:hover, .carta-quitar:focus-visible { background: rgba(139, 90, 43, 0.15); outline: none; opacity: 1; }
.carta-mensaje { margin: 14px 0 4px; font-family: var(--letra); font-weight: 500; font-size: clamp(1.6rem, 6vw, 1.9rem); line-height: 1.15; color: #5B2D14; }
.carta-mensaje[hidden] { display: none; }
.carta-pie { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-top: auto; padding-top: 22px; }
.carta-firma { margin: 0 0 0 auto; text-align: right; font-family: var(--letra); font-weight: 600; font-size: 1.45rem; line-height: 1.1; color: rgba(58, 35, 18, 0.85); }

/* Estampillas pegadas en la carta */
.carta-estampillas { display: flex; align-items: flex-end; min-height: 8px; }
.carta-estampilla + .carta-estampilla { margin-left: -9px; }
.carta-estampilla { width: 58px; padding: 4px; background: #FFFDF8; outline: 2px dashed rgba(184, 134, 43, 0.9); outline-offset: -3px; border-radius: 2px; box-shadow: 0 3px 6px rgba(80, 40, 10, 0.35); transform: rotate(var(--giro, 0deg)); animation: pega 420ms var(--curva) both; }
.carta-estampilla.llegando { animation: none; visibility: hidden; }
.carta-estampilla img { display: block; width: 100%; height: 48px; object-fit: contain; mix-blend-mode: multiply; }
@keyframes pega { from { transform: translateY(-14px) scale(1.5) rotate(calc(var(--giro, 0deg) - 12deg)); opacity: 0; } to { transform: rotate(var(--giro, 0deg)); opacity: 1; } }
.carta-estampilla.pegada { animation: golpe 360ms var(--curva) both; }
@keyframes golpe { 0% { transform: scale(1.35) rotate(var(--giro, 0deg)); } 55% { transform: scale(0.94) rotate(var(--giro, 0deg)); } 100% { transform: scale(1) rotate(var(--giro, 0deg)); } }

/* Pluma mágica: descansa en la esquina superior derecha, flota sola y, al escribir, baja a la punta del texto */
.carta-pluma { position: absolute; top: -46px; right: 2px; left: auto; width: 104px; height: auto; pointer-events: none; z-index: 3; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35)); animation: flota 3.4s ease-in-out infinite; transition: left 160ms linear, top 160ms linear; }
.carta-pluma.escribiendo { animation: none; transition: left 90ms linear, top 90ms linear; }
.carta-pluma.atenta { animation: garabatea 760ms ease-in-out infinite; }
@keyframes flota { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@keyframes garabatea { 0%, 100% { transform: translate(0, 0) rotate(-3deg); } 25% { transform: translate(-10px, 6px) rotate(2deg); } 50% { transform: translate(-4px, 12px) rotate(-2deg); } 75% { transform: translate(-14px, 4px) rotate(3deg); } }

/* Globo de "tu carta está lista": aparece sobre el sello cuando ya hay algo escrito */
.carta-lista { position: absolute; left: 50%; bottom: 150px; translate: -50% 0; z-index: 5; width: max-content; max-width: calc(100% - 28px); margin: 0; padding: 8px 16px; border-radius: 16px; background: #5B2D14; color: #FFF1C7; text-align: center; font-family: var(--letra); font-weight: 700; font-size: 1.4rem; line-height: 1.1; box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.6); animation: asoma 500ms var(--curva) both; }
.carta-lista::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; margin-left: -7px; background: #5B2D14; rotate: 45deg; }
.carta-lista[hidden], .carta-pluma.escribiendo ~ .carta-lista, .carta.sellada .carta-lista { display: none; }
.carta-pergamino[data-lista="1"] .carta-papel { padding-bottom: 210px; }
@keyframes asoma { from { opacity: 0; translate: -50% 10px; } to { opacity: 1; translate: -50% 0; } }
@media (min-width: 768px) { .carta-lista { bottom: 176px; font-size: 1.6rem; } .carta-pergamino[data-lista="1"] .carta-papel { padding-bottom: 240px; } }

/* Sello de cera roja: es el botón de enviar, abajo en el centro de la carta */
.carta-sellar { position: absolute; left: 50%; bottom: 20px; translate: -50% 0; z-index: 4; display: grid; justify-items: center; gap: 4px; padding: 6px 12px; border: 0; background: none; color: #5B2D14; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.carta-cera { position: relative; display: grid; place-items: center; width: 88px; height: 88px; border-radius: 48% 52% 50% 50% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 34% 26%, #EE6E78 0%, #C7242E 38%, #921219 78%, #6F0B11 100%);
  box-shadow: 0 7px 10px rgba(60, 0, 5, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.38), inset 0 -5px 9px rgba(40, 0, 0, 0.5); transition: scale 160ms var(--curva), filter 200ms; }
.carta-cera::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; border: 2px solid rgba(255, 196, 196, 0.45); box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.2); }
.carta-cera::after { content: ""; position: absolute; right: -7px; bottom: 8px; width: 22px; height: 17px; border-radius: 55% 45% 50% 50%; background: radial-gradient(circle at 35% 30%, #D03640, #8E1219); z-index: -1; }
.carta-cera svg { width: 48px; height: 48px; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35)) drop-shadow(0 -1px 1px rgba(60, 0, 5, 0.5)); }
.carta-sellar-texto { font-family: var(--letra); font-weight: 700; font-size: 1.6rem; line-height: 1; }
.carta-sellar:not([disabled]):hover .carta-cera { scale: 1.05; }
.carta-sellar:not([disabled]):active .carta-cera { scale: 0.93; }
.carta-sellar:not([disabled]) .carta-cera { animation: late 2.2s ease-in-out infinite; }
@keyframes late { 0%, 100% { box-shadow: 0 7px 10px rgba(60, 0, 5, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.38), inset 0 -5px 9px rgba(40, 0, 0, 0.5), 0 0 0 0 rgba(238, 110, 120, 0.5); } 50% { box-shadow: 0 7px 10px rgba(60, 0, 5, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.38), inset 0 -5px 9px rgba(40, 0, 0, 0.5), 0 0 0 12px rgba(238, 110, 120, 0); } }
.carta-sellar:focus-visible { outline: 3px solid #5B2D14; outline-offset: 2px; border-radius: 18px; }
.carta-sellar[disabled] { cursor: default; color: rgba(58, 35, 18, 0.55); }
.carta-sellar[disabled] .carta-cera { filter: saturate(0.55) brightness(0.8); }
/* Al sellar: el sello se aplasta sobre el papel y la carta se enrolla */
.carta.sellada .carta-sellar .carta-cera { filter: none; animation: sellazo 420ms var(--curva) both; }
.carta.sellada .carta-sellar-texto { opacity: 0; transition: opacity 200ms; }
@keyframes sellazo { 0% { scale: 1.9; opacity: 0.4; } 60% { scale: 0.9; opacity: 1; } 100% { scale: 1; } }
.carta.enrollada .carta-pergamino { transform: rotate(-2deg) scale(0.9, 0.3); transform-origin: 50% 0; }
.carta.enrollada .carta-panel { opacity: 0; transform: translateY(24px); transition: opacity 500ms ease, transform 500ms ease; pointer-events: none; }

/* ---------- Panel de controles: una sola tarjeta de vidrio ---------- */
.carta-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; width: 100%; }
.carta-vidrio { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; border-radius: 26px; color: var(--crema);
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 28px 44px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.carta-dictar { display: grid; justify-items: center; gap: 8px; text-align: center; }
.carta-mic { display: grid; justify-items: center; gap: 10px; padding: 0; border: 0; background: none; color: var(--crema); font: inherit; font-weight: 600; cursor: pointer; }
.carta-mic-boton { position: relative; display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%; color: var(--oro-claro); border: 2px solid var(--oro-claro);
  background: radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.1) 62%);
  box-shadow: 0 0 0 7px rgba(230, 196, 108, 0.18), 0 12px 24px -10px rgba(0, 0, 0, 0.7), inset 0 2px 7px rgba(255, 255, 255, 0.45); transition: scale 140ms var(--curva), background 200ms; }
.carta-mic-boton svg { width: 52px; height: 52px; }
.carta-mic:active .carta-mic-boton { scale: 0.94; }
.carta-mic:focus-visible .carta-mic-boton { outline: 3px solid var(--crema); outline-offset: 6px; }
.carta-mic[aria-pressed="true"] .carta-mic-boton { color: #fff; border-color: #FFB4A8; background: radial-gradient(circle at 32% 24%, #FF8A76 0%, #D8402F 58%, #8F1D12 100%); box-shadow: 0 12px 22px -10px rgba(0, 0, 0, 0.7), 0 0 0 10px rgba(255, 138, 122, 0.3); animation: late-mic 1.2s ease-in-out infinite; }
@keyframes late-mic { 50% { box-shadow: 0 12px 22px -10px rgba(0, 0, 0, 0.7), 0 0 0 16px rgba(255, 138, 122, 0.12); } }
.carta-mic-texto { font-size: 1rem; max-width: 18em; }
.carta-estado { margin: 0; min-height: 1.3em; font-size: 0.92rem; color: rgba(255, 253, 248, 0.85); }
.carta-estado.mal { color: #FFC2B8; font-weight: 600; }

.carta-escribir label, .carta-mensaje-caja label { display: block; margin: 0 0 6px; font-size: 0.88rem; font-weight: 600; color: rgba(255, 253, 248, 0.9); }
.carta-mensaje-caja label small { font-weight: 500; opacity: 0.8; }
.carta-fila { display: flex; gap: 8px; }
.carta input[type="text"] { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.45); background: rgba(255, 253, 248, 0.92); color: var(--verde); font: inherit; }
.carta input[type="text"]::placeholder { color: rgba(18, 64, 42, 0.55); }
.carta input[type="text"]:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; }
.carta-boton { flex: none; min-height: 48px; padding: 0 18px; border: 0; border-radius: 14px; background: var(--verde); color: var(--crema); font: inherit; font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(230, 196, 108, 0.6); }
.carta-boton:active { scale: 0.96; }
.carta-boton:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; }
.carta-boton-mic { width: 52px; padding: 0; font-size: 1.3rem; }
.carta-boton-mic[aria-pressed="true"] { background: #D8402F; }

/* Paleta de estampillas: barra de herramientas con desplazamiento lateral */
.carta-paleta-cabeza { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-bottom: 4px; }
.carta-paleta h2 { margin: 0; font-family: "IM Fell English", Georgia, serif; font-style: italic; font-weight: 400; font-size: 1.2rem; color: var(--oro-claro); }
.carta-ayuda { margin: 0; font-size: 0.85rem; color: rgba(255, 253, 248, 0.82); }
.carta-paleta-fila { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 18px; background: rgba(20, 10, 5, 0.32); border: 1px solid rgba(255, 255, 255, 0.2); }
.carta-bandeja { display: flex; flex: 1; min-width: 0; gap: 10px; padding: 6px 4px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
.carta-bandeja::-webkit-scrollbar { display: none; }
.carta-flecha { flex: none; display: grid; place-items: center; width: 36px; height: 44px; padding: 0 0 3px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, 0.16); color: var(--oro-claro); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.carta-flecha:hover { background: rgba(255, 255, 255, 0.28); }
.carta-flecha:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; }
.carta-sticker { position: relative; flex: none; width: 62px; height: 62px; padding: 4px; border: 2px solid rgba(255, 255, 255, 0.75); border-radius: 16px; background: #fff; cursor: pointer; scroll-snap-align: start; box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.5); transition: scale 140ms var(--curva), border-color 140ms, box-shadow 140ms; }
.carta-sticker img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.carta-sticker:hover { scale: 1.08; }
.carta-sticker:active { scale: 0.93; }
.carta-sticker:focus-visible { outline: 3px solid var(--oro-claro); outline-offset: 2px; }
.carta-sticker[aria-pressed="true"] { border-color: var(--oro-claro); box-shadow: 0 0 0 3px rgba(230, 196, 108, 0.6), 0 4px 8px -2px rgba(0, 0, 0, 0.5); background: #FFF8E1; }
.carta-sticker[aria-pressed="true"]::after { content: "✓"; position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--verde); color: var(--oro-claro); font-size: 0.8rem; font-weight: 700; }
.carta-sticker.sacude { animation: sacude 320ms ease; }
@keyframes sacude { 0%, 100% { translate: 0; } 25% { translate: -4px; } 75% { translate: 4px; } }

.carta-saltar { justify-self: center; padding: 10px 14px; color: var(--oro-claro); font-weight: 600; text-underline-offset: 3px; }
.carta-consentimiento { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 12px 14px; border-radius: 14px; cursor: pointer; font-size: 0.95rem; line-height: 1.4; font-weight: 600; color: #FFF8EC; background: rgba(255, 253, 248, 0.1); border: 1px solid rgba(230, 196, 108, 0.55); }
.carta-consentimiento input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: #E6C46C; cursor: pointer; }
.carta-consentimiento:has(input:focus-visible) { outline: 3px solid rgba(244, 223, 160, 0.85); outline-offset: 2px; }
.carta-consiento-nota[hidden] { display: none; }
.carta-consiento-nota { color: #F4DFA0; font-weight: 600; }
.carta-aviso { margin: 0; font-size: 0.8rem; line-height: 1.45; text-align: center; color: rgba(255, 253, 248, 0.78); }

/* Estampillas en vuelo y destellos de estrellitas */
.carta-efectos { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.carta-vuela { position: fixed; left: 0; top: 0; width: 62px; height: 62px; padding: 4px; border-radius: 10px; background: #fff; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5); will-change: transform; }
.carta-vuela img { display: block; width: 100%; height: 100%; object-fit: contain; }
.carta-destello { position: fixed; left: 0; top: 0; color: #FFE08A; font-size: 18px; line-height: 1; text-shadow: 0 0 8px rgba(255, 214, 90, 0.9); will-change: transform, opacity; }

/* Vuelo de la carta */
.carta-cine { position: fixed; inset: 0; z-index: 49; display: grid; background: #0B1030; }
.carta-cine[hidden] { display: none; }
.carta-cine video { width: 100%; height: 100%; object-fit: cover; }
.carta-cine-saltar { position: absolute; right: max(16px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); min-height: 48px; padding: 0 22px; border: 1px solid var(--oro-claro); border-radius: 999px; background: rgba(10, 28, 18, 0.7); color: var(--crema); font: inherit; font-weight: 700; cursor: pointer; }
.carta-vuelo { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; background: #0B1030; }
.carta-vuelo[hidden] { display: none; }
.carta-vuelo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: acerca 4.2s ease-out both; }
@keyframes acerca { from { opacity: 0; transform: scale(1.12); } 25% { opacity: 1; } to { opacity: 1; transform: scale(1); } }
.carta-vuelo-texto { position: relative; margin: 0 24px 96px; padding: 12px 20px; border-radius: 18px; background: rgba(10, 16, 48, 0.62); color: var(--oro-claro); text-align: center; font-family: "IM Fell English", Georgia, serif; font-style: italic; font-size: clamp(1.5rem, 6vw, 2.2rem); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); animation: aparece 800ms 600ms ease both; }
.carta-vuelo-saltar { position: absolute; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); translate: -50% 0; min-height: 48px; padding: 0 22px; border: 1px solid var(--oro-claro); border-radius: 999px; background: rgba(10, 28, 18, 0.7); color: var(--crema); font: inherit; font-weight: 700; cursor: pointer; }
@keyframes aparece { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

/* Escritorio (md): 60 % la carta, 40 % los controles */
@media (min-width: 768px) {
  .carta { padding: 0 32px 32px; }
  .carta-barra { max-width: 1280px; }
  .carta-escena { max-width: 1280px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 36px; align-items: start; }
  .carta-pergamino { margin-top: 40px; }
  .carta-papel { min-height: min(640px, calc(100dvh - 150px)); padding: 76px 48px 170px; }
  .carta-saludo { font-size: 3.4rem; }
  .carta-vacio, .carta-lineas li { font-size: 2.2rem; }
  .carta-lineas li { min-height: 56px; }
  .carta-mensaje { font-size: 2rem; }
  .carta-pluma { width: 138px; top: -58px; right: 18px; }
  .carta-cera { width: 100px; height: 100px; }
  .carta-cera svg { width: 54px; height: 54px; }
  .carta-estampilla { width: 66px; }
  .carta-estampilla img { height: 56px; }
  .carta-panel { position: sticky; top: 20px; margin-top: 40px; }
  .carta-vidrio { padding: 22px; }
}
@media (min-width: 1100px) { .carta-sticker { width: 66px; height: 66px; } }

@media (prefers-reduced-motion: reduce) {
  .carta-pluma, .carta-pluma.atenta { animation: none; }
  .carta-estampilla, .carta-vuelo img, .carta-vuelo-texto, .carta-estampilla.pegada, .carta-sellar:not([disabled]) .carta-cera, .carta-mic[aria-pressed="true"] .carta-mic-boton { animation: none; }
  .carta-pergamino, .carta.sellada .carta-cera { transition: none; }
}
html.ligero .carta-pluma, html.ligero .carta-estampilla, html.ligero .carta-vuelo img, html.ligero .carta-sellar .carta-cera { animation: none; }
html.ligero .carta-vidrio, html.ligero .carta-volver { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(40, 28, 22, 0.82); }
