/* --- BASIC RESET AND FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;700;900&family=Lilita+One&display=swap');

/* --- PALETTE --- */
/* The network is built on the red of the Fable tag (gradient #A11C1C -> #5E0A0A in LuckPerms).
   Warm reddish-black backgrounds, pinkish-white text, and a scale of reds for the highlights. Changing a
   colour here changes it across the whole site. The colours after the reds are outside the theme because
   each carries its own meaning (gold, online, Discord, the punishment types), but they live here too. */
:root {
    --background: #120a0b;            /* fields, deeper areas */
    --card-background: #1a0f10;     /* team cards */
    --surface: #211314;       /* page and block background */
    --surface-2: #2c1a1c;     /* navbar buttons */
    --surface-hover: #3d2326;
    --card-border: #3a2225;
    --border: #3f2528;
    --border-strong: #5c3a3e;

    --text: #f7eeee;
    --text-2: #ecdfe0;
    --text-3: #dccbcc;
    --text-soft: #b39a9c;
    --text-faded: #8a6468;

    --red-light: #ff9b9b;   /* links and icons on a dark background that need more light */
    --red: #ef4b4b;         /* highlight: icons, active borders, underlines */
    --red-strong: #d42a2a;   /* background of the primary buttons (white text) */
    --fable: #a11c1c;            /* the tag's colour */
    --fable-dark: #5e0a0a;     /* the end of the tag's gradient, shadows and steps */
    --on-red: #ffffff;   /* text on a red background */

    /* Cards and controls: translucent, they let the page background show faintly. The border colours
       (--border*) are only for borders, never for backgrounds. */
    --card: color-mix(in srgb, var(--card-background) 88%, transparent);
    --control: color-mix(in srgb, var(--surface-2) 88%, transparent);
    --control-hover: var(--surface-hover);

    --danger: #ff6b6b;           /* errors and destructive actions: a red lighter than the highlight */
    --danger-light: #ffc9c9;

    --gold: #facc15;          /* first place, money, achievements, the store */
    --gold-light: #fde047;
    --bronze: #fb923c;        /* third place */
    --online: #4ade80;        /* online, done */
    --purple: #a78bfa;
    --discord: #818cf8;       /* a pastel of Discord's blurple */
    --discord-hover: #6366f1;
    --discord-light: #a5b4fc;
    --ban: #dc2626;
    --mute: #f59e0b;
    --mute-light: #fde68a;
    /* the payment methods on the checkout, near their brands' colours (PayPal's lighter blue, which shows on dark) */
    --pix: #32bcad;
    --mercadopago: #00b1ea;
    --paypal: #009cde;
    --mbway: #e4202e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* Browsers give buttons and fields a system font of their own; on the site they use the page's, like the text */
button, input, select, textarea { font: inherit; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--surface);
    color: var(--text);
    min-height: 100vh;
}

/* The background at the top of the pages: a red light from the theme, brighter on the left and deeper on
   the right, fading into the page colour. It sits behind everything (z-index -1) and catches no clicks. */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: max(100vh, 700px);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 65% at 20% 5%, color-mix(in srgb, var(--red-strong) 26%, transparent), transparent 70%),
        radial-gradient(ellipse 50% 60% at 92% 50%, color-mix(in srgb, var(--fable-dark) 45%, transparent), transparent 70%);
}
/* On the home page it is a picture of the server, darkened with a veil in the theme colour and faded into
   the page colour at the bottom and the sides, so the text on top can be read. */
body.home::before {
    background:
        linear-gradient(to bottom, transparent 35%, var(--surface) 100%),
        radial-gradient(ellipse 75% 90% at 50% 0%, transparent 35%, var(--surface) 100%),
        linear-gradient(color-mix(in srgb, var(--background) 62%, transparent), color-mix(in srgb, var(--background) 62%, transparent)),
        url('../img/fundo.webp') center 55% / cover no-repeat;
}

.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/*
 * Utility to hide anything from JavaScript.
 *
 * The !important is not laziness: after this line there are dozens of single-class rules (.admin-notice,
 * .btn-new-post, .stat-box...) that set display. With the same specificity, the one further down the file
 * wins, and .hidden always lost: that is how the "Novo post" button showed to people without the permission
 * and the profile's red notice showed empty. Since this exists only to hide, it has to win wherever it is.
 */
.hidden { display: none !important; }

/* --- NAVBAR --- */
/* The logo with the links right after it, on the left, and on the right the player search, the server status
   (how many are online and the IP, copied with a click) and the account. The current page is marked with a red
   bar stuck to the bottom of the navbar, like a tab. The buttons have stepped corners, like the game's
   (--pixel-corners). On a narrow screen, the links and the actions move into a panel the menu button opens.
   The HTML comes from header.js. */
.navbar {
    --pixel-corners: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px,
        100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%,
        4px calc(100% - 4px), 0 calc(100% - 4px));
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: stretch;
    column-gap: 28px;
    min-height: 66px;
    /* on a wide screen, the ends line up with the content's width instead of running to the edges */
    padding: 0 max(24px, calc((100% - 1200px) / 2));
    /* Dark, but it lets the page background show faintly behind, like a film */
    background-color: color-mix(in srgb, var(--background) 70%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 40px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Scrolling down the navbar slides up and out; it comes back on scrolling up (header.js sets the class) */
.navbar.tucked { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) { .navbar { transition: none; } }
/* On a wide screen the panel does not exist as a box: the links and the actions are grid columns */
.nav-panel { display: contents; }
.nav-menu { display: none; }

/* The logo: the site's mascot (the favicon image, 180 px, so it stays sharp shrunk) next to the wordmark, which is
   markup so it follows the palette */
.nav-logo {
    align-self: center;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.2s;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}
.nav-logo:hover { transform: scale(1.04); }
.nav-logo-mascote { display: block; height: 40px; width: auto; }
.nav-logo-texto {
    font: 400 30px/1 'Lilita One', 'Poppins', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
}
/* The MC keeps the red of the rest of the site, lighter at the top like the old wordmark */
.nav-logo-texto b {
    font-weight: inherit;
    background-image: linear-gradient(180deg, var(--red) 0%, var(--fable) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* The links take the navbar's full height, so the current page's bar sits at its bottom */
.nav-links { display: flex; align-items: stretch; }
.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    background: none;
    border: none;
    color: var(--text-soft);
    font: 600 15px 'Poppins', sans-serif;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s;
}
.nav-link::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px; /* over the navbar's bottom line */
    height: 3px;
    background-color: var(--red);
    opacity: 0;
    transform: scaleX(0.3);
    transition: transform 0.2s, opacity 0.2s;
}
.nav-link:hover, .nav-link.current { color: var(--text); }
.nav-link:hover::after { opacity: 0.45; transform: none; }
.nav-link.current::after { opacity: 1; transform: none; box-shadow: 0 -2px 12px var(--red); }

/* The store: golden, with the cart glowing, and the bottom bar golden too */
.nav-store { color: var(--gold); }
.nav-store:hover { color: var(--gold-light); }
.nav-store::after { background-color: var(--gold); }
.nav-store i { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold) 60%, transparent)); }

/* On the right: the player search, the server status and the account */
.nav-actions { align-self: center; display: flex; align-items: center; gap: 10px; }

.nav-search, .nav-server, .nav-login, .nav-session-profile { clip-path: var(--pixel-corners); transition: background-color 0.15s, color 0.15s; }

/* The player search: Enter opens the profile, and a nick that cannot exist outlines the field (header.js) */
.nav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background-color: color-mix(in srgb, var(--surface-2) 85%, transparent);
    color: var(--text-faded);
    font-size: 12px;
}
.nav-search:focus-within { background-color: var(--surface-hover); color: var(--text-3); }
.nav-search:has([aria-invalid="true"]) { box-shadow: inset 0 0 0 2px var(--danger); color: var(--danger); }
.nav-search input {
    width: 120px; /* "Buscar jogador…" fits, and not much more */
    min-width: 0;
    padding: 10px 0;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font: 600 13px 'Poppins', sans-serif;
}
.nav-search input::placeholder { color: var(--text-faded); }

/* How many are online and the IP; a click copies the IP */
.nav-server {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background-color: color-mix(in srgb, var(--surface-2) 85%, transparent);
    border: none;
    color: var(--text-3);
    font: 600 13px 'Poppins', sans-serif;
    white-space: nowrap;
    cursor: pointer;
}
.nav-server:hover { background-color: var(--surface-hover); color: var(--text); }
.nav-online { display: inline-flex; align-items: center; gap: 7px; }
/* a green block, not a dot: the server is up */
.nav-online::before { content: ''; width: 8px; height: 8px; background-color: var(--online); box-shadow: 0 0 8px var(--online); }
.nav-online b { color: var(--text); }
.nav-ip { padding-left: 10px; border-left: 1px solid var(--border-strong); }
.nav-ip i { margin-left: 6px; font-size: 11px; color: var(--text-faded); }

.nav-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background-color: var(--red-strong);
    color: var(--on-red);
    font: 700 14px 'Poppins', sans-serif;
    text-decoration: none;
    white-space: nowrap;
}
.nav-login:hover { background-color: var(--red); }

/* Narrow screen: the logo and the menu button on the bar, the rest in a panel that opens below. The bar needs
   about 1150px for the links, the search, the server status and "Entrar", and about 1250px once a long nick takes
   the place of "Entrar"; below that it would run off the screen, so the panel takes over. */
