/* Cabeçalho público */

/*
 * Fundo com textura: camadas CSS (brilho, pontilhado e degradê navy) sempre
 * visíveis como fallback; a arte vetorial branding/header-bg.svg cobre as camadas
 * de base, e os feixes de luz do ::before e o sombreamento de leitura continuam
 * por cima dela.
 */
.top-bar {
    background-color: #0c1d3c;
    background-image:
        linear-gradient(180deg, rgba(143, 184, 255, 0.07) 0%, rgba(143, 184, 255, 0) 40%, rgba(0, 6, 34, 0.24) 100%),
        linear-gradient(90deg, rgba(8, 20, 44, 0) 45%, rgba(8, 20, 44, 0.32) 100%),
        url('branding/header-bg.svg'),
        radial-gradient(ellipse 440px 170% at 0% 110%, rgba(59, 130, 246, 0.36), rgba(59, 130, 246, 0) 70%),
        radial-gradient(ellipse 560px 150% at 100% -10%, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0) 70%),
        radial-gradient(circle, rgba(143, 184, 255, 0.11) 0 1px, rgba(143, 184, 255, 0) 1.6px),
        radial-gradient(circle, rgba(143, 184, 255, 0.06) 0 1px, rgba(143, 184, 255, 0) 1.6px),
        linear-gradient(90deg, #12295a 0%, #0e2149 38%, #0b1a3a 100%);
    background-size: auto, auto, cover, auto, auto, 16px 16px, 16px 16px, auto;
    background-position: 0 0, 0 0, left center, 0 0, 0 0, 0 0, 8px 8px, 0 0;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat, repeat, no-repeat;
    border-bottom: 1px solid transparent;
    border-image: linear-gradient(90deg, rgba(91, 152, 255, 0.2) 0%, #6ea8ff 12%, rgba(91, 152, 255, 0.35) 42%, rgba(36, 59, 94, 0.85) 100%) 1;
    box-shadow: 0 8px 24px rgba(0, 4, 20, 0.35);
}
/* Feixes diagonais de luz saindo do canto inferior esquerdo, como na referência. */
.top-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            115deg,
            rgba(170, 205, 255, 0) 0,
            rgba(170, 205, 255, 0.13) 16px,
            rgba(170, 205, 255, 0.035) 30px,
            rgba(170, 205, 255, 0) 44px,
            rgba(170, 205, 255, 0) 58px
        ),
        repeating-linear-gradient(
            115deg,
            rgba(170, 205, 255, 0) 0 22px,
            rgba(170, 205, 255, 0.08) 24px 27px,
            rgba(170, 205, 255, 0) 29px 71px
        );
    -webkit-mask-image: radial-gradient(ellipse 540px 190% at 0% 100%, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 74%);
    mask-image: radial-gradient(ellipse 540px 190% at 0% 100%, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 74%);
}

/* Botão do menu em um quadrado arredondado com degradê próprio. */
.top-bar .hamburger-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    gap: 4px;
    align-items: center;
    border: 1px solid #3a67bd;
    border-radius: 11px;
    background:
        radial-gradient(120% 90% at 28% 0%, rgba(143, 184, 255, 0.34), rgba(143, 184, 255, 0) 62%),
        linear-gradient(155deg, #2352bb 0%, #173a86 52%, #0f2758 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -2px 4px rgba(0, 8, 30, 0.35),
        0 3px 10px rgba(0, 6, 34, 0.45),
        0 0 14px rgba(37, 99, 235, 0.22);
    transition:
        filter 0.15s,
        transform 0.15s;
}
.top-bar .hamburger-btn span {
    width: 16px;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0, 10, 40, 0.35);
    transition:
        width 0.2s,
        transform 0.2s;
}
.top-bar .hamburger-btn span:nth-child(2) {
    width: 11px;
    align-self: auto;
    transform: translateX(-2.5px);
}
.top-bar .hamburger-btn:hover {
    filter: brightness(1.12);
}
.top-bar .hamburger-btn:hover span:nth-child(2) {
    width: 16px;
    transform: none;
}
.top-bar .hamburger-btn:active {
    transform: scale(0.95);
}

