/* ============================================================
   ZONA ARCADE — sistema visual
   ------------------------------------------------------------
   Tema oscuro inmersivo dentro del layout claro del SIS.
   No depende de Tailwind: todas las utilidades viven aquí.

   Principio: el color de cada juego es un ACENTO (halo, borde,
   icono), nunca un bloque plano. Así los 19 juegos conviven en
   la misma pantalla sin cansar la vista.

   Cada tarjeta/sala recibe su color por las variables --c,
   --c-soft y --c-glow desde el Blade.
   ============================================================ */

.arcade {
    /* Superficies Modo Claro (por defecto) */
    --a-bg: #f8fafc;
    --a-panel: #ffffff;
    --a-panel-shadow: 0 4px 20px -2px rgba(15, 23, 42, .05), 0 2px 6px -1px rgba(15, 23, 42, .03);
    --a-line: rgba(15, 23, 42, .08);
    --a-line-2: rgba(15, 23, 42, .14);

    /* Texto Modo Claro */
    --a-text: #0f172a;
    --a-dim: #475569;
    --a-muted: #64748b;

    /* Acentos del sistema */
    --a-accent: #6366f1;
    --a-accent-2: #0891b2;
    --a-gold: #d97706;

    --a-card-bg: #ffffff;
    --a-card-shadow: 0 4px 18px -4px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
    --a-card-hover-shadow: 0 20px 40px -15px rgba(15, 23, 42, .14), 0 8px 30px -10px var(--c-glow);
    --a-aurora-opacity: .45;
    --a-dots-color: rgba(15, 23, 42, .05);
    --a-ring-bg: radial-gradient(circle at 50% 30%, #ffffff, #f1f5f9 70%);
    --a-title-gradient: linear-gradient(120deg, #0f172a 20%, #4338ca 65%, #0284c7 100%);
    --a-result-gradient: linear-gradient(180deg, #0f172a, #475569);
    --a-toast-bg: #ffffff;
    --a-glass-edge: linear-gradient(90deg, transparent, rgba(15, 23, 42, .08), transparent);

    --a-cat-brightness: 0.85;
    --a-go-brightness: 0.85;

    --a-r: 20px;
    --a-r-sm: 13px;
    --c: var(--a-accent);
    --c-soft: rgba(99, 102, 241, .12);
    --c-glow: rgba(99, 102, 241, .4);

    position: relative;
    min-height: calc(100vh - 60px);
    padding: 30px 22px 70px;
    /* !important: core.css también pinta este div y todo lo que herede de él */
    color: var(--a-text) !important;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    background: var(--a-bg);
    overflow: hidden;
    transition: background-color .25s ease, color .25s ease;
}

/* Modo Oscuro (se activa si html tiene mode-dark, dark o theme-masculine) */
html.mode-dark .arcade,
html.dark .arcade,
html.theme-masculine .arcade {
    --a-bg: #070a12;
    --a-panel: rgba(255, 255, 255, .045);
    --a-panel-shadow: none;
    --a-line: rgba(255, 255, 255, .08);
    --a-line-2: rgba(255, 255, 255, .16);

    --a-text: #eef2ff;
    --a-dim: #9caac9;
    --a-muted: #67748f;

    --a-accent: #7c6cff;
    --a-accent-2: #22d3ee;
    --a-gold: #fbbf24;

    --a-card-bg: linear-gradient(170deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025));
    --a-card-shadow: none;
    --a-card-hover-shadow: 0 22px 44px -18px rgba(0, 0, 0, .9), 0 10px 40px -14px var(--c-glow);
    --a-aurora-opacity: .85;
    --a-dots-color: rgba(255, 255, 255, .075);
    --a-ring-bg: radial-gradient(circle at 50% 30%, #1a2136, #0c111d 70%);
    --a-title-gradient: linear-gradient(120deg, #ffffff 20%, #c3b5ff 60%, #7dd3fc);
    --a-result-gradient: linear-gradient(180deg, #fff, #93a4cc);
    --a-toast-bg: linear-gradient(150deg, #1b2337, #121828);
    --a-glass-edge: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);

    --a-cat-brightness: 1.35;
    --a-go-brightness: 1.3;

    --c-soft: rgba(124, 108, 255, .16);
    --c-glow: rgba(124, 108, 255, .5);
}

/* Auroras de fondo: profundidad sin ruido */
.arcade::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 780px;
    pointer-events: none;
    background:
        radial-gradient(680px 380px at 18% 22%, rgba(124, 108, 255, .30), transparent 65%),
        radial-gradient(600px 340px at 82% 8%, rgba(34, 211, 238, .18), transparent 62%),
        radial-gradient(520px 300px at 55% 40%, rgba(236, 72, 153, .10), transparent 65%);
    filter: blur(6px);
    opacity: var(--a-aurora-opacity, 0.85);
}

/* Trama de puntos tenue */
.arcade::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(var(--a-dots-color) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 60%);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 60%);
}

.arcade-shell {
    position: relative;
    z-index: 1;
    max-width: 1380px;
    margin: 0 auto;
}

.a-hidden { display: none !important; }

/* El layout del SIS (core.css) pinta el color de todo h1..div/span del tema
   claro. Dentro del arcade mandamos nosotros: :where() mantiene la
   especificidad en 0 para que las reglas de abajo (y los estilos en línea)
   sigan ganando. */
.arcade :where(h1, h2, h3, h4, h5, h6, p, div, span, li, td, th, strong, em, small, label, pre, ul, ol):where(:not([style*="color"])) {
    color: inherit !important;
}

.arcade a { text-decoration: none; color: inherit !important; }
.arcade h1, .arcade h2, .arcade h3, .arcade h4 { margin: 0; color: var(--a-text) !important; }
.arcade button { font-family: inherit; }
.arcade ::selection { background: var(--a-accent); color: #fff !important; }

/* ─────────────────────────────────────────────
   Superficies
   ───────────────────────────────────────────── */

.a-panel {
    position: relative;
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    border-radius: var(--a-r);
    padding: 26px;
    box-shadow: var(--a-panel-shadow, none);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}

/* Filo de vidrio superior */
.a-panel::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: var(--a-glass-edge);
}

.a-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: 2.4px;
    font-weight: 900;
    color: var(--a-gold) !important;
}

/* ─────────────────────────────────────────────
   Hero: perfil del jugador
   ───────────────────────────────────────────── */

.a-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 34px;
}

.a-hero-main { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }

.a-level-ring {
    position: relative;
    width: 122px;
    height: 122px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(from -90deg, var(--a-accent) calc(var(--p, 0) * 1%), var(--a-line-2) 0);
    box-shadow: 0 0 0 1px var(--a-line), 0 12px 40px rgba(124, 108, 255, .2);
}
.a-level-ring::after {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background: var(--a-ring-bg);
    box-shadow: inset 0 1px 0 var(--a-line);
}
.a-level-ring > div { position: relative; z-index: 1; text-align: center; line-height: 1; }
.a-level-ring .lv-num {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--a-title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.a-level-ring .lv-lb {
    margin-top: 3px;
    font-size: .58rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 900;
    color: var(--a-muted) !important;
}

.a-hero-copy { flex: 1; min-width: 230px; }

.a-title {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 900;
    letter-spacing: -1.2px;
    line-height: 1;
    background: var(--a-title-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.a-hero-copy .a-sub {
    margin-top: 8px;
    font-size: .96rem;
    color: var(--a-dim) !important;
}
.a-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 99px;
    background: var(--c-soft);
    border: 1px solid var(--a-line-2);
    font-weight: 800;
    font-size: .82rem;
    color: var(--a-text) !important;
}

.a-xpbar {
    position: relative;
    height: 10px;
    margin-top: 18px;
    border-radius: 99px;
    background: var(--a-line-2);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.a-xpbar span {
    position: relative;
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--a-accent), var(--a-accent-2));
    box-shadow: 0 0 18px var(--c-glow);
}
.a-xpbar span::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
    animation: a-shimmer 2.8s ease-in-out infinite;
}
@keyframes a-shimmer {
    0% { transform: translateX(-100%); }
    60%, 100% { transform: translateX(240%); }
}
.a-xp-legend {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--a-muted) !important;
}

/* Fichas de estadística */
.a-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}
.a-stat {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border-radius: var(--a-r-sm);
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
a.a-stat:hover { background: var(--a-bg); border-color: var(--a-line-2); transform: translateY(-2px); }
.a-stat i {
    width: 30px; height: 30px;
    flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 9px;
    font-size: .9rem;
}
.a-stat .v { font-size: 1.12rem; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.a-stat .k {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    font-weight: 800;
    color: var(--a-muted) !important;
}

/* ─────────────────────────────────────────────
   Reto del día
   ───────────────────────────────────────────── */

.a-daily {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background:
        radial-gradient(420px 220px at 90% -10%, rgba(245, 158, 11, .15), transparent 70%),
        var(--a-panel);
    border-color: rgba(245, 158, 11, .3);
}
.a-daily-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.a-daily-date { font-size: .74rem; font-weight: 700; color: var(--a-muted) !important; }

.a-daily-game { display: flex; align-items: center; gap: 16px; }
.a-daily-icon {
    width: 66px; height: 66px;
    flex-shrink: 0;
    border-radius: 19px;
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    color: #fff !important;
    background: linear-gradient(150deg, var(--c), rgba(0, 0, 0, .35));
    box-shadow: 0 10px 26px -6px var(--c-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.a-daily h3 { font-size: 1.35rem; font-weight: 900; letter-spacing: -.4px; }
.a-daily-meta { margin-top: 4px; font-size: .85rem; color: var(--a-dim) !important; }
.a-daily-copy { font-size: .87rem; line-height: 1.55; color: var(--a-dim) !important; }
.a-daily-done {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 15px;
    border-radius: var(--a-r-sm);
    background: rgba(52, 211, 153, .12);
    border: 1px solid rgba(52, 211, 153, .32);
    font-size: .86rem;
    font-weight: 700;
    color: #059669 !important;
}
.a-daily-done i { font-size: 1.15rem; }

/* ─────────────────────────────────────────────
   Botones
   ───────────────────────────────────────────── */

.a-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 22px;
    border: none;
    border-radius: var(--a-r-sm);
    font-weight: 800;
    font-size: .95rem;
    line-height: 1;
    cursor: pointer;
    color: #fff !important;
    background: var(--c);
    box-shadow: 0 8px 20px -6px var(--c-glow), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .16s cubic-bezier(.34, 1.4, .64, 1), box-shadow .16s ease, filter .16s ease;
}
.a-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
    box-shadow: 0 14px 28px -8px var(--c-glow), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.a-btn:active { transform: translateY(0) scale(.985); }
.a-btn.a-lg { padding: 17px 38px; font-size: 1.06rem; border-radius: 15px; }
.a-btn.a-block { width: 100%; }

.a-btn.a-ghost {
    background: var(--a-panel);
    border: 1px solid var(--a-line-2);
    box-shadow: none;
    color: var(--a-text) !important;
}
.a-btn.a-ghost:hover { background: var(--a-bg); }

.a-icon-btn {
    width: 44px; height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    font-size: 1.02rem;
    cursor: pointer;
    color: var(--a-dim) !important;
    transition: all .16s ease;
}
.a-icon-btn:hover {
    color: var(--a-text) !important;
    background: var(--a-bg);
    border-color: var(--a-line-2);
    transform: translateY(-1px);
}
.a-icon-btn.is-on {
    color: #fff !important;
    background: var(--c);
    border-color: transparent;
    box-shadow: 0 6px 18px -6px var(--c-glow);
}

/* ─────────────────────────────────────────────
   Buscador y filtros
   ───────────────────────────────────────────── */

.a-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.a-search { position: relative; flex: 1 1 260px; min-width: 220px; }
.a-search > i {
    position: absolute;
    left: 16px; top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--a-muted) !important;
}
.a-search input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: var(--a-r-sm);
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    font-size: .95rem;
    font-family: inherit;
    outline: none;
    color: var(--a-text) !important;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.a-search input::placeholder { color: var(--a-muted) !important; }
.a-search input:focus {
    border-color: var(--a-accent);
    background: var(--a-panel);
    box-shadow: 0 0 0 4px var(--c-soft);
}

.a-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.a-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 15px;
    border-radius: var(--a-r-sm);
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    font-weight: 800;
    font-size: .84rem;
    cursor: pointer;
    color: var(--a-dim) !important;
    transition: all .16s ease;
}
.a-filter i { font-size: .78rem; opacity: .85; }
.a-filter:hover { color: var(--a-text) !important; background: var(--a-bg); border-color: var(--a-line-2); }
.a-filter.is-active {
    color: #fff !important;
    background: linear-gradient(180deg, #8b7bff, #6d5cf0);
    border-color: transparent;
    box-shadow: 0 8px 20px -8px rgba(124, 108, 255, .9);
}
.a-filter .n { opacity: .6; font-weight: 700; }

/* ─────────────────────────────────────────────
   Tarjetas de juego
   ───────────────────────────────────────────── */

.a-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
    gap: 18px;
}

.a-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 13px;
    padding: 20px;
    border-radius: var(--a-r);
    border: 1px solid var(--a-line);
    background: var(--a-card-bg);
    box-shadow: var(--a-card-shadow, none);
    overflow: hidden;
    isolation: isolate;
    animation: a-rise .45s cubic-bezier(.2, .8, .3, 1) backwards;
    transition: transform .22s cubic-bezier(.34, 1.2, .64, 1), border-color .22s ease, box-shadow .22s ease;
}

