:root {
    --background: #000000;
    --foreground: #ffffff;
    --primary: #d4af37;
    --primary-soft: rgba(212, 175, 55, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --muted: #a1a1aa;
    --panel-bg: #18181b;
    --scrollbar-track: #121214;
    --scrollbar-thumb: rgba(212, 175, 55, 0.42);
    --scrollbar-thumb-hover: rgba(212, 175, 55, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
}

/* Scrollbars: viewport, modal de notícias, menu mobile, tabelas */
html,
body,
.custom-scrollbar,
#mobile-menu,
.responsive-table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.custom-scrollbar::-webkit-scrollbar,
#mobile-menu::-webkit-scrollbar,
.responsive-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.custom-scrollbar::-webkit-scrollbar-track,
#mobile-menu::-webkit-scrollbar-track,
.responsive-table-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 8px;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.custom-scrollbar::-webkit-scrollbar-thumb,
#mobile-menu::-webkit-scrollbar-thumb,
.responsive-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.55), rgba(184, 134, 11, 0.42));
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.custom-scrollbar::-webkit-scrollbar-thumb:hover,
#mobile-menu::-webkit-scrollbar-thumb:hover,
.responsive-table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scrollbar-thumb-hover), rgba(212, 175, 55, 0.48));
    border: 2px solid var(--scrollbar-track);
    background-clip: padding-box;
}

html::-webkit-scrollbar-corner,
body::-webkit-scrollbar-corner,
.custom-scrollbar::-webkit-scrollbar-corner,
#mobile-menu::-webkit-scrollbar-corner,
.responsive-table-container::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/* Notícias (cards): nunca width:100% na img — isso + max-height corta. Só max-* + contain */
.news-card-thumb-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.25);
    overflow: visible;
    min-width: 0;
    flex-shrink: 0;
}

.news-card-thumb {
    display: block;
    width: auto;
    height: auto;
    max-width: min(430px, 100%);
    max-height: 160px;
    object-fit: contain;
    object-position: center;
}

/* Corpo da notícia: Tailwind Typography (.prose) costuma pôr img a 100% largura — neutraliza */
#modalNewsContent.prose img,
#modalNewsContent img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(85vh, 720px) !important;
    object-fit: contain !important;
    margin-left: auto;
    margin-right: auto;
}

/* Página /news — imagem de destaque no leitor */
.news-reader-hero {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(52vh, 460px);
    object-fit: contain;
    object-position: center;
}

#news-reader-body.prose img,
#news-reader-body img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(85vh, 720px) !important;
    object-fit: contain !important;
    margin-left: auto;
    margin-right: auto;
}

/* Setas fixas nas laterais (leitor de notícia) */
.news-page-side-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.55);
    color: var(--primary);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

.news-page-side-nav:hover {
    background: rgba(212, 175, 55, 0.12);
    color: #fff;
    border-color: var(--primary);
}

.news-page-side-nav--left {
    left: max(0.5rem, env(safe-area-inset-left, 0px));
}

.news-page-side-nav--right {
    right: max(0.5rem, env(safe-area-inset-right, 0px));
}

@media (max-width: 1024px) {
    .news-page-side-nav--right {
        right: max(3.5rem, env(safe-area-inset-right, 0px));
    }
}

/* Glassmorphism */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #b8860b);
    color: #000;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

/* Header / Nav Items */
header nav a {
    color: var(--muted);
    transition: color 0.3s;
    text-decoration: none;
    text-transform: capitalize;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

header nav a:hover,
header nav a.active {
    color: var(--foreground);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Nav item icon alignment */
.nav-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-item svg {
    opacity: 0.7;
    transition: opacity 0.25s;
    flex-shrink: 0;
}

.nav-item:hover svg,
.nav-item.active svg {
    opacity: 1;
}

/* ─── Header action buttons (Download + Account) ───────────────── */
.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    flex-shrink: 0;
    background: none;
    font-family: inherit;
}

/* Ghost variant — Download */
.nav-action-btn--ghost {
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.04);
}

.nav-action-btn--ghost:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    background: rgba(255, 255, 255, 0.09);
}

/* Gold variant — Account */
.nav-action-btn--gold {
    border: 1px solid rgba(212, 175, 55, 0.55);
    color: var(--primary);
    background: rgba(212, 175, 55, 0.08);
}

.nav-action-btn--gold:hover,
#account-dropdown-wrap.is-open .nav-action-btn--gold {
    border-color: var(--primary);
    color: #fff;
    background: rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
}

