:root {
    --yg-bg: #f5f7fb;
    --yg-surface: #ffffff;
    --yg-surface-soft: #f9fafc;
    --yg-text: #111827;
    --yg-muted: #6b7280;
    --yg-line: #e5e7eb;
    --yg-dark: #0f172a;
    --yg-purple: #7c3aed;
    --yg-blue: #0284c7;
    --yg-green: #16a34a;
    --yg-yellow: #f59e0b;
    --yg-red: #dc2626;
    --yg-radius: 24px;
    --yg-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    --yg-shadow-sm: 0 14px 35px rgba(15, 23, 42, 0.07);
    --yg-control-height: 42px;
    --yg-subnav-control-height: 58px;
    --yg-subnav-item-height: 44px;
    --yg-mode-tab-width: 78px;
    --yg-subnav-shell-height: calc(var(--yg-subnav-control-height) + 0.4rem);
}

* {
    box-sizing: border-box;
}

html,
body {
    overflow-x: hidden;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, 0.135), transparent 34rem),
        radial-gradient(circle at top right, rgba(2, 132, 199, 0.135), transparent 32rem),
        var(--yg-bg);
    color: var(--yg-text);
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: opacity 0.16s ease;
}

body.modal-open,
body.modal-open .site-navbar {
    padding-right: 0 !important;
}

body.is-page-transitioning {
    opacity: 0.42;
    pointer-events: none;
}

a {
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(79, 70, 229, 0.28);
    outline-offset: 3px;
}

.site-navbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.navbar-layout {
    position: relative;
    min-height: 64px;
}

.navbar-brand {
    position: absolute;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transform: translateX(-50%);
    font-weight: 760;
    letter-spacing: -0.04em;
    transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.navbar-socials {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.navbar-socials a,
.navbar-socials img {
    display: block;
    width: 36px;
    height: 36px;
}

.navbar-socials img {
    border: 1px solid var(--yg-line);
    border-radius: 9px;
    object-fit: cover;
}

.navbar-socials a:hover {
    transform: translateY(-2px);
}

.brand-text {
    display: inline-block;
    color: var(--yg-text);
    transition: letter-spacing 0.24s ease, color 0.24s ease;
}

.navbar-brand:hover {
    transform: translateX(-50%) scale(1.08);
}

.navbar-brand:hover .brand-text,
.navbar-brand:focus-visible .brand-text,
.navbar-brand:active .brand-text {
    color: #4f46e5;
    letter-spacing: 0.015em;
}

.navbar-brand:focus-visible,
.navbar-brand:active {
    transform: translateX(-50%) scale(1.08);
}

.site-navbar .nav-link {
    color: #4b5563;
    font-weight: 700;
    border-radius: 999px;
    padding-inline: 1rem;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link.active {
    color: #111827;
    background: #f3f4f6;
}

.language-switcher {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    border: 1px solid var(--yg-line);
    border-radius: 999px;
    background: #fff;
}

.language-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.35rem 0.65rem;
    color: var(--yg-muted);
    text-decoration: none;
    font-weight: 760;
    font-size: 0.78rem;
    border-radius: 999px;
}

.language-link.active,
.language-link:hover {
    color: #fff;
    background: var(--yg-dark);
}

.hero-section {
    position: relative;
    padding: 7rem 0 5rem;
}

.page-hero {
    position: relative;
    padding: 5rem 0 3rem;
}

.hero-section,
.page-hero,
.home-server-section,
.stats-hero {
    position: relative;
    isolation: isolate;
}

.hero-section::before,
.page-hero::before,
.home-server-section::before,
.stats-hero::after {
    content: "";
    position: absolute;
    z-index: 0;
    top: -13rem;
    left: 50%;
    width: min(96rem, 118vw);
    height: 30rem;
    border-radius: 999px;
    background:
        radial-gradient(ellipse at 3% 42%, rgba(124, 58, 237, 0.145), transparent 58%),
        radial-gradient(ellipse at 97% 36%, rgba(2, 132, 199, 0.145), transparent 59%);
    filter: blur(22px);
    pointer-events: none;
    transform: translateX(-50%);
}

.hero-section > .container,
.page-hero > .container,
.home-server-section > .container,
.stats-hero > .container {
    position: relative;
    z-index: 1;
}

.page-hero.compact {
    padding: 3.9rem 0 1.5rem;
}

.page-hero.compact p {
    margin: 0;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #4f46e5;
    font-size: 0.78rem;
    font-weight: 760;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.12);
}

.hero-title,
.page-hero h1 {
    max-width: 860px;
    margin: 1rem 0;
    font-size: clamp(2.65rem, 7vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
    font-weight: 800;
}

.page-hero h1 {
    font-size: clamp(2.4rem, 5vw, 4.4rem);
}

.page-hero h1:first-child,
.stats-hero h1:first-child,
.player-profile-identity h1:first-child,
.player-profile-error h1:first-child {
    margin-top: 0;
}

.page-hero.compact h1,
.stats-hero h1 {
    margin: 0 0 0.75rem;
}

.hero-subtitle,
.page-hero p,
.section-heading p {
    max-width: 720px;
    color: var(--yg-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.hero-subtitle {
    margin-bottom: 2rem;
}

.hero-panel,
.server-card,
.command-card,
.community-card,
.notice-card,
.placeholder-panel {
    border: 1px solid rgba(229, 231, 235, 0.88);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--yg-shadow-sm);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: 2rem;
    border-radius: 32px;
    box-shadow: var(--yg-shadow);
}

.hero-panel-glow {
    position: absolute;
    inset: -40% auto auto 45%;
    width: 18rem;
    height: 18rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(2, 132, 199, 0.22));
    filter: blur(12px);
    pointer-events: none;
}

.panel-label {
    color: var(--yg-muted);
    font-size: 0.75rem;
    font-weight: 760;
    letter-spacing: 0.16em;
}

.panel-title {
    position: relative;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.live-chip,
.status-pill,
.mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    width: fit-content;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 760;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.live-chip {
    padding: 0.45rem 0.75rem;
    color: #334155;
    background: #f1f5f9;
}

.stacked-stat {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--yg-line);
}

.stacked-stat span,
.mini-grid span,
.server-meta-grid span {
    color: var(--yg-muted);
    font-size: 0.82rem;
    font-weight: 760;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stacked-stat strong {
    font-size: 1.1rem;
}

.mini-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.mini-grid > div {
    padding: 1rem;
    border-radius: 18px;
    background: var(--yg-surface-soft);
}

.mini-grid strong {
    display: block;
    margin-top: 0.35rem;
}

.section-block {
    padding: 4rem 0;
}

.section-heading {
    margin-bottom: 1.75rem;
}

.home-server-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.75rem;
}

.home-server-heading .section-heading {
    margin-bottom: 0;
}

.home-live-summary {
    display: inline-flex;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.92);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--yg-shadow-sm);
}

.home-live-summary > span {
    min-width: 118px;
    padding: 0.8rem 1rem;
}

.home-live-summary > span + span {
    border-left: 1px solid var(--yg-line);
}

.home-live-summary small,
.home-live-summary strong {
    display: block;
}

.home-live-summary small {
    margin-bottom: 0.15rem;
    color: var(--yg-muted);
    font-size: 0.72rem;
    font-weight: 760;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-live-summary strong {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.section-heading h2,
.placeholder-panel h2 {
    margin: 0.7rem 0 0.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.server-card {
    height: 100%;
    padding: 1.5rem;
    border-radius: var(--yg-radius);
}

.server-grid button.server-card {
    width: 100%;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.server-card:hover,
.community-card:hover,
.command-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--yg-shadow);
}

.server-card-top,
.server-card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.4rem;
}

.server-card-header {
    align-items: center;
}

.server-card-main {
    min-width: 0;
    margin-bottom: 1rem;
}

.server-card h3 {
    margin: 0.65rem 0 0;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.server-current-map {
    display: block;
    margin: 0.35rem 0 0;
    overflow: hidden;
    color: var(--yg-muted);
    font-size: 0.86rem;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mode-pill {
    padding: 0.42rem 0.7rem;
    color: #fff;
}

.accent-purple .mode-pill {
    background: var(--yg-purple);
}

.accent-blue .mode-pill {
    background: var(--yg-blue);
}

.status-pill {
    height: fit-content;
    padding: 0.42rem 0.7rem;
    white-space: nowrap;
}

.status-pill.planned {
    color: #92400e;
    background: #fef3c7;
}

.status-pill.online {
    color: #166534;
    background: #dcfce7;
}

.status-pill.offline {
    color: #991b1b;
    background: #fee2e2;
}

.server-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.server-meta-grid > div {
    min-width: 0;
    padding: 1rem;
    border-radius: 18px;
    background: var(--yg-surface-soft);
}

.server-meta-grid strong {
    display: block;
    margin-top: 0.35rem;
    overflow-wrap: anywhere;
}

.notice-card {
    padding: 1rem 1.2rem;
    border-radius: 18px;
    color: #475569;
}

.steam-state {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    border: 4px solid #fff;
    border-radius: 999px;
    background: #94a3b8;
}

.steam-state-1 {
    background: var(--yg-green);
}

.steam-state-2 {
    background: var(--yg-red);
}

.steam-state-3,
.steam-state-4 {
    background: var(--yg-yellow);
}

.steam-state-5,
.steam-state-6 {
    background: var(--yg-blue);
}

.stats-avatar-state {
    right: -3px;
    bottom: -3px;
    left: auto;
    width: 15px;
    height: 15px;
    border-width: 2px;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.16);
}

.command-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.command-tabs {
    display: inline-flex;
    gap: 0.35rem;
    margin-bottom: 0;
    padding: 0.4rem;
    border: 1px solid var(--yg-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--yg-shadow-sm);
}

.command-tab {
    display: grid;
    min-width: var(--yg-mode-tab-width);
    height: var(--yg-subnav-item-height);
    min-height: var(--yg-subnav-item-height);
    padding: 0.8rem 1.2rem;
    border: 0;
    border-radius: 13px;
    place-items: center;
    color: var(--yg-muted);
    background: transparent;
    font-size: 1rem;
    font-weight: 760;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
}

.command-tab.active,
.command-tab:hover {
    color: #fff;
    background: var(--yg-dark);
}

.command-search {
    align-self: flex-end;
    width: min(100%, 220px);
}

.command-search .form-control {
    min-height: 42px;
    border-radius: 13px;
    border-color: var(--yg-line);
    font-size: 0.84rem;
    font-weight: 760;
}

.result-count {
    color: var(--yg-muted);
    font-size: 0.9rem;
    font-weight: 760;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.command-results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.command-favorites-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--yg-line);
    border-radius: 999px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.86);
    font-size: 0.8rem;
    font-weight: 760;
}

.command-favorites-toggle:hover,
.command-favorites-toggle.active {
    border-color: #fbbf24;
    color: #92400e;
    background: #fef3c7;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.command-grid-item {
    min-width: 0;
}

.command-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.9rem;
    height: 100%;
    padding: 1rem;
    border-radius: 18px;
    background:
        linear-gradient(90deg, rgba(79, 70, 229, 0.05), transparent 35%),
        rgba(255, 255, 255, 0.92);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
    will-change: transform;
}

.command-card:hover {
    border-color: #c7d2fe;
    background:
        linear-gradient(90deg, rgba(79, 70, 229, 0.08), transparent 40%),
        #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.command-card.command-mode-general {
    border-left: 3px solid #64748b;
}