/* Halo del color del juego */
.a-card::before {
    content: '';
    position: absolute;
    inset: -40% 40% 55% -30%;
    z-index: -1;
    background: radial-gradient(circle, var(--c-soft), transparent 68%);
    opacity: .85;
    transition: opacity .25s ease, transform .3s ease;
}
/* Trama diagonal casi imperceptible */
.a-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: repeating-linear-gradient(135deg, var(--a-dots-color) 0 1px, transparent 1px 9px);
    opacity: .5;
    mask-image: radial-gradient(120% 90% at 100% 0%, #000, transparent 70%);
    -webkit-mask-image: radial-gradient(120% 90% at 100% 0%, #000, transparent 70%);
}

.a-card:hover {
    transform: translateY(-5px);
    border-color: var(--c);
    box-shadow: var(--a-card-hover-shadow);
}
.a-card:hover::before { opacity: 1; transform: scale(1.15); }

@keyframes a-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.a-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.a-card-icon {
    width: 54px; height: 54px;
    flex-shrink: 0;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.42rem;
    color: #fff !important;
    background: linear-gradient(150deg, var(--c), rgba(0, 0, 0, .45));
    box-shadow: 0 10px 22px -8px var(--c-glow), inset 0 1px 0 rgba(255, 255, 255, .32);
    transition: transform .28s cubic-bezier(.34, 1.4, .64, 1);
}
.a-card:hover .a-card-icon { transform: translateY(-2px) rotate(-6deg) scale(1.06); }

.a-card-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 99px;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .6px;
    white-space: nowrap;
    background: var(--a-bg);
    border: 1px solid var(--a-line);
    color: var(--a-dim) !important;
}
.a-card-flag.is-best { background: rgba(251, 191, 36, .14); border-color: rgba(251, 191, 36, .34); color: var(--a-gold) !important; }
.a-card-flag.is-new { background: rgba(52, 211, 153, .13); border-color: rgba(52, 211, 153, .32); color: #059669 !important; }

.a-card-body { flex: 1; }
.a-card h3 { font-size: 1.1rem; font-weight: 900; letter-spacing: -.3px; }
.a-card .a-cat {
    display: block;
    margin-top: 3px;
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--c) !important;
    filter: brightness(var(--a-cat-brightness, 1.35));
}
.a-card .a-tagline {
    margin: 9px 0 0;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--a-dim) !important;
}

.a-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 13px;
    border-top: 1px solid var(--a-line);
}
.a-card-specs { display: flex; gap: 12px; font-size: .72rem; font-weight: 700; color: var(--a-muted) !important; }
.a-card-specs span { display: inline-flex; align-items: center; gap: 5px; }

.a-card-go {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .82rem;
    font-weight: 900;
    color: var(--c) !important;
    filter: brightness(var(--a-go-brightness, 1.3));
    transition: gap .2s ease;
}
.a-card:hover .a-card-go { gap: 11px; }

/* ─────────────────────────────────────────────
   Secciones
   ───────────────────────────────────────────── */

.a-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 46px 0 18px;
}
.a-section-head h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 1.42rem;
    font-weight: 900;
    letter-spacing: -.6px;
}
.a-section-head h2 i { font-size: 1.05rem; color: var(--a-accent) !important; }
.a-section-head p { margin: 5px 0 0; font-size: .87rem; color: var(--a-muted) !important; }

.a-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .86rem;
    font-weight: 800;
    color: var(--a-accent) !important;
    transition: gap .2s ease;
}
.a-link:hover { gap: 11px; filter: brightness(1.2); }

.a-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ─────────────────────────────────────────────
   Rankings
   ───────────────────────────────────────────── */

.a-rank-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 12px;
    border-radius: 13px;
    transition: background .18s ease;
}
.a-rank-row + .a-rank-row { margin-top: 2px; }
.a-rank-row:hover { background: var(--a-line); }

.a-rank-num {
    width: 28px;
    flex-shrink: 0;
    text-align: center;
    font-weight: 900;
    font-size: .92rem;
    font-variant-numeric: tabular-nums;
    color: var(--a-muted) !important;
}
.a-rank-1 { color: var(--a-gold) !important; text-shadow: 0 0 14px rgba(251, 191, 36, .55); }
.a-rank-2 { color: var(--a-dim) !important; }
.a-rank-3 { color: #d97706 !important; }

.a-avatar {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    background: var(--a-line);
    border: 2px solid var(--a-line-2);
}
.a-rank-row.is-me .a-avatar { border-color: var(--a-accent); }

.a-rank-info { flex: 1; min-width: 0; }
.a-rank-name {
    font-weight: 800;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.a-rank-sub { margin-top: 1px; font-size: .72rem; color: var(--a-muted) !important; }
.a-rank-score {
    text-align: right;
    font-weight: 900;
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
}

.a-rank-row.is-me {
    background: linear-gradient(90deg, var(--c-soft), transparent);
    box-shadow: inset 2px 0 0 var(--a-accent);
}

.a-empty {
    padding: 30px 16px;
    text-align: center;
    font-size: .87rem;
    line-height: 1.6;
    color: var(--a-muted) !important;
}
.a-empty i { display: block; margin-bottom: 10px; font-size: 1.8rem; opacity: .45; }

/* ─────────────────────────────────────────────
   Logros
   ───────────────────────────────────────────── */

.a-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 12px; }

.a-badge {
    display: flex;
    gap: 13px;
    padding: 15px;
    border-radius: 16px;
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.a-badge:hover { transform: translateY(-2px); border-color: var(--a-line-2); }
.a-badge-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 1.05rem;
    background: var(--a-line);
    color: var(--a-muted) !important;
}
.a-badge h4 { font-size: .9rem; font-weight: 900; }
.a-badge p { margin: 4px 0 0; font-size: .75rem; line-height: 1.45; color: var(--a-muted) !important; }

.a-badge.is-unlocked {
    border-color: rgba(245, 158, 11, .34);
    background: linear-gradient(155deg, rgba(245, 158, 11, .12), var(--a-panel));
}
.a-badge.is-unlocked .a-badge-icon {
    background: linear-gradient(150deg, #fbbf24, #b45309);
    color: #ffffff !important;
    box-shadow: 0 8px 18px -6px rgba(245, 158, 11, .6);
}
/* Bloqueado se atenúa por color, no por opacidad: el nombre siempre se lee */
.a-badge.is-locked .a-badge-icon { color: var(--a-muted) !important; background: var(--a-line); }
.a-badge.is-locked h4 { color: var(--a-dim) !important; }

.a-badge-bar {
    height: 5px;
    margin-top: 9px;
    border-radius: 99px;
    background: var(--a-line-2);
    overflow: hidden;
}
.a-badge-bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--a-accent), var(--a-accent-2));
}