/* Account dropdown wrapper */
.nav-account-wrap {
    position: relative;
    flex-shrink: 0;
}

/* Chevron rotation */
.nav-chevron {
    transition: transform 0.2s ease;
}

.nav-account-wrap.is-open .nav-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel — hidden by default via display:none */
.nav-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 11rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(14, 14, 16, 0.97);
    backdrop-filter: blur(16px);
    overflow: hidden;
    z-index: 300;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.65),
        0 2px 6px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    /* entrance animation */
    animation: dropdownIn 0.18s ease-out forwards;
}

.nav-account-wrap.is-open .nav-dropdown {
    display: block;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}

/* Dropdown items */
.nav-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.65rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}

.nav-dropdown__item:hover {
    background: rgba(212, 175, 55, 0.08);
    color: #fff;
}

.nav-dropdown__item--border {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Mobile Menu Styles — z-index above language flags / header */
#mobile-menu {
    z-index: 10050;
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

#mobile-menu.opacity-100 {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Language flags: above header, always below full-screen overlays & modals */
.lang-flags {
    z-index: 90;
}

/* Class balance: keep above content, clear language strip on small screens */
#back-to-top-btn {
    bottom: max(1.25rem, calc(env(safe-area-inset-bottom, 0px) + 0.5rem));
    right: max(1rem, env(safe-area-inset-right, 0px));
}

@media (max-width: 767px) {
    #back-to-top-btn {
        bottom: max(5.75rem, calc(env(safe-area-inset-bottom, 0px) + 0.5rem));
    }
}

/* Header row: prevent logo / CTA crowding and misalignment on narrow screens */
header .container.mx-auto.flex {
    gap: 0.5rem;
    min-width: 0;
}

@media (min-width: 768px) {
    header .container.mx-auto.flex {
        gap: 1.5rem;
    }
}

header .container.mx-auto.flex > div:last-child {
    flex-shrink: 0;
}

/* Subtitles in hero / feature cards: readable on mobile */
.feature-subtitle {
    font-size: clamp(0.6875rem, 2.6vw, 0.8125rem);
    line-height: 1.35;
    letter-spacing: 0.02em;
}

/* Page titles: consistent scaling (works with Tailwind text-4xl etc.) */
@media (max-width: 640px) {
    main h1.text-4xl,
    main h1.text-5xl {
        font-size: clamp(1.5rem, 6.5vw, 2.25rem) !important;
        line-height: 1.15 !important;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Global Responsive Fixes */
@media (max-width: 1024px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    img {
        max-width: 100%;
        height: auto;
    }

    img.news-card-thumb {
        max-width: min(430px, 100%);
        max-height: 160px;
        width: auto;
        height: auto;
    }

    /* Prevent text overflow in large headings */
    h1 {
        font-size: clamp(2rem, 8vw, 4rem) !important;
        line-height: 1.1 !important;
    }

    /* Table Responsiveness */
    .responsive-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 640px) {
    header .container {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0));
        padding-right: max(0.75rem, env(safe-area-inset-right, 0));
    }

    /* Hide specific non-essential desktop elements */
    .desktop-only {
        display: none !important;
    }

    /* Ensure hero logo doesn't span too wide on small mobile */
    .hero-logo {
        max-width: 280px !important;
    }
}

/* Hero launch countdowns */
.hero-countdowns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    opacity: 1;
    visibility: visible;
}

.hero-countdowns.is-hidden {
    display: none;
}

.launch-countdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition:
        opacity 0.55s ease,
        transform 0.55s ease,
        max-height 0.55s ease,
        margin 0.55s ease,
        padding 0.55s ease;
    max-height: 220px;
    overflow: hidden;
}

.launch-countdown.is-ended {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    max-height: 0;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

.launch-countdown--primary {
    padding: 0.85rem 1.1rem 0.7rem;
    border-radius: 0.75rem;
    background: linear-gradient(145deg, rgba(212, 175, 55, 0.12), rgba(0, 0, 0, 0.55));
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow:
        0 0 40px rgba(212, 175, 55, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
}

.launch-countdown--secondary {
    margin-top: 0.3rem;
    padding: 0.45rem 0.75rem 0.55rem;
    border-radius: 0.6rem;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.1), rgba(0, 0, 0, 0.5));
    border: 1px solid rgba(59, 130, 246, 0.28);
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(12px);
}