.command-card.command-mode-surf {
    border-left: 3px solid var(--yg-blue);
}

.command-card.command-mode-bhop {
    border-left: 3px solid var(--yg-purple);
}

.command-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.4rem;
    padding: 0.4rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.command-category-movement { color: #075985; background: #e0f2fe; }
.command-category-records { color: #166534; background: #dcfce7; }
.command-category-tools { color: #0f766e; background: #ccfbf1; }
.command-category-settings { color: #5b21b6; background: #ede9fe; }
.command-category-community { color: #92400e; background: #fef3c7; }

.command-content {
    min-width: 0;
}

.copy-command {
    display: inline-flex;
    max-width: 100%;
    margin-bottom: 0.3rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--yg-text);
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-weight: 760;
    text-align: left;
    overflow-wrap: anywhere;
}

.copy-command.copied {
    color: var(--yg-green);
    background: transparent;
}

.copy-command mark,
.command-card p mark {
    padding: 0 0.08rem;
    border-radius: 4px;
    color: inherit;
    background: #fef08a;
}

.command-card p {
    margin: 0;
    color: var(--yg-muted);
    line-height: 1.65;
}

.command-copy-action {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--yg-line);
    border-radius: 12px;
    color: #64748b;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition:
        border-color 0.18s ease,
        color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.command-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.command-favorite-action {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid var(--yg-line);
    border-radius: 12px;
    color: #94a3b8;
    background: #fff;
    font-size: 1.1rem;
    transition:
        border-color 0.18s ease,
        color 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.command-copy-action:hover,
.command-favorite-action:hover {
    transform: translateY(-1px);
}

.command-favorite-action:hover,
.command-favorite-action.active {
    border-color: #fbbf24;
    color: #d97706;
    background: #fffbeb;
}

.command-copy-action:hover,
.command-copy-action.copied {
    border-color: #a5b4fc;
    color: #4338ca;
    background: #eef2ff;
}

.site-toast-region {
    position: fixed;
    z-index: 2000;
    right: 1rem;
    bottom: 1rem;
    display: grid;
    gap: 0.5rem;
    pointer-events: none;
}

.site-toast-region.site-toast-region-center {
    top: 50%;
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    padding-inline: 1rem;
    transform: translateY(-50%);
    justify-items: center;
}

.site-toast {
    min-width: 210px;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    color: #fff;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 20px 55px rgba(15, 23, 42, 0.28);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    font-size: 0.88rem;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.site-toast.site-toast-center {
    width: min(360px, calc(100vw - 2rem));
    padding: 1rem 1.2rem;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.78);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.45;
}

.site-toast.show {
    opacity: 0.9;
    transform: translateY(0);
}

.empty-state {
    padding: 3rem 1.5rem;
    border: 1px dashed #cbd5e1;
    border-radius: var(--yg-radius);
    color: var(--yg-muted);
    background: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-weight: 760;
}

.community-card {
    display: flex;
    height: 100%;
    min-height: 280px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    border-radius: var(--yg-radius);
    color: var(--yg-text);
    text-align: center;
    text-decoration: none;
}

.community-card img {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.community-card strong {
    font-size: 1.35rem;
    font-weight: 800;
}

.community-card span {
    color: var(--yg-muted);
    line-height: 1.65;
}

.placeholder-panel {
    padding: 2rem;
    border-radius: var(--yg-radius);
}

.planned-module {
    padding: 1.2rem;
    border: 1px solid var(--yg-line);
    border-radius: 18px;
    background: var(--yg-surface-soft);
    font-weight: 760;
}

.site-footer {
    margin-top: 4rem;
    padding: 2.5rem 0;
    border-top: 1px solid var(--yg-line);
    background: rgba(255, 255, 255, 0.72);
}

.site-footer .row {
    row-gap: 0.85rem;
}

.footer-brand {
    margin-bottom: 0.3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.footer-copy {
    color: var(--yg-muted);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.footer-links a {
    color: #475569;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

.footer-links a:hover {
    color: #111827;
}

@media (max-width: 575.98px) {
    .site-footer {
        padding: 2rem 0;
    }

    .site-footer .row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.85rem;
    }

    .site-footer .col-lg-8,
    .site-footer .col-lg-3 {
        width: auto;
        min-width: 0;
    }

    .site-footer .col-lg-3 {
        margin-left: auto;
        text-align: right;
    }

    .footer-links {
        min-width: 0;
        flex-wrap: wrap;
        gap: 0.5rem 0.7rem;
    }

    .footer-links a {
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .site-footer small {
        display: block;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

@media (max-width: 991.98px) {
    .site-navbar .navbar-nav {
        align-items: stretch !important;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        padding-top: 1rem;
    }

    .site-navbar .navbar-nav .nav-item {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .site-navbar .navbar-nav .nav-item:first-child {
        grid-column: 1;
    }

    .site-navbar .navbar-nav .nav-item:last-child {
        grid-row: 1;
        grid-column: 2;
        align-self: center;
        margin-left: 0 !important;
    }

    .language-switcher {
        margin-top: 0;
    }

    .command-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .command-search {
        align-self: stretch;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding-top: 4.5rem;
    }

    .hero-panel,
    .server-card,
    .placeholder-panel {
        padding: 1.2rem;
        border-radius: 22px;
    }

    .server-card-top,
    .server-meta-grid,
    .mini-grid {
        grid-template-columns: 1fr;
    }

    .server-card-top {
        flex-direction: column;
    }

}

/* Restored portal layouts */
.home-server-section {
    min-height: 0;
    padding-top: 3.5rem;
    padding-bottom: 2.25rem;
}

.page-home .site-footer {
    margin-top: 0;
}

.discord-feed-grid {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.4rem;
}

.discord-feed-panel {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    padding: 1.35rem;
    border: 1px solid rgba(229, 231, 235, 0.88);
    border-radius: 24px;
    color: var(--yg-text);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--yg-shadow-sm);
}

.discord-feed-panel::before {
    content: "";
    position: absolute;
    top: -5rem;
    right: -4rem;
    width: 12rem;
    height: 12rem;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.18);
    pointer-events: none;
}

.discord-feed-updates::before {
    background: rgba(250, 204, 21, 0.18);
}

.discord-feed-heading {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.discord-feed-heading h2 {
    margin: 0;
    color: var(--yg-text);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.discord-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
}

.discord-message-list {
    position: relative;
    display: grid;
    align-content: start;
    flex: 1 1 auto;
    gap: 0.75rem;
}

.discord-message-card[hidden] {
    display: none !important;
}

.discord-message-card {
    padding: 1rem;
    border: 1px solid var(--yg-line);
    border-radius: 18px;
    color: var(--yg-text);
    background: var(--yg-surface-soft);
    box-shadow: none;
}

.discord-message-card + .discord-message-card {
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
    background: var(--yg-surface-soft);
}

.discord-message-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.discord-message-meta img,
.discord-avatar-fallback {
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    object-fit: cover;
    color: #fff;
    background: linear-gradient(135deg, #5865f2, #7c3aed);
    font-size: 0.72rem;
    font-weight: 800;
}

.discord-message-meta strong,
.discord-message-meta time {
    display: block;
}

.discord-message-meta strong {
    color: var(--yg-text);
    font-size: 0.9rem;
}

.discord-message-meta time {
    margin-top: 0.05rem;
    color: var(--yg-muted);
    font-size: 0.72rem;
}

.discord-message-card + .discord-message-card .discord-message-meta {
    gap: 0.55rem;
}

.discord-message-card + .discord-message-card .discord-message-meta img,
.discord-message-card + .discord-message-card .discord-avatar-fallback {
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    font-size: 0.66rem;
}

.discord-message-card + .discord-message-card .discord-message-meta strong {
    font-size: 0.84rem;
}

.discord-message-card + .discord-message-card .discord-message-meta time {
    font-size: 0.68rem;
}

.discord-message-card h3 {
    margin: 0.75rem 0 0.35rem;
    color: var(--yg-text);
    font-size: 1rem;
    font-weight: 760;
}

.discord-message-card p {
    margin: 0.7rem 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.58;
    overflow-wrap: anywhere;
}

.discord-message-card p strong {
    color: var(--yg-text);
    font-weight: 800;
}

.discord-message-card a {
    color: #00a8fc;
}

.discord-message-card a:hover {
    color: #3eb7ff;
}

.discord-message-card + .discord-message-card h3 {
    margin-top: 0.6rem;
    font-size: 0.92rem;
}

.discord-message-card + .discord-message-card p {
    margin-top: 0.55rem;
    font-size: 0.86rem;
    line-height: 1.52;
}

.discord-message-image {
    width: 100%;
    max-height: 220px;
    margin-top: 0.75rem;
    border-radius: 14px;
    object-fit: contain;
    background: #eef2f7;
}

.discord-feed-empty {
    position: relative;
    display: grid;
    min-height: 120px;
    place-items: center;
    padding: 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: var(--yg-muted);
    background: var(--yg-surface-soft);
    text-align: center;
    font-weight: 760;
}

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1rem;
}

.server-grid-item {
    min-width: 0;
}

.server-grid .server-card {
    display: flex;
    height: 100%;
    flex-direction: column;
    padding: 1.15rem;
    border-radius: 20px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.server-grid .server-card-header {
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.95rem;
}

.server-grid .server-card-main {
    margin-bottom: 0.95rem;
    text-align: center;
}

.server-grid .server-card h3 {
    margin: 0;
    overflow: hidden;
    font-size: 1.08rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-grid .server-meta-grid {
    grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
    gap: 0.55rem;
    margin-top: auto;
    overflow: visible;
    border-radius: 0;
    background: transparent;
}

.server-grid .server-meta-grid > div {
    display: flex;
    min-width: 0;
    min-height: 64px;
    flex-direction: column;
    justify-content: center;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(229, 231, 235, 0.88);
    border-radius: 14px;
    background: var(--yg-surface-soft);
}

.server-grid .server-meta-grid > div:first-child {
    align-items: center;
    text-align: left;
}

.server-grid .server-meta-grid > div:first-child span,
.server-grid .server-meta-grid > div:first-child strong {
    width: min(100%, 4.9rem);
    transform: translateX(-0.12rem);
}

.server-grid .server-meta-grid > div:last-child {
    align-items: flex-start;
    padding-left: 0.95rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.88);
}

.server-grid .server-meta-grid > div:last-child span,
.server-grid .server-meta-grid > div:last-child strong {
    transform: none;
}

.server-grid .server-meta-grid span {
    color: var(--yg-muted);
    font-size: 0.72rem;
    font-weight: 760;
}

.server-grid .server-meta-grid strong {
    font-size: 0.86rem;
}

.server-grid .server-meta-grid > div:last-child strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 1rem;
}

.server-card-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-inline: 0.55rem;
    white-space: nowrap;
}

.home-server-section.is-motd {
    padding: 1rem 0 1.25rem;
}

.home-server-section.is-motd > .container {
    max-width: 780px;
}

.home-server-section.is-motd .server-grid {
    width: min(100%, 720px);
    margin-inline: auto;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}

.home-server-section.is-motd .discord-feed-grid {
    width: min(100%, 720px);
    margin: 1rem auto 0;
}

.home-server-section.is-motd .server-grid .server-card {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(8.5rem, 10.5rem) minmax(0, 1fr) minmax(10.5rem, 10.5rem);
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 0.75rem;
    border-radius: 16px;
}

.home-server-section.is-motd .server-grid .server-card:hover {
    transform: translateY(-2px);
}

.home-server-section.is-motd .server-grid .server-card-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
}

.home-server-section.is-motd .mode-pill,
.home-server-section.is-motd .status-pill {
    padding: 0.3rem 0.5rem;
    font-size: 0.68rem;
    line-height: 1;
}

.home-server-section.is-motd .server-grid .server-card-main {
    margin: 0;
    text-align: center;
}

.home-server-section.is-motd .server-grid .server-card h3 {
    margin: 0;
    font-size: 0.98rem;
}

.home-server-section.is-motd .server-current-map {
    margin-top: 0.22rem;
    font-size: 0.78rem;
}

.home-server-section.is-motd .server-grid .server-meta-grid {
    grid-template-columns: minmax(4.5rem, auto) minmax(0, 1fr);
    gap: 0.35rem;
    margin: 0;
}

.home-server-section.is-motd .server-grid .server-meta-grid > div {
    min-height: 0;
    padding: 0.48rem 0.55rem;
    border-radius: 11px;
}

.home-server-section.is-motd .server-grid .server-meta-grid > div:first-child,
.home-server-section.is-motd .server-grid .server-meta-grid > div:last-child {
    align-items: flex-start;
    text-align: left;
}

.home-server-section.is-motd .server-grid .server-meta-grid > div:first-child span,
.home-server-section.is-motd .server-grid .server-meta-grid > div:first-child strong,
.home-server-section.is-motd .server-grid .server-meta-grid > div:last-child span,
.home-server-section.is-motd .server-grid .server-meta-grid > div:last-child strong {
    width: auto;
    transform: none;
}

.home-server-section.is-motd .server-grid .server-meta-grid span {
    font-size: 0.66rem;
}

.home-server-section.is-motd .server-grid .server-meta-grid strong {
    margin-top: 0.2rem;
    font-size: 0.78rem;
}

@media (max-width: 575.98px) {
    .home-server-section.is-motd .server-grid .server-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .home-server-section.is-motd .server-grid .server-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .home-server-section.is-motd .server-grid .server-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Shavit Timer statistics */
.stats-hero {
    position: relative;
    overflow: visible;
    padding: 3.9rem 0 1.5rem;
}

.stats-hero h1 {
    max-width: 860px;
    margin: 0 0 0.75rem;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.075em;
    font-weight: 800;
}

.stats-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--yg-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.stats-mode-switcher {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, var(--yg-mode-tab-width));
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.4rem;
    border: 1px solid var(--yg-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--yg-shadow-sm);
}

.stats-mode-switcher a {
    display: grid;
    width: var(--yg-mode-tab-width);
    height: var(--yg-subnav-item-height);
    min-height: var(--yg-subnav-item-height);
    place-items: center;
    padding: 0.8rem 1.2rem;
    border-radius: 13px;
    color: var(--yg-muted);
    font-size: 1rem;
    font-weight: 760;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
}

.stats-mode-switcher a:hover,
.stats-mode-switcher a.active {
    color: #fff;
    background: var(--yg-dark);
}

.stats-hero-tools {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.75rem;
}

.stats-content {
    position: relative;
    z-index: 2;
}

.stats-subnav-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stats-subnav-row .stats-mode-switcher {
    margin-left: 0;
}

.stats-subnav-right {
    display: flex;
    flex: 0 1 auto;
    align-items: stretch;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-left: auto;
}

.player-profile-content {
    position: relative;
    z-index: 2;
}

@media (min-width: 992px) {
    .player-profile-hero {
        margin-top: 0;
    }

    .player-profile-content.pt-0 {
        margin-top: 0;
        padding-top: 0 !important;
    }
}

.player-profile-subnav {
    order: -1;
}

.stats-view-switcher {
    display: inline-flex;
    gap: 0.35rem;
    margin-bottom: 0;
    padding: 0.35rem;
    border: 1px solid var(--yg-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--yg-shadow-sm);
}

.stats-view-switcher a {
    position: relative;
    display: grid;
    overflow: visible;
    isolation: isolate;
    height: var(--yg-subnav-item-height);
    min-height: var(--yg-subnav-item-height);
    place-items: center;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    color: var(--yg-muted);
    font-size: 1rem;
    font-weight: 760;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    transition:
        color 0.18s ease;
}

.stats-view-switcher a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: var(--yg-dark);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.stats-view-switcher a > span {
    position: relative;
    z-index: 1;
    display: block;
    line-height: inherit;
}

.stats-view-switcher a:hover,
.stats-view-switcher a.active {
    color: #fff;
}

.stats-view-switcher a:hover::before,
.stats-view-switcher a.active::before {
    opacity: 1;
}

.player-profile-subnav .stats-view-switcher a:hover::before,
.player-profile-subnav .stats-view-switcher a.active::before {
    top: 1px;
    bottom: -1px;
}

.maps-total {
    flex: 0 0 auto;
    padding: 0.65rem 0.9rem;
    border-radius: 13px;
    color: #5b21b6;
    background: #f3e8ff;
    font-size: 0.86rem;
    font-weight: 760;
}

.map-library-panel {
    padding: 1.5rem;
}

.stats-map-list-panel {
    margin-top: 1.75rem;
}

.map-library-panel .map-heading {
    padding-bottom: 0;
}

.stats-offline,
.stats-panel,
.summary-card {
    border: 1px solid rgba(229, 231, 235, 0.9);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--yg-shadow-sm);
}

.stats-offline {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: var(--yg-radius);
}

.stats-offline .status-dot {
    width: 12px;
    height: 12px;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: var(--yg-red);
    box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.1);
}

.stats-offline strong {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.05rem;
}

.stats-offline p {
    margin: 0;
    color: var(--yg-muted);
}

.panel-kicker {
    color: var(--yg-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.summary-card {
    display: flex;
    min-height: 129px;
    flex-direction: column;
    justify-content: center;
    padding: 1.24rem;
    border-radius: 20px;
}

.summary-card > span,
.summary-card-head > span {
    color: var(--yg-muted);
    font-size: 0.92rem;
    font-weight: 760;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.summary-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.summary-card strong {
    display: block;
    margin: 0.5rem 0 0.2rem;
    font-size: clamp(2.25rem, 4vw, 3.15rem);
    line-height: 1;
    letter-spacing: -0.06em;
}

.summary-card small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.28rem 0.48rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: #475569;
    background: #f8fafc;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.summary-card small.summary-rank-medal {
    min-width: 2rem;
    padding: 0.18rem 0.38rem;
    font-size: 1rem;
    background: #fff;
    filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.12));
}

.stats-panel {
    overflow: hidden;
    padding: 1.5rem;
    border-radius: var(--yg-radius);
}

.stats-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stats-panel-heading h2 {
    margin: 0.25rem 0 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

:root {
    --yg-filter-control-width: 130px;
    --yg-filter-control-gap: 0.5rem;
    --yg-filter-control-line-height: 1.2rem;
    --yg-filter-control-y-padding: calc((var(--yg-control-height) - var(--yg-filter-control-line-height) - 2px) / 2);
}

.record-ranking-toggle {
    display: inline-flex;
    gap: 0.18rem;
    padding: 0.22rem;
    border: 1px solid var(--yg-line);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
}

.record-ranking-title {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.record-ranking-toggle a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.36rem 0.68rem;
    border-radius: 9px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 760;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.record-ranking-toggle a:hover,
.record-ranking-toggle a.active {
    color: #fff;
    background: var(--yg-dark);
}

.stats-style-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 0 0 calc((var(--yg-filter-control-width) * 2) + var(--yg-filter-control-gap));
    gap: var(--yg-filter-control-gap);
    width: calc((var(--yg-filter-control-width) * 2) + var(--yg-filter-control-gap));
}

.stats-style-filter.record-ranking-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex-basis: calc((var(--yg-filter-control-width) * 3) + (var(--yg-filter-control-gap) * 2));
    width: calc((var(--yg-filter-control-width) * 3) + (var(--yg-filter-control-gap) * 2));
}

.stats-style-filter.player-record-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex-basis: calc((var(--yg-filter-control-width) * 3) + (var(--yg-filter-control-gap) * 2));
    width: calc((var(--yg-filter-control-width) * 3) + (var(--yg-filter-control-gap) * 2));
}

.stats-style-filter.stats-record-sort-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(160px, 187px);
    flex-basis: 528px;
    width: 528px;
}

.stats-style-filter .form-control,
.stats-style-filter .form-select,
.sort-direction-button {
    min-height: 42px;
    border-color: var(--yg-line);
    border-radius: 13px;
    font-size: 0.84rem;
    font-weight: 760;
}

.sort-direction-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--yg-line);
    color: var(--yg-text);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.sort-control-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    min-width: 0;
}

.sort-control-group .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.sort-control-group .sort-direction-button {
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    color: #64748b;
    background: #f8fafc;
    font-size: 0.9rem;
}

.sort-control-group .form-select:focus,
.sort-control-group .sort-direction-button:focus-visible {
    position: relative;
    z-index: 2;
}

.sort-control-group .sort-direction-button:hover,
.sort-control-group .sort-direction-button:focus-visible {
    transform: none;
}

.sort-direction-button:hover,
.sort-direction-button:focus-visible {
    border-color: #c7d2fe;
    background: #f8fafc;
    transform: translateY(-1px);
}

.stats-ranking-filter {
    width: var(--yg-filter-control-width);
}

.stats-ranking-filter-wide {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--yg-filter-control-gap);
    width: calc((var(--yg-filter-control-width) * 2) + var(--yg-filter-control-gap));
}

.stats-ranking-filter-player {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc((var(--yg-filter-control-width) * 3) + (var(--yg-filter-control-gap) * 2));
}

.stats-ranking-filter .form-control,
.stats-ranking-filter .form-select {
    min-height: 42px;
    border-color: var(--yg-line);
    border-radius: 13px;
    font-size: 0.84rem;
    font-weight: 760;
}

.panel-metric {
    padding: 0.45rem 0.7rem;
    border-radius: 10px;
    color: #5b21b6;
    background: #f3e8ff;
    font-size: 0.78rem;
    font-weight: 760;
}

.leaderboard-list,
.record-list {
    display: grid;
    gap: 0.55rem;
}

.record-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-list.record-list-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
}

