/* Alerta en la Ciudad — base: colores, tipografía, marco de teléfono en computadora, botones, escena, alerta, interfaz
   del vuelo (contador, guía al siguiente globo, pista, joystick), "¡A la fiesta!", "¡cumple!", final y vitrina. Todo
   cuelga de html.ac (la página del prototipo). Por dentro todo se mide contra el marco (.app es un contenedor de
   tamaño: cqw/cqh), nunca contra la ventana. */
.ac {
  --ink: #10173A; --ink-2: #33406E; --azul: #1F2A5C; --azul-m: #2E4FA8; --cielo: #4FA3F0; --crema: #FFF6E6; --papel: #FFFBF3;
  --rojo: #FF4D3D; --rojo-d: #D6302A; --oro: #FFC21A; --oro-l: #FFE58A; --verde: #2FA866; --wa: #25D366;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --f-display: "Lilita One", "Nunito", system-ui, sans-serif; --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.ac *, .ac *::before, .ac *::after { box-sizing: border-box; }
.ac body { margin: 0; font-family: var(--f-body); color: var(--ink); overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
.ac button { font: inherit; color: inherit; }
.ac :focus-visible { outline: 3px solid #FFC21A; outline-offset: 3px; }
.ac .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ac .noscript { margin: 24px; font: 800 18px/1.5 var(--f-body); color: var(--ink); background: var(--crema); padding: 16px; border-radius: 12px; }

/* ---------- marco ---------- */
.ac .fondo { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, #4FA3F0 0%, #8EC8F5 45%, #FFD9B0 72%, #6F9E5C 72.2%, #4E7F44 100%); }
.ac .fondo::before { content: ""; position: absolute; left: 0; right: 0; bottom: 27.8%; height: 34%; background:
  linear-gradient(#2E4FA8, #2E4FA8) 6% 100% / 5% 70% no-repeat, linear-gradient(#3D6FD6, #3D6FD6) 13% 100% / 6% 100% no-repeat,
  linear-gradient(#FF8A5C, #FF8A5C) 22% 100% / 5% 55% no-repeat, linear-gradient(#2E4FA8, #2E4FA8) 78% 100% / 6% 90% no-repeat,
  linear-gradient(#FFC860, #FFC860) 86% 100% / 5% 60% no-repeat, linear-gradient(#3D6FD6, #3D6FD6) 93% 100% / 5% 80% no-repeat; filter: blur(14px); opacity: .8; }
.ac .app { position: fixed; inset: 0; z-index: 1; overflow: hidden; isolation: isolate; container-type: size; container-name: marco; background: #8EC8F5; transition: opacity .5s ease; }
/* computadora y tableta: el mismo marco de teléfono que los demás diseños, con la ciudad difuminada alrededor */
@media (min-width: 560px) and (min-height: 560px) {
  .ac .app { inset: auto; left: 50%; top: 50%; width: min(430px, 100vw - 32px); height: min(932px, 100dvh - 40px); transform: translate(-50%, -50%); border-radius: 36px;
    box-shadow: 0 0 0 3px var(--oro), 0 0 0 6px var(--ink), 0 30px 90px rgba(10, 15, 40, .45); }
}
.ac:not(.is-showcase) .fondo { filter: blur(6px); }
.ac.is-showcase .fondo { display: none; }
.ac.is-showcase .app { inset: 0 !important; width: auto !important; height: auto !important; transform: none !important; border-radius: 0 !important; box-shadow: none !important; }
.ac .stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ac .gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s ease; }
.ac .gl.is-on { opacity: 1; }
.ac .sin-gl .stage { background: url("../assets/poster/fondo-alerta.webp") center / cover no-repeat, linear-gradient(180deg, #4FA3F0 0%, #8EC8F5 50%, #FFD9B0 72%, #6F9E5C 72.2%); }
.ac .stage.is-tiembla { animation: ac-tiembla .45s linear; }
@keyframes ac-tiembla { 15%, 55% { transform: translate(-3px, 2px); } 35%, 75% { transform: translate(3px, -2px); } }
.ac .ui { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.ac .ui > * { pointer-events: auto; }

/* ---------- botones ---------- */
.ac .gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border: 3px solid var(--ink); border-radius: 16px; background: var(--crema); color: var(--ink);
  font: 900 16px/1.15 var(--f-body); text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s; touch-action: manipulation; user-select: none;
}
.ac .gbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ac .gbtn.is-primary { background: var(--rojo-d); color: #fff; }
.ac .gbtn.is-oro { background: var(--oro); }
.ac .gbtn.is-wa { background: var(--wa); color: #06301A; }
.ac .gbtn.is-small { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 13px; box-shadow: 0 3px 0 var(--ink); }
.ac .gbtn.is-big { min-height: 56px; font-size: 18px; border-radius: 18px; }
.ac .gbtn.is-block { width: 100%; }
.ac .gbtn .bi { display: inline-flex; }
.ac .icon-btn { display: inline-grid; place-items: center; width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 50%; background: rgba(255, 246, 230, .96); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); padding: 0; }
.ac .icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.ac .nb-link { border: 0; background: none; padding: 10px 6px; min-height: 44px; font: 900 15px var(--f-body); color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- HUD ---------- */
.ac .hud { position: absolute; left: 10px; right: 10px; top: calc(var(--safe-t) + 10px); display: flex; align-items: center; justify-content: space-between; gap: 8px; pointer-events: none; }
.ac .hud > * { pointer-events: auto; }
.ac .contador { margin: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border: 3px solid var(--ink); border-radius: 999px; background: var(--oro); font: 400 20px/1 var(--f-display); letter-spacing: .02em; box-shadow: 0 3px 0 var(--ink); }
.ac .contador-ic { display: inline-flex; }
.ac .contador.is-pop { animation: ac-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ac-pop { 40% { transform: scale(1.25); } }
.ac .hud.is-intro .contador, .ac [data-fase="picada"] .contador, .ac [data-fase="cumple"] .contador, .ac [data-fase="final"] .contador { visibility: hidden; }
.ac [data-fase="picada"] .hud-datos, .ac [data-fase="cumple"] .hud-datos, .ac [data-fase="despegue"] .hud-datos { visibility: hidden; }

/* ---------- avisos ---------- */
.ac .toast { position: absolute; left: 50%; top: calc(var(--safe-t) + 74px); transform: translateX(-50%); max-width: 88cqw; padding: 12px 18px; border-radius: 14px; border: 3px solid var(--ink); background: var(--oro); color: var(--ink); font: 900 16px var(--f-body); box-shadow: 0 4px 0 var(--ink); z-index: 60; text-align: center; }
.ac .toast.is-out { opacity: 0; transition: opacity .3s; }
.ac .dbg-sensor { position: absolute; left: 8px; right: 124px; top: calc(var(--safe-t) + 66px); margin: 0; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, .62); color: #DFFFE9; font: 10.5px/1.35 ui-monospace, monospace; white-space: pre-wrap; z-index: 80; pointer-events: none; }
.ac .dbg-fps { position: absolute; left: 8px; bottom: calc(var(--safe-b) + 6px); margin: 0; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); color: #fff; font: 12px ui-monospace, monospace; z-index: 80; pointer-events: none; }

/* ---------- ALERTA ---------- */
.ac .intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 70px) 16px calc(var(--safe-b) + 20px); text-align: center; pointer-events: none; transition: opacity .45s ease; }
.ac .intro > * { pointer-events: auto; }
.ac .intro.is-out { opacity: 0; pointer-events: none; }
.ac .alerta-flash { position: absolute; inset: 0; pointer-events: none !important; background: radial-gradient(120% 90% at 50% 40%, rgba(255, 77, 61, 0) 35%, rgba(255, 50, 40, .55) 100%); opacity: 0; animation: ac-rojo 1.1s ease-in-out 3 .2s; will-change: opacity; }
@keyframes ac-rojo { 50% { opacity: 1; } }
.ac .intro-caja { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 380px); padding: 14px 16px 16px; border: 3px solid var(--ink); border-radius: 22px; background: rgba(255, 251, 243, .95); box-shadow: 0 6px 0 var(--ink); animation: ac-entra .55s .25s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes ac-entra { from { opacity: 0; transform: translateY(-18px) scale(.9); } }
.ac .intro-alerta { margin: -38px 0 0; display: flex; align-items: center; gap: 10px; padding: 6px 18px; border: 3px solid var(--ink); border-radius: 14px; background: var(--rojo); color: #fff; font: 400 clamp(30px, 11cqw, 42px)/1 var(--f-display); letter-spacing: .04em; text-shadow: 0 3px 0 var(--rojo-d); box-shadow: 0 4px 0 var(--ink); animation: ac-latido .55s ease-in-out 6 .2s alternate; }
@keyframes ac-latido { to { transform: scale(1.06); } }
.ac .ia-luz { width: 14px; height: 14px; border-radius: 50%; background: var(--oro); border: 2px solid var(--ink); box-shadow: 0 0 10px 2px rgba(255, 194, 26, .8); animation: ac-luz .55s steps(1) 6 .2s alternate; }
@keyframes ac-luz { 50% { background: #fff; } }
.ac .intro-msg { margin: 2px 0 0; font: 400 clamp(22px, 7.2cqw, 28px)/1.15 var(--f-display); color: var(--azul); }
.ac .intro-sub { margin: 0; font: 800 16px/1.35 var(--f-body); color: var(--ink-2); }
.ac .intro-acciones { display: flex; flex-direction: column; align-items: center; gap: 2px; width: min(100%, 360px); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.ac .gbtn.is-volar { width: 100%; min-height: 76px; border-radius: 24px; font: 400 34px/1 var(--f-display); letter-spacing: .03em; color: #fff; text-shadow: 0 3px 0 var(--rojo-d);
  background: linear-gradient(180deg, #FF6A55, var(--rojo) 55%, var(--rojo-d)); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink), 0 0 0 4px var(--oro); animation: ac-boton 1.6s ease-in-out infinite; }
.ac .gbtn.is-volar .bi { color: var(--oro); filter: drop-shadow(0 2px 0 var(--ink)); }
.ac .gbtn.is-volar:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink), 0 0 0 4px var(--oro); }
@keyframes ac-boton { 50% { transform: scale(1.035); } }

/* ---------- vuelo: guía al siguiente globo, pista y joystick ---------- */
.ac .guia, .ac .marca { position: absolute; left: 0; top: 0; pointer-events: none !important; opacity: 0; transition: opacity .25s; will-change: transform; }
.ac .guia.is-on, .ac .marca.is-on { opacity: 1; }
.ac .guia-flecha { position: absolute; left: -24px; top: -24px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--oro); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 0 16px 4px rgba(255, 194, 26, .6); }
.ac .guia-d, .ac .marca-d { position: absolute; left: 50%; top: 28px; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: rgba(16, 23, 58, .78); color: #fff; font: 900 13px var(--f-body); white-space: nowrap; }
.ac .marca-anillo { position: absolute; left: -26px; top: -26px; width: 52px; height: 52px; border-radius: 50%; border: 3px dashed var(--oro); box-shadow: 0 0 0 2px rgba(16, 23, 58, .5); animation: ac-gira 4s linear infinite; }
@keyframes ac-gira { to { transform: rotate(1turn); } }
.ac .marca-d { top: 32px; }
.ac .pista { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 22px); transform: translateX(-50%); width: max-content; max-width: 90cqw; margin: 0; padding: 10px 16px; border: 3px solid var(--ink); border-radius: 16px; background: rgba(255, 251, 243, .95); font: 900 16px/1.3 var(--f-body); text-align: center; box-shadow: 0 4px 0 var(--ink); opacity: 0; transition: opacity .4s; pointer-events: none !important; }
.ac .pista.is-on { opacity: 1; }
.ac .joystick { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none !important; opacity: 0; transition: opacity .15s; }
.ac .joystick.is-on { opacity: 1; }
.ac .joystick::before { content: ""; position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .85); background: rgba(16, 23, 58, .25); }
/* control: recalibrar el sensor y cambiar a dedo ⇄ sensor (discretos, bajo el botón de datos) */
.ac .ctl { position: absolute; right: 10px; top: calc(var(--safe-t) + 66px); display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ac .ctl[hidden], .ac .ctl-btn[hidden] { display: none; }
.ac .ctl-btn { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 4px 11px 4px 8px; border: 2px solid var(--ink); border-radius: 999px; background: rgba(255, 251, 243, .88); color: var(--ink); font: 900 13px/1 var(--f-body); box-shadow: 0 2px 0 var(--ink); cursor: pointer; }
.ac .ctl-btn:active { transform: translateY(2px); box-shadow: none; }
.ac .ctl-btn .bi { display: inline-flex; }
.ac [data-fase="picada"] .ctl, .ac .con-tarjeta .ctl { visibility: hidden; }
.ac .joystick-perilla { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; border-radius: 50%; background: var(--oro); border: 3px solid var(--ink); transform: translate(var(--dx, 0), var(--dy, 0)); }

/* ---------- ¡A la fiesta! ---------- */
.ac .grito { position: absolute; left: 0; right: 0; top: 30%; margin: 0; text-align: center; font: 400 clamp(40px, 13cqw, 56px)/1 var(--f-display); color: var(--oro); -webkit-text-stroke: 2px var(--ink); filter: drop-shadow(0 5px 0 var(--ink)); pointer-events: none !important; animation: ac-grito 2.2s ease both; }
@keyframes ac-grito { 0% { opacity: 0; transform: scale(.5); } 15% { opacity: 1; transform: scale(1.1); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }

/* ---------- ¡cumple! ---------- */
.ac .cumple { position: absolute; left: 0; right: 0; top: 21cqh; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px; text-align: center; pointer-events: none !important; animation: ac-entra .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.ac .cumple-t { margin: 0; text-wrap: balance; font: 400 clamp(36px, 11.5cqw, 52px)/1 var(--f-display); color: var(--oro); -webkit-text-stroke: 2px var(--ink); filter: drop-shadow(0 5px 0 var(--ink)); }
.ac .cumple-s { margin: 0; padding: 6px 14px; border-radius: 12px; background: var(--crema); border: 3px solid var(--ink); font: 900 16px/1.3 var(--f-body); box-shadow: 0 3px 0 var(--ink); }
.ac .confeti { position: absolute; inset: 0; overflow: hidden; pointer-events: none !important; }
.ac .confeti i { position: absolute; top: -20px; left: var(--x); width: 11px; height: 17px; border-radius: 3px; background: var(--c); transform: rotate(var(--r)); animation: ac-confeti 3.2s var(--d) cubic-bezier(.3, .2, .5, 1) both; }
@keyframes ac-confeti { to { transform: translate(30px, 110cqh) rotate(calc(var(--r) + 720deg)); } }

/* ---------- final: resumen, lugar y confirmación ---------- */
.ac .fin { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 10px); max-height: 62cqh; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 12px 4px; border: 3px solid var(--ink); border-radius: 24px; background: rgba(255, 251, 243, .97); box-shadow: 0 6px 0 var(--ink), 0 18px 40px rgba(16, 23, 58, .35); text-align: center; animation: ac-sube .6s .1s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes ac-sube { from { opacity: 0; transform: translateY(40px); } }
.ac .fin-k { margin: 0; font: 900 13px var(--f-body); text-transform: uppercase; letter-spacing: .08em; color: var(--rojo-d); }
.ac .fin-t { margin: -2px 0 0; font: 400 clamp(28px, 9cqw, 36px)/1 var(--f-display); color: var(--azul); }
.ac .fin-linea { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; column-gap: 12px; margin: -2px 0 0; font: 900 16px/1.3 var(--f-body); color: var(--ink-2); }
.ac .fin-lugar .bi { display: inline-flex; flex: none; }
.ac .fin-lugar { border: 2px solid #E8DCC4; border-radius: 16px; padding: 2px 10px; background: #fff; text-align: left; }
.ac .fin-lugar[open] { padding-bottom: 10px; }
.ac .fin-lugar summary { display: flex; align-items: center; gap: 6px; min-height: 36px; font: 900 16px var(--f-body); cursor: pointer; list-style: none; }
.ac .fin-lugar summary::-webkit-details-marker { display: none; }
.ac .fin-vermapa { margin-left: auto; padding: 2px 10px; border-radius: 999px; background: var(--azul-m); color: #fff; font: 900 13px var(--f-body); }
.ac .fin-lugar[open] .fin-vermapa { display: none; }
.ac .fin-lugar .mapa { margin-top: 4px; }
.ac .fin-salon { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac .fin-lugar .lugar-dir { margin: 6px 0; }
.ac .fin .cf-deadline { margin: -2px 0 0; }
.ac .fin-links { display: flex; justify-content: center; gap: 18px; margin-top: -4px; }
.ac .fin-links .nb-link { min-height: 40px; padding: 6px 4px; color: var(--azul-m); }

/* ---------- vitrina ---------- */
.ac .is-vitrina .ui > :not(.vitrina-t) { display: none; }
.ac .vitrina-t { position: absolute; left: 0; right: 0; top: 6%; margin: 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.ac .vitrina-t span { font: 400 clamp(32px, 6.5cqw, 74px)/1 var(--f-display); color: #fff; -webkit-text-stroke: 2px var(--ink); filter: drop-shadow(0 4px 0 var(--ink)); }
.ac .vitrina-t small { padding: 4px 16px; border-radius: 999px; background: var(--oro); border: 3px solid var(--ink); font: 400 clamp(17px, 2.8cqw, 30px)/1.2 var(--f-display); }

@media (prefers-reduced-motion: reduce) {
  .ac *, .ac *::before, .ac *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; }
}
.ac.rm *, .ac.rm *::before, .ac.rm *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
