/*** /mod/xmas/xmas.css ***/
/* xmas26 — HUD minimalista, fondo oscuro cinemático y mobile-first (100dvh + safe-area) */
:root {
    --az-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --az-font-title: 'Outfit', system-ui, -apple-system, sans-serif;
    --az-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

    --az-bg: #070d16;
    --az-surface: rgba(11, 20, 34, 0.90);
    --az-surface-pill: rgba(13, 24, 40, 0.72);
    --az-ink: #f8fafc;
    --az-ink-muted: #94a3b8;
    --az-border: rgba(255, 255, 255, 0.14);
    --az-border-warm: rgba(251, 191, 36, 0.28);

    --az-primary: #e11d48;
    --az-primary-2: #fbbf24;
    --az-danger: #fb7185;
    --az-shadow: 0 26px 64px rgba(0, 0, 0, 0.72);
    --az-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    background: radial-gradient(circle at 50% 34%, #152840 0%, #0b1524 54%, #050911 100%);
    font-family: var(--az-font);
    color: var(--az-ink);
    touch-action: none;
    -webkit-font-smoothing: antialiased;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    box-shadow: inset 0 0 140px rgba(2, 6, 14, 0.72);
}

.xm-root { position: fixed; inset: 0; width: 100%; height: 100%; }
.xm-stage { position: fixed; inset: 0; z-index: 1; }
.xm-stage canvas { display: block; width: 100%; height: 100%; }
.xm-hidden { display: none !important; }

.xm-pill {
    background: var(--az-surface-pill);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--az-border);
    box-shadow: var(--az-shadow-sm);
}

.xm-panel {
    background: var(--az-surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--az-border-warm);
    box-shadow: var(--az-shadow);
}

/* HUD Superior minimalista con soporte safe-area */
.xm-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) calc(18px + env(safe-area-inset-right, 0px)) 10px calc(18px + env(safe-area-inset-left, 0px));
}

