/* GameFam — thème sombre / violet néon */

:root {
    --bg-deep: #050208;
    --bg-card: linear-gradient(160deg, rgba(35, 18, 60, 0.85), rgba(10, 5, 18, 0.95));
    --purple: #a855f7;
    --purple-soft: #c4b5fd;
    --purple-deep: #7c3aed;
    --purple-glow: rgba(168, 85, 247, 0.55);
    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --border: rgba(168, 85, 247, 0.22);
    --font-display: "Barlow Condensed", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --radius: 14px;
    --maxw: 1480px;
    --pad-x: clamp(1rem, 3vw, 3rem);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background: #050208;
    overflow-x: hidden;
}

.bg-fx {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 45% at 78% 32%, rgba(124, 58, 237, 0.32), transparent 60%),
        radial-gradient(ellipse 55% 35% at 18% 70%, rgba(76, 29, 149, 0.18), transparent 60%),
        linear-gradient(180deg, #07040c 0%, #050208 60%, #03010a 100%);
}

/* ---------- Social rail ---------- */
.social-rail {
    position: fixed;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.social-rail__label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.3em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.social-rail__icons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.social-rail__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s, transform 0.15s;
}

.social-rail__icon:hover {
    color: var(--purple);
    transform: scale(1.15);

}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: 0.55rem var(--pad-x);
    background: linear-gradient(180deg, rgba(5, 2, 8, 0.94) 60%, rgba(5, 2, 8, 0.6));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(168, 85, 247, 0.12);
    overflow: visible;
}

/* Reserve a small slot in the header — the logo overflows below it */
.brand {
    position: relative;
    width: 150px;
    height: 56px;
    text-decoration: none;
    color: var(--text);
}

/* Full logo (PNG with near-black background): `lighten` keeps only pixels
   brighter than the page so the dark backdrop disappears cleanly.
   `contrast`/`brightness` crushes residual near-black pixels to true black,
   removing the faint rectangular outline caused by PNG compression. */
.brand__logo {
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 130px;
    object-fit: contain;
    mix-blend-mode: lighten;
    filter: contrast(1.15) brightness(1.05);
    transition: transform 0.2s;
    pointer-events: none;
    z-index: 2;
}

.brand:hover .brand__logo {
    transform: scale(1.03);
    transform-origin: top left;
}

.nav-main {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    justify-content: center;
}

.nav-main__link {
    position: relative;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--text);
    text-decoration: none;
    padding: 0.25rem 0;
    transition: color 0.2s;
}

.nav-main__link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--purple);
    transition: width 0.2s;
    /* box-shadow: 0 0 8px var(--purple-glow); */
}

.nav-main__link:hover,
.nav-main__link.is-active {
    color: var(--purple-soft);
}

.nav-main__link.is-active::after,
.nav-main__link:hover::after {
    width: 70%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: var(--purple);
    background: rgba(168, 85, 247, 0.1);
}

.icon-btn--badge .badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    /* box-shadow: 0 0 6px rgba(239, 68, 68, 0.7); */
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    border: 2px solid var(--purple);
    background: transparent;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s;
}

