/* Keep the menu and content offset in sync at every breakpoint. */
:root { --sidebar-width: 296px; }
.sidebar {
    width: var(--sidebar-width);
    padding-inline: 20px;
    padding-top: 22px;                 /* the logo near the top, with a little air above it */
    overflow-x: hidden;
    scrollbar-width: thin;
}
.workspace {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
}
.sidebar .brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 0 14px;
}
.sidebar .brand + .nav-label { margin-top: 8px; }
.brand img {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    object-fit: contain;
}
.brand > .brand-wordmark {
    display: block;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}
.brand-name {
    display: block;
    font-size: 30px;
    line-height: 1;
    letter-spacing: 2px;
    text-indent: 2px;
}
.brand .brand-sub {
    display: block;
    margin-top: 10px;
    padding: 0;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: .55em;
    /* Balance trailing letter spacing so ARENA is optically centered. */
    text-indent: .55em;
    text-align: center;
}
@media (min-width: 851px) and (max-width: 1150px) {
    :root { --sidebar-width: 280px; }
    .sidebar { padding-inline: 16px; }
}
@media (max-width: 850px) {
    .sidebar { width: min(296px, 100vw); }
    .workspace { margin-left: 0; width: 100%; }
}

/* Solar artwork: dark copy area, unobstructed faces on the right. */
.hero-solar { background: #101013; }
.hero-solar .hero-image { object-position: var(--hero-focus, right) center; opacity: 1; }
.hero-solar::after {
    background: linear-gradient(90deg, #0b0b0ef2 0%, #0b0b0eb3 32%, transparent 64%),
        linear-gradient(0deg, #10101399, transparent 35%);
}
/* Give the duo its own space when text and artwork cannot fit side by side. */
@media (max-width: 1100px) {
    .hero-solar { padding-top: calc(clamp(210px, 36vw, 320px) + 24px); padding-bottom: 65px; }
    .hero-solar .hero-image {
        height: clamp(210px, 36vw, 320px);
        object-position: var(--hero-focus, right) 25%;
    }
    .hero-solar::after {
        background: linear-gradient(180deg, transparent calc(clamp(210px, 36vw, 320px) - 60px), #101013 clamp(210px, 36vw, 320px));
    }
    .hero-solar p { max-width: 480px; }
    .hero-solar .hero-foot { left: 23px; right: 23px; letter-spacing: 2px; }
}

/* Banner words edited in Panel → Portada: one line per title row, an empty row takes no space. */
.hero .hero-line { display: block; }
.hero .hero-line:empty { display: none; }
/* "Move the text right" (Panel → Portada): only where the words sit over the artwork; the shade follows them. */
@media (min-width: 1101px) {
    .hero-solar { padding-left: calc(44px + var(--hero-shift, 0%)); }
    .hero-solar::after {
        background: linear-gradient(90deg, #0b0b0ef2 var(--hero-shift, 0%), #0b0b0eb3 calc(var(--hero-shift, 0%) + var(--hero-shade, 64%) / 2),
                transparent calc(var(--hero-shift, 0%) + var(--hero-shade, 64%))),
            linear-gradient(0deg, #10101399, transparent 35%);
    }
}

/* The menu a little tighter: same icons and letters, less air between the options and around the section names. */
.sidebar .nav-link { padding-block: 8px; margin-bottom: 3px; }
.sidebar .nav-label { margin: 14px 14px 6px; }
.sidebar .brand + .nav-label { margin-top: 8px; }

/* Phones and tablets: the bottom bar holds the four places used most and «Más», which opens every other section in
   one panel (this sidebar, drawn as a sheet above the bar, its sections as tiles); the top bar shows the sun and the
   page's name. The page draws edge to edge (viewport-fit=cover): the safe areas keep it clear of notches. */
.topbar-logo, .nav-sheet-label { display: none; }
@media (max-width: 850px) {
    .topbar .mobile-toggle { display: none; }
    .topbar { padding-left: max(25px, env(safe-area-inset-left)); padding-right: max(25px, env(safe-area-inset-right)); }
    main { padding-left: max(25px, env(safe-area-inset-left)); padding-right: max(25px, env(safe-area-inset-right)); }
    .topbar-logo { display: grid; place-items: center; flex: none; width: 34px; height: 34px; margin-left: -3px; }
    .topbar-logo img { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 0 8px #ff782f40); }
    .breadcrumb { flex: 1; min-width: 0; font-size: 0; letter-spacing: 0; }
    .breadcrumb > span { display: none; }
    .breadcrumb > strong { display: block; overflow: hidden; font: 700 20px/1.15 Rajdhani, Arial, sans-serif; letter-spacing: .2px; color: var(--text); white-space: nowrap; text-overflow: ellipsis; }

    .tabbar { padding-left: max(4px, env(safe-area-inset-left)); padding-right: max(4px, env(safe-area-inset-right)); }
    .tabbar .tab-more { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; border: 0; border-radius: 10px; background: none; font-family: inherit; font-size: 10.5px; line-height: 1.6; color: #a9a4b3; }
    .tabbar .tab-more span { display: grid; place-items: center; height: 24px; }
    .tabbar .tab-more.on, .tabbar .tab-more[aria-expanded="true"] { color: var(--fire); }
    .tabbar .tab-more.on span, .tabbar .tab-more[aria-expanded="true"] span { filter: drop-shadow(0 0 7px #ff782f99); }
    .tabbar .tab-more:active { background: #ffffff0d; }

    .sidebar ~ .nav-scrim:not([hidden]) { z-index: 43; }
    .sidebar {
        inset: auto 0 calc(64px + env(safe-area-inset-bottom)) 0;
        width: auto;
        max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));
        padding: 24px max(14px, env(safe-area-inset-right)) 16px max(14px, env(safe-area-inset-left));
        border: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 22px 22px 0 0;
        background: #141417;
        box-shadow: 0 -24px 60px #000b;
        transform: translateY(calc(100% + 90px));
        visibility: hidden;
        transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s;
        z-index: 44;
        overscroll-behavior: contain;
    }
    .sidebar.open { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
    .sidebar:focus { outline: none; }
    .sidebar::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #45424d; }
    .sidebar .brand { display: none; }
    .sidebar .nav-label { margin: 6px 4px 8px; }
    .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .sidebar nav .nav-label { grid-column: 1 / -1; margin: 10px 4px 0; }
    .sidebar .nav-link { position: relative; flex-direction: column; justify-content: center; gap: 7px; min-height: 80px; margin: 0; padding: 12px 6px; border: 1px solid var(--line); border-radius: 14px; background: #1b1a20; font-size: 12px; line-height: 1.2; text-align: center; color: #d7d3de; }
    .sidebar .nav-link > span { width: 26px; height: 26px; color: #b6b1c0; }
    .sidebar .nav-link .nav-icon { width: 24px; height: 24px; }
    .sidebar .nav-link:active { background: #24222a; }
    .sidebar .nav-link.selected { border-color: #ff782f80; background: #ff782f14; box-shadow: none; }
    .sidebar .nav-link.in-tabbar, .sidebar .nav-link i { display: none; }
    .sidebar .nav-link .nav-count { position: absolute; top: 6px; right: 6px; margin: 0; }
    .sidebar-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 0; padding-top: 4px; }
    .sidebar-bottom .nav-sheet-label { display: block; grid-column: 1 / -1; margin: 10px 4px 0; }
    .sidebar-bottom .discord-card { grid-column: 1 / -1; order: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 0; padding: 13px 14px; }
    .sidebar-bottom .discord-card .eyebrow { display: none; }
    .sidebar-bottom .discord-card strong { margin: 0; font-size: 12.5px; }
    .sidebar-bottom .discord-card a { gap: 8px; font-size: 12px; white-space: nowrap; }
    .sidebar-bottom > small { display: none; }
    .sidebar .nav-install { grid-column: 1 / -1; order: -1; flex-direction: row; gap: 10px; min-height: 52px; margin-top: 10px; border-color: #ff782f66; background: linear-gradient(100deg, #ff782f26, #1b1a20 70%); font-size: 13px; font-weight: 600; color: var(--gold); }
    .sidebar .nav-install > span { color: var(--gold); }
}
@media (max-width: 600px) {
    .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
    main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
/* Big phones in landscape get the desktop menu: it and the page step out of the notch (both are 0 on a computer). */
@media (min-width: 851px) {
    .sidebar { left: env(safe-area-inset-left); }
    .workspace { margin-left: calc(var(--sidebar-width) + env(safe-area-inset-left)); width: calc(100% - var(--sidebar-width) - env(safe-area-inset-left) - env(safe-area-inset-right)); }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .sidebar.open { transition: none; } }
/* Phones: the row of tabs linking the sections of a group (Jugar, Tienda), at the top of their pages: tabs with a line
   under the current one, unlike the round filter chips some pages have below. */
.subnav { display: none; }
@media (max-width: 850px) {
    .subnav {
        display: flex; gap: 2px; margin: -14px -25px 18px; padding: 0 25px; border-bottom: 1px solid var(--line);
        overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
    }
    .subnav::-webkit-scrollbar { display: none; }
    .subnav a { position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 12px 12px 13px; color: #a29dad; font-size: 13.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; scroll-snap-align: center; }
    .subnav a .nav-icon { width: 18px; height: 18px; }
    .subnav a:active { color: var(--text); }
    .subnav a.on { color: var(--text); }
    .subnav a.on .nav-icon { color: var(--fire); filter: drop-shadow(0 0 6px #ff782f80); }
    .subnav a.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--fire); box-shadow: 0 0 10px #ff782f80; }
}
@media (max-width: 600px) { .subnav { margin: -10px -16px 16px; padding: 0 16px; } }
/* The installed app on iPhone and iPad draws under the status bar (black-translucent): the bars keep clear of it. On a
   computer, and in a browser tab, the inset is 0 and nothing moves. */
.topbar { padding-top: env(safe-area-inset-top); height: calc(58px + env(safe-area-inset-top)); }
@media (min-width: 851px) { .sidebar { padding-top: calc(22px + env(safe-area-inset-top)); } }
@media (max-width: 850px) { .topbar { height: calc(54px + env(safe-area-inset-top)); } }
/* Phones: the home banner as a compact card. The artwork is a band that fades into the card, the words start over its
   dark end, the title is smaller and the buttons share a row when they fit: about two thirds of the height it took. */
@media (max-width: 600px) {
    .hero-solar { min-height: 0; padding: 128px 18px 18px; }
    .hero-solar .hero-image { height: 190px; object-position: var(--hero-focus, right) 22%; }
    .hero-solar::after { background: linear-gradient(180deg, transparent 64px, #101013ee 160px, #101013 190px); }
    .hero-solar h1 { margin: 10px 0; font-size: 40px; line-height: .98; letter-spacing: -.5px; }
    .hero-solar p { max-width: none; font-size: 12.5px; line-height: 1.55; }
    .hero-solar .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
    .hero-solar .actions .button { flex: 1 1 auto; justify-content: center; gap: 8px; padding: 12px 14px; white-space: nowrap; }
    .hero-solar .hero-foot { display: none; }
}
/* The banner's second button: the shop on a computer; on phones and tablets (the shop is in their bottom bar) the ranking. */
.hero-cta-phone { display: none; }
@media (max-width: 850px) { .hero-cta-wide { display: none; } .hero-cta-phone { display: inline-flex; } }


/* The Free Fire server (Sur / EEUU): the choice before playing, on «Jugar», «Mi equipo» and the clans page. */
.server-choice { display: grid; gap: 10px; padding: 26px; margin-bottom: 22px; border-color: #3a4a4a; background: radial-gradient(ellipse at top right, #2a8a8a1f, transparent 70%), var(--panel); }
.server-choice h2 { font-size: 26px; }
.server-choice > p { max-width: 640px; font-size: 13px; }
.discord-join { display: grid; gap: 10px; padding: 26px; margin-bottom: 22px; border-color: #3b3f6e; background: radial-gradient(ellipse at top right, #5865f226, transparent 70%), var(--panel); }
.discord-join h2 { font-size: 26px; }
.discord-join > p { max-width: 640px; font-size: 13px; }
.discord-join-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.server-choice-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.server-choice-options form { display: contents; }
.server-option { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
    padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: #141317; color: var(--text); transition: border-color .2s, background .2s, transform .2s; }
.server-option > span { grid-row: 1 / 3; font-size: 30px; line-height: 1; }
.server-option strong { font: 700 22px/1.1 Rajdhani, Arial, sans-serif; }
.server-option small { color: var(--muted); font-size: 11.5px; }
.server-option:hover, .server-option:focus-visible { border-color: #5fe3d8; background: #172022; transform: translateY(-1px); }
.server-choice-note { color: var(--muted); }
@media (max-width: 560px) { .server-choice { padding: 20px 16px; } .server-choice-options { grid-template-columns: 1fr; } }
