/* =========================================================
   Shaiya Hex — design tokens
   Monochrome + a single gilt accent lifted from the logo art
   ========================================================= */
:root {
    /* true neutrals — R=G=B on every step */
    --ink-deep: #050505;
    --ink: #0d0d0d;
    --panel: #1a1a1a;
    --panel-soft: #242424;
    --hairline: rgba(255, 255, 255, 0.09);

    /* the two faces of the duality — no hue, only value */
    --light: #f2f2f0;
    --light-dim: rgba(242, 242, 240, 0.3);
    --fury: #141414;
    --fury-line: rgba(255, 255, 255, 0.55);
    --fury-dim: rgba(20, 20, 20, 0.5);

    /* the one accent — lifted straight from the logo's own gilding */
    --gilt: #c9a05c;
    --gilt-soft: #e8c988;

    --parchment: #ede9e2;
    --parchment-dim: rgba(237, 233, 226, 0.66);
    --parchment-faint: rgba(237, 233, 226, 0.4);

    --font-display: "Cinzel", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --nav-h: 84px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-deep); }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 6px; border: 2px solid var(--ink-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--gilt); }
html { scrollbar-color: #2a2a2a var(--ink-deep); scrollbar-width: thin; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    background: var(--ink);
    color: var(--parchment);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
svg { width: 18px; height: 18px; display: block; }

::selection { background: var(--gilt); color: var(--ink-deep); }

:focus-visible {
    outline: 2px solid var(--gilt-soft);
    outline-offset: 3px;
    border-radius: 4px;
}

/* =========================================================
   Hero background layers
   ========================================================= */
.hero {
    position: fixed;
    inset: 0;
    height: 100dvh;
    width: 100dvw;
    z-index: -1;
    overflow: hidden;
    background: var(--ink-deep);
}

/* bg2.jpg — the black/white blossom split. This IS the environment art. */
.hero-background {
    position: absolute;
    inset: 0;
    background-image: url("bg2.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: grayscale(1) contrast(1.05);
    opacity: 0.85;
}

/* dark scrim so hero copy stays legible over the lighter half of the split */
.hero-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(100deg, rgba(5,5,5,0.92) 0%, rgba(5,5,5,0.6) 38%, rgba(5,5,5,0.15) 60%, transparent 80%),
        linear-gradient(180deg, rgba(5,5,5,0.5) 0%, transparent 30%, transparent 65%, rgba(5,5,5,0.95) 100%);
}

/* bg1.png — the two figures, anchored where the reference composition puts them */
.hero-characters {
    position: absolute;
    inset: 0;
    background-image: url("bg1.png");
    background-position: bottom right;
    background-repeat: no-repeat;
    background-size: contain;
    filter: grayscale(1) contrast(1.05);
    opacity: 0.92;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% 40%, transparent 45%, var(--ink) 100%),
        linear-gradient(180deg, rgba(5,5,5,0.4) 0%, transparent 20%, transparent 68%, var(--ink) 100%);
    pointer-events: none;
}

.particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mote {
    position: absolute;
    top: -5%;
    width: var(--size, 3px);
    height: var(--size, 3px);
    border-radius: 50%;
    background: var(--mote-color, var(--gilt-soft));
    box-shadow: 0 0 6px 1px var(--mote-color, var(--gilt-soft));
    opacity: 0;
    animation: drift var(--dur, 14s) linear var(--delay, 0s) infinite;
}

@keyframes drift {
    0% { transform: translate3d(0, -5vh, 0); opacity: 0; }
    8% { opacity: 0.8; }
    92% { opacity: 0.5; }
    100% { transform: translate3d(var(--drift-x, 40px), 108vh, 0); opacity: 0; }
}

/* =========================================================
   Foreground scroll wrapper
   ========================================================= */
.hero-content {
    position: relative;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 0 clamp(20px, 4vw, 56px);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
}

.navbar.is-scrolled {
    background: rgba(5, 5, 5, 0.78);
    backdrop-filter: blur(14px) saturate(120%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-brand {
    display: flex;
    align-items: baseline;
    margin-right: 8px;
    flex-shrink: 0;
}

.nav-brand-text {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--parchment);
}
.nav-brand-text em { font-style: normal; color: var(--gilt-soft); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.nav-links > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    color: var(--parchment-dim);
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-links > li > a:hover {
    color: var(--parchment);
    background: rgba(255, 255, 255, 0.06);
}

.nav-links svg { color: var(--gilt-soft); opacity: 0.85; }

.nav-dropdown { position: relative; }

.nav-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: var(--parchment-dim);
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.nav-dropdown-trigger:hover { color: var(--parchment); background: rgba(255, 255, 255, 0.06); }
.nav-dropdown-trigger svg:first-child { color: var(--gilt-soft); opacity: 0.85; }
.nav-dropdown-trigger .chev { width: 12px; height: 12px; transition: transform 0.25s var(--ease); }
.nav-dropdown:hover .chev, .nav-dropdown:focus-within .chev { transform: rotate(180deg); }

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 140px;
    background: rgba(10, 10, 10, 0.96);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 160, 92, 0.18);
    border-radius: 10px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--parchment-dim);
}