.launch-countdown__title {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.launch-countdown--primary .launch-countdown__title {
    color: var(--primary);
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.45);
}

.launch-countdown--secondary .launch-countdown__title {
    color: #60a5fa;
    font-size: 0.52rem;
    letter-spacing: 0.14em;
    margin-bottom: 0.25rem;
}

.launch-countdown__date {
    font-size: 0.55rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.55rem;
}

.launch-countdown--secondary .launch-countdown__date {
    display: none;
}

.launch-countdown__grid {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
}

.launch-countdown--secondary .launch-countdown__grid {
    gap: 0.25rem;
}

.launch-countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 2.75rem;
    padding: 0.4rem 0.35rem 0.3rem;
    border-radius: 0.45rem;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.launch-countdown--primary .launch-countdown__unit {
    min-width: 3.1rem;
    padding: 0.5rem 0.4rem 0.35rem;
    border-color: rgba(212, 175, 55, 0.15);
}

.launch-countdown--secondary .launch-countdown__unit {
    min-width: 2.2rem;
    padding: 0.3rem 0.25rem 0.25rem;
    border-color: rgba(59, 130, 246, 0.15);
}

.launch-countdown__value {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.launch-countdown--primary .launch-countdown__value {
    font-size: clamp(1.25rem, 4.5vw, 1.75rem);
    color: var(--primary);
    text-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

@supports (-webkit-background-clip: text) {
    .launch-countdown--primary .launch-countdown__value {
        background: linear-gradient(180deg, #fff8e7 0%, var(--primary) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}

.launch-countdown--secondary .launch-countdown__value {
    font-size: clamp(0.85rem, 3vw, 1.05rem);
    color: #93c5fd;
}

.launch-countdown__label {
    margin-top: 0.25rem;
    font-size: 0.48rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.launch-countdown--secondary .launch-countdown__label {
    font-size: 0.44rem;
    margin-top: 0.2rem;
}

.launch-countdown__sep {
    display: flex;
    align-items: center;
    padding-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 800;
    color: rgba(212, 175, 55, 0.45);
    user-select: none;
}

.launch-countdown--secondary .launch-countdown__sep {
    font-size: 0.7rem;
    padding-bottom: 0.65rem;
    color: rgba(96, 165, 250, 0.45);
}

@media (max-width: 400px) {
    .launch-countdown__unit {
        min-width: 2.35rem;
    }

    .launch-countdown--primary .launch-countdown__unit {
        min-width: 2.65rem;
    }

    .launch-countdown__sep {
        padding-bottom: 0.7rem;
    }
}

/* Info page guide */
.info-side-nav {
    position: fixed;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: none;
    max-height: 80vh;
    overflow-y: auto;
}

@media (min-width: 1280px) {
    .info-side-nav {
        display: block;
    }
}

.info-side-nav-item {
    position: relative;
    padding: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #aaa;
    text-decoration: none;
}

.info-side-nav-item::before {
    content: '';
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.info-side-nav-item:hover,
.info-side-nav-item.active {
    color: #fff;
}

.info-side-nav-item:hover::before,
.info-side-nav-item.active::before {
    background: var(--primary);
    height: 24px;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.info-side-nav-label {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.info-guide-section {
    scroll-margin-top: 120px;
}

.info-guide-card {
    border-left: 3px solid rgba(212, 175, 55, 0.25);
}

.info-guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #d4d4d8;
    font-size: 0.875rem;
}

.info-guide-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.info-guide-list li::before {
    content: '•';
    color: var(--primary);
    font-weight: bold;
    flex-shrink: 0;
}

.info-guide-list--deny li::before {
    content: '✕';
    color: #f87171;
}

.info-guide-list--check li::before {
    content: '✓';
    color: #4ade80;
}

.info-guide-steps {
    list-style: none;
    counter-reset: guide-step;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.info-guide-steps li {
    counter-increment: guide-step;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #d4d4d8;
}

.info-guide-steps li::before {
    content: counter(guide-step);
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}

.info-guide-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
    margin-right: 0.35rem;
    flex-shrink: 0;
}

.info-guide-badge--blue {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.info-guide-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e4e4e7;
}

.info-guide-tag--safe {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.info-guide-tag--pvp {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.info-guide-cmd {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 0.4rem;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--primary);
}

.info-guide-cmd-inline {
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--primary);
}

.info-guide-table thead th {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #71717a;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-guide-table tbody td {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e4e4e7;
}