/* Chips */
.a-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 11px;
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    font-size: .83rem;
    font-weight: 700;
    color: var(--a-text) !important;
}
.a-chip i { color: var(--a-gold); }
.a-chips { display: flex; gap: 10px; flex-wrap: wrap; }
a.a-chip { transition: background .16s ease, transform .16s ease, border-color .16s ease; }
a.a-chip:hover { background: var(--a-bg); border-color: var(--a-line-2); transform: translateY(-2px); }

/* ═════════════════════════════════════════════
   SALA DE JUEGO
   ═════════════════════════════════════════════ */

.a-play-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.a-play-title { display: flex; align-items: center; gap: 15px; min-width: 0; }
.a-play-title h1 { font-size: 1.55rem; font-weight: 900; letter-spacing: -.6px; line-height: 1.1; }
.a-play-title .a-sub { margin-top: 3px; font-size: .82rem; color: var(--a-muted) !important; }
.a-play-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

.a-record-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(245, 158, 11, .15), rgba(245, 158, 11, .05));
    border: 1px solid rgba(245, 158, 11, .3);
    font-size: .8rem;
    font-weight: 800;
    color: var(--a-gold) !important;
}
.a-record-chip strong {
    font-size: 1.06rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--a-text) !important;
}

.a-play-grid { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: 20px; align-items: start; }

/* Cabina */
.a-stage-wrap {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    background: var(--a-stage-wrap-bg, #05070d);
    border: 1px solid var(--a-line-2);
    box-shadow:
        0 30px 70px -30px rgba(0, 0, 0, .5),
        0 0 90px -40px var(--c-glow);
}
/* Filo de luz con el color del juego */
.a-stage-wrap::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 40;
    background: linear-gradient(90deg, transparent, var(--c), transparent);
}

/* Marcador */
.a-hud {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--a-panel);
    border-bottom: 1px solid var(--a-line);
    flex-wrap: wrap;
}
.a-hud-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-right: 16px;
    margin-right: 14px;
    border-right: 1px solid var(--a-line);
    line-height: 1;
}
.a-hud-item:last-of-type { border-right: none; margin-right: 0; }
.a-hud-item .lb {
    font-size: .58rem;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    font-weight: 900;
    color: var(--a-muted) !important;
}
.a-hud-item .vl {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -.5px;
    font-variant-numeric: tabular-nums;
}
.a-hud-spacer { flex: 1; }
.a-pill {
    padding: 6px 12px;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 800;
    background: var(--c-soft);
    border: 1px solid var(--c);
    color: var(--a-text) !important;
}

.a-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Crece con la ventana: el tablero manda en la pantalla */
    min-height: clamp(420px, 62vh, 660px);
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .035), transparent 62%),
        #05070d;
    color: #f8fafc !important;
}
.a-stage .g-wrap,
.a-stage .g-title {
    color: #f8fafc !important;
}
.a-stage .g-sub {
    color: #cbd5e1 !important;
}
.a-stage #hangWord {
    color: #ffffff !important;
    text-shadow: 0 2px 14px rgba(255, 255, 255, .25);
}
.a-stage #hangHint {
    color: #cbd5e1 !important;
}
.a-stage .hkey {
    background: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    color: #ffffff !important;
    font-weight: 900;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: all .12s ease;
}
.a-stage .hkey:hover:not(:disabled) {
    background: rgba(255, 255, 255, .28) !important;
    border-color: rgba(255, 255, 255, .45) !important;
    transform: translateY(-2px);
}
.a-stage .hkey:disabled {
    cursor: default;
    opacity: .5;
}
.a-stage .g-btn {
    background: rgba(255, 255, 255, .08) !important;
    border-color: rgba(255, 255, 255, .2) !important;
    color: #ffffff !important;
}
.a-stage .g-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, .16) !important;
    border-color: rgba(255, 255, 255, .35) !important;
}
.a-stage canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    image-rendering: pixelated;
    touch-action: none;
    box-shadow: 0 0 60px -20px var(--c-glow);
}

/* Overlay */
.a-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 26px;
    text-align: center;
    overflow-y: auto;
    background:
        radial-gradient(circle at 50% 38%, var(--c-soft), transparent 62%),
        var(--a-panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: a-fade .25s ease;
}
@keyframes a-fade { from { opacity: 0; } to { opacity: 1; } }

.a-overlay h2 {
    font-size: clamp(1.8rem, 4.6vw, 3rem);
    font-weight: 900;
    letter-spacing: -1px;
    text-transform: uppercase;
    line-height: 1;
    color: var(--c) !important;
    text-shadow: 0 0 42px var(--c-glow);
}
.a-overlay .a-msg {
    max-width: 480px;
    margin: 12px 0 26px;
    font-size: .95rem;
    line-height: 1.6;
    color: var(--a-dim) !important;
}

/* Selectores de partida */
.a-picker { width: 100%; max-width: 540px; margin-bottom: 20px; text-align: left; }
.a-picker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 900;
    color: var(--a-muted) !important;
}
.a-picker-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.a-opt {
    flex: 1 1 0;
    min-width: 86px;
    padding: 11px 10px;
    border-radius: 13px;
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    cursor: pointer;
    text-align: center;
    color: var(--a-dim) !important;
    transition: all .16s ease;
}
.a-opt:hover { background: var(--a-bg); color: var(--a-text) !important; transform: translateY(-1px); }
.a-opt .t { display: block; font-weight: 900; font-size: .89rem; }
.a-opt .h { display: block; margin-top: 3px; font-size: .66rem; opacity: .8; }
.a-opt.is-active {
    color: var(--a-text) !important;
    border-color: var(--c);
    background: var(--c-soft);
    box-shadow: 0 6px 20px -10px var(--c-glow);
}
.a-opt.is-active .t { color: var(--c) !important; filter: brightness(var(--a-cat-brightness, 1.35)); }