.nav-dropdown-menu a:hover { background: rgba(255, 255, 255, 0.07); color: var(--parchment); }
.nav-dropdown-menu a.is-active { background: rgba(255, 255, 255, 0.07); color: var(--gilt-soft); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}


/* buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: transform 0.2s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-ghost { color: var(--parchment-dim); }
.btn-ghost:hover { color: var(--gilt-soft); }

.btn-outline {
    border-color: rgba(255, 255, 255, 0.28);
    color: var(--parchment);
}
.btn-outline:hover { border-color: var(--gilt-soft); color: var(--gilt-soft); }

.btn-gilt {
    background: var(--gilt);
    color: var(--ink-deep);
}
.btn-gilt:hover { background: var(--gilt-soft); box-shadow: 0 4px 18px rgba(201, 160, 92, 0.3); }

.btn-primary {
    background: linear-gradient(120deg, var(--gilt) 0%, var(--gilt-soft) 100%);
    color: var(--ink-deep);
    padding: 14px 28px;
    font-size: 0.9rem;
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(201, 160, 92, 0.35); }

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--light);
    padding: 14px 28px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.05);
}
.btn-secondary:hover { border-color: var(--light); box-shadow: 0 0 0 1px rgba(242, 242, 240, 0.15), 0 8px 24px rgba(242, 242, 240, 0.1); }

.nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
}
.nav-burger span { display: block; width: 22px; height: 1.5px; background: var(--parchment); margin: 0 auto; transition: transform 0.25s var(--ease), opacity 0.25s var(--ease); }

.mobile-menu {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    width: min(78vw, 320px);
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(14px);
    border-left: 1px solid rgba(201, 160, 92, 0.16);
    display: none;
    flex-direction: column;
    padding: 18px;
    gap: 4px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    z-index: 39;
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu a { padding: 14px 10px; font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.05em; color: var(--parchment-dim); border-bottom: 1px solid rgba(255,255,255,0.06); }
.mobile-menu .mobile-cta { color: var(--gilt-soft); }

/* =========================================================
   Hero main
   ========================================================= */
.hero-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav-h) + 40px) clamp(20px, 6vw, 90px) 60px;
    max-width: 720px;
}

.hero-eyebrow {
    font-family: var(--font-display);
    font-size: 0.78rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gilt-soft);
    margin: 0 0 18px;
}

.hero-logo {
    display: block;
    width: min(92%, 560px);
    height: auto;
    margin: 0 0 26px -6px;
    filter:
        drop-shadow(0 0 46px rgba(242, 242, 240, 0.16))
        drop-shadow(0 22px 40px rgba(0, 0, 0, 0.7))
        drop-shadow(0 0 70px rgba(201, 160, 92, 0.22));
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.6;
    color: var(--parchment-dim);
    max-width: 480px;
    margin: 0 0 40px;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
}

.hero-actions-center { justify-content: center; }

.hero-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat-icon { color: var(--gilt-soft); align-self: center; width: 16px; height: 16px; }
.hero-stat-num { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; color: var(--parchment); font-variant-numeric: tabular-nums; }
.hero-stat-label { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--parchment-faint); }

.scroll-cue {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}
.scroll-cue span {
    width: 3px;
    height: 8px;
    border-radius: 2px;
    background: var(--gilt-soft);
    animation: scrollcue 1.8s ease-in-out infinite;
}
@keyframes scrollcue { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(8px); opacity: 0.3; } }

/* =========================================================
   Content
   ========================================================= */
.content {
    position: relative;
    z-index: 2;
    background: var(--ink);
}

.ticker {
    background: var(--panel);
    border-bottom: 1px solid rgba(201, 160, 92, 0.14);
    padding: 12px 0;
    overflow: hidden;
}
.ticker-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 56px);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--parchment-dim);
}
.ticker-badge {
    flex-shrink: 0;
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(201, 160, 92, 0.16);
    color: var(--gilt-soft);
    border: 1px solid rgba(201, 160, 92, 0.3);
}
.ticker-inner p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(60px, 9vw, 110px) clamp(20px, 4vw, 56px);
}

