.main-container {
    max-width: 950px;
    margin: 20px auto;
    background: var(--surface-glass);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.main-header {
    text-align: center;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.01);
}

.main-header h1 {
    margin: 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 500;
}

.clan-row {
    border-bottom: 1px solid var(--border-light);
}

.clan-trigger {
    width: 100%;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.clan-trigger:hover {
    background: var(--surface-hover);
}

.clan-icon {
    width: 30px;
    height: 30px;
    margin: 5px 25px 5px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clan-info {
    flex-grow: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.clan-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.clan-id {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: monospace;
}

.clan-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 0.8rem;
}

.clan-checkbox {
    display: none;
}

.content-expander {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.clan-checkbox:checked+.clan-row .content-expander {
    grid-template-rows: 1fr;
}

.clan-checkbox:checked+.clan-row .clan-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.inner-content {
    min-height: 0;
}

.stats-container {
    padding: 0 28px 24px 28px;
}

.stats-table-wrapper {
    overflow: visible !important;
    margin-bottom: 16px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 600px;
}

.stats-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.60rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-light);
}

.stats-table th:nth-child(1) {
    width: 20px;
}

.stats-table td {
    padding: 10px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.stats-table tfoot td {
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    color: var(--text-muted);
}

.stats-table .nick-col {
    color: var(--text-primary);
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
    position: relative;
}

.nick-level {
    color: var(--text-muted);
    font-weight: 400;
}

.rank-num {
    color: var(--text-muted);
    width: 10px;
}

.val-cell {
    font-family: monospace;
}

.accent-val {
    color: var(--accent-color);
}

.clan-actions {
    display: flex;
    justify-content: flex-end;
}

.clan-actions-btn {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.clan-actions-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-light);
}

.user-hover-card {
    position: relative;
    display: inline-block;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color);
    transition: color 0.15s ease;
    padding: 6px 0;
}

.user-hover-card:hover {
    color: #fff;
}

.user-hover-card::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    width: calc(100% + 40px);
    height: 24px;
    background: transparent;
    pointer-events: auto;
    z-index: 999;
}

.hover-popup {
    position: absolute;
    top: calc(100%);
    left: 50%;
    transform: translateX(-50%) translateY(-6px) scale(0.95);
    z-index: 1000;
    min-width: 200px;
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-color: rgba(30, 41, 59, 0.96);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 6px 0;
    box-shadow: var(--shadow-heavy);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transform-origin: top center;
    pointer-events: none;
}

.user-hover-card:hover .hover-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
    pointer-events: auto;
}

.hover-popup-item {
    display: block;
    padding: 10px 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    white-space: nowrap;
    position: relative;
    z-index: 1001;
    border-radius: var(--border-radius);
    margin: 2px 6px;
    width: calc(100% - 12px);
}

.hover-popup-item:first-child {
    margin-top: 4px;
}

.hover-popup-item:last-child {
    margin-bottom: 4px;
}

.hover-popup-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.hover-popup-item:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(0.98);
}

.hover-popup-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 14px;
}

.hover-popup-item.copied {
    color: var(--success-color);
    pointer-events: none;
}

@media (pointer: coarse) {
    .user-hover-card::before {
        display: none;
    }

    .hover-popup {
        position: absolute;
        top: calc(100% + 8px);
        left: 55%;
        transform: translateX(-50%) translateY(-6px) scale(0.92);
        width: auto;
        min-width: 180px;
        max-width: 260px;
        background: rgba(30, 41, 59, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: var(--border-radius-lg);
        padding: 4px 0;
        box-shadow: var(--shadow-heavy);
        transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
        border: 1px solid var(--border-color);
    }

    .user-hover-card.active .hover-popup {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0) scale(1);
        pointer-events: auto;
        z-index: 1000;
    }

    .hover-popup-item {
        padding: 10px 14px;
        font-size: 0.8rem;
        margin: 1px 4px;
        width: calc(100% - 8px);
        border-radius: var(--border-radius);
    }

    .hover-popup-divider {
        margin: 2px 10px;
    }

    .hover-popup {
        min-width: 150px;
        max-width: 220px;
    }
}

@media (max-width: 600px) {
    .clan-trigger {
        padding: 12px 16px;
    }

    .clan-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .clan-name {
        font-size: 0.95rem;
    }

    .clan-id {
        font-size: 0.75rem;
    }

    .stats-container {
        padding: 0 10px 10px 10px;
    }

    .stats-table {
        table-layout: fixed;
        width: 100%;
        font-size: 0.72rem;
        min-width: 100% !important;
    }

    .stats-table th,
    .stats-table td {
        padding: 8px 4px;
    }

    .stats-table th:nth-child(1),
    .stats-table td:nth-child(1) {
        width: 8%;
        text-align: center;
    }

    .stats-table th:nth-child(2),
    .stats-table td:nth-child(2) {
        width: 34%;
    }

    .stats-table th:nth-child(3),
    .stats-table td:nth-child(3) {
        width: 20%;
        text-align: left;
    }

    .stats-table th:nth-child(4),
    .stats-table td:nth-child(4) {
        width: 18%;
        text-align: right;
    }

    .stats-table th:nth-child(5),
    .stats-table td:nth-child(5) {
        width: 20%;
        text-align: right;
    }

    .stats-table .nick-col {
        vertical-align: middle;
    }

    .stats-table .val-cell {
        text-align: right;
    }

    .clan-actions {
        padding-bottom: 10px;
        justify-content: center;
    }

    .clan-actions-btn {
        width: 100%;
        text-align: center;
    }

    .hover-popup {
        min-width: 140px;
        max-width: 200px;
    }

    .hover-popup-item {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}