:root {
    color-scheme: dark;
    --bg: #08090d;
    --bg-elevated: #0e1016;
    --panel: rgba(18, 20, 28, 0.82);
    --panel-solid: #12141c;
    --panel-2: #1a1d28;
    --panel-hover: rgba(255, 255, 255, 0.035);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.12);
    --text: #f4f5f8;
    --muted: #9aa0b0;
    --soft: #6b7285;
    --accent: #f5c84c;
    --accent-soft: rgba(245, 200, 76, 0.14);
    --accent-glow: rgba(245, 200, 76, 0.28);
    --cyan: #4fd4e8;
    --cyan-soft: rgba(79, 212, 232, 0.12);
    --green: #5fd48a;
    --green-soft: rgba(95, 212, 138, 0.12);
    --red: #f07578;
    --red-soft: rgba(240, 117, 120, 0.12);
    --gold: #f5c84c;
    --silver: #c8cdd8;
    --bronze: #d4945a;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 0 1px rgba(245, 200, 76, 0.12), 0 8px 32px rgba(245, 200, 76, 0.08);
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --header-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(79, 212, 232, 0.1), transparent 50%),
        radial-gradient(ellipse 60% 40% at 90% 0%, rgba(245, 200, 76, 0.08), transparent 45%),
        radial-gradient(ellipse 50% 30% at 50% 100%, rgba(95, 212, 138, 0.05), transparent 50%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-feature-settings: "ss01" on, "cv11" on;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, black, transparent);
    opacity: 0.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Header ── */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 9, 13, 0.72);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}

.top-nav {
    width: min(1280px, calc(100vw - 40px));
    height: var(--header-h);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: opacity 180ms var(--ease);
}

.brand:hover {
    opacity: 0.9;
}

.brand-icon-wrap {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(245, 200, 76, 0.2), rgba(79, 212, 232, 0.1));
    box-shadow: 0 0 0 1px rgba(245, 200, 76, 0.25), var(--shadow-sm);
}

.brand-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    border-radius: 8px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.15;
}

.brand-name {
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.brand-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--soft);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-link {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    transition: color 180ms var(--ease), background 180ms var(--ease);
}

.nav-link:hover {
    color: var(--text);
    background: var(--panel-hover);
}

.nav-link.is-active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px var(--line);
}

/* ── Language switch ── */

.language-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-solid);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.language-switch::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 38px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #e8b030);
    box-shadow: 0 2px 12px var(--accent-glow);
    transform: translateX(0);
    transition: transform 220ms var(--ease), box-shadow 220ms var(--ease);
}

.language-switch.is-ja::before {
    transform: translateX(40px);
}

.language-option {
    appearance: none;
    position: relative;
    z-index: 1;
    border: 0;
    padding: 0;
    min-width: 38px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    transition: color 180ms var(--ease), transform 180ms var(--ease);
}

.language-option:hover {
    color: var(--text);
}

.language-option.is-active {
    color: #12141a;
    transform: translateY(-0.5px);
}

/* ── Page ── */

.page {
    position: relative;
    z-index: 1;
    width: min(1280px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 36px 0 48px;
    flex: 1;
}

.ranking-shell {
    display: grid;
    gap: 22px;
}

/* ── Mode tabs ── */

.mode-tabs {
    position: relative;
    --mode-tab-x: 0px;
    --mode-tab-width: 108px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding: 4px;
    margin: -4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.mode-tabs::-webkit-scrollbar {
    height: 4px;
}

.mode-tabs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.mode-tabs::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: var(--mode-tab-width);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(245, 200, 76, 0.18), rgba(245, 200, 76, 0.06));
    box-shadow:
        0 0 0 1px rgba(245, 200, 76, 0.45),
        0 8px 28px rgba(245, 200, 76, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateX(var(--mode-tab-x));
    transition: transform 260ms var(--ease), width 260ms var(--ease);
    pointer-events: none;
}

.mode-tab {
    position: relative;
    z-index: 1;
    min-width: 108px;
    height: 78px;
    display: grid;
    place-items: center;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(18, 20, 28, 0.55);
    color: var(--muted);
    text-transform: capitalize;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition:
        color 180ms var(--ease),
        border-color 180ms var(--ease),
        background 180ms var(--ease),
        transform 180ms var(--ease),
        box-shadow 180ms var(--ease);
    flex-shrink: 0;
}

.mode-tab > [data-mode-label] {
    line-height: 1.1;
}

.mode-tab:hover {
    color: var(--text);
    border-color: rgba(245, 200, 76, 0.28);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.mode-tab.is-active {
    color: var(--text);
    border-color: transparent;
    background: transparent;
    transform: translateY(-1px);
}

.mode-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--accent);
}

.mode-icon {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
    transition: transform 200ms var(--ease), filter 200ms var(--ease);
}

