/* ============================================================
   JG Toplist
   Breakpoints: desktop > 1141px, tablet <= 1141px, mobile <= 631px
   ============================================================ */

.jg-toplist { margin: 25px 0; }

.jg-toplist__title {
    font-size: 24px;
    line-height: 1.3;
    font-weight: 700;
    color: #1e2837;
    margin: 0 0 20px;
}

.jg-toplist__inner { position: relative; }

.jg-toplist__list { display: flex; flex-direction: column; gap: 0; }

.jg-toplist__card { position: relative; margin-bottom: 10px}
.jg-toplist__card + .jg-toplist__card { margin-top: 0; }
.jg-toplist__card--with-ribbon + .jg-toplist__card--with-ribbon { margin-top: 10px; }

/* Social badge tab */
.jg-toplist__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    min-height: 18px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: capitalize;
    border-radius: 5px 10px 0 0;
    overflow: hidden;
    width: fit-content;
}
.jg-toplist__badge svg { width: 14px; height: 14px; flex-shrink: 0; }

.jg-toplist__card-inner {
    display: block;
    background: #fff;
    border: 1px solid #c4daff;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(88,113,157,.16);
    overflow: hidden;
    position: relative;
}
.jg-toplist__card--with-ribbon .jg-toplist__card-inner {
    border: 2px solid #994e03;
    border-radius: 0 10px 10px 10px;
}

.jg-toplist__top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    position: relative;
}

.jg-toplist__left,
.jg-toplist__right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}
.jg-toplist__left  { flex: 0 0 51%; max-width: 51%; }
.jg-toplist__right { flex: 0 0 49%; max-width: 49%; }

/* Position badge (small yellow rounded square) */
.jg-toplist__position {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-left: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1e2837;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffd230 0%, #ffdf20 50%, #ffb900 100%);
}

/* Logo block */
.jg-toplist__logo {
    flex: 0 0 42%;
    max-width: 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    background: #fff;
}
.jg-toplist__logo img { max-height: 100px; max-width: 250px; width: 100%; height: auto; }
.jg-toplist__logo:hover { opacity: 1; }

/* Bonus block */
.jg-toplist__bonus {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
    margin: 20px;
    padding: 20px;
    text-align: center;
    color: #1e2837;
    text-decoration: none;
    background: linear-gradient(150deg, #ffd230 0%, #ffdf20 50%, #ffb900 100%);
    border: 2px dashed #994e03;
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow .25s ease;
}
.jg-toplist__bonus:hover {
    box-shadow: 0 2px 10px rgba(88,113,157,.25);
    text-decoration: none;
    color: #1e2837;
}

/* Decorative diamonds peeking out of the bonus block edges. The wrapper
   fills the bonus (inset:0), then each <svg> is positioned via its own
   inline `style` attribute (positions baked into the blade). Some have
   negative offsets so they overflow and get clipped by the bonus's
   `overflow:hidden`, producing the "peeking out" effect. */
.jg-toplist__bonus-decorations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.jg-toplist__bonus-text {
    display: block;
    position: relative;
    z-index: 1;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
}
.jg-toplist__bonus-exclusive { position: relative; z-index: 1; }
.jg-toplist__bonus--empty .jg-toplist__bonus-text { font-size: 18px; }
.jg-toplist__bonus-exclusive {
    display: inline-block;
    margin-bottom: 4px;
    padding: 2px 8px;
    background: #994e03;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
}

/* Rating column */
.jg-toplist__rating {
    flex: 0 0 38%;
    max-width: 38%;
    padding: 25px 10px;
    text-align: center;
}
.jg-toplist__review-link a,
.jg-toplist__review-link span {
    display: inline-block;
    margin-bottom: 10px;
    color: #314158;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    text-decoration: underline;
}
.jg-toplist__rating-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
}
.jg-toplist__rating-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: #1e2837;
}

/* Stars sprite (matches clf/jeux/ocrb pattern).
   The sprite is a 2-row image: filled stars on top, empty stars on bottom.
   .stars     shows the empty row via `left bottom`.
   .stars_in  overlays the filled row via `left top`, and starsNew() sets an
              inline `style="width: X%"` to mask how much is revealed.
   `display:flex` on .stars makes .stars_in a flex item so its width % is
   resolved against the 90px parent. No background-size — let the sprite
   render at its native dimensions. */
.jg-toplist__rating-stars { display: inline-block; vertical-align: middle; line-height: 0; }
.jg-toplist__rating-stars .stars {
    display: flex;
    width: 90px;
    height: 17px;
    background: #fff url('../img/commons/clf/home_stars_new.svg') left bottom repeat-x;
}
.jg-toplist__rating-stars .stars_in {
    width: 100%;
    height: 100%;
    background: url('../img/commons/clf/home_stars_new.svg') left top repeat-x;
}

/* CTA */
.jg-toplist__cta-wrap {
    flex: 1;
    padding: 20px 30px 20px 10px;
    text-align: center;
}
.jg-toplist__cta {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
    min-width: 200px;
    margin: 0 auto;
    padding: 20px 50px 20px 20px;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: 16px;
    background: linear-gradient(90deg, #452fdb 0%, #4f39f6 50%, #9213fa 100%);
    box-shadow: 0 10px 15px rgba(181,172,255,.5);
    overflow: hidden;
    transition: background .25s ease;
}
.jg-toplist__cta:hover {
    color: #fff;
    text-decoration: none;
    background: linear-gradient(90deg, #4f39f6 0%, #9213fa 50%, #452fdb 100%);
}
.jg-toplist__cta-text { flex: 1; }
.jg-toplist__cta-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 11px;
    height: 15px;
}

/* Terms / disclaimer */
.jg-toplist__terms {
    padding: 10px 16px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 400;
    color: #58719d;
    text-align: left;
}
.jg-toplist__terms p { margin: 0; }
.jg-toplist__terms:empty { display: none; }

/* -------- Tablet: <= 1141px -------- */
@media (max-width: 1141px) {
    .jg-toplist__left,
    .jg-toplist__right {
        flex: 0 0 50%;
        max-width: 50%;
        display: block;
        padding: 25px 20px;
        border-left: 1px solid #c4daff;
    }
    .jg-toplist__left { border-left: none; }

    .jg-toplist__position {
        position: absolute;
        top: 20px;
        left: 20px;
        margin: 0;
    }

    .jg-toplist__logo {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 0 20px;
    }
    .jg-toplist__logo img { max-width: 154px; max-height: 80px; }

    .jg-toplist__bonus {
        margin: 0;
        flex: 0 0 100%;
        max-width: 100%;
    }
    .jg-toplist__bonus-text { font-size: 18px; line-height: 1.5; }

    .jg-toplist__rating {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 0 0 20px;
    }
    .jg-toplist__rating-value { font-size: 20px; line-height: 1; }
    .jg-toplist__rating-block { flex-direction: row; gap: 10px; }

    .jg-toplist__cta-wrap { flex: 0 0 100%; max-width: 100%; padding: 0; }
}

/* -------- Mobile: <= 631px -------- */
@media (max-width: 631px) {
    .jg-toplist__left,
    .jg-toplist__right {
        flex: 0 0 100%;
        max-width: 100%;
        padding: 20px 16px 10px;
        border-left: none;
    }
    .jg-toplist__right { padding: 10px 20px 25px; }

    .jg-toplist__position { top: 16px; left: 16px; }

    .jg-toplist__cta {
        padding: 20px;
        min-width: unset;
        font-size: 16px;
    }
    .jg-toplist__cta-arrow { right: 16px; }
}
