@font-face {
    font-family: "Minecraft Rus";
    src: url("../fonts/MinecraftRus.woff2") format("woff2"),
        url("../fonts/MinecraftRus.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.mc-font {
    font-family: "Minecraft Rus", "Minecraft Rus Regular", "Minecraft", monospace;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0;
    text-transform: none;
}

.top-clans-section {
    width: min(960px, 100%);
    margin-top: 28px;
}

.clans-panel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.clans-updated-label {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.clans-refresh-btn {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid rgba(104, 128, 255, 0.28);
    background: rgba(104, 128, 255, 0.12);
    color: #eef2ff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.clans-refresh-btn:hover {
    background: rgba(104, 128, 255, 0.2);
    border-color: rgba(104, 128, 255, 0.42);
}

.top-clans-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.4;
    color: #eef2ff;
}

.top-clans-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.top-clans-guild-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    image-rendering: pixelated;
    object-fit: cover;
}

.top-clans-guild-fallback {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-clans-guild-tag {
    margin-left: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.top-clans-card {
    overflow: hidden;
}

.top-clans-table {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.top-clans-head,
.top-clans-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 120px 96px;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.top-clans-head {
    padding: 0 14px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-clans-row {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s, border-color 0.15s;
}

.top-clans-row:hover {
    background: rgba(104, 128, 255, 0.08);
    border-color: rgba(104, 128, 255, 0.18);
}

.top-clans-rank {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.top-clans-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.4;
    color: #eef2ff;
}

.top-clans-name.mc-font {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-clans-score,
.top-clans-members {
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    color: #dce4ff;
}

.top-clans-members {
    color: var(--muted);
}

.tesla-clans-section .top-clans-head,
.tesla-clans-section .top-clans-row {
    grid-template-columns: 44px minmax(0, 1fr) 120px;
}

@media (max-width: 720px) {
    .top-clans-head {
        display: none;
    }

    .top-clans-row {
        grid-template-columns: 36px minmax(0, 1fr);
        grid-template-areas:
            "rank name"
            "rank score"
            "rank members";
        gap: 4px 10px;
        padding: 12px 14px;
    }

    .top-clans-rank {
        grid-area: rank;
    }

    .top-clans-name {
        grid-area: name;
    }

    .top-clans-score {
        grid-area: score;
        text-align: left;
        font-size: 12px;
        color: var(--muted);
    }

    .top-clans-score::before {
        content: "Очки: ";
        color: var(--muted);
        font-weight: 600;
    }

    .top-clans-members {
        grid-area: members;
        text-align: left;
        font-size: 12px;
    }

    .top-clans-members::before {
        content: "Участники: ";
        font-weight: 600;
    }

    .tesla-clans-section .top-clans-row {
        grid-template-areas:
            "rank name"
            "rank score";
    }
}

.tesla-clans-section {
    width: min(1200px, 100%);
}

.tesla-landing > p {
    margin-bottom: 12px;
}

.tesla-landing .tesla-search-switch {
    margin-top: 8px;
    margin-bottom: 16px;
    margin-inline: auto;
    display: inline-flex;
}

.tesla-landing .tesla-search-panels {
    margin-top: 0;
    text-align: left;
}

.tesla-search-stack {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.tesla-search-switch {
    display: inline-flex;
    gap: 8px;
    margin-top: 18px;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tesla-search-switch-btn {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.tesla-search-switch-btn:hover,
.tesla-search-switch-btn.is-active {
    background: rgba(104, 128, 255, 0.18);
    color: #eef2ff;
}

.tesla-search-panels {
    margin-top: 0;
}

.tesla-search-panel {
    padding: 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.tesla-search-panel.search-form {
    display: block;
    gap: 0;
}

.tesla-search-panel--player {
    border-color: rgba(104, 128, 255, 0.22);
}

.tesla-search-panel--clan {
    border-color: rgba(255, 210, 90, 0.22);
}

.tesla-search-panel[hidden] {
    display: none !important;
}

.tesla-search-btn {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tesla-search-btn--player {
    background: rgba(104, 128, 255, 0.18);
    border-color: rgba(104, 128, 255, 0.34);
    color: #eef2ff;
}

.tesla-search-btn--player:hover {
    background: rgba(104, 128, 255, 0.28);
}

.tesla-search-btn--clan {
    background: rgba(255, 190, 60, 0.14);
    border-color: rgba(255, 210, 90, 0.34);
    color: #fff6df;
}

.tesla-search-btn--clan:hover {
    background: rgba(255, 190, 60, 0.24);
}

.tesla-server-section,
.tesla-clan-details,
.tesla-clan-results {
    width: min(1200px, 100%);
    margin-top: 28px;
}

.search-form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.search-form-row {
    display: flex;
    gap: 10px;
}

.search-form-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.tesla-server-description {
    margin: 0 0 18px;
    color: #d8e0ff;
    line-height: 1.6;
}

.tesla-server-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.tesla-server-ip-box {
    width: 100%;
    max-width: none;
    border: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tesla-server-ip-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(54, 85, 212, 0.16);
}

.tesla-server-ip-box.is-copied {
    background: rgba(90, 210, 140, 0.12);
    box-shadow: 0 0 0 1px rgba(90, 210, 140, 0.28);
}

.tesla-server-ip {
    font-family: "Minecraft Rus", monospace;
    letter-spacing: 0.04em;
}

.tesla-server-ip-hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tesla-server-ip-box.is-copied .tesla-server-ip-hint {
    color: #9ef0c4;
}

.tesla-mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}

.tesla-mode-chip {
    padding: 18px 14px;
    border-radius: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #eef2ff;
    background: rgba(104, 128, 255, 0.08);
    border: 1px solid rgba(104, 128, 255, 0.12);
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tesla-mode-chip:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(104, 128, 255, 0.22);
    box-shadow: 0 14px 32px rgba(54, 85, 212, 0.2);
}

.tesla-mode-chip.is-active {
    box-shadow: 0 0 28px rgba(62, 207, 142, 0.22);
}

.tesla-mode-chip[data-mode="BEDWARS"] {
    background: rgba(104, 128, 255, 0.12);
    border-color: rgba(104, 128, 255, 0.16);
}

.tesla-mode-chip[data-mode="FAST_BEDWARS"] {
    background: rgba(255, 120, 90, 0.1);
    border-color: rgba(255, 140, 100, 0.16);
}

.tesla-mode-chip[data-mode="SKY_WARS"] {
    background: rgba(90, 210, 255, 0.1);
    border-color: rgba(90, 210, 255, 0.16);
}

.tesla-mode-chip[data-mode="HUNGER_GAMES"] {
    background: rgba(255, 190, 60, 0.1);
    border-color: rgba(255, 210, 90, 0.16);
}

.tesla-mode-chip[data-mode="CROCODILE"],
.tesla-mode-chip[data-mode="TNT_RUN"] {
    background: rgba(160, 120, 255, 0.1);
    border-color: rgba(160, 120, 255, 0.16);
}

.tesla-clan-match-list {
    display: grid;
    gap: 8px;
}

.tesla-clan-match-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 120px;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: inherit;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.tesla-clan-match-row:hover {
    background: rgba(104, 128, 255, 0.08);
    border-color: rgba(104, 128, 255, 0.18);
}

.tesla-clan-match-rank {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tesla-clan-match-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tesla-clan-match-score {
    text-align: right;
    font-weight: 700;
}

.tesla-clan-pyramid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    margin-top: 24px;
    padding-top: 8px;
    overflow: visible;
}

.tesla-clan-details .clan-card {
    overflow: visible;
}

.tesla-clan-leader-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tesla-clan-leader-card,
.tesla-clan-vice-card {
    display: block;
    line-height: 0;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.tesla-clan-leader-card:hover,
.tesla-clan-vice-card:hover,
.tesla-clan-leader-card.is-tip-active,
.tesla-clan-vice-card.is-tip-active {
    transform: translateY(-2px);
}

.tesla-clan-leader-card.is-tip-active,
.tesla-clan-vice-card.is-tip-active {
    filter: drop-shadow(0 10px 22px rgba(54, 85, 212, 0.22));
}

.tesla-clan-leader-avatar {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    border: 2px solid rgba(255, 210, 90, 0.45);
    background: rgba(255, 190, 60, 0.08);
    image-rendering: pixelated;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(255, 190, 60, 0.12);
}

.tesla-clan-vice-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    width: 100%;
}

.tesla-clan-vice-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 108px;
}

.tesla-clan-vice-avatar {
    width: 84px;
    height: 84px;
    border-radius: 16px;
    border: 2px solid rgba(104, 128, 255, 0.34);
    background: rgba(104, 128, 255, 0.08);
    image-rendering: pixelated;
    object-fit: cover;
}

.tesla-clan-slot-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 120px;
    text-align: center;
}

.tesla-clan-slot-meta--vice {
    max-width: 108px;
}

.tesla-clan-slot-nick {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-size: 14px;
    color: #eef2ff;
}

.tesla-clan-slot-meta--vice .tesla-clan-slot-nick {
    font-size: 12px;
}

.tesla-clan-slot-score {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.tesla-clan-members-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 88px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: visible;
}

.tesla-clan-member-tile {
    position: relative;
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tesla-clan-member-tile:hover,
.tesla-clan-member-tile.is-tip-active {
    transform: translateY(-3px) scale(1.05);
    border-color: rgba(104, 128, 255, 0.42);
    box-shadow: 0 10px 22px rgba(54, 85, 212, 0.22);
    z-index: 2;
}

.tesla-clan-member-tile img {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    object-fit: cover;
}

.tesla-clan-member-float {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1200;
    min-width: 180px;
    max-width: 280px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(15, 20, 38, 0.98);
    border: 1px solid rgba(104, 128, 255, 0.38);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.tesla-clan-member-float.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tesla-clan-float-nick {
    display: block;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #eef2ff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.tesla-clan-float-table {
    display: grid;
    gap: 6px;
}

.tesla-clan-float-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.tesla-clan-float-row span {
    flex-shrink: 0;
    color: #8b98c6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tesla-clan-float-row em {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #dce4ff;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

@media (max-width: 860px) {
    .tesla-server-meta {
        grid-template-columns: 1fr;
    }

    .search-form-row {
        flex-direction: column;
    }
}

.stats-card {
    overflow: visible;
}

.stat-box--clan-score-trigger {
    cursor: pointer;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-box--clan-score-trigger:hover,
.stat-box--clan-score-trigger:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(140, 160, 255, 0.42);
    box-shadow: 0 12px 28px rgba(54, 85, 212, 0.18);
    outline: none;
}

.stat-box-detail-hint {
    display: block;
    margin-top: 8px;
    color: rgba(188, 204, 255, 0.85);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.clan-score-popover {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.clan-score-popover[hidden] {
    display: none;
}

.clan-score-popover-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(4, 6, 14, 0.72);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.clan-score-popover-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: min(80dvh, 640px);
    overflow: auto;
    padding: 22px 22px 20px;
    border-radius: 20px;
    border: 1px solid rgba(140, 160, 255, 0.28);
    background:
        radial-gradient(circle at top, rgba(104, 128, 255, 0.14), transparent 58%),
        rgba(12, 16, 32, 0.98);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5);
}

.clan-score-popover-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: #eef2ff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.clan-score-popover-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.clan-score-popover-dialog h2 {
    margin: 0 28px 8px 0;
    font-size: 1.35rem;
}

.clan-score-popover-lead {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.clan-score-popover-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(104, 128, 255, 0.24);
    background: rgba(104, 128, 255, 0.1);
}

.clan-score-popover-total span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.clan-score-popover-total strong {
    color: #eef2ff;
    font-size: 1.5rem;
}

.clan-score-popover-section h3 {
    margin: 0 0 10px;
    color: #dce4ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.clan-score-popover-grid {
    display: grid;
    gap: 8px;
}

.clan-score-popover-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.clan-score-popover-row span {
    color: var(--muted);
    font-size: 13px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clan-score-popover-row strong {
    flex-shrink: 0;
    color: #eef2ff;
    font-size: 14px;
}

.clan-score-popover-empty {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

body.clan-score-popover-open {
    overflow: hidden;
}

@media (max-width: 560px) {
    .clan-score-popover {
        place-items: end center;
        padding: 0;
    }

    .clan-score-popover-dialog {
        width: 100%;
        max-height: min(88dvh, 720px);
        border-radius: 20px 20px 0 0;
    }
}