.xm-brand, .xm-actions {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.xm-brand-text { min-width: 0; }

.xm-crest {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 48%, #e11d48 100%);
    border: 1px solid rgba(254, 243, 199, 0.35);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.25);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.xm-title {
    margin: 0;
    font-family: var(--az-font-title);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f8fafc;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.xm-progress {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    color: #cbd5e1;
    margin-top: 2px;
}

/* Botones táctiles cómodos (>= 40px) */
.xm-btn {
    appearance: none;
    border: 1px solid var(--az-border);
    background: var(--az-surface-pill);
    color: #f1f5f9;
    font-family: var(--az-font-title);
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease;
    text-decoration: none;
    white-space: nowrap;
}

.xm-btn:hover { border-color: rgba(251, 191, 36, 0.5); background: rgba(20, 34, 56, 0.9); color: #fff; }
.xm-btn:active { transform: scale(0.95); }

.xm-btn-icon { width: 40px; padding: 0; color: #fbbf24; }
.xm-btn-icon.is-muted { color: var(--az-ink-muted); }

.xm-count-pill {
    font-family: var(--az-font-mono);
    font-size: 11px; font-weight: 700;
    padding: 1px 6px; border-radius: 999px;
    background: rgba(251, 191, 36, 0.18); color: #fde68a;
}
.xm-count-pill.is-complete { background: rgba(16, 185, 129, 0.24); color: #6ee7b7; }

.xm-btn-primary {
    border: 0; min-height: 44px; padding: 10px 22px; border-radius: 13px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #f59e0b 0%, #e11d48 100%);
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.34);
}
.xm-btn-primary:hover { filter: brightness(1.08); color: #fff; }

.xm-btn-gold {
    border: 1px solid rgba(251, 191, 36, 0.38);
    color: #fef3c7; background: rgba(251, 191, 36, 0.16);
}
.xm-btn-gold:hover { background: rgba(251, 191, 36, 0.28); color: #fff; }

.xm-btn-ghost { background: rgba(255, 255, 255, 0.08); color: #e2e8f0; }
.xm-btn-ghost:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.xm-btn-ok { width: 100%; border: 0; background: #059669; color: #fff; font-weight: 700; }
.xm-btn-ok:hover { background: #10b981; color: #fff; }

/* Botones laterales simples ‹ / › sin tapar la carta */
.xm-side-btn {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}
.xm-side-btn:hover { background: rgba(24, 40, 64, 0.9); border-color: rgba(251, 191, 36, 0.55); color: #fde68a; }
.xm-side-btn:active { transform: translateY(-50%) scale(0.92); }
.xm-side-prev { left: calc(12px + env(safe-area-inset-left, 0px)); }
.xm-side-next { right: calc(12px + env(safe-area-inset-right, 0px)); }

/* Barra inferior ultracompacta */
.xm-nav {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex; align-items: center; gap: 8px;
    padding: 7px 9px;
    border-radius: 18px;
    max-width: calc(100vw - 24px);
}

/* Tarjeta de bienvenida / caja precintada */
.xm-welcome-backdrop {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(5, 10, 18, 0.72);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    padding: 18px;
    transition: opacity 0.3s ease;
}
.xm-welcome-backdrop.is-leaving { opacity: 0; pointer-events: none; }

.xm-welcome-card {
    width: 100%; max-width: 440px; border-radius: 24px;
    padding: 28px 24px 24px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 13px;
}

.xm-welcome-seal {
    width: 58px; height: 58px; border-radius: 16px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 48%, #e11d48 100%);
    border: 2px solid rgba(254, 243, 199, 0.4);
    box-shadow: 0 10px 26px rgba(225, 29, 72, 0.32);
    display: flex; align-items: center; justify-content: center;
    color: #fff; overflow: hidden;
}
.xm-welcome-seal.has-cover { width: 92px; height: 92px; background: #0f172a; }
.xm-welcome-seal img { width: 100%; height: 100%; object-fit: cover; display: block; }

.xm-welcome-kicker { font-family: var(--az-font-title); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #fbbf24; }
.xm-welcome-title { margin: 0; font-family: var(--az-font-title); font-size: 25px; font-weight: 800; color: #fff; line-height: 1.2; }
.xm-welcome-ded { margin: 0; font-size: 14.5px; line-height: 1.55; color: #cbd5e1; max-width: 350px; white-space: pre-line; }
.xm-welcome-meta { font-size: 12px; font-weight: 600; color: #fde68a; background: rgba(251, 191, 36, 0.12); border: 1px solid rgba(251, 191, 36, 0.22); padding: 5px 14px; border-radius: 999px; }
.xm-welcome-cta { padding: 12px 26px; font-size: 14px; }
.xm-welcome-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.xm-lock-pill { font-size: 12px; font-weight: 700; color: #fecdd3; background: rgba(225, 29, 72, 0.22); border: 1px solid rgba(244, 63, 94, 0.42); padding: 6px 14px; border-radius: 999px; }

/* Modal Álbum */
.xm-backdrop {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(3, 7, 16, 0.86);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
}

.xm-album { width: 100%; max-width: 1040px; max-height: 100%; border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; }
.xm-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--az-border); }
.xm-modal-head h2 { margin: 0; font-family: var(--az-font-title); font-size: 18px; font-weight: 800; color: #fff; }
.xm-modal-head p { margin: 2px 0 0; font-size: 12px; color: var(--az-ink-muted); }
.xm-modal-head-actions { display: flex; align-items: center; gap: 8px; }

.xm-chapter-bar { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--az-border); overflow-x: auto; background: rgba(255, 255, 255, 0.03); flex-shrink: 0; -webkit-overflow-scrolling: touch; }
.xm-chapter-chip { appearance: none; border: 1px solid var(--az-border); background: rgba(255, 255, 255, 0.05); color: #cbd5e1; font-family: var(--az-font-title); font-size: 12px; font-weight: 600; min-height: 34px; padding: 6px 13px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.xm-chapter-chip.is-active { background: linear-gradient(135deg, #f59e0b 0%, #e11d48 100%); border-color: transparent; color: #fff; }

.xm-album-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 22px; }
.xm-chapter-sec { display: flex; flex-direction: column; gap: 12px; }
.xm-chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--az-border); padding-bottom: 6px; }
.xm-chapter-title { margin: 0; font-family: var(--az-font-title); font-size: 15px; font-weight: 700; color: #f8fafc; }
.xm-chapter-sub { font-size: 12px; color: var(--az-ink-muted); margin: 2px 0 0; }
.xm-chapter-prog { font-size: 11.5px; font-weight: 700; color: #fbbf24; white-space: nowrap; }

.xm-album-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.xm-album-card { cursor: pointer; border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--az-border); padding: 7px; display: flex; flex-direction: column; gap: 7px; transition: border-color 0.18s ease, transform 0.18s ease; }
.xm-album-card:hover { border-color: rgba(251, 191, 36, 0.55); transform: translateY(-2px); }
.xm-album-card img { width: 100%; aspect-ratio: 512 / 716; object-fit: cover; border-radius: 11px; display: block; background: #0f172a; }
.xm-album-card.is-locked { cursor: default; background: rgba(255, 255, 255, 0.025); border: 1.5px dashed rgba(255, 255, 255, 0.16); }
.xm-album-card.is-locked:hover { transform: none; border-color: rgba(255, 255, 255, 0.16); }
.xm-locked-art { width: 100%; aspect-ratio: 512 / 716; border-radius: 11px; background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.06) 10px, rgba(255,255,255,0.06) 20px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--az-ink-muted); }
.xm-locked-seal { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(251, 191, 36, 0.35); display: flex; align-items: center; justify-content: center; color: #fbbf24; background: rgba(251, 191, 36, 0.08); }
.xm-locked-num { font-family: var(--az-font-mono); font-size: 11px; font-weight: 600; }
.xm-album-meta { padding: 0 3px 2px; }
.xm-album-rarity { font-family: var(--az-font-title); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.xm-album-title { font-size: 12px; font-weight: 600; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

/* Lightbox */
.xm-lightbox { z-index: 50; background: rgba(2, 6, 14, 0.92); }
.xm-lightbox-body { width: 100%; max-width: 390px; max-height: 100%; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 18px; border-radius: 22px; }
.xm-lightbox-img { width: 100%; border-radius: 16px; box-shadow: 0 18px 46px rgba(0, 0, 0, 0.72); border: 1px solid var(--az-border-warm); }
.xm-card-rarity { font-family: var(--az-font-title); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.16em; }
.xm-lightbox-meta { font-family: var(--az-font-title); font-size: 11px; font-weight: 700; color: var(--az-ink-muted); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; }
.xm-lightbox-title { margin: 4px 0 0; font-family: var(--az-font-title); font-size: 19px; font-weight: 800; color: #fff; }
.xm-lightbox-omen { margin: 6px 0 0; font-size: 14px; color: #fde68a; line-height: 1.5; }
.xm-lightbox-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }

/* Panel lateral Dev */
.xm-drawer { position: fixed; top: 14px; right: 14px; bottom: 14px; width: min(370px, calc(100vw - 28px)); z-index: 30; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; transform: translateX(calc(100% + 28px)); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.xm-drawer.is-open { transform: translateX(0); }
.xm-drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.xm-sec { display: flex; flex-direction: column; gap: 10px; }
.xm-sec h3 { margin: 0; font-family: var(--az-font-title); font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: #fbbf24; }
.xm-sec p { margin: 0; font-size: 12px; color: var(--az-ink-muted); line-height: 1.5; }
.xm-sec-head { display: flex; align-items: center; justify-content: space-between; }
.xm-link { background: none; border: 0; padding: 0; color: #7dd3fc; font-size: 11px; font-weight: 600; text-decoration: underline; cursor: pointer; }
.xm-hr { border: 0; border-top: 1px solid var(--az-border); margin: 0; }
.xm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xm-file-btn { cursor: pointer; min-height: 40px; padding: 9px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.36); color: #fde68a; }
.xm-file-btn.is-secondary { background: rgba(255, 255, 255, 0.06); border-color: var(--az-border); color: #e2e8f0; }
.xm-file-btn input { display: none; }
.xm-textarea { width: 100%; min-height: 140px; resize: vertical; background: rgba(2, 6, 18, 0.9); border: 1px solid var(--az-border); border-radius: 12px; padding: 10px 12px; font-family: var(--az-font-mono); font-size: 12px; line-height: 1.5; color: #6ee7b7; outline: none; user-select: text; -webkit-user-select: text; }
.xm-err { font-size: 11px; color: var(--az-danger); background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.32); border-radius: 10px; padding: 8px 10px; }
.xm-range-row { display: flex; flex-direction: column; gap: 5px; }
.xm-range-label { display: flex; justify-content: space-between; font-size: 12px; color: #cbd5e1; }
.xm-range-val { font-family: var(--az-font-mono); color: #fbbf24; font-weight: 600; }
input[type="range"].xm-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: rgba(255, 255, 255, 0.16); border-radius: 999px; outline: none; }
input[type="range"].xm-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fbbf24; cursor: pointer; }

/* Toast */
.xm-toast { position: fixed; top: calc(68px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -8px); z-index: 60; padding: 9px 16px; border-radius: 12px; font-size: 12.5px; font-weight: 600; color: #fef3c7; max-width: calc(100vw - 32px); text-align: center; opacity: 0; pointer-events: none; transition: opacity 0.22s ease, transform 0.22s ease; }
.xm-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.xm-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.xm-scroll::-webkit-scrollbar-thumb { background: rgba(251, 191, 36, 0.28); border-radius: 999px; }

@media (max-width: 900px) {
    .xm-album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .xm-hide-xs { display: none; }
    .xm-header { padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 8px; }
    .xm-title { font-size: 14px; }
    .xm-crest { width: 32px; height: 32px; }
    .xm-side-btn { width: 42px; height: 42px; }
    .xm-side-prev { left: 8px; }
    .xm-side-next { right: 8px; }
    .xm-album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .xm-album-body { padding: 12px; }
    .xm-welcome-card { padding: 24px 18px 20px; }
    .xm-welcome-title { font-size: 21px; }
}