@media (max-width: 1260px) {
    .navbar { grid-template-columns: 1fr auto; grid-template-rows: 60px; align-items: center; column-gap: 12px; padding: 0 16px; }
    .nav-logo-mascote { height: 34px; }
    .nav-logo-texto { font-size: 25px; }
    .nav-menu {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        background-color: color-mix(in srgb, var(--surface-2) 85%, transparent);
        border: none;
        clip-path: var(--pixel-corners);
        color: var(--text);
        font-size: 18px;
        cursor: pointer;
    }
    .nav-panel { display: none; grid-column: 1 / -1; flex-direction: column; gap: 14px; padding: 4px 0 16px; }
    .navbar.open .nav-panel { display: flex; }
    .nav-links { flex-direction: column; }
    .nav-link { padding: 13px 14px; font-size: 15px; }
    /* the current page's bar moves to the left of the link */
    .nav-link::after { left: 0; right: auto; top: 9px; bottom: 9px; width: 3px; height: auto; transform: scaleY(0.3); }
    .nav-link:hover::after, .nav-link.current::after { transform: none; }
    .nav-actions { flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
    /* the search gets a row of its own, above the server status and the account */
    .nav-search { flex: 1 1 100%; }
    .nav-search input { flex: 1; width: auto; }
}

/* --- SESSION IN THE NAVBAR --- */
/* Whoever is logged in: the head and the nick in a button like the others, and the log-out beside it */
.nav-session { display: flex; align-items: center; gap: 6px; }
/* No movement on hover: the head is pixel art enlarged from 24 to 30px and changed its look when the
   element moved to a GPU layer. Only the colour changes, like the other buttons. */
.nav-session-profile {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    background-color: color-mix(in srgb, var(--surface-2) 85%, transparent);
    color: var(--text);
    font: 600 14px 'Poppins', sans-serif;
    text-decoration: none;
    white-space: nowrap;
}
.nav-session-profile:hover { background-color: var(--surface-hover); }
.nav-session-profile img { width: 30px; height: 30px; display: block; image-rendering: pixelated; }
.nav-session-logout {
    background: transparent;
    border: none;
    text-decoration: none; /* in admin.php this button is an <a> */
    color: var(--text-soft);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: grid;
    place-items: center;
    transition: 0.25s;
}
.nav-session-logout:hover { background-color: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }

.btn-primary {
    background-color: var(--red-strong);
    color: var(--on-red);
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: 900;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-primary:hover { background-color: var(--fable); transform: translateY(-2px); box-shadow: 0 4px 12px color-mix(in srgb, var(--red) 30%, transparent); }

/* --- LATEST NEWS SECTION --- */
.section-title h2 { font-size: 32px; font-weight: 900; }
.underline {
    width: 40px;
    height: 4px;
    background-color: var(--red);
    margin: 10px 0 30px 0;
}

.tags { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.tag {
    background-color: color-mix(in srgb, var(--red) 16%, transparent);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--red-light);
}

.snippet { font-size: 14px; color: var(--text-3); line-height: 1.5; }

.btn-discord {
    background-color: var(--discord);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 900;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-discord:hover { background-color: var(--discord-hover); transform: translateY(-2px); }

/* A card that calls for an action: an icon, a title with a line of text, and a button. The team and the partners
   pages call for applications with it, the punishments page for a ticket on the Discord. */
.cta-card {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 10px 0 40px;
    padding: 24px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--red) 14%, transparent), color-mix(in srgb, var(--surface) 60%, transparent));
    border: 1px solid var(--border);
    border-radius: 14px;
}
.cta-card > i {
    font-size: 24px;
    color: var(--red);
    background-color: color-mix(in srgb, var(--red) 12%, transparent);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.cta-card-text { flex: 1; min-width: 220px; }
.cta-card-text h3 { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
.cta-card-text p { color: var(--text-soft); font-size: 15px; }
.cta-card .btn-primary, .cta-card .btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    padding: 12px 26px;
    text-decoration: none;
}

/* The site in development (js/dev-mode.js): until the session lets the visitor in, only the navbar, the footer,
   the dialogs and the development page show. !important for the same reason as .hidden: the page's own rules
   set display. */
html.dev-locked body > :not(.navbar, footer, .dev-page, .dialog-backdrop) { display: none !important; }
.dev-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: calc(100vh - 260px);
    padding: 60px 20px;
    text-align: center;
}
.dev-page > i {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--red) 14%, transparent);
    color: var(--red);
    font-size: 30px;
}
.dev-page h1 { font-size: 40px; font-weight: 900; line-height: 1.15; }
.dev-page p { max-width: 520px; margin-bottom: 8px; color: var(--text-2); font-size: 17px; line-height: 1.5; }

/* --- FOOTER --- */
footer {
    margin-top: 50px;
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

footer p { margin-bottom: 8px; }
/* The pages visited less (Regras, Equipe, FAQ, ...), with a dot between them */
.footer-links { display: flex; justify-content: center; gap: 28px; margin-bottom: 18px; font-size: 12px; }
.footer-links a { position: relative; color: var(--text-3); text-decoration: none; transition: color 0.2s; }
.footer-links a:hover { color: var(--red-light); }
.footer-links a + a::before { content: '·'; position: absolute; left: -17px; color: var(--text-faded); pointer-events: none; }
/* Where bugs and reports of players go: a sentence, so in plain case and weight, unlike the rest of the footer */
.footer-support { margin-bottom: 18px; padding: 0 16px; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.footer-support a { color: var(--text-3); transition: color 0.2s; }
.footer-support a:hover { color: var(--red-light); }

/* --- ONLINE / OFFLINE INDICATOR --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.status-badge::before {
    content: '';
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-online { color: var(--online); }
.status-online::before {
    background-color: var(--online);
    box-shadow: 0 0 7px color-mix(in srgb, var(--online) 70%, transparent);
}
.status-offline { color: var(--text-soft); }
.status-offline::before { background-color: var(--danger); }

/* Selects: select-menu.js puts each one behind a button and a list in the site's look, because the browser's
   own list cannot be styled. The
   button takes the select's classes, so a page styles both with one rule and leaves room for the arrow with its
   padding-right. Until the script runs, the select itself shows with the same arrow, stroked in --text-soft. */
:root { --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b39a9c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select {
    appearance: none;
    background-image: var(--select-arrow);
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
}
.select-menu { position: relative; display: inline-flex; }
.select-menu-button { position: relative; text-align: left; }
.select-menu-button::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 14px;
    width: 10px;
    height: 6px;
    margin-top: -3px;
    background: var(--select-arrow) no-repeat center / 10px 6px;
    transition: transform 0.2s;
}
.select-menu.open .select-menu-button::after { transform: rotate(180deg); }
/* every option's text stacked in one cell: the button is as wide as the longest */
.select-menu-label { display: grid; }
.select-menu-label > span { grid-area: 1 / 1; visibility: hidden; }
.select-menu-label > .current { visibility: visible; }
.select-menu-list {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    width: max-content;
    margin-top: 6px;
    padding: 6px;
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 10;
}
.select-menu.open .select-menu-list { display: block; }
.select-menu-list.to-left { left: auto; right: 0; }
.select-menu-list [role="option"] {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-3);
    font: 600 14px 'Poppins', sans-serif;
    text-align: left;
    cursor: pointer;
}
.select-menu-list [role="option"]:hover, .select-menu-list [role="option"]:focus-visible {
    background-color: var(--surface-2);
    color: #fff;
    outline: none;
}
.select-menu-list [aria-selected="true"] { color: var(--red); }

/* Fields */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 22px; }
.field:last-of-type { margin-bottom: 0; }
.field label { font-size: 13px; font-weight: 900; color: var(--text-2); letter-spacing: 0.2px; }
.field .hint { font-size: 12px; font-weight: 400; color: var(--text-soft); }

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field textarea,
.admin-login input {
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    padding: 13px 15px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faded); }
.field input:focus, .field textarea:focus, .admin-login input:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent);
}

/* The text box is monospaced: what is typed is markup, and it lines up better */
.field textarea.editor {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 14.5px;
    line-height: 1.7;
    min-height: 420px;
    resize: vertical;
}

.btn-ghost {
    background-color: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-3);
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.25s;
}
.btn-ghost:hover { background-color: var(--control-hover); color: var(--text); }
.btn-ghost.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn-ghost.danger:hover { background-color: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

/* Top of the profile page */
.profile-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

/* ---------------------------------------------------------------- dialogs */
.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5000;
    background-color: color-mix(in srgb, var(--background) 72%, transparent);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: dialogEnter 0.16s ease-out;
}
.dialog-backdrop.leaving { animation: dialogLeave 0.14s ease-in forwards; }

