/* =====================================================================
   ARENA WOW · PORTAL
   Barra do topo no PC (estilo Steam) e menu escondido no celular.
   As cores vêm de arena-theme.css.
   ===================================================================== */

:root {
    --bar-h: 68px;
}

* {
    box-sizing: border-box;
}

html,
body.portal {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body.portal {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    cursor: url('/img/mouse.cur'), auto;
}

/* cursor do WoW também na barra e no menu, igual às páginas */
body.portal a,
body.portal button {
    cursor: url('/img/mouseclick.cur'), pointer;
}

/* ================= BARRA DO TOPO ================= */

.portal-bar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    height: var(--bar-h);
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 28px;
    background: linear-gradient(180deg, #0b1a2e 0%, var(--bg-2) 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
}

/* linha gelada embaixo da barra */
.portal-bar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .6;
}

.portal-logo {
    display: inline-flex;
    flex-direction: column;
    flex-shrink: 0;
    color: var(--accent);
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    line-height: 1.05;
    text-decoration: none;
    text-shadow: 0 0 14px rgba(var(--accent-rgb), .45);
}

.portal-logo small {
    margin-top: 3px;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.6px;
    text-shadow: none;
}

/* ================= ABAS (PC) ================= */

.portal-tabs {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 4px;
}

.portal-aba {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 14px;
    background: none;
    border: 0;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--speed);
}

.portal-aba .ico {
    display: none;
}

.portal-aba .seta {
    font-size: 11px;
    opacity: .7;
    transition: transform var(--speed);
}

/* sublinhado que cresce, igual às abas da Steam */
.portal-aba::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    height: 3px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), .7);
    transform: scaleX(0);
    transition: transform .25s ease;
}

.portal-aba:hover,
.portal-grupo:hover > .portal-aba,
.portal-grupo.aberto > .portal-aba {
    color: #fff;
}

.portal-aba.ativo,
.portal-grupo.ativo > .portal-aba {
    color: var(--accent);
}

.portal-aba.ativo::after,
.portal-grupo.ativo > .portal-aba::after {
    transform: scaleX(1);
}

/* ================= SUBMENU (PC) ================= */

.portal-grupo {
    position: relative;
    height: 100%;
}

.portal-sub {
    position: absolute;
    top: calc(100% - 6px);
    left: 4px;
    min-width: 250px;
    padding: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(var(--accent-rgb), .06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s;
}

.portal-grupo.aberto > .portal-sub {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.portal-grupo.aberto .seta {
    transform: rotate(180deg);
}

@media (hover: hover) {
    .portal-grupo:hover > .portal-sub {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}

.portal-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--speed), color var(--speed);
}

.portal-sub-link:hover {
    background: var(--card-2);
    color: #fff;
}

.portal-sub-link.ativo {
    background: rgba(var(--accent-rgb), .12);
    color: var(--accent);
}

/* ================= LINKS EXTERNOS (PC) ================= */

.portal-externos {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.portal-externo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--card);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color var(--speed), background var(--speed), color var(--speed), box-shadow var(--speed);
}

.portal-externo:hover {
    border-color: var(--accent);
    background: var(--card-2);
    color: var(--accent-light);
    box-shadow: 0 0 12px rgba(var(--accent-rgb), .25);
}

/* tela de notebook: links externos só com ícone */
@media (max-width: 1360px) {
    .portal-bar {
        gap: 18px;
    }

    .portal-aba {
        padding: 0 10px;
    }

    .portal-aba::after {
        left: 10px;
        right: 10px;
    }

    .portal-externo {
        padding: 8px 10px;
        font-size: 15px;
    }

    .portal-externo span:not(.ico) {
        display: none;
    }
}

/* ================= QUADRO DAS PÁGINAS ================= */

.portal-palco {
    position: fixed;
    inset: var(--bar-h) 0 0 0;
}

.portal-quadro {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--bg);
    transition: opacity .2s ease;
}

.portal-quadro.saindo {
    opacity: 0;
}

/* barrinha de carregamento no topo */
.portal-carregando {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    height: 2px;
    width: 0;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    opacity: 0;
}

body.carregando .portal-carregando {
    opacity: 1;
    animation: portal-progresso 1.2s ease-out forwards;
}

@keyframes portal-progresso {
    from {
        width: 0;
    }

    to {
        width: 85%;
    }
}

/* ================= MENU DO CELULAR ================= */

.portal-burger,
.portal-atual,
.portal-drawer,
.portal-fundo {
    display: none;
}

@media (max-width: 1100px) {
    :root {
        --bar-h: 56px;
    }

    .portal-bar {
        gap: 14px;
        padding: 0 12px;
    }

    .portal-tabs,
    .portal-externos {
        display: none;
    }

    .portal-logo {
        font-size: 19px;
    }

    .portal-logo small {
        font-size: 8px;
    }

    .portal-atual {
        display: block;
        margin-left: auto;
        overflow: hidden;
        color: var(--muted);
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .5px;
        text-overflow: ellipsis;
        text-transform: uppercase;
        white-space: nowrap;
    }

    /* os três riscos */
    .portal-burger {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        padding: 0 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--card);
        cursor: pointer;
    }

    .portal-burger span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: var(--accent);
        transition: transform .25s, opacity .25s;
    }

    body.gaveta-aberta .portal-burger span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.gaveta-aberta .portal-burger span:nth-child(2) {
        opacity: 0;
    }

    body.gaveta-aberta .portal-burger span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* fundo escuro atrás do menu */
    .portal-fundo {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(0, 0, 0, .6);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }

    body.gaveta-aberta .portal-fundo {
        opacity: 1;
        pointer-events: auto;
    }

    /* o menu que desliza da esquerda */
    .portal-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 70;
        width: min(320px, 86vw);
        background: var(--bg-2);
        border-right: 1px solid var(--border);
        box-shadow: 10px 0 40px rgba(0, 0, 0, .6);
        transform: translateX(-102%);
        transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    }

    body.gaveta-aberta .portal-drawer {
        transform: none;
    }

    .portal-drawer-topo {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 14px 12px 18px;
        border-bottom: 1px solid var(--border);
    }

    .portal-fechar {
        width: 38px;
        height: 38px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--card);
        color: var(--accent);
        font-size: 16px;
        cursor: pointer;
    }

    .portal-drawer-links {
        flex: 1;
        overflow-y: auto;
        padding: 8px 10px 24px;
    }

    .portal-gaveta-titulo {
        margin: 16px 8px 6px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 1.4px;
        text-transform: uppercase;
    }

    .portal-gaveta-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 10px;
        border-radius: 8px;
        color: var(--text);
        font-size: 15px;
        font-weight: 500;
        text-decoration: none;
    }

    .portal-gaveta-link .ico {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--card-2);
        font-size: 17px;
    }

    .portal-gaveta-link:active,
    .portal-gaveta-link:hover {
        background: var(--card);
        color: #fff;
    }

    .portal-gaveta-link.ativo {
        background: rgba(var(--accent-rgb), .12);
        color: var(--accent);
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-quadro,
    .portal-drawer,
    .portal-fundo,
    .portal-sub,
    .portal-aba::after {
        transition: none;
    }
}