.mode-tab:hover .mode-icon,
.mode-tab.is-active .mode-icon {
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4));
    transform: translateY(-1px) scale(1.06);
}

.mode-overall-icon {
    position: relative;
    width: 26px;
    height: 26px;
    display: block;
}

.mode-overall-icon::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 9px;
    height: 9px;
    border-radius: 3px;
    background: var(--accent);
    box-shadow: 13px 0 0 var(--cyan), 0 13px 0 var(--green), 13px 13px 0 var(--red);
}

/* ── Toolbar ── */

.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0 4px;
}

.toolbar-title {
    min-width: 0;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    text-transform: capitalize;
    letter-spacing: -0.03em;
}

h1 {
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.05;
    font-weight: 900;
    background: linear-gradient(180deg, #fff 30%, rgba(244, 245, 248, 0.72));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 22px;
    font-weight: 800;
}

.toolbar-sub {
    margin: 10px 0 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--soft);
    font-size: 13px;
    font-weight: 600;
}

.player-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(245, 200, 76, 0.22);
}

.search-box {
    width: min(340px, 100%);
    display: grid;
    gap: 8px;
}

.search-label {
    color: var(--soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.search-field {
    position: relative;
    display: block;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--soft);
    pointer-events: none;
    transition: color 180ms var(--ease);
}

.search-box input {
    height: 48px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(18, 20, 28, 0.75);
    color: var(--text);
    padding: 0 16px 0 44px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.search-box input::placeholder {
    color: var(--soft);
}

.search-box input:hover {
    border-color: var(--line-strong);
    background: rgba(22, 24, 34, 0.9);
}

.search-box input:focus {
    border-color: rgba(79, 212, 232, 0.55);
    background: rgba(18, 20, 28, 0.95);
    box-shadow: 0 0 0 3px rgba(79, 212, 232, 0.12), var(--shadow-sm);
}

.search-box:focus-within .search-icon {
    color: var(--cyan);
}

/* ── Content grid ── */

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.content-grid.is-tier-mode {
    grid-template-columns: minmax(0, 1fr);
}

.content-grid.is-tier-mode .recent-panel {
    position: static;
}

.content-grid.is-tier-mode .recent-list {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    max-height: none;
    overflow-y: visible;
}

.ranking-board,
.recent-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
}

.ranking-board {
    overflow: hidden;
    position: relative;
}

.ranking-board::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 200, 76, 0.35), transparent);
    pointer-events: none;
}

.rank-heading,
.player-row {
    display: grid;
    grid-template-columns: 56px minmax(200px, 1fr) 100px minmax(200px, 1.35fr) 88px;
    gap: 12px;
    align-items: center;
}