.btn-login:hover {
    background: rgba(168, 85, 247, 0.15);
    /* box-shadow: 0 0 16px var(--purple-glow); */
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-menu__avatar {
    border-radius: 50%;
    border: 2px solid var(--purple);
    /* box-shadow: 0 0 12px var(--purple-glow); */
}

.user-menu__name {
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
}

.btn-logout:hover {
    color: var(--text);
    border-color: var(--purple);
}

/* ---------- Flash ---------- */
.flash {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0.65rem var(--pad-x);
    font-size: 0.9rem;
}

.flash__body {
    display: block;
    margin-top: 0.35rem;
    line-height: 1.5;
    color: #e4e4e7;
    font-weight: 400;
}

.flash__body code {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.flash--error {
    background: rgba(127, 29, 29, 0.4);
    border-bottom: 1px solid rgba(248, 113, 113, 0.35);
}

.flash--ok {
    background: rgba(22, 101, 52, 0.35);
    border-bottom: 1px solid rgba(74, 222, 128, 0.35);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.5rem var(--pad-x) 1rem;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
    gap: 1.5rem;
    align-items: center;
    min-height: 70vh;
}

.hero__copy {
    padding-top: 1rem;
    z-index: 2;
}

.hero__tagline {
    font-family: var(--font-display);
    color: var(--purple);
    letter-spacing: 0.22em;
    font-size: 0.85rem;
    margin: 0 0 1.25rem;
}

.hero__title {
    margin: 0 0 1.5rem;
    line-height: 0.92;
}

.hero__title-line {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.25rem, 4vw, 3.4rem);
    letter-spacing: 0.02em;
    color: #fff;
}

.hero__title-accent {
    display: block;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3.5rem, 7.5vw, 6.25rem);
    letter-spacing: 0.02em;
    background:
        linear-gradient(180deg, #f5f3ff 0%, #c4b5fd 30%, #a855f7 60%, #6d28d9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-top: 0.25rem;
}

.hero__desc {
    color: #d4d4d8;
    line-height: 1.55;
    margin: 0 0 2rem;
    font-size: 0.95rem;
    max-width: 32rem;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.4rem;
    border-radius: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.btn--primary {
    background: linear-gradient(135deg, var(--purple-deep), var(--purple));
    color: #fff;
    border: none;
    /* box-shadow: 0 8px 28px rgba(168, 85, 247, 0.4); */
}

.btn--primary:hover {
    transform: translateY(-2px);
    /* box-shadow: 0 12px 36px rgba(168, 85, 247, 0.55); */
}

.btn--ghost {
    border: 2px solid var(--purple);
    color: var(--text);
    background: transparent;
}

.btn--ghost:hover {
    background: rgba(168, 85, 247, 0.12);
    /* box-shadow: 0 0 16px var(--purple-glow); */
}

.hero__visual {
    position: relative;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
}

.hero__halo {
    display: none;
}

/* The logo PNG has a near-black background — `mix-blend-mode: lighten`
   discards anything darker than the page (cleaner than `screen` because it
   doesn't reveal compression artifacts at the edges). `contrast` crushes
   any remaining near-black pixels to true black. */
.hero__img {
    position: relative;
    display: block;
    width: 100%;
    max-width: 680px;
    height: auto;
    object-fit: contain;
    mix-blend-mode: lighten;
    filter: contrast(1.15) brightness(1.05);
}

/* ---------- Bottom band: featured + tournaments ---------- */
.band {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1rem var(--pad-x) 3rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 28%, 420px);
    gap: 1.25rem;
    align-items: stretch;
}

.band__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.band__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.18em;
    margin: 0;
    color: var(--text);
    position: relative;
    padding-left: 0.85rem;
}

.band__title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: var(--purple);
    /* box-shadow: 0 0 8px var(--purple-glow); */
    border-radius: 2px;
}

.band__more {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--purple);
    text-decoration: none;
    font-weight: 700;
}

.band__more:hover {
    text-shadow: 0 0 8px var(--purple-glow);
}

.band__more--center {
    display: block;
    text-align: center;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

/* ---------- Featured cards ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    /* box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); */
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--purple);
    /* box-shadow: 0 14px 32px rgba(168, 85, 247, 0.25); */
}

.card__tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 3;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 0.3rem 0.55rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--purple);
    color: var(--purple-soft);

}

.card__tag--news {
    border-color: #60a5fa;
    color: #bfdbfe;

}

.card__tag--community {
    border-color: #34d399;
    color: #bbf7d0;

}

.card__media {
    position: relative;
    height: 130px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(168, 85, 247, 0.35), transparent 60%),
        linear-gradient(180deg, rgba(76, 29, 149, 0.35), rgba(10, 5, 18, 0.6));
}

.card__media svg {
    margin-bottom: -6px;
}

.card__media--trophy {
    background:
        radial-gradient(ellipse at 50% 100%, rgba(251, 191, 36, 0.25), transparent 65%),
        linear-gradient(180deg, rgba(76, 29, 149, 0.4), rgba(10, 5, 18, 0.7));
}

.card__media--soldier {
    background:
        radial-gradient(ellipse at 50% 100%, rgba(168, 85, 247, 0.4), transparent 60%),
        linear-gradient(180deg, rgba(30, 16, 51, 0.7), rgba(5, 2, 8, 0.9));
}

.card__media--crowd {
    background:
        radial-gradient(ellipse at 50% 100%, rgba(168, 85, 247, 0.45), transparent 70%),
        linear-gradient(180deg, rgba(76, 29, 149, 0.35), rgba(10, 5, 18, 0.7));
}

.card__body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.card__title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    line-height: 1.05;
}

.card__title span {
    color: var(--purple-soft);
}

.card__desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
    flex: 1;
}

.card__date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---------- Tournaments panel ---------- */
.band__tournaments {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.1rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    /* box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); */
}

