/* Popularno — tier lista po average_score, vidi popular_concepts.js. */

.popular-tier-section {
    margin: 0 40px 40px 40px;
}

/* ---- Poster placeholder ---- */
.pc-poster {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    display: block;
    background: #1a1a1a;
    text-decoration: none !important;
}

.pc-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-poster .pc-title {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    padding: clamp(6px, 1.5vw, 10px) clamp(6px, 1.2vw, 8px) 11px;
    color: #fff;
    font-size: clamp(0.68rem, 0.6rem + 0.3vw, 0.78rem);
    font-weight: 700;
    line-height: 1.25;
    /* Jedan red + ellipsis. -webkit-line-clamp (2 reda) se u praksi pokazao
       nepouzdan na uskim posterima (tier lista, ~80px) — treći red bi
       iscureo bez odsecanja uprkos overflow:hidden. white-space:nowrap +
       text-overflow:ellipsis je osnovni CSS, radi svuda bez izuzetka. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-poster::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.88), transparent 62%);
    z-index: 1;
    pointer-events: none;
}

.pc-rank-chip {
    position: absolute;
    top: clamp(6px, 1.2vw, 10px);
    left: clamp(6px, 1.2vw, 10px);
    z-index: 2;
    background: #991b1e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
}

/* ==================== TIER LISTA ==================== */
.tier-list { display: flex; flex-direction: column; gap: 12px; }

.tier-row {
    display: flex;
    border: 1px solid #262626;
    border-radius: 12px;
    overflow: hidden;
    background: #161617;
}

.tier-label {
    flex: 0 0 clamp(44px, 5vw, 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
}

.tier-row[data-tier="S"] .tier-label { background: #991b1e; }
.tier-row[data-tier="A"] .tier-label { background: #a8631f; }
.tier-row[data-tier="B"] .tier-label { background: #3d6b53; }

.tier-items {
    flex: 1;
    display: flex;
    gap: clamp(8px, 1.4vw, 12px);
    padding: clamp(8px, 1.4vw, 12px);
    overflow-x: auto;
    min-width: 0;
    cursor: grab;
    user-select: none;
    /* bez ovoga, drag na ivici trake "iscuri" u horizontalni scroll cele stranice na mobilnom,
       a touch-action mora dozvoliti i pan-y da vertikalni swipe (skrol stranice) ne prestane da radi */
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
}

.tier-items.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.tier-items .pc-poster { flex: 0 0 clamp(80px, 10vw, 120px); }

.tier-items .pc-poster img {
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
}