@keyframes dialogEnter { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogLeave { to { opacity: 0; } }

.dialog {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    padding: 28px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: dialogRise 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes dialogRise {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.dialog-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background-color: color-mix(in srgb, var(--red) 15%, transparent);
    color: var(--red);
}
.dialog-title { font-size: 20px; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.dialog-message {
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-line; /* lets the message use \n */
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}
.dialog-btn {
    background-color: var(--surface-2);
    color: var(--text-2);
    border: none;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.25s;
}
.dialog-btn:hover { background-color: var(--control-hover); }
.dialog-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.dialog-btn.primary { background-color: var(--red-strong); color: var(--on-red); }
.dialog-btn.primary:hover { background-color: var(--fable); }
.dialog-btn.primary.danger { background-color: var(--danger); color: var(--surface); }
.dialog-btn.primary.danger:hover { background-color: var(--red); }
.dialog-btn.danger:not(.primary) { color: var(--danger); }
.dialog-btn.danger:not(.primary):hover { background-color: color-mix(in srgb, var(--danger) 18%, transparent); }
.dialog-btn.subtle { background-color: transparent; color: var(--text-soft); }
.dialog-btn.subtle:hover { background-color: color-mix(in srgb, var(--text-soft) 15%, transparent); color: var(--text-2); }

/* The Discord button on the login and the profile is the same .btn-discord as the home page's; here it only
   gets the icon beside the text and, on the login card, the full width. */
.btn-discord {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
}

/* The gift's nick is asked for in a dialog with a text box (dialogs.js's showPrompt()) */
.dialog .field { margin: 18px 0 0; }
.dialog .field input { background-color: var(--background); text-align: center; }

/* --- STATS PAGE --- */
.stats-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Submenu (Jogadores, Leaderboards, Facções) */
.stats-subnav {
    display: flex;
    justify-content: center;
    gap: 40px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 30px;
}
.stats-subnav a {
    color: var(--text-faded);
    text-decoration: none;
    font-weight: 700;
    padding-bottom: 15px;
    transition: 0.3s;
}
.stats-subnav a.active {
    color: var(--red);
    border-bottom: 2px solid var(--red);
}
.stats-subnav a:hover { color: var(--text-2); }

/* Search bar */
.search-bar {
    display: flex;
    background-color: var(--card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--card-border);
}
/* min-width 0 lets the field give way on a phone, so the button keeps its whole label */
.search-bar input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 15px 20px;
    color: var(--text);
    font-size: 16px;
    outline: none;
}
/* The site's primary button, joined to the field */
.search-bar button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--red-strong);
    color: var(--on-red);
    border: none;
    padding: 0 26px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.3s;
}
.search-bar button:hover { background-color: var(--fable); }

/* Profile and faction cards */
.player-profile-header, .faction-header, .stat-box, .profile-skin {
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

/* Player header */
.player-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    /* a red thread on the left, marking the page's main card */
    box-shadow: inset 3px 0 0 var(--red);
}
.player-name-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.player-name-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.player-name-box h2 { font-size: 28px; font-weight: 900; color: var(--text); line-height: 1.1; }

/* The in-game tags are 13px tall pixel art: drawn at twice that, with the pixels kept sharp */
.game-tag { display: block; height: 26px; width: auto; image-rendering: pixelated; }
.player-tags { display: inline-flex; align-items: center; gap: 6px; }
.player-tags:empty { display: none; }

/* The faction and the player's role in it, on one line: "OPX - aospdoap · Líder" */
.player-faction-line { font-size: 13px; font-weight: 700; color: var(--text-3); }
.player-faction-line a { color: inherit; text-decoration: none; transition: 0.3s; }
.player-faction-line a:hover { color: var(--red); text-decoration: underline; }
.player-faction-role { color: var(--text-soft); }
.player-faction-role:not(:empty)::before { content: '·'; margin: 0 7px; color: var(--text-faded); }

/* Online or offline beside the nick: the dot alone, its words on hover */
.player-name-box .status-badge { cursor: help; }

/* The card's right side: the balance, and under it the skills level */
.player-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
/* The skills level as a gold label that says what it is, so a lone number does not need explaining */
.skills-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px 4px 9px;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--gold) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
    color: var(--gold);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    cursor: help;
}
.skills-badge i { font-size: 11px; }
.player-balance { font-size: 22px; font-weight: 900; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.player-balance i { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--gold) 50%, transparent)); }

/* Members and power, under the faction's card */
.player-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 20px;
    padding: 0 6px;
    font-size: 12px;
    color: var(--text-soft);
    margin-bottom: 20px;
    font-weight: 700;
}
.player-meta strong { color: var(--text-2); }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-bottom: 60px;
}
/* The profile's stats three to a row, two where the column is narrow. The boxes are a little
   tighter than elsewhere, so the longer names ("Jogadores mortos") still fit on one line. */
.profile-data .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-data .stat-box { padding: 14px; gap: 12px; }
.profile-data .stat-icon { width: 38px; height: 38px; font-size: 17px; }
@media (max-width: 1000px) {
    .profile-data .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A stat the game does not record yet: faded, with "Em breve" on hover */
.stat-box.stat-soon .stat-icon { color: var(--text-faded); }
.stat-box.stat-soon .stat-data p, .stat-box.stat-soon .stat-data h4 { color: var(--text-faded); }

.stat-box {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s, background-color 0.2s;
}
.stat-box:hover { border-color: var(--border-strong); background-color: var(--control); }

/* The icon in a square tinted with its own colour (currentColor), whatever it is */
.stat-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: color-mix(in srgb, currentColor 14%, transparent);
    font-size: 19px;
    color: var(--red);
}
.stat-data { min-width: 0; }
.stat-data p { font-size: 11px; color: var(--text-soft); margin-bottom: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-data h4 { font-size: 22px; font-weight: 900; color: var(--text); line-height: 1; }

/* Specific colours for some icons */
.icon-red { color: var(--danger); }
.icon-green { color: var(--online); }
.icon-purple { color: var(--purple); }

/* ---------------------------------------------------------------- profile: achievements */
/* Below the skin and the stats, across the whole width: three per row on a computer, one per row on a phone.
   The stats grid gives its bottom margin to this block, which is now the last on the page. */
.profile-data .stats-grid { margin-bottom: 0; }
.achievements { margin: 30px 0 60px; }
.achievements-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 0 6px;
    margin-bottom: 12px;
}
.achievements-header h3 { font-size: 20px; font-weight: 900; color: var(--text); }
.achievements-header h3 i { color: var(--gold); margin-right: 4px; }
.achievements-header span { font-size: 12px; font-weight: 700; color: var(--text-soft); }

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.achievement-text { flex: 1; min-width: 0; }
.achievement-text strong { display: block; font-size: 15px; font-weight: 900; color: var(--text); }
.achievement-text p { font-size: 12px; color: var(--text-soft); margin: 2px 0 8px; }

/* Unlocked: in gold, the colour of first place. Locked: the same card faded, with the progress. */
.achievement.unlocked { border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.achievement.unlocked .stat-icon { color: var(--gold); }
.achievement-done {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.achievement.locked .stat-icon { color: var(--text-faded); }
.achievement.locked strong { color: var(--text-soft); }
.achievement.locked p { color: var(--text-faded); }

.achievement-progress { display: flex; align-items: center; gap: 10px; }
.achievement-bar {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background-color: var(--background);
    overflow: hidden;
}
.achievement-bar span { display: block; height: 100%; border-radius: inherit; background-color: var(--red); }
.achievement-progress > span { font-size: 12px; font-weight: 700; color: var(--text-3); white-space: nowrap; }

/* ---------------------------------------------------------------- comment ban badge on the profile */
.profile-ban {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: color-mix(in srgb, var(--danger) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
    border-left: 4px solid var(--danger);
    border-radius: 10px;
    padding: 13px 16px;
    margin-bottom: 22px;
}
.profile-ban i { color: var(--danger); font-size: 16px; flex-shrink: 0; }
.profile-ban-text { color: var(--danger-light); font-size: 14px; line-height: 1.5; }
.profile-ban-text strong { color: var(--danger); font-weight: 900; }

/* ---------------------------------------------------------------- profile: 3D skin */
.profile-with-skin { display: flex; gap: 30px; align-items: flex-start; }
.profile-skin {
    flex: 0 0 260px;
    padding: 10px 0 16px;
    text-align: center;
    /* a red glow behind the character, over the card's background */
    background-image: radial-gradient(ellipse 70% 55% at 50% 42%, color-mix(in srgb, var(--red) 16%, transparent), transparent 70%);
}
.profile-skin canvas { display: block; margin: 0 auto; cursor: grab; }
.profile-skin canvas:active { cursor: grabbing; }
.profile-data { flex: 1; min-width: 0; }

@media (max-width: 760px) {
    .profile-with-skin { flex-direction: column; align-items: stretch; }
    .profile-skin { flex-basis: auto; }
    /* the balance and the status drop under the nick, so they line up with it on the left */
    .player-side { align-items: flex-start; }
}

/* ---------------------------------------------------------------- stats: podium */
.podium {
    position: relative;
    margin-bottom: 40px;
    padding: 22px 20px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background:
        radial-gradient(ellipse 45% 70% at 50% 35%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 70%),
        linear-gradient(180deg, var(--card-background) 0%, var(--surface) 100%);
}
.podium-title {
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}
.podium-title i { color: var(--gold); margin-right: 6px; }

.podium-places {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 14px;
}
.podium-place {
    --colour: var(--text-3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}
.place-1 { --colour: var(--gold); }
.place-3 { --colour: var(--bronze); }

.podium-place canvas {
    display: block;
    margin-bottom: -6px;
    transition: transform 0.3s;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.45));
}
.podium-place:hover canvas { transform: translateY(-6px); }

.podium-base {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 10px;
    min-height: 120px;
    border-top: 3px solid var(--colour);
    border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, var(--border) 0%, color-mix(in srgb, var(--border) 35%, transparent) 100%);
    box-shadow: 0 -8px 24px -12px var(--colour);
    overflow: hidden;
    text-align: center;
}
.place-1 .podium-base { min-height: 160px; }
.place-2 .podium-base { min-height: 138px; }

/* A large, faded number at the back of the block */
.podium-pos {
    position: absolute;
    right: 10px;
    bottom: -18px;
    font-size: 96px;
    font-weight: 900;
    line-height: 1;
    color: var(--colour);
    opacity: 0.1;
    pointer-events: none;
}
.podium-name { font-size: 16px; font-weight: 900; color: var(--colour); word-break: break-all; }
.podium-value { font-weight: 900; color: var(--text); display: flex; align-items: center; gap: 6px; }
.podium-value i { color: var(--gold); }

@media (max-width: 600px) {
    .podium { padding-inline: 10px; }
    .podium-places { gap: 6px; }
    .podium-place canvas { width: 100% !important; height: auto !important; }
    .podium-name { font-size: 13px; }
    .podium-pos { font-size: 64px; }
}

/* Badge on the profile: a small Discord next to the nick, which opens the link details */
.discord-badge {
    background: none;
    border: none;
    padding: 0 2px;
    color: var(--discord);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}
.discord-badge:hover { color: var(--discord-light); }

/* The Discord section on the profile */
.profile-discord {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 22px;
}
.profile-discord-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 220px; }
.profile-discord-text strong { font-size: 15px; color: var(--text); }
.profile-discord-text span { font-size: 13px; color: var(--text-soft); }

