/* ============================================================
   OLIMAR — ZOOM-01 · el visor de ampliación de la figurita (oli-zoom.js) y la lupa que lo abre.
   Vive por encima de la apertura (.alb-open z 120) y de la ficha (.alb-sheet z 110). El fondo es el estadio
   apagado con desenfoque; los controles son vidrio con filete de oro, como el resto de los objetos del Álbum.
   ============================================================ */

/* ---- la lupa: un botón redondo apoyado en la esquina de la carta, nunca hijo de la carta ---- */
.oz-lupa { position: absolute; right: -8px; bottom: -8px; z-index: 12; width: 42px; height: 42px; padding: 0; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer; color: var(--gold-2);
    background: linear-gradient(180deg, rgba(24,42,92,.96), rgba(9,22,56,.96));
    border: 1px solid rgba(255,194,51,.55);
    box-shadow: 0 10px 24px -10px rgba(0,0,0,.85), 0 0 0 3px rgba(6,15,40,.55), var(--inlight);
    font-size: 1.05rem; line-height: 1; -webkit-tap-highlight-color: transparent;
    animation: oz-lupa-in .34s var(--ease-out) .32s both; }
.oz-lupa:hover { color: var(--gold); border-color: var(--gold); }
.oz-lupa:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.oz-lupa:active { transform: scale(.94); }
/* la carta de la MANO en la apertura: #albHand es la caja de la carta (absoluta, ancho --cw) */
#albOpen .alb-scene__hand > .oz-lupa { right: -10px; bottom: 18px; }
/* la carta de la FICHA: con el dorso a la vista la lupa se retira (no hay foto que ampliar) */
.alb-detail__card > .oz-lupa { right: -6px; bottom: -6px; }
.alb-detail__card .alb-dflip.is-back ~ .oz-lupa { opacity: 0; pointer-events: none; transition: opacity var(--mo) var(--ease-out); }
.alb-detail__card.is-tilt > .oz-lupa { transform: none; }
@keyframes oz-lupa-in { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
html.rm8 .oz-lupa { animation: none; }

/* ---- el visor ---- */
.oz { position: fixed; inset: 0; z-index: 130; display: block; --oz-velo: 1;
    background: rgba(3,8,24,calc(.94 * var(--oz-velo)));
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    opacity: 0; transition: opacity var(--mo-slow) var(--ease-out);
    touch-action: none; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
.oz[hidden] { display: none !important; }
.oz.is-open { opacity: 1; }
.oz:focus { outline: none; }

.oz__stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: default; -webkit-touch-callout: none; }
.oz.is-zoom .oz__stage { cursor: grab; }
.oz.is-drag.is-zoom .oz__stage { cursor: grabbing; }
.oz__img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; transform-origin: 0 0; will-change: transform;
    pointer-events: none; -webkit-user-drag: none; user-select: none; opacity: 0;
    border-radius: 6px; background: #02060f; box-shadow: 0 40px 90px -30px rgba(0,0,0,.95), 0 0 0 1px rgba(151,177,232,.18); }
.oz.is-ready .oz__img { opacity: 1; }
.oz.is-anim .oz__img { transition: transform 220ms var(--ease-out); }
html.rm8 .oz.is-anim .oz__img { transition: none; }
/* cargando: una pelota que gira (misma pieza del cargador del estadio, en chico) */
.oz.is-loading .oz__stage::after { content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border-radius: 50%; border: 3px solid rgba(255,194,51,.25); border-top-color: var(--gold); animation: oz-spin .8s linear infinite; }
@keyframes oz-spin { to { transform: rotate(360deg); } }
.oz.is-error .oz__stage::before { content: "No se pudo cargar la imagen"; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
    color: var(--tx-2); font-weight: 700; font-size: var(--fs-body); }

/* ---- el HUD: arriba el nombre y el cierre, abajo los controles. Respetan el área segura del iPhone ---- */
.oz__hud { position: absolute; left: 0; right: 0; display: flex; align-items: center; gap: 12px; pointer-events: none;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.oz__hud > * { pointer-events: auto; }
.oz__hud--top { top: 0; padding-top: calc(env(safe-area-inset-top, 0px) + 12px); padding-bottom: 28px; justify-content: space-between;
    background: linear-gradient(180deg, rgba(3,8,24,.75), rgba(3,8,24,0)); }
.oz__hud--bottom { bottom: 0; flex-direction: column; gap: 10px; padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); padding-top: 28px;
    background: linear-gradient(0deg, rgba(3,8,24,.8), rgba(3,8,24,0)); }
.oz__cap { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.oz__t { font-family: var(--disp); font-size: var(--fs-card-title); letter-spacing: .03em; text-transform: uppercase; color: var(--tx);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.oz__dims { font-size: var(--fs-label); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); }
.oz__btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
    color: var(--tx); font-size: 1.05rem; line-height: 1;
    background: rgba(17,36,79,.78); border: 1px solid var(--line-2); box-shadow: var(--sh), var(--inlight);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.oz__btn:hover { background: rgba(22,41,92,.95); border-color: rgba(255,194,51,.5); color: var(--gold-2); }
.oz__btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.oz__ctl { display: inline-flex; align-items: center; gap: 8px; padding: 4px; border-radius: 999px;
    background: rgba(6,15,40,.6); border: 1px solid var(--line); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.oz__pct { min-width: 64px; height: 36px; padding: 0 10px; border-radius: 999px; border: none; background: transparent; cursor: pointer;
    font-family: var(--disp); font-size: 1rem; letter-spacing: .04em; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.oz__pct:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.oz__hint { font-size: var(--fs-body-sm); color: var(--tx-3); text-align: center; max-width: 92vw; }
.oz__nota { font-size: var(--fs-label); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-2);
    padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255,194,51,.35); background: rgba(255,194,51,.08); }
.oz__nota[hidden] { display: none; }
/* el aviso de la ampliación se esconde al tocar: se lee una vez y deja ver la foto */
.oz.is-zoom .oz__hint { opacity: 0; transition: opacity var(--mo) var(--ease-out); }

@media (min-width: 1024px) {
    .oz__hud--top { padding-top: 20px; }
    .oz__hud--bottom { padding-bottom: 22px; }
    .oz__t { font-size: var(--fs-section-title); }
}