/* Resultado */
.a-result { margin-bottom: 22px; }
.a-result-label {
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: 2.4px;
    font-weight: 900;
    color: var(--a-muted) !important;
}
.a-result-score {
    margin-top: 6px;
    font-size: clamp(3rem, 9vw, 4.4rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    background: var(--a-result-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.a-result-tags { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.a-tag {
    padding: 7px 13px;
    border-radius: 10px;
    font-size: .77rem;
    font-weight: 800;
    background: var(--a-panel);
    border: 1px solid var(--a-line);
    color: var(--a-text) !important;
    animation: a-pop .28s cubic-bezier(.2, 1.4, .4, 1) backwards;
}
.a-tag.gold { background: rgba(251, 191, 36, .16); border-color: rgba(251, 191, 36, .4); color: #d97706 !important; }
.a-tag.green { background: rgba(52, 211, 153, .15); border-color: rgba(52, 211, 153, .38); color: #059669 !important; }
.a-tag.violet { background: rgba(124, 108, 255, .2); border-color: rgba(124, 108, 255, .45); color: var(--a-accent) !important; }

/* CRT */
.a-crt {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: none;
    pointer-events: none;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, .22) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, .05), rgba(0, 255, 0, .02), rgba(0, 0, 255, .05));
    background-size: 100% 4px, 3px 100%;
}
.a-crt.is-on { display: block; }
.a-crt.is-on::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 140px rgba(0, 0, 0, .8);
}

/* Controles táctiles: solo en pantallas táctiles o angostas */
.a-touch {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(0, 0, 0, .35));
    border-top: 1px solid var(--a-line);
    user-select: none;
}
@media (max-width: 1024px), (pointer: coarse) {
    .a-touch.is-on { display: flex; }
}
.a-dpad { position: relative; width: 138px; height: 138px; flex-shrink: 0; }
.a-dpad button {
    position: absolute;
    width: 46px; height: 46px;
    border-radius: 12px;
    border: 1px solid var(--a-line-2);
    background: var(--a-panel);
    font-size: 1.15rem;
    color: var(--a-text) !important;
}
.a-dpad button:active { background: var(--c); transform: scale(.94); }
.a-dpad .u { top: 0; left: 46px; }
.a-dpad .d { bottom: 0; left: 46px; }
.a-dpad .l { top: 46px; left: 0; }
.a-dpad .r { top: 46px; right: 0; }

.a-touch-actions { display: flex; align-items: center; gap: 14px; }
.a-round {
    width: 68px; height: 68px;
    border-radius: 50%;
    border: 1px solid var(--a-line-2);
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .25), rgba(124, 108, 255, .4));
    font-weight: 900;
    font-size: 1.1rem;
    color: #fff !important;
}
.a-round.b { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .25), rgba(248, 113, 113, .45)); }
.a-round:active { transform: scale(.93); }

.a-lr { display: flex; gap: 12px; width: 100%; }
.a-lr button {
    flex: 1;
    height: 64px;
    border-radius: 16px;
    border: 1px solid var(--a-line-2);
    background: var(--a-panel);
    font-size: 1.4rem;
    color: var(--a-text) !important;
}
.a-lr button:active { background: var(--c); }

/* Pie de controles */
.a-play-hints {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: .82rem;
    color: var(--a-muted) !important;
}
.a-play-hints span { display: inline-flex; align-items: center; gap: 8px; }
.a-play-hints kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--a-line-2);
    border-bottom-width: 2px;
    background: var(--a-panel);
    font-family: inherit;
    font-size: .74rem;
    font-weight: 800;
    color: var(--a-dim) !important;
}

/* Panel lateral */
.a-side { display: flex; flex-direction: column; gap: 16px; }
.a-side-panel {
    border-radius: var(--a-r);
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    box-shadow: var(--a-panel-shadow, none);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    overflow: hidden;
}
.a-side-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--a-line);
    color: var(--a-dim) !important;
}
.a-side-head i { font-size: .95rem; color: var(--a-gold) !important; }
.a-side-body { padding: 12px 12px 16px; }

.a-tabs { display: flex; gap: 5px; padding: 12px 14px 0; flex-wrap: wrap; }
.a-tab {
    flex: 1;
    padding: 7px 10px;
    border-radius: 99px;
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    font-size: .74rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--a-muted) !important;
    transition: all .15s ease;
}
.a-tab:hover { color: var(--a-text) !important; background: var(--a-bg); }
.a-tab.is-active {
    color: #fff !important;
    background: var(--c);
    border-color: transparent;
    box-shadow: 0 6px 16px -8px var(--c-glow);
}

.a-howto { list-style: none; margin: 0; padding: 0; }
.a-howto li {
    display: flex;
    gap: 11px;
    padding: 8px 6px;
    font-size: .84rem;
    line-height: 1.5;
    color: var(--a-dim) !important;
}
.a-howto li i { margin-top: 3px; font-size: .8rem; color: var(--c) !important; filter: brightness(var(--a-cat-brightness, 1.3)); }
.a-howto strong { color: var(--a-text) !important; }

.a-more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a-more {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid var(--a-line);
    background: var(--a-panel);
    font-size: .78rem;
    font-weight: 800;
    transition: all .16s ease;
}
.a-more i { font-size: .95rem; }
.a-more span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-more:hover { background: var(--a-bg); border-color: var(--a-line-2); transform: translateY(-2px); }

/* ─────────────────────────────────────────────
   Avisos (toasts)
   ───────────────────────────────────────────── */