/* Copying the profile link: under the 3D character, away from the nick's row */
.btn-copy-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}
.btn-copy-link:hover { border-color: var(--red); color: var(--red); }
.profile-skin .btn-copy-link { margin-top: 8px; }

/* Profile without a session: a short notice in the centre, instead of a full-width card */
.profile-no-session {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 70px 20px;
    text-align: center;
}
.profile-no-session > i {
    font-size: 30px;
    color: var(--red);
    background-color: color-mix(in srgb, var(--red) 12%, transparent);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.profile-no-session p { font-size: 17px; font-weight: 700; color: var(--text-2); }
.profile-no-session .btn-primary { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; padding: 11px 26px; text-decoration: none; }

/* --- LEADERBOARDS --- */
/* On a phone the tabs wrap: in one centred row that overflows, the first ones were cut off and could not be
   scrolled to */
.leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}
.lb-tab {
    background-color: var(--control);
    color: var(--text-soft);
    border: 1px solid var(--card-border);
    padding: 10px 26px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lb-tab:hover { background-color: var(--control-hover); color: var(--text-2); }
.lb-tab.active { background-color: var(--red-strong); border-color: var(--red); color: var(--on-red); }

.leaderboard-list {
    background-color: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    margin-bottom: 60px;
    border: 1px solid var(--card-border);
}
.lb-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--card-border);
    transition: 0.3s;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background-color: var(--control); }

/* The rows are links (to the player's or the faction's profile) */
a.lb-row { text-decoration: none; color: inherit; cursor: pointer; }

.lb-pos { width: 32px; font-weight: 900; font-size: 15px; color: var(--text-faded); text-align: center; flex-shrink: 0; }
.lb-row:nth-child(1) .lb-pos { color: var(--gold); }
.lb-row:nth-child(2) .lb-pos { color: var(--text-3); }
.lb-row:nth-child(3) .lb-pos { color: var(--bronze); }

.lb-avatar { width: 32px; height: 32px; border-radius: 6px; background-color: var(--surface-2); image-rendering: pixelated; flex-shrink: 0; }
/* A long nick gives way with "...", so the value at the end of the row always fits */
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text); }
.lb-rank-badge {
    background-color: var(--surface-hover);
    color: var(--text-3);
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.lb-value { font-weight: 900; color: var(--gold); font-size: 15px; display: flex; align-items: center; gap: 6px; min-width: 80px; justify-content: flex-end; }

.leaderboard-empty { padding: 40px; text-align: center; color: var(--text-soft); font-weight: 700; }

.lb-tag-badge {
    background-color: var(--red-strong);
    color: var(--on-red);
    font-size: 12px;
    font-weight: 900;
    padding: 6px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    flex-shrink: 0;
    min-width: 48px;
    text-align: center;
}
.lb-sub { font-size: 11px; color: var(--text-soft); font-weight: 700; }

@media (max-width: 600px) {
    .leaderboard-tabs { gap: 8px; }
    .lb-tab { padding: 9px 16px; }
    .lb-row { gap: 10px; padding: 12px 14px; }
    .lb-pos { width: 24px; }
    .lb-value { min-width: 0; }
}

/* --- FACTIONS PAGE --- */
.faction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: inset 3px 0 0 var(--red);
}
.faction-identity {
    display: flex;
    align-items: center;
    gap: 20px;
}
.faction-tag-badge {
    background-color: var(--red-strong);
    color: var(--on-red);
    padding: 14px 18px;
    border-radius: 10px;
    font-weight: 900;
    font-size: 24px;
    letter-spacing: 2px;
    line-height: 1;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--red) 25%, transparent);
}
.faction-title h2 { font-size: 28px; font-weight: 900; color: var(--text); line-height: 1.2; }
.faction-title span { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.faction-points {
    font-size: 20px;
    font-weight: 900;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-heading {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}
.section-heading-row .section-heading { margin-bottom: 0; }

.filter-select {
    background-color: var(--control);
    color: var(--text-3);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 8px 34px 8px 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: 0.3s;
}
.filter-select:hover { background-color: var(--control-hover); color: var(--text-2); }

/* New post: in the home page's sidebar, as wide as it, below the Discord */
.btn-new-post {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 15px;
    padding: 12px 22px;
}

/* ---------------------------------------------------------------- home page */
/* The latest post on the left, whole; the sidebar on the right. */
.home-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}
.home-posts { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.home-post { background-color: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
/* Byline: the author's head, large, with "Postado por" and the date beside it */
.home-byline { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 15px; color: var(--text-2); }
.home-byline img { display: block; width: 70px; height: 70px; border-radius: 4px; image-rendering: pixelated; }
.home-byline img.bust { image-rendering: auto; border-radius: 0; } /* a 3D render, not enlarged pixel art */
.home-byline a { color: inherit; text-decoration: none; }
.home-byline div a:hover { color: var(--red); }
.home-byline small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-soft); }

/* Banner: the cover, low and wide, with the tag and the title on top, over a gradient so they can be read */
.home-banner {
    display: flex;
    align-items: flex-end;
    min-height: 185px;
    padding: 18px 20px;
    background-color: var(--card-background);
    background-size: cover;
    background-position: center;
    position: relative;
    text-decoration: none; /* it is a link to the post */
    overflow: hidden;
    isolation: isolate; /* the ::after's z-index -1 stays under the text, but inside the banner */
}
/* A copy of the cover (inherited from the JS's style) that zooms in slowly on hover */
.home-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: inherit;
    transition: transform 0.8s ease;
}
.home-banner:hover::after { transform: scale(1.05); }
@media (prefers-reduced-motion: reduce) { .home-banner::after { transition: none; } }
.home-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
}
.home-banner-text { position: relative; color: #fff; }
.home-banner-tag { display: block; font-size: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.home-banner h1 { font-size: clamp(22px, 2.6vw, 27px); font-weight: 900; line-height: 1.2; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.home-post-content { padding: 26px 26px 30px; }
.home-post-footer { display: flex; justify-content: center; margin-top: 12px; }
/* The preview: the body cut at a tall height, fading out down to "Continuar lendo" */
.home-post .post-body { max-height: 900px; overflow: hidden; mask-image: linear-gradient(to bottom, #000 80%, transparent); }
.home-post.whole .post-body { mask-image: none; }
.home-post.whole .home-post-footer { display: none; }

/* Sidebar: cards with the title in a strip, as in the references */
.home-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 20px 20px;
    text-align: center;
}
.sidebar-card h1, .sidebar-card h2 {
    margin: 0 -20px 18px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
}
.sidebar-card p { font-size: 14px; color: var(--text-soft); margin-bottom: 14px; }
.sidebar-about p:last-child { margin-bottom: 0; }
.sidebar-about strong { color: var(--text); }
.sidebar-online { font-size: 16px !important; color: var(--text-2) !important; }
.sidebar-online strong { color: var(--online); }
.sidebar-ip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    background-color: var(--text);
    color: var(--background);
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.15s;
}
.sidebar-ip:hover { transform: translateY(-2px); }
.sidebar-ip i { font-size: 13px; color: var(--text-faded); }
.sidebar-discord h2 i { color: var(--discord); margin-right: 6px; }
.sidebar-discord .btn-discord { width: 100%; justify-content: center; }


/* Narrow screens: one column, with the post first: it is what people want to see on opening */
@media (max-width: 960px) {
    .home-grid { grid-template-columns: minmax(0, 1fr); }
    .home-post-content { padding: 22px 20px 26px; }
}

/* --- POST READING PAGE --- */
/* Same width as .main-wrapper: the blog list and the open post have to line up, or the page seems to shrink
   when a post is clicked. */
.post-wrap {
    max-width: 1200px;
    margin: 0 auto 0;
    padding: 0 20px;
}

.post-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: 0.3s;
}
.post-back:hover { color: var(--red); }

.post-header {
    padding: 26px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 34px;
}
.post-header h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 900;
    line-height: 1.18;
    color: var(--text);
    margin-bottom: 16px;
}
.post-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: 16px;
}

/* Article body */
.post-body { font-size: 17px; line-height: 1.75; color: var(--text-3); }
.post-body > *:first-child { margin-top: 0; }
.post-body p { margin: 0 0 20px; }
.post-body h2 {
    font-size: 26px;
    font-weight: 900;
    color: var(--text);
    margin: 42px 0 16px;
    line-height: 1.25;
}
.post-body h3 {
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
    margin: 34px 0 12px;
}
.post-body h4 {
    font-size: 17px;
    font-weight: 900;
    color: var(--text-2);
    margin: 28px 0 10px;
}
.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 24px; }
.post-body li { margin-bottom: 9px; }
.post-body a { color: var(--red); text-decoration: none; }
.post-body a:hover { text-decoration: underline; }
.post-body strong { color: var(--text); }
.post-body code {
    background-color: var(--background);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.9em;
    font-family: ui-monospace, Consolas, monospace;
}
.post-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 38px 0;
}
.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 10px 0 24px;
    display: block;
}