.band__tournaments .band__title {
    margin-bottom: 0.85rem;
}

.tlist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.tlist__item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "logo info date"
        "logo info btn";
    column-gap: 0.7rem;
    row-gap: 0.1rem;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.12);
    transition: border-color 0.2s, background 0.2s;
}

.tlist__item:hover {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.08);
}

.tlist__logo {
    grid-area: logo;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    color: #fff;
    overflow: hidden;
}

.tlist__logo--val {
    background: linear-gradient(140deg, #ff4655, #b91c1c);
    /* box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.4); */
}

.tlist__logo--fn {
    background: linear-gradient(140deg, #1e1033, #0b0511);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 1.4rem;
}

.tlist__logo--cod {
    background: linear-gradient(140deg, #4b5563, #1f2937);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.tlist__logo--gf {
    background: linear-gradient(140deg, #7c3aed, #4c1d95);
    border: 1px solid rgba(168, 85, 247, 0.35);
    font-size: 1.05rem;
}

.tlist__empty {
    margin: 0;
    padding: 1.25rem 0.5rem;
    text-align: center;
    line-height: 1.5;
}

.tlist__info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.tlist__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tlist__meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.tlist__date {
    grid-area: date;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-align: right;
    white-space: nowrap;
}

.tlist__btn {
    grid-area: btn;
    justify-self: end;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--purple);
    color: var(--text);
    text-decoration: none;
    background: rgba(168, 85, 247, 0.1);
    white-space: nowrap;
}

.tlist__btn:hover {
    background: var(--purple);
    color: #fff;
    /* box-shadow: 0 0 12px var(--purple-glow); */
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    .band {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: left;
        min-height: auto;
        padding-top: 1.5rem;
    }

    .hero__visual {
        order: -1;
        min-height: 320px;
    }

    .hero__img {
        max-width: 88%;
        margin: 0 auto;
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .social-rail {
        display: none;
    }
}

@media (max-width: 760px) {
    .site-header {
        grid-template-columns: auto auto;
        row-gap: 0.75rem;
    }

    .nav-main {
        order: 3;
        grid-column: 1 / -1;
        justify-content: flex-start;
        gap: 1rem 1.25rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .btn-login {
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 520px) {
    .tlist__item {
        grid-template-columns: 36px 1fr;
        grid-template-areas:
            "logo info"
            "date date"
            "btn  btn";
    }

    .tlist__date,
    .tlist__btn {
        justify-self: start;
        text-align: left;
    }
}

/* ---------- User menu (trigger + dropdown) ---------- */
.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.25rem 0.85rem 0.25rem 0.3rem;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.user-menu__trigger:hover,
.user-menu.is-open .user-menu__trigger {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.18);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
}

.user-menu__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--purple);
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.user-menu__name {
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__chevron {
    color: var(--purple-soft);
    transition: transform 0.2s;
}

.user-menu.is-open .user-menu__chevron {
    transform: rotate(180deg);
}

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    padding: 0.4rem;
    background: linear-gradient(170deg, rgba(30, 16, 51, 0.98), rgba(10, 5, 18, 0.98));
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(168, 85, 247, 0.08),
        0 0 24px rgba(168, 85, 247, 0.15);
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.18s ease;
    z-index: 60;
}

.user-menu__dropdown::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: rgba(30, 16, 51, 0.98);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    transform: rotate(45deg);
}

.user-menu.is-open .user-menu__dropdown {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.user-menu__header {
    padding: 0.65rem 0.75rem 0.75rem;
    margin: 0 0 0.35rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.user-menu__header-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.user-menu__header-id {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.user-menu__item svg {
    color: var(--purple-soft);
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}

.user-menu__item:hover,
.user-menu__item:focus-visible {
    background: rgba(168, 85, 247, 0.18);
    outline: none;
}

.user-menu__item:hover svg {
    transform: translateX(2px);
}

.user-menu__item--danger {
    color: #fca5a5;
}

.user-menu__item--danger svg {
    color: #fca5a5;
}

.user-menu__item--danger:hover,
.user-menu__item--danger:focus-visible {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.user-menu__item--danger:hover svg {
    color: #fecaca;
    transform: translateX(2px);
}

.user-menu__subhead {
    padding: 0.55rem 0.75rem 0.25rem;
    margin-top: 0.35rem;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.user-menu__item--staff svg {
    color: #fde68a;
}

.user-menu__item--staff:hover,
.user-menu__item--staff:focus-visible {
    background: rgba(245, 158, 11, 0.12);
}

.user-menu__item--staff:hover svg {
    color: #fcd34d;
}

.user-menu__item--mod svg {
    color: #7dd3fc;
}

.user-menu__item--mod:hover,
.user-menu__item--mod:focus-visible {
    background: rgba(56, 189, 248, 0.12);
}

.user-menu__item--mod:hover svg {
    color: #bae6fd;
}

@media (max-width: 520px) {
    .user-menu__name {
        display: none;
    }
    .user-menu__trigger {
        padding: 0.2rem 0.45rem 0.2rem 0.25rem;
    }
    .user-menu__dropdown {
        min-width: 220px;
    }
}

/* ---------- Profile page ---------- */
.profile-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem var(--pad-x) 4rem;
}

.profile-empty {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
}

.profile-empty h1 {
    font-family: var(--font-display);
    margin: 0 0 0.75rem;
    font-size: 2rem;
    letter-spacing: 0.04em;
}

.profile-empty p {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.profile-empty code {
    background: rgba(168, 85, 247, 0.1);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    color: var(--purple-soft);
}

.profile-card {
    --accent: var(--purple);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.profile-card__banner {
    position: relative;
    height: 160px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 35%, transparent), rgba(124, 58, 237, 0.4)),
        radial-gradient(ellipse at 20% 30%, rgba(168, 85, 247, 0.45), transparent 60%),
        linear-gradient(160deg, #1e1033, #050208);
    background-size: cover;
    background-position: center;
}

.profile-card__pill {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.profile-card__pill--boost {
    border-color: #f0aaff;
    color: #f0aaff;
    text-shadow: 0 0 8px rgba(240, 170, 255, 0.5);
}

.profile-card__pill--warn {
    border-color: #fbbf24;
    color: #fde68a;
}

.profile-card__head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.25rem;
    padding: 0 1.75rem;
    margin-top: 10px;
    align-items: end;
}

.profile-card__avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 5px solid #050208;
    background: #050208;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.profile-card__identity {
    padding-bottom: 0.5rem;
    min-width: 0;
}

.profile-card__name {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.85rem;
    letter-spacing: 0.02em;
    color: #fff;
    line-height: 1.1;
}

.profile-card__handle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.profile-card__nick {
    margin-left: 0.5rem;
    color: var(--purple-soft);
}

.profile-card__nick strong {
    color: var(--text);
}

.profile-card__id {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-card__id code {
    background: rgba(168, 85, 247, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--purple-soft);
    font-size: 0.78rem;
}

.profile-card__stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    padding: 1.5rem 1.75rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat__label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat__value {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.profile-card__roles {
    padding: 1.5rem 1.75rem;
}

.profile-card__section-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
}

.muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.role-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--role-color) 12%, rgba(0, 0, 0, 0.4));
    border: 1px solid color-mix(in srgb, var(--role-color) 50%, transparent);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
}

.role-pill__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--role-color);
    box-shadow: 0 0 8px color-mix(in srgb, var(--role-color) 70%, transparent);
}

.role-pill__name {
    line-height: 1;
}

.profile-card__footer {
    padding: 1rem 1.75rem 1.75rem;
}

@media (max-width: 720px) {
    .profile-card__head {
        grid-template-columns: 1fr;
        margin-bottom: 5px;
    }
    .profile-card__stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .profile-card__avatar {
        width: 110px;
        height: 110px;
    }
}

/* ---------- Staff pages (admin / mod) ---------- */
.staff-page {
    max-width: 1350px;
    margin: 0 auto;
    padding: 2rem var(--pad-x) 4rem;
}

.staff-page__head {
    margin-bottom: 1.5rem;
}

.staff-page__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 0 0 0.5rem;
}

.staff-page__lead {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.staff-page__panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
}

.staff-page--wide {
    max-width: 1080px;
}

.staff-breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.staff-breadcrumb a {
    color: var(--purple-soft);
    text-decoration: none;
}

.staff-breadcrumb a:hover {
    text-decoration: underline;
}

.staff-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    border: 1px solid var(--border);
}

.staff-alert--error {
    background: rgba(127, 29, 29, 0.35);
    border-color: rgba(248, 113, 113, 0.35);
}

.staff-alert--ok {
    background: rgba(22, 101, 52, 0.35);
    border-color: rgba(74, 222, 128, 0.35);
}

.staff-alert__hint {
    margin-top: 0.75rem;
    line-height: 1.55;
}

.staff-alert__code {
    display: block;
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.78rem;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.staff-alert__trace {
    margin: 0.75rem 0 0;
    padding: 0.75rem;
    font-size: 0.75rem;
    overflow: auto;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    max-height: 120px;
}

.staff-alert__list {
    margin: 0;
    padding-left: 1.25rem;
}

.admin-dash__title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.admin-dash__links {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.admin-dash__card {
    display: block;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.admin-dash__card:hover {
    border-color: var(--purple);
    background: rgba(168, 85, 247, 0.08);
}

.admin-dash__card-title {
    display: block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.04em;
    color: var(--purple-soft);
}

.admin-dash__card-desc {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-dash__hint {
    margin-bottom: 1rem;
}

.admin-form-panel__title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 1.25rem;
    color: var(--text-muted);
}

.admin-form-panel {
    margin-bottom: 1.5rem;
}

.admin-form__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.admin-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-field--full {
    grid-column: 1 / -1;
}

.admin-field__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.admin-field__input {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
}

.admin-field__input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.admin-field__textarea {
    resize: vertical;
    min-height: 100px;
}

.admin-field__hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.admin-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.admin-table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.admin-code {
    font-size: 0.75rem;
}

.admin-table__actions {
    white-space: nowrap;
    text-align: right;
}

.admin-table__edit {
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--purple-soft);
    text-decoration: none;
}

.admin-table__edit:hover {
    color: #fff;
    text-decoration: underline;
}

.admin-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-badge--draft {
    background: rgba(113, 113, 122, 0.35);
    color: var(--text-muted);
}

.admin-badge--published {
    background: rgba(34, 197, 94, 0.25);
    color: #86efac;
}

.admin-badge--cancelled {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

@media (max-width: 640px) {
    .admin-form__grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Public tournament detail (tournoi.php) ---------- */
.tournament-detail__head {
    margin-bottom: 1.25rem;
}

.tournament-detail__title {
    margin-bottom: 0.35rem;
}

.tournament-detail__meta {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.tournament-detail__dot {
    opacity: 0.45;
}

.tournament-detail__actions {
    margin-bottom: 1.25rem;
}

.tournament-detail__cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.tournament-detail__hint {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.tournament-detail__cta-msg {
    margin: 0;
    flex: 1 1 220px;
}

.tournament-detail__inline-form {
    display: inline;
}

.tournament-detail__section-title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.tournament-detail__count {
    font-weight: 600;
    color: var(--purple-soft);
}

.tournament-detail__body {
    line-height: 1.6;
    color: var(--text);
}

.tournament-detail__desc {
    margin-bottom: 1.25rem;
}

.tournament-detail__organizer {
    margin-bottom: 1.25rem;
}

.tournament-detail__person {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tournament-detail__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.tournament-detail__avatar--placeholder {
    background: linear-gradient(140deg, #4c1d95, #1e1033);
    flex-shrink: 0;
}

.tournament-detail__person-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--purple-soft);
    text-decoration: none;
}

.tournament-detail__person-name:hover {
    color: #fff;
    text-decoration: underline;
}

.tournament-detail__person-hint {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
}

.tournament-detail__player-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.tournament-detail__player {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.22);
}

.tournament-detail__player-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.tournament-detail__player-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.tournament-detail__player-name {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tournament-detail__player-name:hover {
    color: var(--purple-soft);
}

.tournament-detail__badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--purple-soft);
    align-self: flex-start;
}

/* ---------- Rules modal (auth/rules.php) ---------- */
.rules-body {
    overflow: hidden;
    min-height: 100vh;
}

.rules-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 4, 20, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.rules-modal__card {
    width: min(640px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6),
                0 0 0 1px rgba(168, 85, 247, 0.15);
    padding: 1.75rem 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.rules-modal__head {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rules-modal__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0;
}

.rules-modal__lead {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.rules-modal__body {
    line-height: 1.6;
}

.rules-modal__list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rules-modal__list li {
    color: var(--text);
}

.rules-modal__list li strong {
    color: var(--purple-soft);
}

.rules-modal__notice {
    margin: 0;
    padding: 0.85rem 1rem;
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.92rem;
}

.rules-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.rules-modal__btn {
    min-width: 160px;
}

@media (max-width: 540px) {
    .rules-modal__card {
        padding: 1.25rem;
    }
    .rules-modal__title {
        font-size: 1.35rem;
    }
    .rules-modal__actions {
        justify-content: stretch;
    }
    .rules-modal__btn {
        flex: 1 1 auto;
    }
}