.record-list-compact .record-row {
    min-width: 0;
    padding: 0.72rem;
}

.record-list-compact .record-map {
    flex: 1 1 auto;
}

.record-list-compact .record-time {
    min-width: max-content;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 2.3rem 2.75rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 14px;
    color: var(--yg-text);
    transition:
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.leaderboard-row:hover {
    background: #f6f8fb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transform: translateX(3px);
}

.leaderboard-rank {
    display: grid;
    width: 2.2rem;
    height: 2.2rem;
    place-items: center;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 11px;
    color: var(--yg-dark);
    background: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.leaderboard-rank-medal {
    color: inherit;
    font-size: 1.28rem;
    line-height: 1;
    filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.12));
}

.leaderboard-avatar-wrap {
    position: relative;
    display: block;
    width: 2.75rem;
    height: 2.75rem;
}

.leaderboard-avatar-link {
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.leaderboard-avatar-link:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.leaderboard-avatar {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 14px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--yg-purple), var(--yg-blue));
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
    font-size: 0.9rem;
    font-weight: 800;
}

.leaderboard-avatar-fallback {
    line-height: 1;
}

.leaderboard-player {
    min-width: 0;
}

.leaderboard-player a {
    color: inherit;
    text-decoration: none;
}

.leaderboard-player a:hover {
    color: var(--yg-blue);
    text-decoration: underline;
}