/* --- IMAGES AND GIFS INSIDE THE POST --- */
.post-body .post-figure { margin: 28px 0; }
.post-body .post-figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0;
}
.post-body .post-figure figcaption {
    margin-top: 10px;
    font-size: 13.5px;
    color: var(--text-soft);
    text-align: center;
    font-weight: 700;
}

/* Image sizes in the published post */
.post-body .post-figure.size-pequena { max-width: 45%; margin-left: auto; margin-right: auto; }
.post-body .post-figure.size-media { max-width: 70%; margin-left: auto; margin-right: auto; }
.post-body .post-figure.size-grande { max-width: 100%; }

/* On narrow screens, an image at 45% is too small to see */
@media (max-width: 620px) {
    .post-body .post-figure.size-pequena,
    .post-body .post-figure.size-media { max-width: 100%; }
}

/* ---------------------------------------------------------------- comments */
.comments { margin-top: 56px; }
.comments-total { color: var(--text-faded); font-weight: 900; }

.comment-write { display: flex; gap: 14px; margin-bottom: 18px; }
.comment-write-body { flex: 1; min-width: 0; }
.comment-write textarea {
    width: 100%;
    background-color: var(--background);
    border: 1px solid var(--surface);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    resize: vertical;
    transition: 0.25s;
}
.comment-write textarea:focus { outline: none; border-color: var(--red); }
.comment-write textarea::placeholder { color: var(--border-strong); }

.comment-bar { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.comment-counter { color: var(--text-faded); font-size: 12px; font-weight: 900; margin-right: auto; }
.comment-bar .btn-primary { padding: 9px 22px; font-size: 14px; }

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    display: block;
    background-color: var(--surface);
}

.comments-list { display: flex; flex-direction: column; gap: 4px; }
.comment { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--surface); }
.comment:first-child { border-top: none; }
.comment-body { flex: 1; min-width: 0; }

.comment-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.comment-nick {
    color: var(--text);
    font-weight: 900;
    font-size: 15px;
    text-decoration: none;
    transition: 0.25s;
}
.comment-nick:hover { color: var(--red); }
.comment-time { color: var(--text-faded); font-size: 12.5px; font-weight: 700; }
.comment-actions { display: flex; gap: 4px; margin-left: auto; }

.comment-text {
    color: var(--text-3);
    font-size: 15px;
    line-height: 1.65;
    margin: 0;
    /* keeps the line breaks the player wrote and breaks huge words, so a run without spaces does not push
       the whole column */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comments-empty { color: var(--text-faded); font-size: 15px; padding: 18px 0; }
.comments-invite {
    background-color: var(--background);
    border: 1px solid var(--surface);
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    margin-bottom: 18px;
}
.comments-invite p { color: var(--text-soft); margin: 0 0 14px; font-size: 15px; }

@media (max-width: 600px) {
    .comment-avatar { width: 32px; height: 32px; }
    .comment-top { flex-wrap: wrap; gap: 6px; }
    .comment-actions { margin-left: 0; }
}

/* ---------------------------------------------------------------- cover image */

.post-cover {
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    display: block;
    border-radius: 12px;
    margin-bottom: 28px;
    background-color: var(--surface);
}

/* ---------------------------------------------------------------- FAQ */
/* /faq reads like a post, with each question a <details> card that opens in place: the answers stay in the
   page for search engines and for the browser's find, and need no script. */
.faq details {
    margin-bottom: 12px;
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
}
.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    color: var(--text);
    font-weight: 700;
    line-height: 1.4;
    list-style: none;
    cursor: pointer;
    transition: background-color 0.15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '\f078'; font: 900 13px 'Font Awesome 6 Free'; color: var(--red); transition: transform 0.2s; }
.faq summary:hover { background-color: var(--surface-hover); }
.faq details[open] summary { margin-bottom: 4px; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 20px; }

/* --- PUBLISHING PANEL --- */
.admin-wrap { max-width: 880px; margin: 44px auto 90px; padding: 0 24px; }

/* The page header, with the same highlight bar as the other sections */
.admin-header { margin-bottom: 30px; }
.admin-header h1 { font-size: 34px; font-weight: 900; color: var(--text); line-height: 1.2; }
.admin-header .underline { margin: 12px 0 0; }
.admin-header p { font-size: 14px; color: var(--text-soft); margin-top: 14px; font-weight: 700; }

/* The card around the form: the same language as the site's cards */
.admin-card {
    background-color: var(--card);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 1px solid var(--card-border);
}

.admin-notice {
    display: flex;
    align-items: center;
    gap: 11px;
    background-color: color-mix(in srgb, var(--online) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--online) 35%, transparent);
    color: var(--online);
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 26px;
}
.admin-notice.error {
    background-color: color-mix(in srgb, var(--danger) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
    color: var(--danger);
}

.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .admin-grid-2 { grid-template-columns: 1fr; gap: 0; } }

/* Visibility switch */
.field-visible {
    display: flex;
    align-items: center;
    gap: 11px;
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 0;
}
.field-visible:hover { border-color: var(--text-faded); }
.field-visible input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; flex-shrink: 0; }
.field-visible span { font-size: 14px; font-weight: 700; color: var(--text-2); }
.field-visible .hint { display: block; font-weight: 400; margin-top: 2px; }

/* Formatting help */
.admin-help {
    background-color: var(--card);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    margin: 14px 0 26px;
    overflow: hidden;
}
.admin-help summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text-3);
    padding: 14px 18px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: 0.2s;
}
.admin-help summary::-webkit-details-marker { display: none; }
.admin-help summary::before { content: '\f059'; font-family: 'Font Awesome 6 Free'; font-weight: 900; color: var(--red); }
.admin-help summary:hover { background-color: var(--surface-2); }
.admin-help[open] summary { border-bottom: 1px solid var(--border-strong); }
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px 22px;
    padding: 18px;
}
.help-item { display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--text-soft); }
.help-item code {
    background-color: var(--background);
    color: var(--gold);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 12.5px;
    font-family: ui-monospace, Consolas, monospace;
    white-space: nowrap;
    flex-shrink: 0;
}
.help-note { padding: 0 18px 16px; font-size: 12.5px; color: var(--text-faded); }

/* Action bar */
.admin-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-strong);
}

.admin-bar .btn-primary { font-size: 15px; padding: 12px 28px; }

/* Login */
.admin-login {
    max-width: 400px;
    margin: 70px auto;
    background-color: var(--card);
    padding: 38px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 1px solid var(--card-border);
}
.admin-login h1 { font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.admin-login > p { font-size: 13.5px; color: var(--text-soft); margin-bottom: 26px; }
.admin-login form { display: flex; flex-direction: column; gap: 9px; }
.admin-login label { font-size: 13px; font-weight: 900; color: var(--text-2); }
.admin-login button { margin-top: 10px; font-size: 15px; padding: 12px; }

/* The list of existing posts */
.post-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: 0.25s;
}
.post-row:last-child { border-bottom: none; }
.post-row:hover { background-color: var(--control); }
.post-row-info { flex: 1; min-width: 0; }
.post-row-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.post-row-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-soft); font-weight: 700; }
.post-row-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.post-row-actions .btn-ghost { padding: 8px 14px; font-size: 13px; }
.post-row-actions form { margin: 0; }

.state-pill {
    font-size: 10.5px;
    font-weight: 900;
    padding: 3px 9px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.state-pill.state-visible { background-color: color-mix(in srgb, var(--online) 15%, transparent); color: var(--online); }
.state-pill.state-hidden { background-color: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }

.empty-list { padding: 40px; text-align: center; color: var(--text-soft); font-weight: 700; }

/* --- SECTION EDITOR --- */
.block-list { display: flex; flex-direction: column; gap: 14px; }

.block {
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
}
.block-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background-color: var(--surface-2);
    border-bottom: 1px solid var(--border-strong);
}
.block-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 900;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.block-label i { color: var(--red); }
.block[data-type="gif"] .block-label i { color: var(--purple); }
.block[data-type="imagem"] .block-label i { color: var(--online); }

.block-actions { display: flex; gap: 5px; }
.block-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-soft);
    width: 30px;
    height: 30px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    display: grid;
    place-items: center;
    transition: 0.2s;
}
.block-btn:hover:not(:disabled) { background-color: var(--control-hover); color: var(--text); }
.block-btn.danger:hover:not(:disabled) { background-color: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.block-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.block-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.block-body textarea.editor { min-height: 200px; border-radius: 8px; }
.block-body input[type="text"] {
    background-color: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-size: 14.5px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.block-body input[type="text"]::placeholder { color: var(--text-faded); }
.block-body input[type="text"]:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent);
}
.block-body textarea.editor { background-color: var(--background); }

.block-preview {
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90px;
    background-color: var(--background);
}
.block-preview img { max-width: 100%; max-height: 260px; border-radius: 6px; display: block; }
.block-preview.empty span { font-size: 12.5px; color: var(--text-faded); font-weight: 700; }

.add-block {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 14px;
    background-color: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
}
.add-block-label { font-size: 13px; font-weight: 700; color: var(--text-soft); margin-right: 2px; }
.add-block .btn-ghost { padding: 9px 16px; font-size: 13.5px; }