/* Saldo + depósito em um único controle. */
.header-wallet {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    height: 40px;
    border: 1px solid #2f5596;
    border-radius: 11px;
    background: linear-gradient(180deg, #06122b 0%, #0a1b3a 100%);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.45),
        0 1px 0 rgba(143, 184, 255, 0.08);
}
.header-wallet-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 11px 0 10px;
    border-radius: 10px 0 0 10px;
    color: #f4f8ff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transition: background 0.15s;
}
.header-wallet-balance:hover {
    background: rgba(143, 184, 255, 0.07);
}
.header-wallet-balance .brazil-flag {
    flex-shrink: 0;
    width: 22px;
    height: 16px;
    border-radius: 2px;
}
.header-wallet-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.header-wallet-deposit {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    width: 40px;
    margin: -1px -1px -1px 0;
    border: 1px solid #45d67f;
    border-radius: 11px;
    background:
        radial-gradient(110% 80% at 30% 0%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 60%),
        linear-gradient(160deg, #1fb356 0%, #16a34a 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -2px 0 rgba(0, 0, 0, 0.16),
        0 2px 10px rgba(22, 163, 74, 0.38);
    transition:
        filter 0.15s,
        transform 0.15s;
}
.header-wallet-deposit:hover {
    filter: brightness(1.08);
}
.header-wallet-deposit:active {
    transform: scale(0.95);
}
.header-wallet-plus {
    width: 18px;
    height: 18px;
    filter: drop-shadow(0 1px 1px rgba(0, 60, 20, 0.45));
}
.header-wallet-bonus {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 4px;
    border: 2px solid #0c1d3c;
    border-radius: 6px;
    background: linear-gradient(180deg, #fde68a, #fcd34d 55%, #f5b82e);
    color: #3b2500;
    font-size: 7px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.03em;
    white-space: nowrap;
    pointer-events: none;
}

/* Avatar, busca e recompensas combinando com o novo fundo. */
.top-bar .account-button {
    border: 2px solid #33599e;
    box-shadow: 0 3px 10px rgba(0, 6, 34, 0.4);
}
.top-bar .header-search {
    background: rgba(4, 12, 30, 0.55);
    border-color: rgba(91, 152, 255, 0.28);
}
.top-bar .header-search:focus-within {
    border-color: #6ea8ff;
}
.top-bar .header-reward {
    border-left-color: rgba(143, 184, 255, 0.16);
}

/* Visitantes: Entrar / Criar conta. */
.top-bar .btn-entrar {
    border: 1px solid #2f5596;
    background: rgba(6, 16, 36, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.top-bar .header-register {
    border-color: #4d86ea;
    background: linear-gradient(160deg, #3276f4, #2154cb);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 3px 12px rgba(37, 99, 235, 0.35);
}
.top-bar .registration-badge {
    border-color: #0c1d3c;
}

/* Presente de recompensas com contador */
.header-gift picture {
    display: contents;
}
.header-gift {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    transition: transform 0.18s;
}
.header-gift img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 3px 6px #0008);
    animation: header-gift-wiggle 4s ease-in-out infinite;
}
.header-gift:hover {
    transform: translateY(-1px) scale(1.04);
}
.header-gift:focus-visible {
    outline: 2px solid #8fb8ff;
    outline-offset: 2px;
}
.header-gift-badge {
    position: absolute;
    top: 0;
    right: 0;
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #0c1d3c;
    border-radius: 999px;
    background: #ef3b54;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}
@keyframes header-gift-wiggle {
    0%,
    86%,
    100% {
        transform: rotate(0);
    }
    89% {
        transform: rotate(-9deg);
    }
    92% {
        transform: rotate(8deg);
    }
    95% {
        transform: rotate(-5deg);
    }
}
@media (min-width: 901px) and (max-width: 1100px) {
    .top-bar .header-search {
        min-width: 120px;
    }
}
@media (max-width: 900px) {
    .top-bar .header-search {
        display: none;
    }
}
@media (max-width: 900px) {
    .top-bar .hamburger-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
}
@media (max-width: 600px) {
    .top-bar::before {
        -webkit-mask-image: radial-gradient(ellipse 330px 190% at 0% 100%, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 74%);
        mask-image: radial-gradient(ellipse 330px 190% at 0% 100%, #000 0%, rgba(0, 0, 0, 0.55) 42%, transparent 74%);
    }
    .top-bar .hamburger-btn {
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        border-radius: 9px;
    }
    .top-bar .hamburger-btn span {
        width: 15px;
    }
    .top-bar .hamburger-btn span:nth-child(2) {
        width: 10px;
    }
    .header-wallet {
        height: 34px;
        border-radius: 10px;
    }
    .header-wallet-balance {
        gap: 6px;
        padding: 0 8px 0 7px;
        border-radius: 9px 0 0 9px;
        font-size: 12px;
    }
    .header-wallet-balance .brazil-flag {
        width: 18px;
        height: 13px;
    }
    .header-wallet-deposit {
        flex-basis: 34px;
        width: 34px;
        border-radius: 10px;
    }
    .header-wallet-plus {
        width: 16px;
        height: 16px;
    }
    .header-wallet-bonus {
        top: -8px;
        padding: 2px 3px;
        font-size: 6.5px;
    }
}
@media (max-width: 360px) {
    .header-gift {
        width: 32px;
        height: 32px;
    }
    .header-gift img {
        width: 26px;
        height: 26px;
    }
    .top-bar .left-header {
        gap: 6px;
    }
    .top-bar .header-buttons {
        gap: 5px;
    }
    .header-wallet-balance {
        gap: 5px;
        padding: 0 6px;
        font-size: 11.5px;
        letter-spacing: -0.01em;
    }
    .header-wallet-balance .brazil-flag {
        width: 16px;
        height: 12px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .header-gift img {
        animation: none;
    }
    .top-bar .hamburger-btn,
    .top-bar .hamburger-btn span,
    .header-wallet-balance,
    .header-wallet-deposit {
        transition: none;
    }
}