.leaderboard-player strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-map small,
.record-time small {
    color: var(--yg-muted);
}

.leaderboard-points {
    padding: 0.42rem 0.58rem;
    border-radius: 9px;
    color: #64748b;
    background: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
}

.player-profile-hero {
    padding: 3.9rem 0 1.4rem;
}

.player-profile-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
}

.player-profile-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 1.4rem;
}

@media (max-width: 991.98px) {
    .player-profile-identity {
        align-items: flex-start;
    }

    .player-profile-text {
        min-height: 96px;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.player-profile-avatar {
    display: grid;
    width: 112px;
    height: 112px;
    flex: 0 0 auto;
    place-items: center;
    border: 5px solid #fff;
    border-radius: 32px;
    object-fit: cover;
    color: #fff;
    background: linear-gradient(135deg, var(--yg-purple), var(--yg-blue));
    box-shadow: var(--yg-shadow);
    font-size: 2rem;
    font-weight: 800;
}

.player-profile-avatar-link {
    position: relative;
    display: inline-grid;
    flex: 0 0 auto;
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.player-profile-avatar-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.player-profile-avatar-link .stats-avatar-state {
    right: 2px;
    bottom: 2px;
    left: auto;
    width: 22px;
    height: 22px;
    border-width: 4px;
}

.player-profile-text {
    display: flex;
    min-width: 0;
    min-height: 112px;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 0.08rem;
    padding-bottom: 0.1rem;
}

.player-profile-identity h1,
.player-profile-error h1 {
    margin: 0;
    overflow-wrap: anywhere;
    line-height: 0.92;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -0.065em;
}

.player-profile-identity h1 {
    transform: translateY(-4px);
}

.player-profile-name-link {
    color: inherit;
    text-decoration: none;
}

.player-profile-name-link:hover {
    color: #4f46e5;
}

.player-profile-identity p {
    margin: 0;
    color: var(--yg-muted);
    font-weight: 730;
    line-height: 1.18;
    transform: translateY(4px);
}

.player-profile-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (min-width: 992px) {
    .player-profile-actions {
        transform: translateY(-1.5px);
    }
}

.player-profile-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

.player-profile-layout {
    display: flex;
    flex-direction: column;
}

.player-profile-layout .player-profile-summary {
    order: 0;
}

.player-profile-layout #player-server-records {
    order: 1;
    margin-top: 1.5rem !important;
}

.player-profile-layout #player-recent-runs {
    order: 2;
}

.player-profile-record-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.player-profile-record-grid #player-server-records {
    order: 1;
    margin-top: 0 !important;
}

.player-profile-record-grid #player-recent-runs {
    order: 2;
    margin-top: 0 !important;
}

.favorite-map-list {
    display: grid;
    gap: 0.55rem;
}

.favorite-map-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem;
    border-radius: 14px;
    background: var(--yg-surface-soft);
}

.favorite-map-row strong,
.favorite-map-row small {
    display: block;
}

.favorite-map-link {
    display: block;
    padding: 0;
    border: 0;
    color: var(--yg-text);
    background: transparent;
    font: inherit;
    font-weight: 760;
    text-align: left;
}

.favorite-map-link:hover {
    color: var(--yg-blue);
    text-decoration: underline;
}

.favorite-map-row small {
    margin-top: 0.15rem;
    color: var(--yg-muted);
}

.favorite-map-row > span {
    flex: 0 0 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 760;
}

.player-profile-error {
    padding: 2.5rem;
    border: 1px solid var(--yg-line);
    border-radius: var(--yg-radius);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--yg-shadow);
}

.record-row {
    --record-inner-gap: 0.48rem;
    display: grid;
    gap: var(--record-inner-gap);
    padding: 0.8rem;
    border: 1px solid var(--yg-line);
    border-radius: 15px;
    background: var(--yg-surface-soft);
}

.record-meta-line,
.record-content-line {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.record-map {
    flex: 1 1 auto;
    min-width: 0;
}

.record-map > span,
.record-meta-line > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 760;
}

.record-meta-line > span:first-child {
    flex: 1 1 auto;
}

.record-tier-text {
    flex: 0 0 auto;
    text-align: right;
}

.record-map > span.track-main,
.record-meta-line > span.track-main {
    color: #15803d;
}

.record-map > span.track-bonus,
.record-meta-line > span.track-bonus {
    color: #b45309;
}

.record-map > span.track-stage,
.record-meta-line > span.track-stage {
    color: #0369a1;
}