/* --- FILE UPLOADS IN THE SECTIONS --- */
.block-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.block-upload .btn-ghost { padding: 9px 16px; font-size: 13.5px; }
.block-status { font-size: 12.5px; font-weight: 700; color: var(--text-soft); }
.block-status.ok { color: var(--online); }
.block-status.error { color: var(--danger); }

/* Size picker inside the section */
.block-size { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.block-size-label { font-size: 12.5px; font-weight: 700; color: var(--text-soft); }
.block-size .filter-select { padding: 7px 32px 7px 11px; font-size: 13px; }

/* ---------------------------------------------------------------- author picker */
.picker { position: relative; }
.picker-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background-color: var(--background);
    border: 1px solid var(--surface);
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s;
}
.picker-button:hover { border-color: var(--border); }
.picker-button[aria-expanded="true"] { border-color: var(--red); }
.picker-button img { width: 24px; height: 24px; border-radius: 5px; display: block; }
.picker-button > span { flex: 1; text-align: left; }
.picker-button > i { color: var(--text-faded); font-size: 12px; }

.picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 50;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    padding: 8px;
}
.picker-search {
    width: 100%;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 6px;
}
.picker-search:focus { outline: none; border-color: var(--red); }
.picker-search::placeholder { color: var(--border-strong); }

.picker-options { max-height: 260px; overflow-y: auto; }
.picker-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: 0.2s;
}
.picker-option:hover { background-color: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.picker-option img { width: 24px; height: 24px; border-radius: 5px; display: block; }
.picker-empty { color: var(--text-faded); font-size: 13px; padding: 10px; text-align: center; }

/* The post's author, clickable.
   It inherits everything from the .post-meta it belongs to (colour, size and weight) so it reads as part of
   the sentence "Publicado em ... por Fulano", not as a separate element. Only the underline on hover shows
   that it can be clicked. */
.post-author-link {
    color: inherit;
    text-decoration: none;
    transition: 0.25s;
}
.post-author-link:hover { text-decoration: underline; color: var(--red); }

/* the panel's cover field */
.cover-preview {
    border: 1px solid var(--surface);
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--background);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover-preview img { width: 100%; max-height: 260px; object-fit: cover; display: block; }
.cover-preview.empty {
    border-style: dashed;
    border-color: var(--border);
    color: var(--border-strong);
    font-size: 14px;
    font-weight: 700;
}
.cover-preview.empty span { display: flex; align-items: center; gap: 9px; }
.cover-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }

/* --- LOGIN PAGE --- */
.login-wrap { max-width: 480px; margin: 60px auto 90px; padding: 0 24px; }

.login-card {
    background-color: var(--card);
    border-radius: 12px;
    padding: 38px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    text-align: center;
    border: 1px solid var(--card-border);
}
.login-card h1 { font-size: 26px; font-weight: 900; margin-bottom: 8px; }
.login-sub { font-size: 14px; color: var(--text-soft); line-height: 1.6; margin-bottom: 26px; }

.login-card form { display: flex; flex-direction: column; gap: 9px; text-align: left; }
.login-card label { font-size: 13px; font-weight: 900; color: var(--text-2); }
.login-card input[type="text"],
.login-card input[type="password"] {
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    padding: 13px 15px;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    border-color: var(--red);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 15%, transparent);
}
.login-card .btn-primary { margin-top: 10px; font-size: 16px; padding: 13px; width: 100%; }
.login-card label + label { margin-top: 8px; }

/* "Confirme no jogo": a discreet alternative to logging in with the password */
.login-alternative { margin-top: 18px; font-size: 13px; color: var(--text-soft); }
.login-alternative button {
    background: none;
    border: none;
    padding: 0;
    color: var(--red);
    font-weight: 900;
    cursor: pointer;
}
.login-alternative button:hover { text-decoration: underline; }

/* The command to copy */
.login-code {
    background-color: var(--background);
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.login-code code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 19px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 1px;
}

.login-status {
    font-size: 14px;
    color: var(--text-3);
    font-weight: 700;
    margin: 22px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.login-status i { color: var(--red); }

.login-error, .login-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    margin-top: 18px;
}
.login-error {
    background-color: color-mix(in srgb, var(--danger) 12%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 35%, transparent);
    color: var(--danger);
}
.login-notice {
    background-color: color-mix(in srgb, var(--gold) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent);
    color: var(--gold);
    margin-top: 0;
    margin-bottom: 18px;
}

.login-avatar { width: 64px; height: 64px; border-radius: 10px; margin-bottom: 16px; }

.login-card .btn-discord { width: 100%; }

/* The "ou" with a line on each side, between the Discord and the form */
.login-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 4px;
    color: var(--text-faded);
    font-size: 13px;
    font-weight: 900;
}
.login-or::before, .login-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

/* ---------------------------------------------------------------- team */
/* A strip per role, with the role's gradient in game, and below it a card per person with the Minecraft
   head. The role's gradient arrives in --colour and --colour-2. */
.team-wrap { max-width: 1200px; margin: 30px auto 0; padding: 0 20px; }
.team-status { color: var(--text-soft); text-align: center; padding: 40px 0; }
.team-status i { color: var(--red); }

.team-role {
    margin-bottom: 30px;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}
.team-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(90deg, var(--colour), var(--colour-2));
    color: #fff;
    font-size: 16px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.team-members {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    padding: 20px;
}
.team-member {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--card-background);
    background: radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--colour) 14%, transparent), transparent 70%), var(--card-background);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    /* top and not transform: with transform the card moves to a GPU layer on hover and the head, pixel art
       reduced from 48 to 44px, was resampled and changed its look. */
    position: relative;
    top: 0;
    transition: top 0.2s, border-color 0.2s;
}
.team-member:hover { top: -3px; border-color: var(--colour); }
.team-member img { width: 44px; height: 44px; border-radius: 6px; image-rendering: pixelated; flex-shrink: 0; }
.team-member-text { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.team-member-text strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.team-label {
    padding: 2px 12px;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--colour), var(--colour-2));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Team management: the form and the × only exist while editing */

.team-form { display: none; }
.editing .team-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 24px;
    padding: 18px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.team-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 900; color: var(--text-2); }
.team-form input, .team-form .select-menu-button {
    min-width: 200px;
    padding: 11px 13px;
    background-color: var(--background);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
}
.team-form .select-menu-button { padding-right: 36px; text-align: left; }
.team-form input:focus, .team-form .select-menu-button:focus { outline: none; border-color: var(--red); }
.team-form .btn-primary { font-size: 15px; padding: 11px 22px; }
#team-error { margin-bottom: 20px; }
/* dashed cards: the page being edited shows at a glance */
.editing .team-member { border-style: dashed; }

.team-item { position: relative; }
.team-item .team-member { height: 100%; }
.team-remove { display: none; }
.editing .team-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: grid; /* only while editing: otherwise the display: none above holds */
    place-items: center;
    border: none;
    border-radius: 6px;
    background-color: color-mix(in srgb, var(--background) 70%, transparent);
    color: var(--text-soft);
    cursor: pointer;
    transition: 0.2s;
}
.team-remove:hover { background-color: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }

/* ---------------------------------------------------------------- partners: the programme */
/* Requirements and benefits side by side on a computer, one under the other on a phone. */
.partner-program { margin-top: 10px; }
.partner-program h3 { font-size: 20px; font-weight: 900; margin-bottom: 12px; }
.partner-program-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.partner-program-card {
    padding: 20px 22px;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.partner-program-card h4 { font-size: 16px; font-weight: 900; margin-bottom: 10px; }
.partner-program-card h4 i { color: var(--red); margin-right: 6px; }
.partner-program-card ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.partner-program-card li { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.partner-program-card li::marker { color: var(--red); }
.partner-program-card a { color: var(--red-light); }

/* ---------------------------------------------------------------- wiki */
/* A grid of squares: the guide's icon (which already carries the background) with the name below. The same
   square (.wiki-icon) shows small at the top of each guide. */
.wiki-wrap { max-width: 1100px; margin: 30px auto 0; padding: 0 20px; }
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px 48px;
}
.wiki-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: var(--text);
}
.wiki-card strong { font-size: 20px; font-weight: 900; text-align: center; }
.wiki-icon {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--surface); /* only shows while the image loads */
    border-radius: 6px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
.wiki-icon img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.wiki-card:hover .wiki-icon { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35); }
.wiki-card:hover .wiki-icon img { transform: scale(1.04); }

/* The top of a guide: the small square on the left, and "Guia FableMC" + the title beside it */
/* The guide's grid: the top at full width, and below it the body and the index side by side */
.guide-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    grid-template-areas: "topo topo" "conteudo indice";
    column-gap: 56px;
    align-items: start;
}
.guide-content { grid-area: conteudo; min-width: 0; }
.guide-top { grid-area: topo; display: flex; align-items: center; gap: 36px; margin-bottom: 44px; }
.guide-edit { margin-left: auto; align-self: flex-start; }

/* Index: a vertical line with the guide's name at the top and the sections below; it stays fixed beside the
   text while reading. Jumping to a section does not hide it behind the navbar. */
.guide-index {
    grid-area: indice;
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 4px 0 4px 18px;
    border-left: 2px solid var(--border);
}
.guide-index a { color: var(--text-soft); text-decoration: none; font-size: 14px; line-height: 1.4; transition: color 0.2s; }
.guide-index a:hover { color: var(--text); }
.guide-index .index-guide { color: var(--red); font-weight: 900; font-size: 15px; margin-bottom: 2px; }
.guide-index .index-section { padding-left: 12px; }
.guide-index .index-sub { padding-left: 26px; font-size: 13px; }
#guide-top, .guide-content h2, .guide-content h3 { scroll-margin-top: 110px; }