.rank-heading {
    min-height: 46px;
    padding: 0 20px;
    color: var(--soft);
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.18);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ranking-list {
    display: grid;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.ranking-list.is-changing,
.recent-list.is-changing {
    opacity: 0;
    transform: translateY(8px);
}

/* ── Player rows ── */

.player-row {
    min-height: 84px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
    transition: background 160ms var(--ease);
}

.player-row:last-child {
    border-bottom: 0;
}

.player-row:hover {
    background: var(--panel-hover);
}

.player-row.rank-top {
    position: relative;
}

.player-row.rank-1 {
    background: linear-gradient(90deg, rgba(245, 200, 76, 0.08), transparent 55%);
}

.player-row.rank-2 {
    background: linear-gradient(90deg, rgba(200, 205, 216, 0.06), transparent 55%);
}

.player-row.rank-3 {
    background: linear-gradient(90deg, rgba(212, 148, 90, 0.07), transparent 55%);
}

.player-row.rank-1:hover {
    background: linear-gradient(90deg, rgba(245, 200, 76, 0.12), rgba(255, 255, 255, 0.02) 55%);
}

.player-row.rank-2:hover {
    background: linear-gradient(90deg, rgba(200, 205, 216, 0.1), rgba(255, 255, 255, 0.02) 55%);
}

.player-row.rank-3:hover {
    background: linear-gradient(90deg, rgba(212, 148, 90, 0.11), rgba(255, 255, 255, 0.02) 55%);
}

.rank-number {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.rank-medal {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.rank-medal.gold {
    color: #1a1508;
    background: linear-gradient(145deg, #ffe08a, var(--gold) 45%, #c99620);
    box-shadow: 0 0 0 1px rgba(245, 200, 76, 0.5), 0 4px 16px rgba(245, 200, 76, 0.25);
}

.rank-medal.silver {
    color: #1a1c22;
    background: linear-gradient(145deg, #f0f2f6, var(--silver) 45%, #9aa3b2);
    box-shadow: 0 0 0 1px rgba(200, 205, 216, 0.45), 0 4px 14px rgba(160, 170, 190, 0.2);
}

.rank-medal.bronze {
    color: #1a120c;
    background: linear-gradient(145deg, #f0c090, var(--bronze) 45%, #a66a35);
    box-shadow: 0 0 0 1px rgba(212, 148, 90, 0.45), 0 4px 14px rgba(212, 148, 90, 0.22);
}

.player-cell {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.avatar-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 58px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
    box-shadow: var(--shadow-sm);
}

.avatar-wrap.compact {
    width: 34px;
    height: 48px;
    border-radius: 11px;
}

.avatar-wrap img,
.player-avatar {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 10px;
    image-rendering: pixelated;
    object-fit: contain;
    background: var(--panel-2);
}

.player-meta,
.recent-meta {
    min-width: 0;
}

.player-cell strong,
.recent-item strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.player-updated,
.player-cell span,
.recent-item span,
.recent-empty {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.player-updated {
    display: block;
    margin-top: 3px;
    color: var(--soft);
    font-size: 11px;
}

.region-pill {
    width: fit-content;
    min-width: 44px;
    border: 1px solid rgba(79, 212, 232, 0.28);
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--cyan);
    background: var(--cyan-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.tier-stack {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(7, 8, 12, 0.42);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.tier-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border-radius: 8px;
    padding: 4px 9px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 140ms var(--ease), border-color 140ms var(--ease);
}

.player-row:hover .tier-chip {
    transform: translateY(-1px);
}

.tier-chip span {
    color: var(--soft);
    text-transform: capitalize;
    font-weight: 700;
}

.tier-mode-icon {
    display: block;
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.4));
}

.overall-tier-chip {
    flex: 0 0 38px;
    min-width: 38px;
    min-height: 48px;
    display: inline-grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 4px;
    border-radius: 10px;
}

.tier-chip .tier-code {
    color: inherit;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

/* Gamemode pages are grouped by Tier; HT always occupies the upper slot. */
.tier-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    overflow-x: auto;
    padding: 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

.tier-group {
    overflow: hidden;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.16);
    scroll-snap-align: start;
}

.tier-group-title {
    margin: 0;
    padding: 11px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: center;
}

.tier-slots {
    display: grid;
}

.tier-slot {
    min-height: 108px;
    padding: 9px;
}

.tier-slot + .tier-slot {
    border-top: 1px solid var(--line);
}

.tier-slot-high { background: linear-gradient(135deg, rgba(245, 200, 76, 0.09), transparent); }
.tier-slot-low { background: linear-gradient(135deg, rgba(79, 212, 232, 0.07), transparent); }

.tier-slot-label {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-bottom: 7px;
    padding: 2px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.tier-slot-high .tier-slot-label {
    border-color: rgba(245, 200, 76, 0.3);
    color: var(--accent);
    background: rgba(245, 200, 76, 0.08);
}

.tier-slot-low .tier-slot-label {
    border-color: rgba(79, 212, 232, 0.28);
    color: var(--cyan);
    background: rgba(79, 212, 232, 0.07);
}

.tier-player-list { display: grid; gap: 6px; }

.tier-slot-empty {
    min-height: 52px;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    font-family: var(--mono);
    font-size: 13px;
}

.tier-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 9px;
    background: rgba(10, 11, 16, 0.48);
}

.tier-player.is-retired { opacity: 0.58; }

.skin-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 46px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--panel-2);
}

.player-skin {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    image-rendering: pixelated;
}

.tier-player-meta { min-width: 0; }
.tier-player-meta strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.tier-player-meta span { color: var(--soft); font-size: 10px; font-weight: 700; text-transform: uppercase; }

.tier-ht1,
.tier-lt1 {
    border-color: rgba(245, 200, 76, 0.55);
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 16px rgba(245, 200, 76, 0.08);
}

.tier-ht2,
.tier-lt2 {
    border-color: rgba(95, 212, 138, 0.45);
    color: var(--green);
    background: var(--green-soft);
}

.tier-ht3,
.tier-lt3 {
    border-color: rgba(79, 212, 232, 0.45);
    color: var(--cyan);
    background: var(--cyan-soft);
}

.tier-ht4,
.tier-lt4 {
    border-color: rgba(167, 167, 176, 0.35);
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.tier-ht5,
.tier-lt5 {
    border-color: rgba(240, 117, 120, 0.42);
    color: var(--red);
    background: var(--red-soft);
}

.points {
    font-family: var(--mono);
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
    text-shadow: 0 0 24px rgba(245, 200, 76, 0.2);
}

/* ── Empty states ── */

.empty-state {
    min-height: 240px;
    display: grid;
    place-items: center;
    gap: 14px;
    padding: 32px;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.empty-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
    font-size: 22px;
    color: var(--soft);
}

.empty-state img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    image-rendering: pixelated;
    box-shadow: var(--shadow-sm);
    opacity: 0.85;
}

/* ── Recent panel ── */

.recent-panel {
    padding: 20px;
    position: sticky;
    top: calc(var(--header-h) + 16px);
}

.panel-title {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.recent-list {
    display: grid;
    gap: 8px;
    transition: opacity 180ms var(--ease), transform 180ms var(--ease);
    max-height: calc(100vh - var(--header-h) - 180px);
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.recent-item {
    min-height: 68px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
    transition: background 160ms var(--ease), border-color 160ms var(--ease), transform 160ms var(--ease);
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.recent-meta {
    display: grid;
    gap: 3px;
}

.recent-meta > span {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.tier-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
}

.tier-from {
    color: var(--soft);
}

.tier-arrow {
    color: var(--muted);
    font-size: 12px;
}

.tier-to {
    color: var(--green);
}

.recent-empty {
    padding: 28px 8px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.015);
}

/* ── Footer ── */

.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--line);
    background: rgba(8, 9, 13, 0.5);
    margin-top: auto;
}

.footer-inner {
    width: min(1280px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 22px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--soft);
    font-size: 12px;
    font-weight: 600;
}

.footer-brand {
    color: var(--muted);
    font-weight: 800;
}

.footer-sep {
    opacity: 0.5;
}

/* ── Responsive ── */

@media (max-width: 980px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .recent-panel {
        position: static;
    }

    .recent-list {
        max-height: none;
    }

    .rank-heading {
        display: none;
    }

    .player-row {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px 12px;
        padding: 16px;
    }

    .player-row .region-pill,
    .player-row .tier-stack,
    .player-row .points {
        grid-column: 2;
    }

    .player-row .points {
        justify-self: start;
    }

    .tier-board {
        grid-template-columns: repeat(5, minmax(165px, 1fr));
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .search-box {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .top-nav,
    .page,
    .footer-inner {
        width: min(100vw - 24px, 1280px);
    }

    .top-nav {
        gap: 12px;
        height: 64px;
    }

    :root {
        --header-h: 64px;
    }

    .brand-tag {
        display: none;
    }

    .nav-actions {
        gap: 8px;
    }

    .nav-link {
        padding: 7px 10px;
        font-size: 12px;
    }

    .mode-tab {
        min-width: 92px;
        height: 70px;
        font-size: 11px;
        padding: 8px 10px;
    }

    .mode-mark {
        width: 32px;
        height: 32px;
    }

    .mode-icon {
        width: 30px;
        height: 30px;
    }

    h1 {
        font-size: 32px;
    }

    .page {
        padding: 24px 0 40px;
    }

    .ranking-board,
    .recent-panel {
        border-radius: var(--radius-md);
    }

    .player-row {
        min-height: 0;
    }

    .avatar-wrap {
        width: 42px;
        height: 58px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Competitive arena presentation ── */

.ranking-shell {
    --mode-accent: #f5c84c;
    --mode-rgb: 245, 200, 76;
}

.ranking-shell[data-active-mode="vanilla"] { --mode-accent: #b88cff; --mode-rgb: 184, 140, 255; }
.ranking-shell[data-active-mode="mace"] { --mode-accent: #9ba7c8; --mode-rgb: 155, 167, 200; }
.ranking-shell[data-active-mode="pot"] { --mode-accent: #ff7ab8; --mode-rgb: 255, 122, 184; }
.ranking-shell[data-active-mode="nethpot"] { --mode-accent: #a879ff; --mode-rgb: 168, 121, 255; }
.ranking-shell[data-active-mode="axe"] { --mode-accent: #58d3ed; --mode-rgb: 88, 211, 237; }
.ranking-shell[data-active-mode="uhc"] { --mode-accent: #f07578; --mode-rgb: 240, 117, 120; }
.ranking-shell[data-active-mode="smp"] { --mode-accent: #42d8b4; --mode-rgb: 66, 216, 180; }
.ranking-shell[data-active-mode="sword"] { --mode-accent: #6ea8ff; --mode-rgb: 110, 168, 255; }

.ranking-shell .mode-tabs::before {
    background: linear-gradient(160deg, rgba(var(--mode-rgb), 0.2), rgba(var(--mode-rgb), 0.055));
    box-shadow:
        0 0 0 1px rgba(var(--mode-rgb), 0.52),
        0 10px 30px rgba(var(--mode-rgb), 0.13),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ranking-shell .mode-tab:hover {
    border-color: rgba(var(--mode-rgb), 0.34);
}

.ranking-shell .eyebrow {
    color: var(--mode-accent);
}

.mode-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 144px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 24px 26px;
    border: 1px solid rgba(var(--mode-rgb), 0.24);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(circle at 9% 12%, rgba(var(--mode-rgb), 0.17), transparent 34%),
        linear-gradient(145deg, rgba(22, 24, 33, 0.96), rgba(12, 14, 20, 0.92));
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.mode-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--mode-rgb), 0.7), transparent);
}

.mode-hero-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.mode-hero-icon-wrap {
    flex: 0 0 82px;
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(var(--mode-rgb), 0.34);
    border-radius: 24px;
    background: radial-gradient(circle, rgba(var(--mode-rgb), 0.18), rgba(5, 6, 10, 0.48));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 30px rgba(var(--mode-rgb), 0.1);
}

.mode-hero-icon {
    width: 62px;
    height: 62px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.42));
}

.mode-hero-copy {
    min-width: 0;
}

.mode-hero-copy h1 {
    font-size: clamp(38px, 5vw, 58px);
}

.mode-hero-meta {
    margin: 10px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.ranking-shell .player-count {
    background: rgba(var(--mode-rgb), 0.13);
    color: var(--mode-accent);
    box-shadow: inset 0 0 0 1px rgba(var(--mode-rgb), 0.27);
}

.mode-hero .search-box {
    flex: 0 1 340px;
}

.ranking-shell .ranking-board::before {
    background: linear-gradient(90deg, transparent, rgba(var(--mode-rgb), 0.56), transparent);
}

.ranking-list.is-overall {
    display: block;
}

.overall-stage {
    display: grid;
}

.podium-section {
    padding: 22px 22px 28px;
    border-bottom: 1px solid var(--line);
    background: radial-gradient(ellipse 54% 44% at 50% 100%, rgba(var(--mode-rgb), 0.08), transparent 72%);
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title .eyebrow {
    display: none;
}

.section-title h2 {
    font-size: 20px;
    letter-spacing: -0.015em;
}

.podium {
    min-height: 318px;
    margin: 0;
    padding: 4px 0 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas: "second first third";
    align-items: end;
    gap: 14px;
}

.podium-position-1 { grid-area: first; }
.podium-position-2 { grid-area: second; }
.podium-position-3 { grid-area: third; }

.podium-card,
.leaderboard-row,
.tier-player,
.recent-item {
    appearance: none;
    border: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.podium-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 274px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 16px 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.055), transparent 38%),
        linear-gradient(165deg, rgba(27, 30, 40, 0.97), rgba(12, 14, 20, 0.97));
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.29), inset 0 1px 0 rgba(255, 255, 255, 0.045);
    transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.podium-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    opacity: 0.8;
    background: var(--silver);
}

.podium-card.rank-1 {
    min-height: 312px;
    border-color: rgba(245, 200, 76, 0.3);
    background:
        radial-gradient(circle at 50% 30%, rgba(245, 200, 76, 0.13), transparent 40%),
        linear-gradient(165deg, rgba(32, 30, 24, 0.98), rgba(13, 14, 18, 0.98));
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.36), 0 0 34px rgba(245, 200, 76, 0.085);
}

.podium-card.rank-1::before { background: var(--gold); }
.podium-card.rank-3::before { background: var(--bronze); }

.podium-card:hover,
.podium-card:focus-visible {
    z-index: 2;
    outline: none;
    transform: translateY(-4px);
    border-color: rgba(var(--mode-rgb), 0.48);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 30px rgba(var(--mode-rgb), 0.1);
}

.podium-rank {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
}

.podium-skin-wrap {
    width: 100%;
    height: 142px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-top: 8px;
}

.podium-card.rank-1 .podium-skin-wrap {
    height: 174px;
}

.podium-skin {
    width: auto;
    height: 100%;
    max-width: 100%;
    display: block;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.55));
    transition: transform 180ms var(--ease);
}

.podium-card:hover .podium-skin {
    transform: translateY(-3px) scale(1.025);
}

.podium-player {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.podium-player strong {
    overflow-wrap: anywhere;
    font-size: 15px;
    font-weight: 800;
}

.podium-score {
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.podium-score strong {
    color: var(--text);
    font-family: var(--mono);
    font-size: 15px;
}

.podium-card > .tier-stack {
    justify-content: center;
    max-width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
}

.rank-movement {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 22px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--soft);
    background: rgba(255, 255, 255, 0.035);
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 800;
}

.rank-movement.is-up {
    border-color: rgba(95, 212, 138, 0.34);
    color: var(--green);
    background: var(--green-soft);
}

.rank-movement.is-down {
    border-color: rgba(240, 117, 120, 0.34);
    color: var(--red);
    background: var(--red-soft);
}

.rank-movement.is-flat {
    color: var(--soft);
}

.rank-movement-placeholder {
    color: var(--soft);
    font-family: var(--mono);
    font-size: 11px;
}

.leaderboard-section {
    padding: 20px 0 0;
}

.leaderboard-section .section-title {
    padding: 0 20px;
}

.leaderboard-title {
    margin-bottom: 14px;
}

.leaderboard-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.leaderboard-item {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-row {
    width: 100%;
    min-height: 82px;
    display: grid;
    grid-template-columns: 56px minmax(185px, 1fr) 82px minmax(190px, 1.25fr) 112px;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: transparent;
    transition: background 160ms var(--ease), box-shadow 160ms var(--ease);
}

.leaderboard-row:hover,
.leaderboard-row:focus-visible {
    outline: none;
    background: linear-gradient(90deg, rgba(var(--mode-rgb), 0.075), rgba(255, 255, 255, 0.018));
    box-shadow: inset 3px 0 0 rgba(var(--mode-rgb), 0.5);
}

.leaderboard-score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.ranking-list.is-overall .rank-heading {
    grid-template-columns: 56px minmax(185px, 1fr) 82px minmax(190px, 1.25fr) 112px;
}

.ranking-list.is-overall .tier-stack {
    min-width: 0;
}

.tier-board {
    overflow-x: auto;
}

.tier-group {
    --tier-rgb: 200, 205, 216;
    position: relative;
    border-color: rgba(var(--tier-rgb), 0.24);
    background: linear-gradient(180deg, rgba(var(--tier-rgb), 0.04), rgba(8, 9, 13, 0.42));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.tier-group[data-tier-number="1"] { --tier-rgb: 245, 200, 76; }
.tier-group[data-tier-number="2"] { --tier-rgb: 95, 212, 138; }
.tier-group[data-tier-number="3"] { --tier-rgb: 79, 164, 232; }
.tier-group[data-tier-number="4"] { --tier-rgb: 200, 205, 216; }
.tier-group[data-tier-number="5"] { --tier-rgb: 240, 117, 120; }

.tier-group-title {
    padding: 0;
    background: linear-gradient(135deg, rgba(var(--tier-rgb), 0.12), rgba(0, 0, 0, 0.08));
}

.tier-group-toggle {
    appearance: none;
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border: 0;
    color: var(--text);
    background: transparent;
    font: inherit;
    cursor: default;
}

.tier-group-count {
    min-width: 26px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 0 6px;
    border: 1px solid rgba(var(--tier-rgb), 0.3);
    border-radius: 999px;
    color: rgb(var(--tier-rgb));
    background: rgba(var(--tier-rgb), 0.09);
    font-size: 10px;
}

.tier-slot-high {
    background: linear-gradient(145deg, rgba(var(--tier-rgb), 0.13), rgba(var(--tier-rgb), 0.025) 65%, transparent);
}

.tier-slot-low {
    background: linear-gradient(145deg, rgba(var(--tier-rgb), 0.055), rgba(0, 0, 0, 0.055) 70%, transparent);
}

.tier-slot-high .tier-slot-label,
.tier-slot-low .tier-slot-label {
    border-color: rgba(var(--tier-rgb), 0.31);
    color: rgb(var(--tier-rgb));
    background: rgba(var(--tier-rgb), 0.085);
}

.tier-player {
    position: relative;
    width: 100%;
    min-height: 60px;
    display: block;
    margin-top: 7px;
    padding: 9px 8px 8px 48px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 11px;
    background: rgba(8, 9, 13, 0.64);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease);
}

.tier-player:hover,
.tier-player:focus-visible {
    outline: none;
    transform: translateY(-2px);
    border-color: rgba(var(--tier-rgb), 0.38);
    background: rgba(var(--tier-rgb), 0.075);
}

.tier-player .skin-wrap {
    position: absolute;
    left: 8px;
    bottom: 6px;
    width: 34px;
    height: 58px;
    overflow: visible;
    background: transparent;
    filter: drop-shadow(0 7px 6px rgba(0, 0, 0, 0.5));
}

.tier-player-meta {
    display: block;
    text-align: left;
}

.tier-player-meta strong {
    line-height: 1.25;
}

.tier-slot-empty {
    border-color: rgba(var(--tier-rgb), 0.1);
    background: rgba(var(--tier-rgb), 0.018);
}

.recent-card {
    min-width: 0;
}

.recent-item {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: inherit;
}

.recent-item:hover,
.recent-item:focus-visible {
    outline: none;
    border-color: rgba(var(--mode-rgb), 0.28);
    background: rgba(var(--mode-rgb), 0.055);
    box-shadow: 0 0 0 2px rgba(var(--mode-rgb), 0.12);
}

.recent-mode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.recent-mode-icon {
    width: 17px;
    height: 17px;
    display: block;
    object-fit: contain;
}

.recent-time {
    display: block;
    margin-top: 4px;
    color: var(--soft);
    font-size: 9px;
    line-height: 1.3;
}

.content-grid.is-tier-mode .recent-list {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(270px, 320px);
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 2px 8px;
}

.content-grid.is-tier-mode .recent-card {
    scroll-snap-align: start;
}

.player-drawer-layer {
    position: fixed;
    z-index: 80;
    inset: 0;
}

.player-drawer-backdrop {
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(3, 4, 7, 0.72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    cursor: default;
    opacity: 0;
    transition: opacity 200ms var(--ease);
}

.player-drawer {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(440px, 100vw);
    overflow-y: auto;
    padding: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(165deg, rgba(22, 24, 33, 0.99), rgba(9, 10, 15, 0.99));
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.48);
    transform: translateX(100%);
    transition: transform 220ms var(--ease);
}

.player-drawer-layer.is-open .player-drawer-backdrop {
    opacity: 1;
}

.player-drawer-layer.is-open .player-drawer {
    transform: translateX(0);
}

.player-drawer:focus {
    outline: none;
}

.player-drawer-header {
    position: sticky;
    z-index: 2;
    top: -22px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: -22px -22px 0;
    padding: 22px;
    border-bottom: 1px solid var(--line);
    background: rgba(16, 18, 25, 0.94);
    backdrop-filter: blur(16px);
}

.player-drawer-header h2 {
    overflow-wrap: anywhere;
}

.player-drawer-close {
    appearance: none;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    cursor: pointer;
    font: inherit;
    font-size: 24px;
    transition: color 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease);
}

.player-drawer-close:hover,
.player-drawer-close:focus-visible {
    outline: none;
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.075);
}

.player-drawer-hero {
    min-height: 250px;
    display: grid;
    grid-template-columns: 144px minmax(0, 1fr);
    align-items: end;
    gap: 20px;
    margin: 0 -6px;
    padding: 24px 8px 20px;
    border-bottom: 1px solid var(--line);
}

.player-drawer-skin-wrap {
    height: 216px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.player-drawer-skin {
    width: auto;
    height: 100%;
    max-width: 100%;
    display: block;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 18px 15px rgba(0, 0, 0, 0.58));
}

.player-drawer-identity {
    min-width: 0;
    padding-bottom: 8px;
}

.player-drawer-stats {
    margin: 18px 0 0;
    display: grid;
    gap: 10px;
}

.player-drawer-stats > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.player-drawer-stats dt {
    color: var(--soft);
    font-size: 11px;
    font-weight: 700;
}

.player-drawer-stats dd {
    margin: 0;
    color: var(--text);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.player-drawer-section {
    padding: 22px 0 0;
}

.player-drawer-section h3 {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.player-drawer-modes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.drawer-mode-card,
.player-mode-card,
.player-drawer-mode {
    min-height: 70px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.027);
}

.drawer-mode-card img,
.player-mode-card img,
.player-drawer-mode img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.drawer-mode-card strong,
.player-mode-card strong,
.player-drawer-mode strong {
    display: block;
    font-size: 11px;
}

.drawer-mode-card span,
.player-mode-card span,
.player-drawer-mode span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10px;
}

.player-drawer-mode-name {
    min-width: 0;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.player-drawer-tier {
    grid-column: 2;
    color: var(--text) !important;
    font-weight: 800;
}

.player-drawer-tier.is-unranked {
    color: var(--soft) !important;
}

.player-drawer-mode.tier-ht1,
.player-drawer-mode.tier-lt1 {
    border-color: rgba(245, 200, 76, 0.34);
    background: rgba(245, 200, 76, 0.07);
}

.player-drawer-mode.tier-ht2,
.player-drawer-mode.tier-lt2 {
    border-color: rgba(95, 212, 138, 0.3);
    background: rgba(95, 212, 138, 0.06);
}

.player-drawer-mode.tier-ht3,
.player-drawer-mode.tier-lt3 {
    border-color: rgba(79, 212, 232, 0.3);
    background: rgba(79, 212, 232, 0.055);
}

.player-drawer-mode.tier-ht4,
.player-drawer-mode.tier-lt4 {
    border-color: rgba(200, 205, 216, 0.24);
    background: rgba(200, 205, 216, 0.045);
}

.player-drawer-mode.tier-ht5,
.player-drawer-mode.tier-lt5 {
    border-color: rgba(240, 117, 120, 0.3);
    background: rgba(240, 117, 120, 0.055);
}

.player-drawer-mode.is-retired {
    opacity: 0.62;
}

.player-drawer-history {
    display: grid;
    gap: 8px;
    padding-bottom: 18px;
}

.drawer-history-item,
.player-history-item,
.player-drawer-history-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.022);
}

.drawer-history-item img,
.player-history-item img,
.player-drawer-history-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.drawer-history-item strong,
.player-history-item strong,
.player-drawer-history-item strong {
    display: block;
    font-size: 11px;
}

.drawer-history-item small,
.player-history-item small,
.player-drawer-history-item small {
    color: var(--soft);
    font-size: 9px;
}

.player-drawer-history-meta {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.player-drawer-history-item time {
    max-width: 94px;
    color: var(--soft);
    font-size: 9px;
    line-height: 1.35;
    text-align: right;
}

.player-drawer-empty {
    display: block;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    color: var(--soft);
    text-align: center;
}

body.drawer-open,
body.is-drawer-open {
    overflow: hidden;
}

body.drawer-open .page,
body.is-drawer-open .page {
    z-index: 30;
}

@media (max-width: 1150px) {
    .content-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ranking-board,
    .recent-panel {
        min-width: 0;
    }

    .recent-panel {
        position: static;
    }

    .content-grid:not(.is-tier-mode) .recent-list {
        display: grid;
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(270px, 320px);
        overflow-x: auto;
        max-height: none;
        padding-bottom: 8px;
        scroll-snap-type: x proximity;
    }

    .content-grid:not(.is-tier-mode) .recent-card {
        scroll-snap-align: start;
    }
}

@media (max-width: 760px) {
    .mode-hero {
        align-items: stretch;
        flex-direction: column;
        gap: 20px;
    }

    .mode-hero .search-box {
        width: 100%;
        flex-basis: auto;
    }

    .podium {
        min-height: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "first first"
            "second third";
    }

    .podium-card,
    .podium-card.rank-1 {
        min-height: 250px;
    }

    .podium-card.rank-1 {
        max-width: none;
    }

    .podium-position-1 {
        width: 100%;
        max-width: 360px;
        justify-self: center;
    }

    .podium-position-2:last-child {
        width: min(100%, 300px);
        grid-column: 1 / -1;
        justify-self: center;
    }

    .podium-card.rank-1 .podium-skin-wrap,
    .podium-skin-wrap {
        height: 135px;
    }

    .leaderboard-section .rank-heading {
        display: none;
    }

    .leaderboard-row {
        grid-template-columns: 42px minmax(0, 1fr) auto;
        gap: 8px 10px;
        padding: 12px 14px;
    }

    .leaderboard-row > .region-pill {
        grid-column: 3;
        grid-row: 1;
    }

    .leaderboard-row > .tier-stack {
        grid-column: 2 / -1;
    }

    .leaderboard-score {
        grid-column: 2 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .mode-hero {
        min-height: 0;
        padding: 18px;
        border-radius: var(--radius-lg);
    }

    .mode-hero-identity {
        align-items: flex-start;
        gap: 14px;
    }

    .mode-hero-icon-wrap {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
        border-radius: 17px;
    }

    .mode-hero-icon {
        width: 44px;
        height: 44px;
    }

    .mode-hero-copy h1 {
        font-size: 32px;
    }

    .podium-section {
        padding: 16px 12px 20px;
    }

    .podium {
        gap: 9px;
    }

    .podium-card,
    .podium-card.rank-1 {
        min-height: 220px;
        padding: 12px 8px;
    }

    .podium-card.rank-1 {
        width: 100%;
    }

    .podium-position-1 {
        max-width: 290px;
    }

    .podium-card.rank-1 .podium-skin-wrap,
    .podium-skin-wrap {
        height: 112px;
    }

    .podium-player {
        flex-direction: column;
        gap: 4px;
    }

    .podium-card > .tier-stack {
        width: 100%;
        justify-content: flex-start;
    }

    .ranking-list.tier-board {
        grid-template-columns: 1fr;
        gap: 10px;
        overflow: visible;
        padding: 12px;
    }

    .tier-group-toggle {
        min-height: 54px;
        cursor: pointer;
    }

    .tier-group-toggle::after {
        content: "⌄";
        margin-left: auto;
        color: rgb(var(--tier-rgb));
        font-size: 16px;
        transition: transform 180ms var(--ease);
    }

    .tier-group-count {
        order: 2;
    }

    .tier-group.is-collapsed .tier-group-toggle::after,
    .tier-group:not(.is-open) .tier-group-toggle::after {
        transform: rotate(-90deg);
    }

    .tier-group.is-collapsed .tier-slots,
    .tier-group.is-collapsed .tier-group-body {
        display: none;
    }

    .tier-slot {
        min-height: 92px;
    }

    .player-drawer {
        width: 100vw;
        padding: 18px;
    }

    .player-drawer-header {
        top: -18px;
        margin: -18px -18px 0;
        padding: 18px;
    }

    .player-drawer-hero {
        min-height: 220px;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
    }

    .player-drawer-skin-wrap {
        height: 184px;
    }

    .player-drawer-modes {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 360px) {
    .brand-name {
        display: none;
    }

    .top-nav,
    .nav-actions {
        gap: 6px;
    }

    .nav-link {
        padding-inline: 8px;
    }
}
