/* ===== МОБИЛЬНАЯ ВЕРСИЯ (PWA) ===== */
@media (max-width: 640px) {
    #comparePage {
        display: flex;
        flex-direction: column;
        flex: 1;
        padding: 8px 10px;
        height: 100dvh;
        height: 100svh;
        overflow: hidden;
        width: 100%;
        max-width: 100vw;
    }

    #comparePage .max-w-5xl {
        display: flex;
        flex-direction: column;
        height: 100%;
        justify-content: space-between;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    #comparePage .compare-header {
        flex-shrink: 0;
        margin-bottom: 0;
        width: 100%;
    }

    /* ===== КОЛЕСА ===== */
    #comparePage .wheels-row {
        margin: 0;
        flex-shrink: 0;
        margin-top: 10px;
        gap: 6px;
        align-items: center;
        width: 100%;
        max-width: 100%;
        justify-content: center;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        pointer-events: auto;
    }

    #comparePage .wheel-container {
        flex: 0 0 45%;
        max-width: 45%;
        min-width: 0;
        overflow: hidden;
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
    }

    #comparePage .wheel-picker {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
        padding: 90px 0;
        perspective: 800px;
        scroll-behavior: smooth;
        width: 100%;
        overflow-y: auto;
        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        overscroll-behavior: contain;
        background: transparent;
        touch-action: pan-y;
    }

    #comparePage .wheel-option {
        height: 40px;
        min-height: 40px;
        max-height: 40px;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.40);
        transition: color 0.15s ease, transform 0.15s ease;
        will-change: transform;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 4px;
        user-select: none;
        -webkit-user-select: none;
        pointer-events: none;
    }

    #comparePage .wheel-option.selected {
        font-size: 22px;
        font-weight: 500;
        color: #ffffff;
        white-space: normal;
        word-break: break-word;
        line-height: 1.2;
        text-align: center;
        padding: 0 6px;
        height: auto;
        min-height: 40px;
        max-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #comparePage .vs-badge {
        width: auto;
        height: auto;
        background: none;
        border: none;
        box-shadow: none;
        font-size: 2.5rem;
        font-weight: 900;
        font-style: italic;
        color: #c7d2fe;
        text-shadow:
                0 0 5px rgba(99, 102, 241, 0.8),
                0 0 10px rgba(129, 140, 248, 0.6),
                0 0 15px rgba(99, 102, 241, 0.4);
        flex-shrink: 0;
        letter-spacing: -1px;
        transform: skewX(-5deg);
    }

    /* ===== КАРТОЧКИ ===== */
    #comparePage .cards-row {
        margin: 0 auto;
        flex-shrink: 0;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 70px);
        gap: 8px;
        width: 95%;
        max-width: 100%;
        justify-content: center;
        align-items: center;
    }

    #comparePage .result-card {
        flex: 0 0 42%;
        max-width: 55%;
        min-width: 0;
        padding: 12px 6px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: rgba(255, 255, 255, 0.02);
        overflow: hidden;
        height: 240px;
        min-height: 240px;
        max-height: 240px;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }

    #comparePage .result-card .player-name {
        font-size: 0.8rem;
        margin-bottom: 2px;
        white-space: normal;
        word-break: break-word;
        overflow: hidden;
        text-align: center;
        line-height: 1.2;
        height: 34px;
        min-height: 34px;
        max-height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #comparePage .result-card .player-league {
        font-size: 0.55rem;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    #comparePage .player-league-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        margin-bottom: 4px;
    }

    #comparePage .player-league-icon {
        font-size: 0.6rem;
    }

    #comparePage .stat-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.55rem;
        margin-bottom: 4px;
        gap: 4px;
    }

    #comparePage .stat-label {
        font-size: 0.55rem;
        color: #a1a1aa;
        white-space: nowrap;
    }

    #comparePage .stat-value {
        font-size: 0.55rem;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        text-align: right;
    }

    /* ===== ПРОГРЕСС-БАРЫ ===== */
    #comparePage .stat-bar-row {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-bottom: 4px;
        width: 100%;
    }

    #comparePage .stat-bar-row .stat-label {
        flex: 0 0 auto;
        font-size: 0.55rem;
        color: #a1a1aa;
        white-space: nowrap;
        text-align: left;
    }

    #comparePage .stat-bar {
        flex: 1;
        height: 5px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
        overflow: hidden;
        min-width: 0;
    }

    #comparePage .stat-bar-fill {
        height: 100%;
        background: linear-gradient(90deg, #6366f1, #4f46e5);
        border-radius: 3px;
        transition: width 0.3s ease;
    }

    #comparePage .stat-bar-row .stat-value {
        flex: 0 0 auto;
        font-size: 0.55rem;
        font-weight: 600;
        color: #fff;
        white-space: nowrap;
        text-align: right;
    }
}
/* ===== МОБИЛЬНАЯ ТАБЛИЦА H2H ===== */

/* ===== МОБИЛЬНАЯ ТАБЛИЦА H2H ===== */

/* ===== МОБИЛЬНАЯ ТАБЛИЦА H2H ===== */

@media (max-width: 640px) {
    .h2h-stage-header {
        display: grid;
        grid-template-columns: 1fr 60px 60px 60px 60px;
        align-items: center;
        gap: 8px;
        padding: 0 0 10px;
        margin-bottom: 6px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .h2h-stage-row {
        display: grid;
        grid-template-columns: 1fr 60px 60px 60px 60px;
        align-items: center;
        gap: 8px;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .h2h-header-stage {
        font-size: 0.65rem;
        text-align: left;
    }

    .h2h-header-col {
        font-size: 0.6rem;
        text-align: center;
        letter-spacing: 0;
    }

    .h2h-stage-label {
        font-size: 0.85rem;
        text-align: left;
    }

    .h2h-stage-col {
        font-size: 0.85rem;
        text-align: center;
    }

    .h2h-diff {
        font-size: 0.85rem;
        text-align: center;
    }
}