/* Narrow screens: the index moves between the top and the text */
@media (max-width: 1000px) {
    .guide-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topo" "indice" "conteudo"; }
    .guide-index { position: static; margin-bottom: 36px; }
}
.guide-icon { width: 190px; flex-shrink: 0; }
.guide-about { display: block; font-size: 14px; font-weight: 900; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.guide-top h1 { font-size: 44px; font-weight: 900; line-height: 1.1; }
@media (max-width: 600px) {
    .guide-top { gap: 18px; }
    .guide-icon { width: 110px; }
    .guide-top h1 { font-size: 28px; }
}

/* ---------------------------------------------------------------- punishments */
/* Pill filters, the total, and a table of rows: type, date, player, reason and duration. */
.punishments-wrap { max-width: 1200px; margin: 30px auto 0; padding: 0 20px; }
.punishments-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.punishments-filter {
    padding: 10px 38px 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--card);
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
}
.punishments-filter:hover { border-color: var(--border-strong); }
.punishments-filter:focus { outline: none; border-color: var(--red); }
.punishments-total { font-weight: 900; color: var(--text-2); margin-bottom: 12px; }

.punishments-table { background-color: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.punishments-row {
    display: grid;
    grid-template-columns: 110px 190px 240px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 14px 20px;
    border-top: 1px solid var(--card-border);
    color: var(--text-2);
    font-size: 15px;
}
.punishments-head { border-top: none; background-color: var(--card-background); font-size: 13px; font-weight: 900; text-transform: uppercase; color: var(--text-soft); }
.punishments-row.revoked { opacity: 0.55; }

.punishment-type { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 900; text-transform: uppercase; color: #fff; }
/* ban red, mute amber: clearly apart at a glance */
.punishment-type.type-ban { background-color: var(--ban); }
.punishment-type.type-mute { background-color: var(--mute); color: #1c1300; }
.punishment-date { font-weight: 700; color: var(--text-3); }
.punishment-player { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-weight: 700; text-decoration: none; }
.punishment-player:hover { color: var(--red); }
.punishment-player img { width: 24px; height: 24px; border-radius: 4px; image-rendering: pixelated; }
.punishment-reason { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; }
.punishment-revoked { font-size: 12px; color: var(--text-soft); margin-left: 6px; }
.punishment-duration { flex-shrink: 0; padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: 6px; font-size: 13px; font-weight: 900; color: var(--text); }
.punishments-more { display: flex; justify-content: center; margin-top: 20px; }

/* Narrow screens: each punishment becomes a two-line card, without a header */
@media (max-width: 800px) {
    .punishments-head { display: none; }
    .punishments-row { grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; }
    .punishment-date { text-align: right; font-size: 13px; }
    .punishments-row > :nth-child(n+3) { grid-column: 1 / -1; }
}

/* Clickable rows and the details panel that opens below, in the type's colour */
.punishments-row[tabindex] { cursor: pointer; transition: background-color 0.15s; }
.punishments-row[tabindex]:hover, .punishments-row.open { background-color: var(--surface-2); }
.punishments-row[tabindex]:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
/* A light shade of the type's colour with a bar on the left, like the ban notice on the profile: a background
   full of red or orange shouted too loud beside the rest of the site. */
.punishment-details {
    --colour: var(--ban);
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 16px 24px;
    background-color: var(--surface-2); /* Safari < 16.2, without color-mix */
    background-color: color-mix(in srgb, var(--colour) 9%, var(--surface));
    border-left: 3px solid var(--colour);
    color: var(--text-2);
}
.punishment-details.type-mute { --colour: var(--mute); }
.punishment-details div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.punishment-details strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--colour); }
.punishment-details span { font-weight: 700; overflow-wrap: anywhere; }

/* Ban/mute in force notice on the profile: the same format as the comments' notice, clickable */
.punishment-notice { text-decoration: none; transition: border-color 0.2s; }
.punishment-notice:hover { border-color: var(--danger); }
.punishment-notice .notice-arrow { margin-left: auto; font-size: 13px; }
.punishment-notice.type-mute { background-color: color-mix(in srgb, var(--mute) 10%, transparent); border-color: color-mix(in srgb, var(--mute) 35%, transparent); border-left-color: var(--mute); }
.punishment-notice.type-mute i { color: var(--mute); }
.punishment-notice.type-mute .profile-ban-text { color: var(--mute-light); }
.punishment-notice.type-mute .profile-ban-text strong { color: var(--mute); }
.punishment-notice.type-mute:hover { border-color: var(--mute); }

@media (max-width: 800px) {
    .punishment-details { grid-template-columns: 1fr; gap: 10px; }
}

/* The punishments' edit mode: a × at the end of each row, which only exists while editing */
.punishment-remove { display: none; }
.editing .punishment-remove {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background-color: color-mix(in srgb, var(--background) 60%, transparent);
    color: var(--text-soft);
    cursor: pointer;
    transition: 0.2s;
}
.editing .punishment-remove:hover { background-color: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }
.punishment-reason > span:first-child { margin-right: auto; }

/* --- STORE --- */
/* Like the servers' stores: the menu on the left (the cart and the categories, which follow the page down)
   and on the right a section per category. Each product is a card with the discount strip, the art with a
   light in its colour (--colour), the name, the price and Comprar. */
.store {
    max-width: 1200px;
    margin: 30px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 36px;
    align-items: start;
}

/* The title in the centre, between two lines */
.store-top { grid-column: 1 / -1; margin-bottom: 40px; text-align: center; }
.store-top h1 {
    display: flex;
    align-items: center;
    gap: 28px;
    font-size: 40px;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}
.store-top h1::before, .store-top h1::after { content: ''; flex: 1; height: 1px; background-color: var(--border-strong); }
.store-top p { margin-top: 6px; color: var(--text-soft); font-size: 13px; font-weight: 700; letter-spacing: 5px; text-transform: uppercase; }
/* The promotion under the title, with its countdown in boxes */
.store-promotion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 28px;
    margin-top: 24px;
    padding: 14px 20px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--fable-dark), var(--red-strong), var(--fable-dark));
    color: var(--on-red);
}
.store-promotion strong { font-size: 18px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }
.store-countdown { display: flex; gap: 8px; }
.store-countdown span {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 54px;
    padding: 6px 8px;
    border-radius: 8px;
    background-color: color-mix(in srgb, var(--background) 45%, transparent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.store-countdown b { font-size: 20px; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }

.store-menu { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 10px; }
.store-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background-color: var(--red-strong);
    color: var(--on-red);
    border: none;
    border-radius: 8px;
    font: 900 16px 'Poppins', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
}
.store-cart:hover { background-color: var(--fable); }
.store-cart-count {
    min-width: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background-color: var(--on-red);
    color: var(--red-strong);
    font-size: 13px;
    line-height: 22px;
}
.store-cart-count:empty { display: none; }
.store-categories {
    display: flex;
    flex-direction: column;
    padding: 8px;
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}
.store-categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text-3);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.store-categories a:hover { background-color: var(--control); color: var(--text); }

.store-section { margin-bottom: 56px; }
.store-section, .store-product { scroll-margin-top: 110px; }
/* The section's title with a red bar on the left */
.store-section h2 {
    margin-bottom: 24px;
    padding-left: 16px;
    border-left: 4px solid var(--red);
    font-size: 32px;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}

.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.store-product {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: transform 0.2s, border-color 0.2s;
}
.store-product:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--colour) 45%, var(--card-border)); }
/* Over the top of the art, so the cards with and without them stay aligned: the discount strip and, under it
   rather than on it, the "Mais escolhido" badge */
.store-flags { position: absolute; top: 0; left: 0; right: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; }
/* Golden, like the store's link in the navbar */
.store-ribbon {
    align-self: stretch;
    padding: 6px;
    background-color: var(--gold);
    color: var(--background);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
}
.store-badge {
    margin: 10px;
    padding: 4px 10px;
    border: 1px solid var(--colour);
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--background) 85%, transparent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--colour) 45%, transparent);
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.store-badge i { color: var(--colour); }
/* The pixel art, enlarged without blurring, with the light in the product's colour behind it */
.store-art {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    background: radial-gradient(circle, color-mix(in srgb, var(--colour) 24%, transparent), transparent 65%), var(--background);
    border-bottom: 1px solid var(--card-border);
}
.store-art img { image-rendering: pixelated; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--colour) 60%, transparent)); transition: transform 0.2s; }
.store-art > img { width: 72%; }
.store-product:hover .store-art img { transform: scale(1.06); }
/* Cash's coins: one large, and smaller ones the more there are */
.store-coins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: 80%; }
.store-coins img { width: max(26%, calc(60% / var(--coins))); }
/* A combo's art: the VIP's tag above its coins */
.store-combo-art { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.store-combo-art > img { width: 62%; }
.store-combo-art .store-coins { width: 50%; }
.store-combo-art .store-coins img { width: 26%; }
.store-product h3 {
    margin: 0 16px;
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border);
    font-size: 17px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}