.record-tier-text.tier-1 { color: #166534; }
.record-tier-text.tier-2 { color: #0f766e; }
.record-tier-text.tier-3 { color: #075985; }
.record-tier-text.tier-4 { color: #1d4ed8; }
.record-tier-text.tier-5 { color: #5b21b6; }
.record-tier-text.tier-6 { color: #7e22ce; }
.record-tier-text.tier-7 { color: #9d174d; }
.record-tier-text.tier-8 { color: #9f1239; }
.record-tier-text.tier-9 { color: #9a3412; }
.record-tier-text.tier-10 { color: #991b1b; }

.record-map strong,
.record-map small {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-map-link,
.table-map-link {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    font-weight: 760;
    text-align: left;
    cursor: pointer;
}

.record-map-link {
    display: block;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-map-with-player .record-map-link {
    margin-bottom: var(--record-inner-gap);
}

.record-map-link:hover,
.table-map-link:hover {
    color: var(--yg-blue);
    text-decoration: underline;
}

.record-time {
    flex: 0 0 auto;
    text-align: right;
}

.record-time strong,
.record-time small {
    display: block;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-time strong {
    margin-bottom: var(--record-inner-gap);
}

.record-time strong,
.run-time {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
}

.stats-table {
    --bs-table-bg: transparent;
}

.stats-table thead th {
    padding-top: 0.4rem;
    padding-bottom: 0.75rem;
    border-bottom-color: var(--yg-line);
    color: var(--yg-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.stats-table tbody td {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom-color: #eef0f4;
    white-space: nowrap;
}

.stats-table tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 575.98px) {
    #recent-runs .table-responsive,
    #player-recent-runs .table-responsive,
    .map-details-modal [data-map-modal-table] {
        overflow: visible;
    }

    #recent-runs .stats-table,
    #recent-runs .stats-table thead,
    #recent-runs .stats-table tbody,
    #recent-runs .stats-table tr,
    #recent-runs .stats-table td,
    #player-recent-runs .stats-table,
    #player-recent-runs .stats-table thead,
    #player-recent-runs .stats-table tbody,
    #player-recent-runs .stats-table tr,
    #player-recent-runs .stats-table td,
    .map-detail-table,
    .map-detail-table thead,
    .map-detail-table tbody,
    .map-detail-table tr,
    .map-detail-table td {
        display: block;
        width: 100%;
        max-width: none;
    }

    #recent-runs .stats-table thead,
    #player-recent-runs .stats-table thead,
    .map-detail-table thead {
        display: none;
    }

    #recent-runs .stats-table tbody,
    #player-recent-runs .stats-table tbody,
    .map-detail-table tbody {
        display: grid;
        gap: 0.7rem;
    }

    #recent-runs .stats-table tbody tr,
    #player-recent-runs .stats-table tbody tr,
    .map-detail-table tbody tr {
        padding: 0.85rem;
        border: 1px solid var(--yg-line);
        border-radius: 16px;
        background: var(--yg-surface-soft);
    }

    #recent-runs .stats-table tbody td,
    #player-recent-runs .stats-table tbody td,
    .map-detail-table tbody td {
        display: grid;
        grid-template-columns: 5.25rem minmax(0, 1fr);
        gap: 0.75rem;
        align-items: center;
        padding: 0.36rem 0;
        border: 0;
        white-space: normal;
    }

    #recent-runs .stats-table tbody td::before,
    #player-recent-runs .stats-table tbody td::before,
    .map-detail-table tbody td::before {
        content: attr(data-label);
        color: var(--yg-muted);
        font-size: 0.72rem;
        font-weight: 800;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #recent-runs .stats-table .run-details,
    #player-recent-runs .stats-table .run-details,
    .map-detail-table .run-details {
        grid-template-columns: 1fr;
        gap: 0.25rem;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.74rem;
        white-space: nowrap;
        scrollbar-width: none;
    }

    #recent-runs .stats-table .run-details::-webkit-scrollbar,
    #player-recent-runs .stats-table .run-details::-webkit-scrollbar,
    .map-detail-table .run-details::-webkit-scrollbar {
        display: none;
    }

    #recent-runs .stats-table .run-details::before,
    #player-recent-runs .stats-table .run-details::before,
    .map-detail-table .run-details::before {
        margin-bottom: 0.05rem;
    }

    #recent-runs .stats-table tbody td.run-category,
    #player-recent-runs .stats-table tbody td.run-category,
    .map-detail-table tbody td.run-category {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.35rem 0.4rem;
    }

    #recent-runs .stats-table tbody td.run-category::before,
    #player-recent-runs .stats-table tbody td.run-category::before,
    .map-detail-table tbody td.run-category::before {
        flex: 0 0 5.25rem;
    }

    #recent-runs .stats-table tbody td.run-category .stats-badge,
    #player-recent-runs .stats-table tbody td.run-category .stats-badge,
    .map-detail-table tbody td.run-category .stats-badge {
        flex: 0 0 auto;
        width: auto;
        max-width: max-content;
    }

    .map-record-player {
        max-width: 100%;
    }
}

.stats-badge,
.tier-pill {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: #5b21b6;
    background: #f3e8ff;
    font-size: 0.7rem;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
}

.tier-pill.tier-1 { color: #166534; background: #dcfce7; }
.tier-pill.tier-2 { color: #0f766e; background: #ccfbf1; }
.tier-pill.tier-3 { color: #075985; background: #e0f2fe; }
.tier-pill.tier-4 { color: #1d4ed8; background: #dbeafe; }
.tier-pill.tier-5 { color: #5b21b6; background: #ede9fe; }
.tier-pill.tier-6 { color: #7e22ce; background: #f3e8ff; }
.tier-pill.tier-7 { color: #9d174d; background: #fce7f3; }
.tier-pill.tier-8 { color: #9f1239; background: #ffe4e6; }
.tier-pill.tier-9 { color: #9a3412; background: #ffedd5; }
.tier-pill.tier-10 { color: #991b1b; background: #fee2e2; }

.stats-badge.track-main {
    color: #166534;
    background: #dcfce7;
}

.stats-badge.track-bonus {
    color: #92400e;
    background: #fef3c7;
}

.stats-badge.track-stage {
    color: #075985;
    background: #e0f2fe;
}

.stats-badge.muted {
    color: #475569;
    background: #eef2f7;
}

.record-player-link {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.record-player-link:hover {
    color: var(--yg-blue);
    text-decoration: underline;
}

.server-record-player {
    position: relative;
    display: block;
    min-width: 0;
    max-width: 100%;
    padding-left: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.15;
}

.server-record-player::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: #94a3b8;
    transform: translateY(-50%);
}

.server-record-player.record-steam-state-1::before {
    background: var(--yg-green);
}

.server-record-player.record-steam-state-2::before {
    background: var(--yg-red);
}

.server-record-player.record-steam-state-3::before,
.server-record-player.record-steam-state-4::before {
    background: var(--yg-yellow);
}

.server-record-player.record-steam-state-5::before,
.server-record-player.record-steam-state-6::before {
    background: var(--yg-blue);
}

.server-record-player:hover {
    color: var(--yg-blue);
}

.map-record-player {
    display: inline-flex;
    min-width: 0;
    max-width: 160px;
    align-items: center;
    gap: 0.5rem;
}

.map-record-player .record-player-link {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-record-player .record-player-link strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.record-rank-medal {
    display: inline-grid;
    width: 1.3rem;
    height: 1.3rem;
    flex: 0 0 auto;
    place-items: center;
    margin-left: 0.08rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 1rem;
    line-height: 1;
    vertical-align: -0.12em;
    box-shadow: none;
    filter: drop-shadow(0 2px 2px rgba(15, 23, 42, 0.16));
}

.record-rank-medal.rank-1,
.record-rank-medal.rank-2,
.record-rank-medal.rank-3 {
    color: inherit;
    background: transparent;
}

.run-details {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--yg-muted) !important;
    font-size: 0.85rem;
}

.run-detail-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-details-column {
    width: 310px;
    max-width: 310px;
}

.run-date-column {
    width: 160px;
    max-width: 160px;
}

.map-heading {
    align-items: center;
}

.map-search {
    display: grid;
    grid-template-columns:
        var(--yg-filter-control-width)
        var(--yg-filter-control-width)
        var(--yg-filter-control-width)
        var(--yg-filter-control-width)
        calc(var(--yg-filter-control-width) + 42px);
    gap: var(--yg-filter-control-gap);
    width: max-content;
    max-width: 100%;
    margin-left: auto;
}

.map-search .form-control,
.map-search .form-select {
    min-height: 42px;
    border-radius: 13px;
    border-color: var(--yg-line);
    font-size: 0.84rem;
    font-weight: 760;
}

.map-search .sort-control-group .form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

@media (min-width: 768px) {
    .map-search .sort-control-group {
        grid-template-columns: var(--yg-filter-control-width) 42px;
    }
}

.map-search-input {
    min-width: 0;
}

.map-sort-select,
.map-tier-select,
.map-track-select,
.map-style-select {
    font-weight: 760;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
}

.map-stat-card {
    display: block;
    width: 100%;
    padding: 1.1rem;
    border: 1px solid var(--yg-line);
    border-radius: 18px;
    color: inherit;
    background: var(--yg-surface-soft);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease;
}

.map-stat-card:hover {
    border-color: #c4b5fd;
    background: #fff;
    box-shadow: var(--yg-shadow-sm);
    transform: translateY(-3px);
}

.map-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.map-card-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.55rem;
}

.map-stat-card h3 {
    margin: 0;
    overflow: hidden;
    font-size: 1.02rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-card-stats {
    display: grid;
    grid-template-columns: 1.4fr repeat(2, 0.8fr);
    gap: 0.65rem;
}

.map-card-stats span,
.map-card-stats strong {
    display: block;
}

.map-card-stats span {
    margin-bottom: 0.15rem;
    color: var(--yg-muted);
    font-size: 0.7rem;
}

.map-card-stats strong {
    font-size: 0.88rem;
}

.stats-empty {
    padding: 2rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: var(--yg-muted);
    text-align: center;
    font-weight: 760;
}

[data-map-results] {
    position: relative;
    transition: opacity 0.16s ease;
}

[data-map-results].is-loading {
    opacity: 0.48;
    pointer-events: none;
}

[data-map-results].is-loading::after {
    top: 50%;
}

.stats-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
}

.stats-pagination a,
.stats-pagination button {
    display: inline-grid;
    min-width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    padding: 0 0.55rem;
    border: 1px solid var(--yg-line);
    border-radius: 10px;
    color: var(--yg-muted);
    background: #fff;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 760;
    text-decoration: none;
    cursor: pointer;
}

.stats-pagination .pagination-mobile-hidden {
    display: none;
}

.stats-pagination a:hover,
.stats-pagination a.active,
.stats-pagination button:hover,
.stats-pagination button.active {
    border-color: var(--yg-dark);
    color: #fff;
    background: var(--yg-dark);
}

.stats-anchor {
    position: relative;
    scroll-margin-top: 6.5rem;
    transition: opacity 0.16s ease;
}

.stats-anchor.is-loading {
    opacity: 0.48;
    pointer-events: none;
}

.stats-anchor.is-loading::after {
    top: 50%;
}

.stats-anchor.is-loading::after,
[data-map-results].is-loading::after {
    content: "";
    position: absolute;
    z-index: 5;
    left: 50%;
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-top-color: #4f46e5;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    animation: yatta-spin-centered 0.7s linear infinite;
}

@keyframes yatta-spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

@keyframes yatta-spin-centered {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes yatta-pulse {
    to { opacity: 0.35; }
}

.map-details-modal {
    --map-modal-width: min(890px, calc(100vw - 2rem));
    --map-detail-rank-width: 4rem;
    --map-detail-player-width: 8rem;
    --map-detail-time-width: 6.7rem;
    --map-detail-type-width: 13.6rem;
    --map-detail-info-width: 20rem;
    --map-detail-table-width: calc(
        var(--map-detail-rank-width)
        + var(--map-detail-player-width)
        + var(--map-detail-time-width)
        + var(--map-detail-type-width)
        + var(--map-detail-info-width)
    );
    --bs-modal-width: var(--map-modal-width);
}

.map-details-modal .modal-dialog {
    width: var(--map-modal-width);
    max-width: calc(100vw - 2rem);
}

.map-detail-rank-column {
    width: var(--map-detail-rank-width, 4.25rem);
    min-width: var(--map-detail-rank-width, 4.25rem);
    max-width: var(--map-detail-rank-width, 4.25rem);
}

.map-detail-table {
    width: var(--map-detail-table-width);
    min-width: var(--map-detail-table-width);
    max-width: none;
    table-layout: fixed;
}

.map-detail-table col.map-detail-rank-col {
    width: var(--map-detail-rank-width, 4.25rem);
}

.map-detail-table col.map-detail-player-col {
    width: var(--map-detail-player-width, 10rem);
}

.map-detail-table col.map-detail-time-col {
    width: var(--map-detail-time-width, 6.2rem);
}

.map-detail-table col.map-detail-type-col {
    width: var(--map-detail-type-width, 10rem);
}

.map-detail-table col.map-detail-info-col {
    width: var(--map-detail-info-width);
}

.map-detail-player-column,
.map-detail-time-column,
.map-detail-type-column,
.map-detail-table .run-category {
    width: auto;
    max-width: none;
    white-space: nowrap;
}

.map-detail-info-column {
    width: auto;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
}

.map-details-modal .modal-content {
    width: 100%;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.34);
}

.map-details-modal .modal-header {
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem 0.8rem;
    border-bottom: 0;
}

.map-modal-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.6rem;
    margin-right: auto;
}

.map-modal-heading .tier-pill {
    min-height: 2rem;
    align-items: center;
    padding: 0.38rem 0.8rem 0.42rem;
    border-radius: 12px;
    font-size: 1.1rem;
    line-height: 1.1;
    transform: translateY(3.5px);
}

.map-modal-heading .modal-title {
    margin: 0;
    line-height: 1.1;
}

.map-modal-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.map-details-modal .modal-header .btn-close {
    flex: 0 0 auto;
    margin: 0;
}

.map-modal-filters .form-select {
    width: var(--yg-filter-control-width);
    min-height: var(--yg-control-height);
    border-color: var(--yg-line);
    border-radius: 13px;
    font-size: 0.84rem;
    font-weight: 760;
}

.map-details-modal .modal-title {
    margin-top: 0.25rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.map-modal-count {
    color: var(--yg-muted);
    font-weight: 700;
}

.map-details-modal .modal-body {
    position: relative;
    min-height: 0;
    padding: 0.65rem 1.5rem 1.5rem;
}

.map-details-modal [data-map-modal-table] {
    overflow-x: hidden;
}

.map-details-modal .modal-body.is-loading [data-map-modal-table],
.map-details-modal .modal-body.is-loading [data-map-modal-pagination] {
    opacity: 0.42;
    pointer-events: none;
}

.map-details-modal [data-map-modal-table],
.map-details-modal [data-map-modal-pagination] {
    transition: opacity 0.16s ease;
}

.map-details-modal .modal-body.is-loading::after {
    content: "";
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid rgba(79, 70, 229, 0.2);
    border-top-color: #4f46e5;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    animation: yatta-spin-centered 0.7s linear infinite;
}

.map-modal-loading {
    display: grid;
    min-height: 240px;
    place-items: center;
    color: var(--yg-muted);
    font-weight: 760;
}

.map-detail-table tbody td {
    vertical-align: middle;
}

.map-detail-table th,
.map-detail-table td {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
}

.map-detail-table .map-detail-player-column {
    padding-right: 0.75rem;
}

.map-detail-table .run-category .stats-badge {
    transform: translateY(-1px);
}

.map-detail-table .map-record-player {
    max-width: 100%;
}

.map-detail-table .map-record-player,
.map-detail-table .map-record-player a,
.map-detail-table .map-record-player strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-detail-table .run-details {
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
    line-height: 1.08;
}

.map-detail-info-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    width: max-content;
    max-width: 100%;
    gap: 0.07rem;
    vertical-align: middle;
    line-height: 1.07;
}

.map-detail-table .run-detail-text,
.map-detail-meta-inline {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: clip;
    white-space: nowrap;
}

.map-detail-meta-inline {
    color: inherit;
    font: inherit;
    font-weight: inherit;
    line-height: 1.07;
    text-align: left;
}

.map-detail-table .map-detail-rank-column {
    width: var(--map-detail-rank-width, 4.25rem);
    min-width: var(--map-detail-rank-width, 4.25rem);
    max-width: var(--map-detail-rank-width, 4.25rem);
    padding-right: 0.25rem;
    padding-left: 0.25rem;
    text-align: center;
}

.record-rank-number {
    display: inline-grid;
    min-width: 2.45rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--yg-line);
    border-radius: 10px;
    color: var(--yg-text);
    background: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.modal-backdrop.show {
    opacity: 0.72;
}

.server-details-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.34);
}

.server-details-modal,
.server-details-modal .modal-dialog {
    --bs-modal-width: 520px;
}

.server-details-modal .modal-title {
    font-weight: 800;
    letter-spacing: -0.04em;
}

.server-details-modal .modal-header small {
    display: block;
    color: var(--yg-muted);
}

.server-modal-updated {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    font-weight: 760;
}

.server-details-modal .modal-footer {
    justify-content: center;
    gap: 0.55rem;
}

.server-refresh-button {
    display: inline-flex;
    align-items: center;
    border-color: #475569;
    color: #fff;
    background: #475569;
    font-weight: 400;
}

.server-refresh-button:hover,
.server-refresh-button:focus-visible {
    border-color: #334155;
    color: #fff;
    background: #334155;
}

.server-player-list.is-refreshing {
    opacity: 0.45;
    pointer-events: none;
}

.server-modal-loading {
    display: grid;
    min-height: 220px;
    place-items: center;
    color: var(--yg-muted);
    font-weight: 760;
}

.server-player-list {
    display: grid;
    gap: 0.5rem;
}

.server-player-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: var(--yg-surface-soft);
}

.server-player-row span {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: var(--yg-dark);
    font-size: 0.75rem;
    font-weight: 760;
}

.server-player-row small {
    color: var(--yg-muted);
    font-weight: 760;
}

.server-player-row a,
.server-player-row strong {
    overflow: hidden;
    color: var(--yg-text);
    font-weight: 760;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-player-row a:hover {
    color: var(--yg-blue);
    text-decoration: underline;
}

@media (min-width: 1200px) {
    .server-grid.server-count-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .server-grid.server-count-5 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .server-grid.server-count-5 > .server-grid-item {
        grid-column: span 2;
    }

    .server-grid.server-count-5 > .server-grid-item:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .stats-mode-switcher {
        margin-left: 0;
    }

    .stats-summary-grid,
    .map-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .record-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .server-grid.server-count-5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .server-grid.server-count-5 > .server-grid-item {
        grid-column: span 2;
    }

    .server-grid.server-count-5 > .server-grid-item:last-child {
        grid-column: 2 / span 2;
    }
}

@media (max-width: 575.98px) {
    .home-server-section {
        padding-top: 3.5rem;
    }

    .home-server-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .home-live-summary {
        width: 100%;
    }

    .home-live-summary > span {
        min-width: 0;
        flex: 1 1 50%;
    }

    .server-card-actions,
    .map-grid {
        grid-template-columns: 1fr;
    }

    .stats-summary-grid,
    .player-profile-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-hero {
        padding-top: 3.55rem;
    }

    .stats-panel-heading,
    .map-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .stats-subnav-row {
        align-items: stretch;
        flex-direction: column;
        gap: 1.5rem;
    }

    .stats-subnav-row .stats-mode-switcher {
        width: 100%;
        max-width: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-subnav-row .stats-mode-switcher a {
        width: auto;
        min-width: 0;
    }

    .command-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .command-tab {
        min-width: 0;
    }

    .stats-subnav-right {
        align-items: stretch;
    }

    .stats-view-switcher {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
    }

    .stats-view-switcher a {
        flex: 1 1 0;
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .server-details-modal [data-server-modal-join] {
        display: none;
    }

    .stats-style-filter {
        flex: 0 0 auto;
        width: 100%;
    }

    .stats-ranking-filter,
    .stats-ranking-filter-wide {
        width: 100%;
    }

    .stats-style-filter.record-ranking-filter {
        flex: 0 0 auto;
        width: 100%;
    }

    .stats-style-filter.player-record-filter {
        flex: 0 0 auto;
        width: 100%;
    }

    #player-server-records .stats-record-sort-filter {
        flex: 0 0 auto !important;
        grid-template-columns: 0.9fr 1fr minmax(0, 1.2fr);
        grid-auto-rows: 38px;
        align-items: center;
        gap: 0.4rem;
        width: 100%;
    }

    #player-server-records .stats-record-sort-filter .form-select,
    #player-server-records .stats-record-sort-filter .sort-direction-button {
        height: 38px;
        min-height: 38px;
        max-height: 38px;
    }

    #player-server-records .stats-record-sort-filter .form-select {
        padding: 0.25rem 1.55rem 0.25rem 0.55rem;
        border-radius: 10px;
        background-position: right 0.45rem center;
        background-size: 12px 10px;
        font-size: 0.72rem;
        line-height: 1.15;
        text-overflow: ellipsis;
    }

    #player-server-records .stats-record-sort-filter .sort-direction-button {
        width: 38px;
        border-radius: 10px;
        font-size: 0.92rem;
    }

    #player-server-records .stats-record-sort-filter .sort-control-group {
        grid-template-columns: minmax(0, 1fr) 38px;
    }

    #player-server-records .stats-record-sort-filter .sort-control-group .form-select {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    #player-server-records .stats-record-sort-filter .sort-control-group .sort-direction-button {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }

    .map-details-modal .modal-header {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .map-modal-filters {
        order: 3;
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .map-modal-filters .form-select {
        width: 100%;
    }

    .map-search {
        width: 100%;
    }

    .leaderboard-row {
        grid-template-columns: 2.15rem 2.55rem minmax(0, 1fr) max-content;
        gap: 0.58rem;
    }

    .leaderboard-points {
        grid-column: auto;
        justify-self: end;
        max-width: 7.2rem;
        overflow: hidden;
        padding: 0.36rem 0.5rem;
        font-size: 0.78rem;
        text-overflow: ellipsis;
    }

    .player-profile-heading,
    .player-profile-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .player-profile-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-profile-summary .summary-card-head {
        gap: 0.45rem;
    }

    .player-profile-summary .summary-card-head > span {
        min-width: 0;
        font-size: clamp(0.76rem, 2.7vw, 0.86rem);
        letter-spacing: 0.02em;
        white-space: nowrap;
    }

    .player-profile-summary .summary-card small {
        flex: 0 0 auto;
    }
}

@media (max-width: 991.98px) {
    .navbar-layout {
        min-height: 64px;
    }

    .navbar-socials,
    .site-navbar .navbar-toggler {
        position: absolute;
        top: 32px;
        z-index: 3;
        transform: translateY(-50%);
    }

    .navbar-socials {
        left: 0.75rem;
        gap: 0.3rem;
    }

    .site-navbar .navbar-toggler {
        right: 0.75rem;
    }

    .navbar-brand {
        position: absolute;
        top: 32px;
        left: 50%;
        z-index: 2;
        margin: 0;
        transform: translate(-50%, -50%);
    }

    .navbar-brand:hover {
        transform: translate(-50%, -50%) scale(1.06);
    }

    .navbar-brand:focus-visible,
    .navbar-brand:active {
        transform: translate(-50%, -50%) scale(1.06);
    }

    .navbar-socials a,
    .navbar-socials img {
        width: 30px;
        height: 30px;
    }

    .site-navbar .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        margin-top: 64px;
    }

    .player-profile-record-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1rem;
    }
}

@media (max-width: 767.98px) {
    .command-grid {
        grid-template-columns: 1fr;
    }

    .command-search {
        position: sticky;
        z-index: 15;
        top: 72px;
        padding: 0.45rem 0;
        background: rgba(245, 247, 251, 0.92);
        backdrop-filter: blur(12px);
    }

    .command-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .discord-feed-grid {
        grid-template-columns: 1fr;
    }

    .command-actions {
        grid-column: 2;
        justify-content: flex-end;
    }
}

@media (max-width: 767.98px) {
    .map-search {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .map-search-input {
        grid-column: 1 / -1;
    }

    .record-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .map-search {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .map-detail-rank-column,
    .map-detail-player-column,
    .map-detail-time-column,
    .map-detail-type-column,
    .map-detail-info-column,
    .run-details-column,
    .run-date-column {
        width: 100%;
        max-width: none;
    }

    .map-detail-table .run-details,
    .map-detail-table .run-detail-text {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .map-details-modal [data-map-modal-table] {
        overflow: visible;
    }

    .player-profile-identity {
        align-items: flex-start;
        flex-direction: column;
    }

    .player-profile-avatar {
        width: 92px;
        height: 92px;
        border-radius: 27px;
    }

    .site-toast-region {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
    }

    .site-toast {
        min-width: 0;
        width: 100%;
    }
}

/* UI polish pass: spacing, controls, and interaction rhythm. */
.stats-subnav-row {
    margin-bottom: 1.5rem;
}

.stats-summary-grid {
    margin-bottom: 0;
}

.stats-summary-grid + .row.mt-1 {
    margin-top: 0 !important;
}

.stats-summary-grid + .stats-map-list-panel {
    margin-top: 1.5rem;
}

.stats-style-filter .form-control,
.stats-style-filter .form-select,
.stats-ranking-filter .form-control,
.stats-ranking-filter .form-select,
.map-search .form-control,
.map-search .form-select,
.map-modal-filters .form-select,
.sort-direction-button,
.stats-pagination a,
.stats-pagination button {
    min-height: var(--yg-control-height);
    height: var(--yg-control-height);
    border-radius: 13px;
    font-size: 0.84rem;
    font-weight: 760;
    line-height: 1;
}

.stats-style-filter .form-control,
.stats-style-filter .form-select,
.stats-ranking-filter .form-control,
.stats-ranking-filter .form-select,
.map-search .form-control,
.map-search .form-select,
.map-modal-filters .form-select {
    padding-top: var(--yg-filter-control-y-padding);
    padding-bottom: var(--yg-filter-control-y-padding);
    line-height: var(--yg-filter-control-line-height);
}

.stats-style-filter.player-record-filter .form-control,
.stats-style-filter.player-record-filter .form-select {
    padding-top: calc(var(--yg-filter-control-y-padding) + 0.5px);
    padding-bottom: calc(var(--yg-filter-control-y-padding) - 0.5px);
}

.stats-style-filter.player-record-filter .form-control {
    padding-top: var(--yg-filter-control-y-padding);
    padding-bottom: var(--yg-filter-control-y-padding);
}

.sort-direction-button {
    width: var(--yg-control-height);
}

.sort-control-group {
    grid-template-columns: minmax(0, 1fr) var(--yg-control-height);
}

.stats-subnav-right .stats-view-switcher {
    align-self: stretch;
}

.stats-view-switcher a {
    min-height: var(--yg-subnav-item-height);
}

@media (max-width: 991.98px) {
    .stats-subnav-right {
        flex-direction: row;
        align-items: stretch;
        gap: 1rem;
    }

    .stats-view-switcher {
        width: auto;
    }

}

@media (min-width: 768px) {
    .stats-subnav-row {
        align-items: stretch;
        flex-direction: row;
    }

    .stats-subnav-row .stats-mode-switcher {
        width: auto;
        max-width: 320px;
    }

    .stats-subnav-right {
        flex: 0 1 auto;
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-end;
        gap: 1.5rem;
        margin-left: auto;
    }

    .stats-subnav-right .stats-view-switcher {
        flex: 0 0 auto;
        width: auto;
    }
}

.server-card:hover,
.community-card:hover,
.command-card:hover,
.map-stat-card:hover {
    transform: translateY(-3px);
}

.leaderboard-row:hover,
.record-row:hover,
.favorite-map-row:hover {
    background: #f6f8fb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transform: translateX(2px);
}

.record-row,
.favorite-map-row {
    transition:
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.sort-direction-button:hover,
.sort-direction-button:focus-visible,
.stats-pagination a:hover,
.stats-pagination a.active,
.stats-pagination button:hover,
.stats-pagination button.active {
    transform: none;
}

@media (max-width: 575.98px) {
    .stats-view-switcher a {
        min-height: var(--yg-subnav-item-height);
    }

    .record-list.record-list-compact {
        grid-template-columns: 1fr;
    }
}

/* Final MOTD overrides. Keep these below the normal responsive grid rules. */
.home-server-section.is-motd {
    padding: 1rem 0 1.1rem;
}

.home-server-section.is-motd > .container {
    max-width: 780px;
}

.home-server-section.is-motd .server-grid.server-count-5,
.home-server-section.is-motd .server-grid {
    width: min(100%, 720px);
    margin-inline: auto;
    grid-template-columns: 1fr !important;
    gap: 0.52rem;
}

.home-server-section.is-motd .server-grid.server-count-5 > .server-grid-item,
.home-server-section.is-motd .server-grid.server-count-5 > .server-grid-item:nth-child(4),
.home-server-section.is-motd .server-grid.server-count-5 > .server-grid-item:last-child {
    width: 100% !important;
    justify-self: stretch !important;
    grid-column: 1 / -1 !important;
}

.home-server-section.is-motd .server-grid .server-card {
    width: 100%;
    grid-template-columns: 7rem minmax(0, 1fr) 12rem;
    gap: 0.65rem;
    padding: 0.58rem 0.7rem;
}

.home-server-section.is-motd .server-grid .server-card-header {
    align-items: flex-start;
}

.home-server-section.is-motd .server-grid .server-card-main {
    text-align: center;
}

.home-server-section.is-motd .server-grid .server-card h3 {
    font-size: 0.98rem;
}

.home-server-section.is-motd .server-grid .server-meta-grid {
    grid-template-columns: minmax(4.65rem, auto) minmax(0, 1fr);
}

.home-server-section.is-motd .discord-feed-grid {
    width: min(100%, 720px);
    margin: 1rem auto 0;
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.page-stats.is-motd .stats-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    body.page-stats.is-motd .summary-card {
        min-height: 106px;
        padding: 1.05rem 1rem;
    }

    body.page-stats.is-motd .summary-card > span,
    body.page-stats.is-motd .summary-card-head > span {
        font-size: 0.82rem;
    }

    body.page-stats.is-motd .summary-card strong {
        font-size: clamp(1.8rem, 3.4vw, 2.35rem);
        letter-spacing: -0.055em;
    }

    body.page-stats.is-motd .stats-summary-grid + .stats-main-grid {
        margin-top: 1rem !important;
    }

    body.page-stats.is-motd .stats-main-grid-rankings {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        margin-right: 0;
        margin-left: 0;
        --bs-gutter-x: 0;
        --bs-gutter-y: 0;
    }

    body.page-stats.is-motd .stats-main-grid-rankings > .col-xl-6 {
        width: auto;
        max-width: none;
        padding-right: 0;
        padding-left: 0;
    }

    body.page-stats.is-motd .stats-main-grid-rankings .stats-panel {
        padding: 1.25rem;
    }

    body.page-stats.is-motd .stats-main-grid-rankings .stats-panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }

    body.page-stats.is-motd .record-ranking-title {
        align-items: center;
        justify-content: space-between;
        gap: 0.55rem;
    }

    body.page-stats.is-motd .record-ranking-toggle a {
        min-height: 28px;
        padding: 0.32rem 0.5rem;
        font-size: 0.68rem;
    }

    body.page-stats.is-motd .stats-main-grid-rankings .stats-ranking-filter {
        width: 100%;
        align-self: stretch;
    }

    body.page-stats.is-motd .stats-main-grid-rankings .stats-style-filter {
        width: 100%;
        flex: 0 1 auto;
    }

    body.page-stats.is-motd .stats-main-grid-rankings .leaderboard-row {
        gap: 0.55rem;
        padding: 0.62rem 0.5rem;
    }

    body.page-stats.is-motd .stats-main-grid-rankings .leaderboard-points {
        padding: 0.36rem 0.5rem;
        font-size: 0.78rem;
    }

    body.page-stats.is-motd #recent-runs .table-responsive,
    body.page-stats.is-motd #player-recent-runs .table-responsive {
        overflow-x: hidden;
    }

    body.page-stats.is-motd #recent-runs .stats-table,
    body.page-stats.is-motd #player-recent-runs .stats-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    body.page-stats.is-motd #recent-runs .stats-table th,
    body.page-stats.is-motd #recent-runs .stats-table td,
    body.page-stats.is-motd #player-recent-runs .stats-table th,
    body.page-stats.is-motd #player-recent-runs .stats-table td {
        padding-right: 0.42rem;
        padding-left: 0.42rem;
        font-size: 0.76rem;
    }

    body.page-stats.is-motd #recent-runs .stats-table th:nth-child(1),
    body.page-stats.is-motd #recent-runs .stats-table td:nth-child(1),
    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(1),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(1) {
        width: 15%;
    }

    body.page-stats.is-motd #recent-runs .stats-table th:nth-child(2),
    body.page-stats.is-motd #recent-runs .stats-table td:nth-child(2),
    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(2),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(2) {
        width: 19%;
    }

    body.page-stats.is-motd #recent-runs .stats-table th:nth-child(3),
    body.page-stats.is-motd #recent-runs .stats-table td:nth-child(3),
    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(3),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(3) {
        width: 17%;
    }

    body.page-stats.is-motd #recent-runs .stats-table th:nth-child(4),
    body.page-stats.is-motd #recent-runs .stats-table td:nth-child(4),
    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(4),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(4) {
        width: 12%;
    }

    body.page-stats.is-motd #recent-runs .stats-table th:nth-child(5),
    body.page-stats.is-motd #recent-runs .stats-table td:nth-child(5),
    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(5),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(5) {
        width: 24%;
    }

    body.page-stats.is-motd #recent-runs .stats-table th:nth-child(6),
    body.page-stats.is-motd #recent-runs .stats-table td:nth-child(6),
    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(6),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(6) {
        width: 13%;
    }

    body.page-stats.is-motd #recent-runs .record-player-link strong,
    body.page-stats.is-motd #recent-runs .table-map-link,
    body.page-stats.is-motd #player-recent-runs .record-player-link strong,
    body.page-stats.is-motd #player-recent-runs .table-map-link {
        display: block;
        overflow: hidden;
        max-width: 100%;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.page-stats.is-motd #recent-runs .stats-table tbody td.run-category,
    body.page-stats.is-motd #player-recent-runs .stats-table tbody td.run-category {
        white-space: normal;
    }

    body.page-stats.is-motd #recent-runs .run-category .stats-badge,
    body.page-stats.is-motd #player-recent-runs .run-category .stats-badge {
        padding: 0.24rem 0.42rem;
        font-size: 0.64rem;
    }

    body.page-stats.is-motd #recent-runs .run-details,
    body.page-stats.is-motd #player-recent-runs .run-details {
        width: auto;
        max-width: none;
        color: #64748b !important;
        font-size: 0.68rem;
        line-height: 1.25;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
    }

    body.page-stats.is-motd #recent-runs .run-date-column,
    body.page-stats.is-motd #player-recent-runs .run-date-column {
        width: auto;
        max-width: none;
        font-size: 0.68rem;
        line-height: 1.3;
        white-space: normal;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.is-motd .page-hero.compact,
    body.is-motd .stats-hero {
        padding: 2.45rem 0 1rem;
    }

    body.is-motd .page-hero > .container,
    body.is-motd .stats-hero > .container,
    body.page-commands.is-motd .section-block > .container,
    body.page-stats.is-motd .stats-content > .container,
    body.page-stats.is-motd .player-profile-content > .container {
        max-width: 720px;
    }

    body.is-motd .page-hero h1,
    body.is-motd .stats-hero h1 {
        margin-bottom: 0.55rem;
        font-size: clamp(2.35rem, 5.2vw, 3.55rem);
        line-height: 0.95;
    }

    body.is-motd .page-hero p,
    body.is-motd .stats-hero p {
        max-width: 620px;
        font-size: 0.98rem;
        line-height: 1.55;
    }

    body.is-motd .section-block {
        padding-bottom: 1.15rem;
    }

    body.is-motd .site-footer {
        margin-top: 1.35rem;
        padding: 1.15rem 0;
    }

    body.is-motd .site-footer .container {
        max-width: 720px;
    }

    body.is-motd .footer-links {
        gap: 0.45rem 0.8rem;
    }

    body.is-motd .footer-links a,
    body.is-motd .site-footer small {
        font-size: 0.88rem;
    }

    body.page-commands.is-motd .command-toolbar {
        align-items: center;
        flex-direction: row;
        gap: 0.75rem;
        margin-bottom: 0.85rem;
    }

    body.page-commands.is-motd .command-tabs {
        flex: 0 0 auto;
        padding: 0.32rem;
        border-radius: 15px;
    }

    body.page-commands.is-motd .command-tab {
        min-width: var(--yg-mode-tab-width);
        min-height: 42px;
        padding: 0.55rem 0.95rem;
        border-radius: 11px;
        font-size: 0.84rem;
        line-height: 1.15;
    }

    body.page-commands.is-motd .command-search {
        width: 220px;
        align-self: center;
        margin-left: auto;
    }

    body.page-commands.is-motd .command-results-bar {
        margin-bottom: 0.8rem;
    }

    body.page-commands.is-motd .command-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    body.page-commands.is-motd .command-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.6rem;
        padding: 0.72rem;
        border-radius: 15px;
    }

    body.page-commands.is-motd .command-category {
        min-width: 3rem;
        padding: 0.32rem 0.45rem;
        font-size: 0.64rem;
    }

    body.page-commands.is-motd .copy-command {
        margin-bottom: 0.18rem;
        font-size: 0.84rem;
    }

    body.page-commands.is-motd .command-card p {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    body.page-commands.is-motd .command-actions {
        gap: 0.3rem;
    }

    body.page-commands.is-motd .command-copy-action,
    body.page-commands.is-motd .command-favorite-action {
        width: 2.1rem;
        height: 2.1rem;
        border-radius: 10px;
        font-size: 0.92rem;
    }

    body.page-stats.is-motd .stats-subnav-row {
        margin-bottom: 1rem;
    }

    body.page-stats.is-motd .stats-view-switcher,
    body.page-stats.is-motd .stats-mode-switcher {
        border-radius: 15px;
    }

    body.page-stats.is-motd .stats-view-switcher a,
    body.page-stats.is-motd .stats-mode-switcher a {
        min-height: 42px;
        padding: 0.55rem 0.95rem;
        border-radius: 11px;
        font-size: 0.84rem;
    }

    body.page-stats.is-motd .stats-panel,
    body.page-stats.is-motd .stats-map-list-panel {
        padding: 1.15rem;
        border-radius: 20px;
    }

    body.page-stats.is-motd .stats-panel-heading {
        gap: 0.8rem;
        margin-bottom: 0.9rem;
    }

    body.page-stats.is-motd .stats-panel-heading h2,
    body.page-stats.is-motd .map-heading h2 {
        font-size: 1.24rem;
    }

    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(1),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(1) {
        width: 24%;
    }

    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(2),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(2) {
        width: 20%;
    }

    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(3),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(3) {
        width: 14%;
    }

    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(4),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(4) {
        width: 27%;
    }

    body.page-stats.is-motd #player-recent-runs .stats-table th:nth-child(5),
    body.page-stats.is-motd #player-recent-runs .stats-table td:nth-child(5) {
        width: 15%;
    }

    body.page-stats.is-motd .record-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
    }

    body.page-stats.is-motd .record-row {
        gap: 0.5rem;
        padding: 0.62rem;
        border-radius: 13px;
    }

    body.page-stats.is-motd .record-map > span,
    body.page-stats.is-motd .record-meta-line > span {
        font-size: 0.62rem;
    }

    body.page-stats.is-motd .record-map-link {
        font-size: 0.84rem;
    }

    body.page-stats.is-motd .record-time strong {
        font-size: 0.82rem;
    }

    body.page-stats.is-motd .record-time small {
        font-size: 0.68rem;
    }

    body.page-stats.is-motd .stats-map-list-panel {
        margin-top: 1rem;
    }

    body.page-stats.is-motd .map-heading {
        gap: 0.75rem;
    }

    body.page-stats.is-motd .map-search {
        grid-template-columns:
            var(--yg-filter-control-width)
            var(--yg-filter-control-width)
            var(--yg-filter-control-width)
            var(--yg-filter-control-width)
            calc(var(--yg-filter-control-width) + 42px);
        gap: 0.45rem;
    }

    body.page-stats.is-motd .map-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
    }

    body.page-stats.is-motd .map-stat-card {
        padding: 0.78rem;
        border-radius: 15px;
    }

    body.page-stats.is-motd .map-card-top {
        margin-bottom: 0.62rem;
    }

    body.page-stats.is-motd .map-stat-card h3 {
        font-size: 0.88rem;
    }

    body.page-stats.is-motd .map-card-stats {
        gap: 0.42rem;
    }

    body.page-stats.is-motd .map-card-stats span {
        font-size: 0.62rem;
    }

    body.page-stats.is-motd .map-card-stats strong {
        font-size: 0.78rem;
    }

    body.page-stats.is-motd .player-profile-hero {
        padding-top: 2.45rem;
        padding-bottom: 0.9rem;
    }

    body.page-stats.is-motd .player-profile-identity {
        gap: 0.95rem;
    }

    body.page-stats.is-motd .player-profile-avatar {
        width: 82px;
        height: 82px;
        border-width: 4px;
        border-radius: 24px;
    }

    body.page-stats.is-motd .player-profile-text {
        min-height: 82px;
        padding-top: 0.05rem;
        padding-bottom: 0.08rem;
    }

    body.page-stats.is-motd .player-profile-identity h1 {
        margin: 0;
        font-size: clamp(2.2rem, 5vw, 3.45rem);
    }

    body.page-stats.is-motd .player-profile-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }

    body.page-stats.is-motd .player-profile-summary .summary-card {
        padding-right: 0.95rem;
        padding-left: 0.95rem;
    }

    body.page-stats.is-motd .player-profile-summary .summary-card-head {
        gap: 0.38rem;
    }

    body.page-stats.is-motd .player-profile-summary .summary-card-head > span {
        min-width: 0;
        font-size: 0.78rem;
        letter-spacing: 0.02em;
        white-space: nowrap;
    }

    body.page-stats.is-motd .player-profile-summary .summary-card small {
        flex: 0 0 auto;
    }

    body.page-stats.is-motd .player-profile-layout #player-server-records,
    body.page-stats.is-motd .player-profile-layout #player-recent-runs {
        margin-top: 1rem !important;
    }

    body.is-motd .map-details-modal {
        --map-modal-width: min(890px, calc(100vw - 2rem));
        --bs-modal-width: var(--map-modal-width);
    }

    body.is-motd .server-details-modal {
        --bs-modal-width: 460px;
    }

    body.is-motd .modal-dialog {
        margin-top: 0.6rem;
        margin-bottom: 0.6rem;
    }
}

@media (max-width: 767.98px) {
    .home-server-section.is-motd,
    body.page-stats.is-motd .player-profile-hero {
        padding-top: 2.45rem;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.is-motd {
        --yg-motd-content-width: min(1040px, calc(100vw - 32px));
    }

    .home-server-section.is-motd {
        padding-top: 2.45rem;
    }

    body.is-motd .page-hero > .container,
    body.is-motd .stats-hero > .container,
    body.is-motd .site-footer .container,
    body.page-commands.is-motd .section-block > .container,
    body.page-stats.is-motd .stats-content > .container,
    body.page-stats.is-motd .player-profile-content > .container,
    .home-server-section.is-motd > .container {
        max-width: var(--yg-motd-content-width);
    }

    .home-server-section.is-motd .server-grid.server-count-5,
    .home-server-section.is-motd .server-grid,
    .home-server-section.is-motd .discord-feed-grid {
        width: min(100%, var(--yg-motd-content-width));
    }

    .home-server-section.is-motd .server-grid.server-count-5,
    .home-server-section.is-motd .server-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 0.75rem;
    }

    .home-server-section.is-motd .server-grid.server-count-5 > .server-grid-item,
    .home-server-section.is-motd .server-grid.server-count-5 > .server-grid-item:nth-child(4),
    .home-server-section.is-motd .server-grid.server-count-5 > .server-grid-item:last-child {
        width: auto !important;
        justify-self: stretch !important;
        grid-column: auto !important;
    }

    .home-server-section.is-motd .server-grid .server-card {
        display: flex;
        min-height: 0;
        flex-direction: column;
        grid-template-columns: none;
        gap: 0;
        padding: 0.78rem;
        border-radius: 18px;
    }

    .home-server-section.is-motd .server-grid .server-card-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.45rem;
        margin-bottom: 0.72rem;
    }

    .home-server-section.is-motd .mode-pill,
    .home-server-section.is-motd .status-pill {
        padding: 0.28rem 0.48rem;
        font-size: 0.62rem;
    }

    .home-server-section.is-motd .server-grid .server-card-main {
        margin-bottom: 0.72rem;
        text-align: center;
    }

    .home-server-section.is-motd .server-grid .server-card h3 {
        font-size: 0.88rem;
        line-height: 1.25;
    }

    .home-server-section.is-motd .server-current-map {
        margin-top: 0.25rem;
        font-size: 0.7rem;
    }

    .home-server-section.is-motd .server-grid .server-meta-grid {
        grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
        gap: 0.38rem;
        margin-top: 0;
    }

    .home-server-section.is-motd .server-grid .server-meta-grid > div {
        min-height: 52px;
        padding: 0.46rem 0.5rem;
        border-radius: 12px;
    }

    .home-server-section.is-motd .server-grid .server-meta-grid > div:first-child,
    .home-server-section.is-motd .server-grid .server-meta-grid > div:last-child {
        align-items: flex-start;
        text-align: left;
    }

    .home-server-section.is-motd .server-grid .server-meta-grid span {
        font-size: 0.58rem;
    }

    .home-server-section.is-motd .server-grid .server-meta-grid strong {
        margin-top: 0.18rem;
        font-size: 0.68rem;
    }

    body.page-stats.is-motd .map-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.55rem;
    }

    body.page-stats.is-motd .map-stat-card {
        padding: 0.7rem;
    }

    body.page-stats.is-motd .map-card-title {
        gap: 0.42rem;
    }

    body.page-stats.is-motd .map-card-title .tier-pill {
        padding: 0.24rem 0.42rem;
        font-size: 0.62rem;
    }

    body.page-stats.is-motd .map-stat-card h3 {
        min-width: 0;
        font-size: 0.84rem;
    }

    body.page-stats.is-motd .map-search {
        grid-template-columns:
            var(--yg-filter-control-width)
            var(--yg-filter-control-width)
            var(--yg-filter-control-width)
            var(--yg-filter-control-width)
            calc(var(--yg-filter-control-width) + 42px);
    }

    body.page-stats.is-motd .record-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.page-stats.is-motd .record-list.record-list-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.page-stats.is-motd .stats-main-grid-records > .col-xl-6 {
        flex: 0 0 50%;
        width: 50%;
    }

    body.page-stats.is-motd .stats-main-grid-records .stats-panel-heading,
    body.page-stats.is-motd .player-profile-record-grid .stats-panel-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }

    body.page-stats.is-motd .stats-main-grid-records .stats-style-filter,
    body.page-stats.is-motd .player-profile-record-grid .player-record-filter {
        width: 100%;
        flex: 0 1 auto;
    }

    body.page-stats.is-motd .record-list-compact .record-map {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.page-stats.is-motd .record-list-compact .record-time {
        flex: 0 0 4.65rem;
        min-width: 4.65rem;
        max-width: 4.65rem;
    }

    body.page-stats.is-motd .record-list-compact .record-time strong,
    body.page-stats.is-motd .record-list-compact .record-time small {
        max-width: 100%;
    }

    body.page-stats.is-motd .player-profile-record-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        margin-top: 1rem;
    }

    body.page-stats.is-motd .run-details {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.25;
    }

    body.page-stats.is-motd .map-detail-table .run-details,
    body.page-stats.is-motd .map-detail-table .run-detail-text {
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    body.page-stats.is-motd .stats-main-grid-rankings {
        gap: 1rem;
    }

    body.page-commands.is-motd .command-search {
        width: 300px;
    }

    body.page-commands.is-motd .command-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.is-motd .map-details-modal {
        --map-modal-width: min(890px, calc(100vw - 2rem));
        --bs-modal-width: var(--map-modal-width);
    }

    body.is-motd .server-details-modal {
        --bs-modal-width: min(500px, calc(100vw - 2rem));
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    body.is-motd .site-navbar .navbar-layout {
        max-width: var(--yg-motd-content-width);
        min-height: 66px;
        flex-wrap: nowrap;
        align-items: center;
        gap: 1.05rem;
    }

    body.is-motd .navbar-socials {
        position: static;
        flex: 0 0 auto;
        gap: 0.34rem;
        transform: none;
    }

    body.is-motd .navbar-socials a,
    body.is-motd .navbar-socials img {
        width: 32px;
        height: 32px;
    }

    body.is-motd .navbar-brand {
        position: absolute;
        top: 50%;
        left: 50%;
        z-index: 2;
        margin: 0;
        font-size: 1.28rem;
        transform: translate(-50%, -50%);
    }

    body.is-motd .navbar-brand:hover,
    body.is-motd .navbar-brand:focus-visible,
    body.is-motd .navbar-brand:active {
        transform: translate(-50%, -50%) scale(1.06);
    }

    body.is-motd .site-navbar .navbar-toggler {
        display: none !important;
    }

    body.is-motd .site-navbar .navbar-collapse {
        display: flex !important;
        flex: 0 1 auto;
        flex-basis: auto;
        width: auto;
        margin-top: 0;
        margin-left: auto;
    }

    body.is-motd .site-navbar .navbar-nav {
        display: flex;
        flex-direction: row;
        align-items: center !important;
        gap: 0;
        padding-top: 0;
    }

    body.is-motd .site-navbar .navbar-nav .nav-item,
    body.is-motd .site-navbar .navbar-nav .nav-item:first-child,
    body.is-motd .site-navbar .navbar-nav .nav-item:last-child {
        grid-row: auto;
        grid-column: auto;
        min-width: 0;
        margin-left: 0 !important;
    }

    body.is-motd .site-navbar .nav-link {
        padding: 0.36rem 0.46rem;
        border-radius: 999px;
        font-size: 0.82rem;
        line-height: 1.2;
    }

    body.is-motd .language-switcher {
        gap: 0.12rem;
        margin-top: 0;
        margin-left: 0.24rem;
        padding: 0.17rem;
    }

    body.is-motd .language-link {
        min-width: 2rem;
        padding: 0.36rem 0.42rem;
        font-size: 0.72rem;
        line-height: 1;
    }
}

@media (max-width: 575.98px) {
    .home-server-section.is-motd .server-grid.server-count-5,
    .home-server-section.is-motd .server-grid,
    .home-server-section.is-motd .discord-feed-grid {
        width: 100%;
    }

    .home-server-section.is-motd .server-grid .server-card {
        grid-template-columns: 1fr;
    }

    .home-server-section.is-motd .server-grid .server-card-main {
        text-align: left;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
