/* Moduł: Widok Top 10 */

.top10-grid {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

/* Lewa Kolumna */
.top10-col-left {
    flex: 0 0 36%;
    display: grid;
    gap: 8px;
    grid-template-rows: repeat(3, var(--pillarH, 108px));
}

/* Prawa Kolumna */
.top10-col-right {
    flex: 1 1 auto;
    display: grid;
    gap: 8px;
    grid-template-rows: repeat(3, var(--rowH, 108px));
    grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 1fr);
    height: auto;
}

/* Karty */
.top10-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .12s ease, box-shadow .12s ease;
    cursor: pointer;
    /* F4.24: usunięto outline:none — focus klawiatury obsługuje globalny :focus-visible */
    height: 100%;
    border: 1px solid var(--card-border);
    color: var(--text-color);
}

.top10-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Układ Wewnętrzny */
.tile-inner {
    display: flex;
    align-items: center;
    height: 100%;
}

.tile-text {
    flex: 1 1 auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tile-photo {
    display: none !important;
}

/* Filary (Lewy) */
.pillar .tile-text {
    border-left: 5px solid var(--primary-color);
}

.pillar .tile-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
}

/* Lista Rankingowa (Prawa) */
.rank .tile-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

.tile-stat {
    font-size: 13px;
    color: var(--text-muted);
}

.tile-stat .label {
    text-transform: uppercase;
    letter-spacing: .3px;
    opacity: .85;
    margin-right: 6px;
}

.tile-val {
    font-weight: 800;
    color: var(--text-color);
}

/* Dekoracje */
/* Ikona przed tytułem */
.top10-grid .tile-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top10-grid .tile-header::before {
    content: "";
    width: 18px;
    height: 14px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'><rect x='5' y='12' width='30' height='12' rx='2' fill='%23006400'/><ellipse cx='20' cy='12' rx='15' ry='8' fill='%2300a050'/><rect x='18' y='5' width='4' height='5' rx='1' fill='%23006400'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

/* Diament Rankingu / Odznaka */
.top10-grid .rank-diamond {
    position: relative;
    width: 34px;
    height: 26px;
    margin-right: 8px;
    flex: 0 0 auto;
}

.top10-grid .rank-diamond::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 30'><rect x='5' y='12' width='30' height='12' rx='2' fill='%23006400'/><ellipse cx='20' cy='12' rx='15' ry='8' fill='%2300a050'/><rect x='18' y='5' width='4' height='5' rx='1' fill='%23006400'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.top10-grid .rank-diamond>span {
    position: absolute;
    right: -6px;
    top: -6px;
    width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: #fff;
    background: var(--primary-color);
}

/* Wstążki (odznaki) — F4.12 (2026-07-23): tło z tokena (w dark mode
   #4ade80 na białym miał kontrast ~1.9:1) */
.ribbon {
    background: var(--card-bg, #fff);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 3px 7px;
    font-weight: 800;
    color: var(--primary-color);
    font-size: 12px;
}

.ribbon.gold {
    background: #DAA520;
    border-color: #DAA520;
    color: #000;
}

.ribbon.silver {
    background: #C0C0C0;
    border-color: #C0C0C0;
    color: #000;
}

.ribbon.bronze {
    background: #CD7F32;
    border-color: #CD7F32;
    color: #000;
}

.flag-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    /* F4.12: token zamiast #e6ffe6 (accent-light = #e8f5e9 light / #1f2e1f dark) */
    background: var(--accent-light, #e6ffe6);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 11px;
    margin-left: 4px;
}

/* Pasek Filtrów */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 6px 0 14px 0;
}

.segmented {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--accent-border);
    border-radius: 999px;
    background: var(--card-bg);
}

.segmented button {
    border: 0;
    background: transparent;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-color);
    cursor: pointer;
}

.segmented button.active {
    background: var(--primary-color);
    color: #fff;
}

.filters-bar select {
    height: 32px;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid var(--accent-border);
    background: var(--card-bg);
    color: var(--text-color);
}

/* F4.9 (2026-07-23): 980→1024 (ujednolicenie breakpointów projektu) */
@media (max-width: 1024px) {
    .top10-grid {
        flex-direction: column;
    }
}

/* Stylizacja Suwaka / Nawigatora */
.gf-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--accent-border);
    box-shadow: var(--shadow-sm);
}

.gf-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.gf-btn:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.gf-current {
    font-weight: 700;
    font-size: 14px;
    /* F4.15: token — dark nadpisywany osobno na #fff, teraz jedno źródło */
    color: var(--text-color);
    min-width: 75px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.gf-range {
    width: 140px;
    cursor: pointer;
    accent-color: var(--primary-color);
    height: 4px;
    /* F4.15: token — tor suwaka podąża za motywem (dark = ciemny tor) */
    background: var(--input-border);
    border-radius: 2px;
    /* F4.24: outline:none usunięty — :focus-visible pokazuje obwódkę przy Tab */
}

/* Zapewnij prawidłowe wyrównanie pionowe w kontenerze flex */
.filters-bar .gf-nav {
    margin-left: 10px;
}