.section-head { margin-bottom: 44px; }
.section-head-center { text-align: center; max-width: 620px; margin-left: auto; margin-right: auto; }

.section-eyebrow {
    font-family: var(--font-display);
    font-size: 0.74rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--gilt-soft);
    margin: 0 0 10px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.4vw, 2.5rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
}

.section-lede {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--parchment-dim);
    margin: 14px 0 0;
}

/* faction divider — signature element, drawn from the logo's own blade + diamond flourish */
.faction-divider {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 clamp(20px, 4vw, 56px);
}
.fd-blade {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--parchment-faint));
}
.fd-blade-right { background: linear-gradient(90deg, var(--parchment-faint), transparent); }
.fd-diamond {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    background: var(--gilt);
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(201, 160, 92, 0.5);
}
.faction-divider-tight { max-width: 420px; margin: 0 auto 36px; }

/* news */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 18px;
}
.news-card {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.news-card:hover { border-color: rgba(201, 160, 92, 0.35); transform: translateY(-3px); }
.news-card-feature { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; padding: 32px; background: linear-gradient(160deg, var(--panel-soft), var(--panel)); }
.news-card-feature h3 { font-size: 1.35rem; }
.news-card h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0; color: var(--parchment); }
.news-card p { font-size: 0.88rem; line-height: 1.6; color: var(--parchment-dim); margin: 0; flex: 1; }
.news-card time { font-size: 0.72rem; color: var(--parchment-faint); letter-spacing: 0.04em; }
.news-tag {
    align-self: flex-start;
    font-family: var(--font-display);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 4px;
    background: rgba(201, 160, 92, 0.16);
    color: var(--gilt-soft);
    border: 1px solid rgba(201, 160, 92, 0.28);
}
.news-tag-light { background: rgba(242, 242, 240, 0.12); color: var(--light); border-color: rgba(242, 242, 240, 0.26); }
.news-tag-fury { background: rgba(0, 0, 0, 0.5); color: var(--parchment); border-color: var(--fury-line); }

/* factions */
.faction-columns {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
}
.faction-col h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0 0 12px;
    letter-spacing: 0.06em;
}
.faction-col-light { text-align: right; }
.faction-col-light h3 { color: var(--light); text-shadow: 0 0 20px rgba(242, 242, 240, 0.35); }
.faction-col-fury h3 { color: var(--parchment); text-shadow: none; }
.faction-col p { color: var(--parchment-dim); line-height: 1.7; margin: 0 0 16px; }
.faction-col ul { display: flex; flex-direction: column; gap: 8px; }
.faction-col-light ul { align-items: flex-end; }
.faction-col li { font-size: 0.85rem; color: var(--parchment-faint); }

.faction-col-emblem {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    background: conic-gradient(from 90deg, var(--light) 0 var(--light-pct, 50%), var(--fury) var(--light-pct, 50%) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.faction-col-emblem-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.faction-ratio {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--parchment-dim);
    white-space: nowrap;
}
.emblem-diamond {
    width: 30px;
    height: 30px;
    background: var(--ink);
    border: 1px solid var(--gilt);
    transform: rotate(45deg);
    box-shadow: 0 0 30px rgba(201, 160, 92, 0.25), inset 0 0 16px rgba(201, 160, 92, 0.12);
}

/* features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.feature-card {
    padding: 26px 22px;
    border-radius: 12px;
    background: var(--panel);
    border: 1px solid var(--hairline);
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.feature-card:hover { border-color: rgba(201, 160, 92, 0.32); transform: translateY(-3px); }
.feature-card svg { color: var(--gilt-soft); width: 24px; height: 24px; margin-bottom: 14px; }
.feature-card h3 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 8px; }
.feature-card p { font-size: 0.86rem; color: var(--parchment-dim); line-height: 1.6; margin: 0; }

/* download cta */
.download-cta { text-align: center; }
.download-cta .section-title { margin-bottom: 12px; }
.download-cta .section-lede { margin-bottom: 34px; }

/* footer */
.site-footer {
    border-top: 1px solid var(--hairline);
    padding: 40px clamp(20px, 4vw, 56px) 50px;
    text-align: center;
    color: var(--parchment-faint);
}
.footer-brand { display: flex; align-items: baseline; justify-content: center; margin-bottom: 10px; }
.footer-brand .nav-brand-text { font-size: 0.9rem; }
.site-footer p { font-size: 0.82rem; margin: 0 0 18px; }
.footer-links { display: flex; justify-content: center; gap: 22px; }
.footer-links a { font-size: 0.8rem; color: var(--parchment-dim); }
.footer-links a:hover { color: var(--gilt-soft); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
    .nav-links, .nav-actions .btn-ghost, .nav-actions .btn-outline { display: none; }
    .nav-burger { display: flex; }
    .mobile-menu { display: flex; }
    .news-grid { grid-template-columns: 1fr 1fr; }
    .news-card-feature { grid-column: 1 / 3; grid-row: auto; }
    .faction-columns { grid-template-columns: 1fr; text-align: center; }
    .faction-col-light, .faction-col-light ul { text-align: center; align-items: center; }
    .faction-col-emblem { margin: 0 auto; }
    .faction-col-emblem-wrap { margin: 0 auto; }
    .features-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .hero-actions { gap: 14px; }
    .hero-logo { width: 100%; }
    .news-grid { grid-template-columns: 1fr; }
    .news-card-feature { grid-column: 1; }
    .features-grid { grid-template-columns: 1fr; }
    .nav-actions .btn-gilt span { display: none; }
    .nav-actions .btn-gilt::after { content: "Sign up"; }
}

/* =========================================================
   Auth — logged-in account chip + login/register modal
   ========================================================= */
[hidden] { display: none !important; }

.nav-account {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.nav-account[hidden] { display: none; }

.nav-account-name {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: var(--gilt-soft);
    white-space: nowrap;
}

.nav-account-points {
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    color: var(--parchment-dim);
    white-space: nowrap;
}

/* Logout — filled gilt so it stays visible over the hero's light + dark halves */
#logoutBtn {
    background: var(--gilt);
    border-color: var(--gilt);
    color: var(--ink-deep);
}
#logoutBtn:hover {
    background: var(--gilt-soft);
    border-color: var(--gilt-soft);
    color: var(--ink-deep);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(5, 5, 5, 0.72);
    backdrop-filter: blur(8px);
}
.modal-backdrop[hidden] { display: none; }