.a-toasts {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.a-toast {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
    padding: 15px 19px;
    border-radius: 16px;
    /* Con respaldo: si el aviso queda fuera de .arcade no hereda el tema */
    background: var(--a-toast-bg, #ffffff);
    border: 1px solid rgba(245, 158, 11, .4);
    font-family: 'Outfit', system-ui, sans-serif;
    color: var(--a-text, #0f172a) !important;
    box-shadow: 0 20px 46px -14px rgba(0, 0, 0, .25), 0 0 30px -14px rgba(245, 158, 11, .3);
    animation: a-toast-in .4s cubic-bezier(.2, 1.2, .3, 1.2);
}
.a-toast i { font-size: 1.4rem; color: #d97706 !important; }
.a-toast .tt { font-weight: 900; font-size: .92rem; color: var(--a-text, #0f172a) !important; }
.a-toast .ts { margin-top: 2px; font-size: .77rem; color: var(--a-dim, #475569) !important; }
.a-toast.out { animation: a-toast-out .3s ease forwards; }
@keyframes a-toast-in { from { opacity: 0; transform: translateX(50px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes a-toast-out { to { opacity: 0; transform: translateX(50px) scale(.9); } }

/* ─────────────────────────────────────────────
   Utilidades para los juegos (usadas por *.js)
   ───────────────────────────────────────────── */

.g-wrap { display: flex; flex-direction: column; width: 100%; height: 100%; color: var(--a-text); font-family: 'Outfit', system-ui, sans-serif; }
.g-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; height: 100%; }
.g-grid { display: grid; gap: 9px; }
.g-btn {
    padding: 13px 16px;
    border-radius: 13px;
    border: 1px solid var(--a-line-2);
    background: var(--a-panel);
    font-family: inherit;
    font-weight: 800;
    font-size: .95rem;
    text-align: left;
    cursor: pointer;
    color: var(--a-text) !important;
    transition: transform .13s ease, background .13s ease, border-color .13s ease;
}
.g-btn:hover:not(:disabled) { background: var(--a-bg); border-color: var(--a-line-2); transform: translateY(-2px); }
.g-btn:disabled { opacity: .58; cursor: default; }
.g-btn.ok { background: rgba(52, 211, 153, .26); border-color: rgba(52, 211, 153, .6); }
.g-btn.bad { background: rgba(248, 113, 113, .26); border-color: rgba(248, 113, 113, .6); }
.g-title { font-size: 1.4rem; font-weight: 900; line-height: 1.35; text-align: center; }
.g-sub { font-size: .87rem; text-align: center; color: var(--a-dim) !important; }
.g-input {
    width: 230px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 2px solid var(--a-line-2);
    background: var(--a-panel);
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 900;
    text-align: center;
    outline: none;
    color: var(--a-text) !important;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.g-input:focus { border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }

@keyframes a-pop {
    from { transform: scale(.72); opacity: .35; }
    to { transform: scale(1); opacity: 1; }
}

/* ─────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────── */

@media (max-width: 1180px) {
    .a-hero { grid-template-columns: 1fr; }
    .a-play-grid { grid-template-columns: 1fr; }
    .a-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .arcade { padding: 18px 13px 48px; }
    .a-panel { padding: 19px; }
    .a-hero { gap: 14px; margin-bottom: 26px; }
    .a-hero-main { gap: 18px; }
    .a-level-ring { width: 92px; height: 92px; }
    .a-level-ring .lv-num { font-size: 1.9rem; }
    .a-stats { grid-template-columns: 1fr 1fr; }
    .a-title { font-size: 1.7rem; }

    /* Filtros en una sola fila deslizable, como en una app */
    .a-toolbar { gap: 11px; }
    .a-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -13px;
        padding: 0 13px 2px;
    }
    .a-filters::-webkit-scrollbar { display: none; }
    .a-filter { flex: 0 0 auto; padding: 10px 14px; }

    .a-grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 11px; }
    .a-card { padding: 14px; gap: 10px; border-radius: 17px; }
    .a-card-icon { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 13px; }
    .a-card h3 { font-size: .95rem; }
    .a-card .a-tagline { display: none; }
    .a-card-specs { gap: 8px; font-size: .67rem; }
    .a-card-go span { display: none; }

    .a-section-head { margin: 32px 0 14px; }
    .a-section-head h2 { font-size: 1.2rem; }

    .a-play-head { gap: 12px; margin-bottom: 14px; }
    .a-play-title h1 { font-size: 1.2rem; }
    /* Que las cuatro dificultades quepan en una sola fila */
    .a-opt { min-width: 66px; padding: 10px 6px; }
    .a-opt .t { font-size: .82rem; }
    .a-opt .h { font-size: .6rem; }
    .a-stage { min-height: clamp(340px, 52vh, 470px); padding: 9px; }
    .a-hud { padding: 10px 12px; gap: 2px; }
    .a-hud-item { padding-right: 11px; margin-right: 9px; }
    .a-hud-item .vl { font-size: 1.05rem; }
    .a-badges { grid-template-columns: 1fr; }
    .a-toasts { left: 13px; right: 13px; bottom: 13px; }
    .a-toast { min-width: 0; }
}

/* Pantalla completa */
.a-stage-wrap:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.a-stage-wrap:fullscreen .a-stage { flex: 1; }

/* Respeto por quien prefiere menos movimiento */
@media (prefers-reduced-motion: reduce) {
    .arcade *, .arcade *::before, .arcade *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* ─────────────────────────────────────────────
   Mientras se juega en móvil, los botones flotantes del layout
   (accesibilidad y chat) tapan los controles táctiles.
   El motor marca <body class="arcade-playing"> durante la partida.
   ───────────────────────────────────────────── */
@media (max-width: 1024px), (pointer: coarse) {
    body.arcade-playing .a11y-fab-stack,
    body.arcade-playing .chatbot-btn,
    body.arcade-playing .chat-bubble-stack {
        display: none !important;
    }
}

/* ─────────────────────────────────────────────
   Potenciadores activos (insignias del HUD)
   ───────────────────────────────────────────── */

.a-powers { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.a-power {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 99px;
    border: 1px solid var(--c);
    background: var(--c-soft);
    color: var(--a-text) !important;
    font-size: .7rem;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    animation: a-pop .25s cubic-bezier(.2, 1.4, .4, 1);
}
.a-power i { font-size: .78rem; }
.a-power .pt { opacity: .7; font-variant-numeric: tabular-nums; }
.a-power .pt:empty { display: none; }
.a-power.is-low { animation: a-blink .5s steps(2) infinite; }
.a-power.out { animation: a-power-out .26s ease forwards; }

@keyframes a-blink { 50% { opacity: .35; } }
@keyframes a-power-out { to { opacity: 0; transform: scale(.7); } }

@media (max-width: 720px) {
    .a-power { padding: 4px 8px; font-size: .64rem; }
    .a-power .pl { display: none; }
}

/* Gamer Card & Store Enhancements */
.a-gamer-card {
    background: var(--a-panel);
    border-radius: var(--a-r);
    padding: 20px;
    box-shadow: var(--a-panel-shadow);
    border: 1px solid var(--c-glow);
    position: relative;
    overflow: hidden;
}

.a-neon-frame {
    border: 2px solid var(--c);
    box-shadow: 0 0 10px var(--c-glow), inset 0 0 10px var(--c-glow);
    border-radius: var(--a-r);
}

.a-banner-theme {
    background-size: cover;
    background-position: center;
    border-radius: var(--a-r);
    position: relative;
}

.a-banner-theme::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--a-bg) 0%, transparent 100%);
}

.btn-arcade {
    background: var(--a-line-2);
    color: var(--a-text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.btn-arcade:hover {
    background: var(--c-glow);
    color: #fff;
}

/* =========================================
   PREMIUM UI ENHANCEMENTS (XBOX / STEAM)
   ========================================= */
.a-glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.a-item-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}
.a-item-card::before {
    content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.05) 0%, transparent 50%); pointer-events: none;
}
.a-item-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.rarity-common { border-color: #64748b; box-shadow: 0 0 10px rgba(100, 116, 139, 0.1); }
.rarity-rare { border-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }
.rarity-epic { border-color: #a855f7; box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); }
.rarity-legendary { border-color: #eab308; box-shadow: 0 0 25px rgba(234, 179, 8, 0.5); }

.text-rarity-common { color: #94a3b8; }
.text-rarity-rare { color: #60a5fa; text-shadow: 0 0 5px rgba(96, 165, 250, 0.5); }
.text-rarity-epic { color: #c084fc; text-shadow: 0 0 8px rgba(192, 132, 252, 0.6); }
.text-rarity-legendary { color: #fde047; text-shadow: 0 0 10px rgba(253, 224, 71, 0.8); }

.a-btn-buy {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.a-btn-buy:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
}

.a-btn-equip {
    background: linear-gradient(135deg, #10b981, #059669);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.a-btn-equip:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.a-pedestal {
    background: radial-gradient(ellipse at center, rgba(59,130,246,0.15) 0%, rgba(15,23,42,0) 70%);
    padding: 30px;
    border-radius: 50%;
}

.a-profile-cover {
    height: 320px;
    position: relative;
    border-radius: var(--a-r);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 -100px 100px -50px #0f172a;
}
.a-profile-avatar-wrapper {
    position: absolute;
    bottom: -60px;
    left: 40px;
    z-index: 10;
}
.a-profile-info-layer {
    position: absolute;
    bottom: 20px;
    left: 210px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
}

.a-badge-equipped {
    position: absolute;
    top: 10px;
    right: -30px;
    background: #10b981;
    color: #fff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 4px 30px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.a-game-card {
    background: linear-gradient(145deg, #1e293b, #151e2f);
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.2s;
}
.a-game-card:hover {
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-3px);
}

/* ============================================================
   PREMIUM ARCADE UI (NATIVE CSS - NO TAILWIND)
   ============================================================ */

/* Utilities */
.a-flex { display: flex; }
.a-flex-col { display: flex; flex-direction: column; }
.a-items-center { align-items: center; }
.a-justify-between { justify-content: space-between; }
.a-justify-center { justify-content: center; }
.a-gap-2 { gap: 8px; }
.a-gap-4 { gap: 16px; }
.a-gap-6 { gap: 24px; }
.a-w-full { width: 100%; }
.a-text-center { text-align: center; }
.a-text-right { text-align: right; }
.a-mb-2 { margin-bottom: 8px; }
.a-mb-4 { margin-bottom: 16px; }
.a-mb-6 { margin-bottom: 24px; }
.a-mt-4 { margin-top: 16px; }

/* Grid System */
.a-grid-cols-1 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media(min-width: 768px) {
    .a-grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .a-grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .a-grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
    .a-grid-cols-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
}

/* Glass & Panel Upgrades */
.a-glass-panel {
    background: var(--a-panel);
    border: 1px solid var(--a-line-2);
    border-radius: var(--a-r);
    padding: 24px;
    box-shadow: var(--a-panel-shadow);
    position: relative;
    overflow: hidden;
}
.a-glass-overlay {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--a-r);
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Shop specific */
.a-shop-hero {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    padding: 40px 30px;
    border-radius: var(--a-r);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px rgba(15,23,42,0.3);
    position: relative;
    overflow: hidden;
}
.a-shop-hero h1 {
    font-size: 2.5rem;
    font-weight: 900;
    margin: 0 0 10px 0;
    background: -webkit-linear-gradient(0deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.a-shop-hero p { margin: 0; color: #94a3b8; font-size: 1.1rem; }
.a-shop-balance {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 20px rgba(234,179,8,0.1);
}
.a-shop-balance .coins { font-size: 2rem; font-weight: 900; color: #fff; }
.a-shop-balance i { font-size: 1.8rem; color: #eab308; text-shadow: 0 0 10px rgba(234,179,8,0.5); }

/* Item Cards */
.a-item-card {
    background: var(--a-panel);
    border: 2px solid var(--a-line-2);
    border-radius: var(--a-r);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, border-color 0.3s;
    position: relative;
}
.a-item-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.a-item-icon {
    width: 80px; height: 80px;
    background: var(--a-bg);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin-bottom: 15px;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.05);
}
.a-item-name { font-weight: 800; text-align: center; font-size: 1rem; color: var(--a-text); margin: 0 0 5px 0; min-height: 40px; display: flex; align-items: center;}
.a-item-rarity { font-size: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; margin-bottom: 15px; }
.a-item-price { color: #eab308; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 5px; margin-bottom: 15px; }

/* Rarities */
.rarity-common { border-color: #cbd5e1; }
.rarity-rare { border-color: #93c5fd; }
.rarity-epic { border-color: #d8b4fe; }
.rarity-legendary { border-color: #fde047; }
.rarity-text-common { color: #94a3b8; }
.rarity-text-rare { color: #3b82f6; }
.rarity-text-epic { color: #a855f7; }
.rarity-text-legendary { color: #eab308; }

/* Buttons */
.a-btn-primary, .a-btn-success {
    border: none; border-radius: 8px; font-weight: 700; padding: 10px 20px;
    color: #fff; cursor: pointer; transition: all 0.2s; width: 100%; text-transform: uppercase; letter-spacing: 0.5px;
}
.a-btn-primary { background: #3b82f6; }
.a-btn-primary:hover { background: #2563eb; box-shadow: 0 4px 12px rgba(59,130,246,0.3); }
.a-btn-success { background: #10b981; }
.a-btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.3); }
.a-btn-disabled { background: var(--a-line-2); color: var(--a-text-muted); cursor: not-allowed; }

/* Profile V2 */
.a-profile-cover {
    height: 300px;
    border-radius: var(--a-r);
    background-size: cover;
    background-position: center;
    position: relative;
    margin-bottom: 80px;
    box-shadow: var(--a-panel-shadow);
}
.a-profile-cover::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 60%);
    border-radius: var(--a-r);
}
.a-profile-avatar-wrap {
    position: absolute;
    bottom: -60px;
    left: 40px;
    z-index: 10;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: var(--a-panel);
    padding: 5px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.a-profile-avatar { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #1e293b; position: relative; }
.a-profile-avatar svg { width: 100%; height: 100%; }
.a-profile-info {
    position: absolute;
    bottom: 20px;
    left: 220px;
    z-index: 10;
    color: #fff;
}
.a-profile-name { font-size: 2.5rem; font-weight: 900; margin: 0 0 5px 0; line-height: 1; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
.a-profile-title { color: #fde047; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.a-profile-actions { position: absolute; top: 20px; right: 20px; z-index: 10; display: flex; gap: 10px; }

/* Profile Stats Row */
.a-stat-row { display: flex; background: var(--a-panel); border-radius: var(--a-r); box-shadow: var(--a-panel-shadow); padding: 20px; gap: 20px; margin-bottom: 30px; align-items: center;}
.a-stat-main { flex: 2; padding-right: 20px; border-right: 1px solid var(--a-line); }
.a-stat-box { flex: 1; text-align: center; }
.a-stat-box-label { font-size: 0.75rem; text-transform: uppercase; color: var(--a-text-muted); font-weight: 700; margin-bottom: 5px; }
.a-stat-box-val { font-size: 1.5rem; font-weight: 900; color: var(--a-text); }

/* Play History & Achievements */
.a-history-card { display: flex; align-items: center; gap: 15px; padding: 15px; background: var(--a-panel); border-radius: var(--a-r); border: 1px solid var(--a-line-2); transition: all 0.2s; }
.a-history-card:hover { border-color: var(--c-glow, #cbd5e1); transform: translateX(5px); }
.a-history-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.a-history-info { flex: 1; }
.a-history-info h4 { margin: 0 0 5px 0; font-weight: 800; color: var(--a-text); }
.a-history-stats { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--a-text-muted); }

/* Vestidor Pedestal */
.a-vestidor-layout { display: flex; gap: 30px; flex-wrap: wrap; }
.a-vestidor-pedestal-wrap { flex: 1; min-width: 300px; }
.a-vestidor-inventory { flex: 2; min-width: 300px; }
.a-pedestal {
    background: radial-gradient(ellipse at center, rgba(59,130,246,0.1) 0%, transparent 70%);
    padding: 40px;
    display: flex; flex-direction: column; align-items: center;
    border: 1px solid var(--a-line-2);
    border-radius: var(--a-r);
}
.a-pedestal-avatar { width: 180px; height: 180px; border-radius: 50%; overflow: hidden; background: #1e293b; position: relative; margin-bottom: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); }
.a-accessory-overlay { position: absolute; top: -10px; right: -10px; font-size: 4rem; color: #fde047; transform: rotate(15deg); filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5)); z-index: 20;}
.a-badge-equipped { position: absolute; top: 10px; right: -30px; background: #10b981; color: #fff; font-size: 0.7rem; font-weight: bold; padding: 4px 30px; transform: rotate(45deg); z-index: 10;}

/* ============================================================
   TIENDA OPTIMIZADA (MINIATURAS CLICKABLES)
   ============================================================ */
.a-compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}
@media(min-width: 768px) {
    .a-compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
.a-compact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.a-compact-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--a-panel);
    border: 2px solid var(--a-line-2);
    border-radius: var(--a-r);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.a-compact-preview::after {
    content: '\f07a';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 50;
}
.a-compact-preview:hover {
    transform: translateY(-4px);
}
.a-compact-preview:hover::after {
    opacity: 1;
}

/* Rarity specific glow on the preview box */
.a-compact-preview.rarity-common { border-color: #cbd5e1; }
.a-compact-preview.rarity-rare { border-color: #93c5fd; background: rgba(59, 130, 246, 0.05); }
.a-compact-preview.rarity-epic { border-color: #d8b4fe; background: rgba(168, 85, 247, 0.05); }
.a-compact-preview.rarity-legendary { border-color: #fde047; background: rgba(234, 179, 8, 0.05); }

.a-compact-preview.rarity-common:hover { box-shadow: 0 8px 20px rgba(148, 163, 184, 0.4); }
.a-compact-preview.rarity-rare:hover { box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5); border-color: #3b82f6; }
.a-compact-preview.rarity-epic:hover { box-shadow: 0 8px 20px rgba(168, 85, 247, 0.5); border-color: #a855f7; }
.a-compact-preview.rarity-legendary:hover { box-shadow: 0 8px 20px rgba(234, 179, 8, 0.6); border-color: #eab308; }

.a-compact-owned .a-compact-preview {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(80%);
}
.a-compact-owned .a-compact-preview:hover {
    transform: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.a-compact-owned .a-compact-preview:hover::after {
    content: '\f00c';
    color: #10b981;
}

.a-compact-info {
    text-align: center;
    width: 100%;
}
.a-compact-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--a-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.a-compact-price {
    font-size: 1rem;
    font-weight: 900;
    color: #eab308;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
/* ═══════════════════ Miniatura de la tarjeta ═══════════════════
   Pantallazo real del juego (public/img/games/screenshots/<slug>.webp,
   generado con scratch/capturas.mjs). El marco pone el acento del juego
   arriba, difumina el borde de abajo contra la tarjeta para que el título
   respire, y acerca la imagen al pasar el puntero. */
.a-shot {
    position: relative;
    margin: 0;
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #05070d;
}
.a-shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.03);
    transition: transform .5s cubic-bezier(.2, .8, .3, 1);
}
.a-card:hover .a-shot img,
.a-card:focus-visible .a-shot img { transform: scale(1.1); }

/* Halo del color del juego: filete arriba y luz que entra en diagonal. */
.a-shot::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 32%, transparent),
                inset 0 18px 34px -20px var(--c);
    background: linear-gradient(115deg, color-mix(in srgb, var(--c) 14%, transparent), transparent 45%);
}

/* Velo inferior: la imagen se funde con la tarjeta (sirve en claro y oscuro). */
.a-shot::after {
    content: '';
    position: absolute;
    inset: auto 0 -1px 0;
    height: 54%;
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(to top,
        var(--a-card-bg) 2%,
        color-mix(in srgb, var(--a-card-bg) 58%, transparent) 40%,
        transparent);
}

.a-shot-play {
    position: absolute;
    z-index: 4;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: .72rem;
    padding-left: 2px;
    background: color-mix(in srgb, var(--c) 82%, #000);
    box-shadow: 0 8px 20px -8px var(--c), inset 0 0 0 1px rgba(255, 255, 255, .22);
    opacity: 0;
    transform: translateY(6px) scale(.9);
    transition: opacity .25s ease, transform .25s ease;
}
.a-card:hover .a-shot-play,
.a-card:focus-visible .a-shot-play { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .a-shot img, .a-shot-play { transition: none; }
    .a-card:hover .a-shot img { transform: scale(1.03); }
}