/* What a combo includes, each item beside its art (in a box of the same width, so the names line up) */
.store-includes { margin: 0 16px; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text-faded); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.store-includes ul { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; list-style: none; }
.store-includes li { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; text-transform: none; }
.store-includes img { flex-shrink: 0; width: 42px; height: 15px; object-fit: contain; image-rendering: pixelated; }
/* At the bottom of the card, so a name on two lines does not put its price below the others' in the row */
.store-price { margin-top: auto; padding: 12px 16px 0; text-align: center; }
/* the struck-through price; without a discount it stays empty, holding the row so the prices sit at the same height */
.store-price s { display: block; min-height: 18px; color: var(--text-faded); font-size: 12px; }
.store-value { display: inline-flex; align-items: baseline; gap: 3px; }
.store-value strong { font-size: 34px; font-weight: 900; line-height: 1.1; }
.store-value small { color: var(--text-soft); font-size: 14px; font-weight: 700; }
.store-value small:first-child { align-self: flex-start; margin-top: 6px; }
/* Comprar and, beside it, the gift (golden). Once in the cart, both turn dark: Comprar becomes Remover and
   the gift a ×, and the second click takes them out. */
.store-actions { display: flex; gap: 8px; margin: 14px 16px 16px; }
.store-buy {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px;
    font-size: 15px;
    text-transform: uppercase;
}
.store-gift-btn {
    flex-shrink: 0;
    width: 44px;
    border: none;
    border-radius: 8px;
    background-color: var(--gold);
    color: var(--background);
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.store-gift-btn:hover { background-color: var(--gold-light); }
/* while the nick is checked */
.store-gift-btn:disabled { cursor: progress; }
.store-buy.in-cart, .store-gift-btn.in-cart { background-color: var(--surface-2); color: var(--text-2); }
.store-buy.in-cart:hover, .store-gift-btn.in-cart:hover { background-color: var(--surface-hover); color: var(--text); box-shadow: none; }
/* The nick of whoever receives the gift, in a strip at the bottom of the art */
.store-gift {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 8px;
    overflow: hidden;
    background-color: color-mix(in srgb, var(--background) 80%, transparent);
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.store-gift:empty { display: none; }
/* with the head of whoever receives it */
.store-gift img { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; image-rendering: pixelated; }

/* The VIPs compared side by side, the free player first. On a narrow screen the table scrolls sideways and the
   perks' names stay in place on the left. */
.store-perks-scroll { overflow-x: auto; background-color: var(--card); border: 1px solid var(--card-border); border-radius: 12px; }
.store-perks-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.store-perks-table th, .store-perks-table td { padding: 13px 18px; text-align: center; border-top: 1px solid var(--card-border); }
.store-perks-table thead th { border-top: none; vertical-align: bottom; color: var(--text-2); font-size: 13px; font-weight: 900; text-transform: uppercase; }
.store-perks-table thead small { display: block; margin-top: 2px; color: var(--text-faded); font-size: 11px; font-weight: 700; text-transform: none; }
.store-perks-table thead img { height: 28px; image-rendering: pixelated; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--colour) 50%, transparent)); }
.store-perks-table tbody th {
    position: sticky;
    left: 0;
    background-color: var(--card-background);
    color: var(--text-3);
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}
.store-perks-table thead th:first-child { position: sticky; left: 0; background-color: var(--card-background); }
.store-perks-table td { color: var(--text-2); font-weight: 700; white-space: nowrap; }
.store-perks-table .store-perks-vip { background-color: color-mix(in srgb, var(--colour) 6%, transparent); }
.store-perks-table td .fa-check { color: var(--colour, var(--text-2)); }
.store-perks-table td .fa-minus { color: var(--text-faded); }
.store-perks-table tbody tr:hover td, .store-perks-table tbody tr:hover th { background-color: var(--surface-2); }
/* Past the first rows, the perks wait for "Ver mais benefícios" */
.store-perks-table:not(.open) .store-perks-extra { display: none; }
.store-perks-more { display: flex; margin: 14px auto 0; font-size: 13px; text-transform: uppercase; }

/* Narrow screen: the menu moves above the products */
@media (max-width: 900px) {
    .store { grid-template-columns: minmax(0, 1fr); }
    .store-menu { position: static; margin-bottom: 32px; }
    .store-top h1 { gap: 16px; font-size: 30px; }
}
/* Phone: the products two by two */
@media (max-width: 600px) {
    .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .store-product h3 { margin: 0 10px; font-size: 14px; }
    .store-badge { margin: 8px; padding: 3px 8px; font-size: 9px; letter-spacing: 0.5px; white-space: nowrap; }
    .store-includes { margin: 0 10px; }
    .store-includes li { gap: 6px; font-size: 11px; }
    .store-includes img { width: 32px; }
    .store-value strong { font-size: 26px; }
    .store-actions { gap: 6px; margin: 12px 10px; }
    .store-buy { gap: 6px; padding: 10px 4px; font-size: 12px; }
    .store-gift-btn { width: 38px; }
}

/* --- CHECKOUT (/pagamento) --- */
/* The form on the left, in numbered steps, and the cart's summary on the right, which follows the page down.
   The title is the store's (.store-top). The summary comes first in the page, so on a narrow screen, where the
   columns stack, it shows above the form. */
.checkout {
    max-width: 1100px;
    margin: 30px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    column-gap: 32px;
    align-items: start;
}
.checkout-form { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 20px; }
.checkout-summary { grid-column: 2; grid-row: 2; }

.checkout-step {
    min-width: 0; /* a fieldset is otherwise as wide as its content, and pushed the page past a phone's screen */
    margin: 0;
    padding: 24px;
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}
/* Floated, the legend sits inside the card instead of on its border */
.checkout-step legend {
    float: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 0;
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
}
.checkout-step legend + * { clear: both; }
.checkout-step legend span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--red-strong);
    color: var(--on-red);
    font-size: 14px;
}
.checkout-hint { margin-bottom: 18px; color: var(--text-soft); font-size: 13px; }

/* The payment methods: a card each, with the radio, the method's icon in its brand's colour (--brand) and a line
   about it. The chosen one gets the red border. */
.checkout-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.checkout-method {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background-color: var(--control);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.checkout-method:hover { background-color: var(--control-hover); }
.checkout-method:has(input:checked) {
    border-color: var(--red);
    background-color: color-mix(in srgb, var(--red) 10%, var(--control));
}
.checkout-method:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 2px; }
/* the browser's own radio and checkbox, dark like the page and red when ticked */
.checkout-method input, .checkout-terms input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--red-strong);
    color-scheme: dark;
}
.checkout-method input:focus-visible { outline: none; }
.checkout-method > i {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--brand) 15%, transparent);
    color: var(--brand);
    font-size: 20px;
}
.checkout-method strong { display: block; font-size: 15px; font-weight: 900; }
.checkout-method small { display: block; color: var(--text-soft); font-size: 12px; }

/* The payer's details: the name and the e-mail side by side, and under them the CPF when the method needs it */
.checkout-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.checkout-fields .field { margin-bottom: 0; }
/* only once the player has typed or tried to pay: an untouched field is not an error yet */
.checkout .field input:user-invalid { border-color: var(--danger); }

.checkout-terms { display: flex; align-items: flex-start; gap: 12px; color: var(--text-2); font-size: 14px; line-height: 1.5; cursor: pointer; }
.checkout-terms input { margin-top: 2px; }
.checkout-terms a { color: var(--red-light); }
.checkout-pay { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 22px; }

.checkout-summary {
    position: sticky;
    top: 110px;
    padding: 24px;
    background-color: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}
.checkout-summary h2 { margin-bottom: 18px; font-size: 18px; font-weight: 900; text-transform: uppercase; }
.checkout-items { display: flex; flex-direction: column; gap: 14px; list-style: none; }
.checkout-items li { display: flex; align-items: center; gap: 12px; }
/* The product's art lit in its colour (--colour), like on the store's cards */
.checkout-item-art {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: radial-gradient(circle, color-mix(in srgb, var(--colour) 28%, transparent), transparent 70%), var(--background);
}
.checkout-item-art img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.checkout-item-text { flex: 1; min-width: 0; }
.checkout-item-text strong { display: block; font-size: 14px; font-weight: 900; }
.checkout-item-text small { display: block; color: var(--text-soft); font-size: 12px; }
/* the receiver's head before the nick */
.checkout-item-text small img { width: 16px; height: 16px; margin: 0 4px 0 2px; vertical-align: -3px; image-rendering: pixelated; }
.checkout-item-text .fa-gift { margin-right: 3px; color: var(--gold); }
.checkout-item-price { font-size: 14px; font-weight: 900; white-space: nowrap; }
.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.checkout-total span { color: var(--text-soft); font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.checkout-total strong { font-size: 26px; font-weight: 900; }
/* Without a session: whoever is not logged in cannot pay, and is told so before filling in the form */
.checkout-login {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background-color: color-mix(in srgb, var(--gold) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent);
    color: var(--gold);
    font-size: 13px;
    font-weight: 700;
}
.checkout-login i { margin-top: 3px; }
.checkout-login a { color: inherit; }
.checkout-back { width: 100%; justify-content: center; margin-top: 16px; }

.checkout-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
}
.checkout-empty > i {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--red) 14%, transparent);
    color: var(--red);
    font-size: 30px;
}
.checkout-empty h2 { font-size: 26px; font-weight: 900; }
.checkout-empty p { max-width: 420px; color: var(--text-soft); }
.checkout-empty .btn-primary { margin-top: 8px; font-size: 16px; text-decoration: none; }

/* Narrow screen: one column, the summary above the form */
@media (max-width: 900px) {
    .checkout { grid-template-columns: minmax(0, 1fr); }
    .checkout-form, .checkout-summary { grid-column: auto; grid-row: auto; }
    .checkout-summary { position: static; margin-bottom: 20px; }
}
/* Phone: the payment methods and the fields one under the other */
@media (max-width: 600px) {
    .checkout-step, .checkout-summary { padding: 18px; }
    .checkout-methods, .checkout-fields { grid-template-columns: minmax(0, 1fr); }
}