.modal {
    position: relative;
    width: min(420px, 100%);
    background: var(--panel);
    border: 1px solid rgba(201, 160, 92, 0.28);
    border-radius: 14px;
    padding: 34px 30px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: var(--parchment-dim);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.modal-close:hover { color: var(--gilt-soft); }

.modal-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    margin: 0 0 22px;
    color: var(--parchment);
}

.modal .field { margin-bottom: 14px; }
.modal .field[hidden] { display: none; }

.modal .field label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--parchment-faint);
    margin-bottom: 6px;
}

.modal .field input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--parchment);
    font-family: var(--font-body);
    font-size: 0.92rem;
}
.modal .field input:focus {
    outline: none;
    border-color: var(--gilt);
}

.modal-error {
    font-size: 0.82rem;
    color: #e6a5a5;
    margin: 2px 0 14px;
    line-height: 1.5;
}
.modal-error[hidden] { display: none; }

.modal-submit {
    width: 100%;
    justify-content: center;
    margin-top: 6px;
}

.modal-switch {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--parchment-dim);
}
.modal-switch a { color: var(--gilt-soft); }
.modal-switch a:hover { text-decoration: underline; }

body.modal-open { overflow: hidden; }

/* =========================================================
   Leaderboard — top killers
   ========================================================= */
.leaderboard-head,
.leaderboard-row {
    display: grid;
    grid-template-columns: 64px 1fr 80px 110px 130px;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
}

.leaderboard-head {
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--parchment-faint);
    border-bottom: 1px solid var(--hairline);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
}

.leaderboard-row {
    background: var(--panel);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.leaderboard-row:hover { border-color: rgba(201, 160, 92, 0.35); transform: translateY(-2px); }

.lb-rank { font-family: var(--font-display); color: var(--parchment-dim); font-variant-numeric: tabular-nums; }
.lb-rank-top { color: var(--gilt-soft); }
.lb-name { font-family: var(--font-display); color: var(--parchment); letter-spacing: 0.02em; }
.lb-level { color: var(--parchment-dim); font-variant-numeric: tabular-nums; }
.lb-kills { color: var(--gilt-soft); font-weight: 600; font-variant-numeric: tabular-nums; }

.lb-status { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; }
.lb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.lb-status.is-online { color: #9fdc9f; }
.lb-status.is-online .lb-dot { background: #5fc75f; box-shadow: 0 0 8px rgba(95, 199, 95, 0.6); }
.lb-status.is-offline { color: var(--parchment-faint); }
.lb-status.is-offline .lb-dot { background: #4a4a4a; }

@media (max-width: 640px) {
    .leaderboard-head { display: none; }
    .leaderboard-row { grid-template-columns: 36px 1fr auto auto; }
    .lb-level { display: none; }
    .lb-status-text { display: none; }
}