*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #08090c;
    --bg-soft: #10131a;
    --panel: #151923;
    --panel-2: #1c2230;
    --line: #2a3142;
    --line-strong: #3a465d;
    --text: #f0f3f6;
    --muted: #9aa4b5;
    --dim: #687386;
    --cyan: #35bff0;
    --cyan-soft: rgba(53, 191, 240, 0.15);
    --green: #35d07f;
    --gold: #d7aa4a;
    --red: #ef5a5a;
    --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        linear-gradient(rgba(8, 9, 12, 0.64), rgba(8, 9, 12, 0.92)),
        url("/assets/screenshots/20260512014133_1.jpg") center / cover fixed,
        var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
}

a { color: inherit; }

button, input, select {
    font: inherit;
}

.nr-shell {
    min-height: 100vh;
    padding: 0 1.4rem 4rem;
    animation: fadeSlideIn 0.35s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nr-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 1rem 0.7rem;
    background: linear-gradient(rgba(8, 9, 12, 0.92), rgba(8, 9, 12, 0.56));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nr-tab {
    display: inline-grid;
    min-width: 0;
    min-height: 48px;
    padding: 0.5rem 0.7rem;
    place-items: center;
    gap: 0.24rem;
    color: rgba(240, 243, 246, 0.6);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nr-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.nr-tab.active {
    color: #ffffff;
    background: rgba(126, 200, 227, 0.1);
}

.nr-tab.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(126, 200, 227, 0.4);
}

.nr-tab i {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    margin-bottom: 0.1rem;
}

.nr-tab:hover i {
    color: #ffffff;
    transform: scale(1.2);
}

.nr-tab.active i {
    color: var(--accent);
    transform: scale(1.3);
}

.nr-tab span {
    transition: color 0.3s ease;
}

.nr-tab.active span {
    color: var(--accent);
}

.nr-page {
    width: min(1160px, 100%);
    margin: 0 auto;
    padding-top: 4.5rem;
}

.nr-title {
    text-align: center;
    margin-bottom: 2rem;
}

.nr-title .eyebrow {
    color: var(--cyan);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.nr-title h1 {
    margin: 0.3rem 0 0.55rem;
    font-size: 2.55rem;
    line-height: 1.08;
}

.nr-title p {
    max-width: 720px;
    margin: 0 auto;
    color: var(--muted);
}

.nr-band {
    padding: 1.2rem;
    background: rgba(21, 25, 35, 0.88);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.nr-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.3rem;
}

.nr-pill,
.nr-select,
.nr-input {
    min-height: 42px;
    color: var(--text);
    background: rgba(21, 25, 35, 0.86);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.nr-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0 1rem;
    font-weight: 800;
    cursor: pointer;
}

.nr-pill.active {
    color: #061015;
    background: linear-gradient(90deg, #2ab5e8, #49d0ff);
    border-color: transparent;
}

.nr-select,
.nr-input {
    padding: 0 0.8rem;
}

.nr-input {
    width: min(300px, 100%);
}

.nr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.nr-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nr-card {
    background: rgba(18, 22, 31, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.nr-card-header {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nr-card-header h2,
.nr-card-header h3 {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.3;
}

.nr-card-body {
    padding: 1rem;
}

.nr-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.nr-stat {
    min-height: 76px;
    padding: 0.75rem;
    display: grid;
    place-items: center;
    text-align: center;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.nr-stat strong {
    display: block;
    color: #ffffff;
    font-size: 1.38rem;
    line-height: 1.1;
}

.nr-stat span {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.nr-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 1rem;
    color: #071016;
    background: linear-gradient(90deg, #2ab5e8, #49d0ff);
    border: 0;
    border-radius: 8px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.nr-button.secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
}

.nr-button.success {
    background: linear-gradient(90deg, #32c779, #74e39e);
}

.nr-button:disabled {
    color: var(--dim);
    background: rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
}

.map-preview {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #0c1117;
    border-bottom: 1px solid var(--line);
}

.map-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.vote-count {
    color: var(--cyan);
    font-weight: 900;
}

.nr-table-wrap {
    width: 100%;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(12, 14, 20, 0.78);
}

.nr-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

.nr-table th,
.nr-table td {
    padding: 0.72rem 0.85rem;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    white-space: nowrap;
}

.nr-table th {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.035);
}

.nr-table th:nth-child(2),
.nr-table td:nth-child(2) {
    text-align: left;
}

.nr-table tr:nth-child(1) td { background: rgba(215, 170, 74, 0.16); }
.nr-table tr:nth-child(2) td { background: rgba(174, 185, 198, 0.10); }
.nr-table tr:nth-child(3) td { background: rgba(177, 99, 45, 0.12); }

.leaderboard-list {
    display: grid;
    gap: 0.82rem;
}

.lb-card {
    display: grid;
    grid-template-columns: 64px minmax(180px, 1fr) minmax(320px, 1.6fr);
    gap: 0.85rem;
    align-items: center;
    padding: 0.9rem;
    background: rgba(18, 22, 31, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}

.lb-card.rank-1 { border-color: rgba(215, 170, 74, 0.38); background: linear-gradient(90deg, rgba(215, 170, 74, 0.13), rgba(18, 22, 31, 0.94) 36%); }
.lb-card.rank-2 { border-color: rgba(174, 185, 198, 0.24); }
.lb-card.rank-3 { border-color: rgba(177, 99, 45, 0.24); }

.lb-rank {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    color: var(--cyan);
    background: rgba(53, 191, 240, 0.09);
    border: 1px solid rgba(53, 191, 240, 0.18);
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 900;
}

.lb-player {
    min-width: 0;
}

.lb-player span {
    display: block;
    margin-top: 0.18rem;
    color: var(--dim);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lb-player .lb-category {
    width: fit-content;
    margin: 0 0 0.34rem;
    padding: 0.22rem 0.48rem;
    color: var(--cyan);
    background: rgba(53, 191, 240, 0.09);
    border: 1px solid rgba(53, 191, 240, 0.16);
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
}

.lb-primary,
.lb-chip-grid,
.profile-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 0.55rem;
}

.lb-chip {
    min-height: 58px;
    display: grid;
    align-content: center;
    gap: 0.12rem;
    padding: 0.58rem 0.68rem;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
}

.lb-chip span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.lb-chip strong {
    color: #fff;
    font-size: 1.02rem;
    line-height: 1.1;
}

.lb-details {
    grid-column: 1 / -1;
}

.lb-details summary {
    width: fit-content;
    margin: 0.2rem 0 0.1rem 4.2rem;
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 900;
    cursor: pointer;
}

.lb-details .lb-chip-grid {
    margin-top: 0.72rem;
    padding-top: 0.72rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.player-link {
    color: #ffffff;
    font-weight: 900;
    background: none;
    border: 0;
    cursor: pointer;
}

.player-link:hover {
    color: var(--cyan);
}

.nr-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
}

.nr-modal.show { display: flex; }

.nr-modal-panel {
    width: min(1040px, 100%);
    max-height: min(86vh, 820px);
    overflow: auto;
    background: rgba(17, 21, 30, 0.98);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.nr-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--line);
}

.nr-modal-head h2 {
    margin: 0;
}

.close-button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.profile-summary {
    padding: 1rem 1rem 0;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.85fr) repeat(3, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.hit-figure {
    min-height: 100%;
    display: grid;
    align-items: center;
    justify-items: center;
    color: var(--muted);
    background:
        radial-gradient(circle at 50% 24%, rgba(53, 191, 240, 0.26), transparent 16%),
        radial-gradient(circle at 50% 52%, rgba(215, 170, 74, 0.22), transparent 26%),
        rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
    padding: 1rem;
}

.hit-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.85rem;
    color: var(--cyan);
    background: rgba(53, 191, 240, 0.12);
    border: 1px solid rgba(53, 191, 240, 0.24);
    border-radius: 999px;
    font-size: 1.6rem;
}

.stat-list {
    display: grid;
    gap: 0.55rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    color: var(--muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-row strong {
    color: #ffffff;
}

.status-dot {
    width: 0.68rem;
    height: 0.68rem;
    border-radius: 999px;
    background: var(--dim);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
}

.status-dot.online {
    background: var(--green);
    box-shadow: 0 0 18px rgba(53, 208, 127, 0.45);
}

.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 1rem; }
.hide { display: none !important; }

@media (max-width: 920px) {
    .nr-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .nr-grid,
    .nr-grid.two,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .nr-page {
        padding-top: 2.6rem;
    }

    .lb-card {
        grid-template-columns: 54px 1fr;
    }

    .lb-primary {
        grid-column: 1 / -1;
    }

    .lb-details summary {
        margin-left: 0;
    }
}

@media (max-width: 640px) {
    .nr-shell {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .nr-tab {
        min-width: 0;
        font-size: 0.68rem;
    }

    .nr-title h1 {
        font-size: 2rem;
    }

    .nr-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Leaderboard grouped details ── */
.lb-group {
    margin-bottom: 0.8rem;
}
.lb-group:last-child {
    margin-bottom: 0;
}
.lb-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ── Auth widget ── */
.nr-auth-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.78rem;
    text-decoration: none;
    transition: border-color 0.15s;
}
.nr-auth-btn:hover {
    border-color: var(--accent);
}
.nr-auth-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
}

/* ── MapVote ── */
.map-preview {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: var(--surface2);
}
.vote-bar-bg {
    height: 6px;
    background: var(--surface2);
    border-radius: 3px;
    margin: 0.5rem 0;
    overflow: hidden;
}
.vote-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    transition: width 0.5s ease;
}
.winner-card {
    border-color: var(--gold) !important;
    background: rgba(212, 168, 75, 0.05);
}
.winner-badge {
    position: absolute;
    top: -8px;
    right: 12px;
    background: var(--gold);
    color: var(--bg);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
}
