/*
 * Responsive card grid - base structural styles only.
 * Actual grid-template-columns are emitted per-page via a scoped <style> block
 * with proper @media guards, so breakpoints are never overridden by inline styles.
 *
 * Default fallback breakpoints (used when the scoped block hasn't rendered yet):
 *   xs  < 600px     -> 2 columns
 *   sm  600-959px   -> 4 columns
 *   md  960-1599px  -> 6 columns
 *   lg  1600-1919px -> 8 columns
 *   xl  >= 1920px   -> 12 columns
 */

.card-responsive-grid {
    display: grid;
    gap: 0;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 600px) {
    .card-responsive-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 960px) {
    .card-responsive-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (min-width: 1600px) {
    .card-responsive-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

@media (min-width: 1920px) {
    .card-responsive-grid {
        grid-template-columns: repeat(12, 1fr);
    }
}


/* Players page */
.player-row {
    cursor: pointer;
    background: rgba(0,0,0,0.18) !important;
    border-radius: 8px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.player-row:hover {
    transform: translateY(-2px);
    background: rgba(0,0,0,0.3) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.player-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.player-card:hover {
    transform: translateY(-2px);
    background: rgba(0,0,0,0.3) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.player-card-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--mud-palette-primary-text);
    background: var(--mud-palette-primary);
}

.player-card-body {
    flex: 1;
    min-width: 0;
}

.player-card-name {
    font-weight: 600 !important;
    line-height: 1.3 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
}

.player-card-country {
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-card-chevron {
    opacity: 0.4;
    flex-shrink: 0;
}

.player-card:hover .player-card-chevron {
    opacity: 0.9;
}

.player-initial {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.25);
}

.deck-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.deck-toolbar .deck-toolbar-grouping {
    flex: 0 1 260px;
    min-width: 120px;
}

/* Deck page - mobile */
@media (max-width: 599.98px) {
    .deck-title {
        font-size: 1.35rem !important;
        line-height: 1.3 !important;
        word-break: break-word;
    }

    .deck-tabs .mud-tabs-scroll-button .mud-icon-button {
        padding: 4px;
    }

    .deck-tabs .mud-tabs-tabbar,
    .deck-tabs .mud-tabs-tabbar-inner,
    .deck-tabs .mud-tabs-tabbar-content,
    .deck-tabs .mud-tabs-tabbar-wrapper {
        min-height: 36px !important;
        height: 36px !important;
    }

    .deck-tabs .mud-tabs-tabbar .mud-tab {
        min-height: 36px !important;
        min-width: 0 !important;
        padding: 4px 10px !important;
        font-size: 0.72rem !important;
        letter-spacing: 0.02em;
    }

    .deck-toolbar .deck-toolbar-grouping {
        flex: 1 1 auto;
    }
}


/* Shared card popup layout */
    .popup-layout {
        display: flex;
        flex-direction: row;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .popup-image-column {
        flex: 0 0 380px;
        max-width: 380px;
    }

    .popup-info-column {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .popup-title {
        font-weight: 600;
    }

    .popup-nav-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.75rem;
        gap: 0.5rem;
    }

    .popup-nav-center {
        flex: 1 1 auto;
        min-width: 0;
    }

    .popup-nav-center .mud-input-control {
        margin-top: 0;
    }

    .edition-option {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .edition-thumb {
        width: 48px;
        aspect-ratio: 375 / 525;
        object-fit: cover;
        border-radius: 4.75% / 3.5%;
        flex: none;
    }

    .popup-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .popup-chip {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        padding: 0.25rem 0.6rem;
        border: 1px solid rgba(255, 255, 255, 0.15);
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.04);
        font-size: 0.95rem;
    }

    .popup-chip-subtle {
        border-color: transparent;
        background: rgba(255, 255, 255, 0.08);
    }

    .popup-chip-icon {
        width: 20px;
        height: 20px;
    }

    .popup-stats {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        gap: 0.5rem;
        padding: 0.5rem;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.05);
    }

    .popup-stat {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 60px;
    }

    .popup-stat-label {
        font-size: 0.8rem;
        opacity: 0.75;
    }

    .popup-stat-value {
        font-size: 1.6rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .popup-effect {
        line-height: 1.7;
    }

    .popup-edition-info {
        padding: 0.75rem;
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.05);
    }

    .popup-info-label {
        opacity: 0.7;
    }

    .effect-line {
        margin-top: 0.35em;
    }

    .effect-line:first-child {
        margin-top: 0;
    }

    .inline-icon {
        width: 18px;
        height: 18px;
        display: inline-block;
        vertical-align: baseline;
        margin: 0 2px;
        position: relative;
        top: 2px;
    }

    .effect__bubble {
        background: rgba(0, 0, 0, .8);
        border-radius: 10px;
        color: #fff;
        display: inline-block;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        margin: 0 2px;
        padding: 3px 6px;
        position: relative;
        vertical-align: baseline;
    }

    .effect__bubble--yellow {
        background: #e6d24b;
        box-shadow: 0 1px 1px 0 #9b9788;
        color: #000;
        font-size: 15px;
        padding: 2px 6px;
    }

    @media (max-width: 860px) {
        .popup-layout {
            flex-direction: column;
            align-items: stretch;
        }

        .popup-image-column {
            flex: none;
            max-width: 100%;
            width: 100%;
        }
    }


.card-overlay-paper .price-display-row { padding: 0.5rem 0; border-top: 1px solid rgba(255,255,255,0.1); }
.card-overlay-paper .price-link { text-decoration: none; }
.popup-extra { padding: 0.5rem; border-radius: 6px; background: rgba(255,255,255,0.05); }
