/* Slider */
.center {
    width: 100%;
    min-width: 320px;
    max-width: 1264px;
    margin: 0 auto;
    position: relative;
}
.jcarousel-wrapper {
    padding: 5px 0;
    margin-bottom: 0px;
    position: relative;
    background-color: #f0f0f0;
}
.dt .jcarousel-wrapper {
    background-color: var(--ui-bg);
}
.jcarousel {
    position: relative;
    overflow: hidden;
    padding: 0px;
}
.jcarousel ul {
    width: 20000em;
    position: relative;
    list-style: none;
    padding: 0;
    margin-left: 10px;
}
.jcarousel li {
    float: left;
    width: 130px;
    margin-top: 10px;
    margin-right: 10px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(34,44,66,0.18);
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: posterFadeIn 0.7s cubic-bezier(.25,.46,.45,.94) forwards;
    transition: box-shadow 0.3s, transform 0.3s;
}
@keyframes posterFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.jcarousel li:last-child {
    margin-right: 0;
}
.jcarousel li:hover {
    box-shadow: 0 12px 40px #224cff55, 0 0 60px #00e67655;
    transform: translateY(-4px) scale(1.03);
}
.jcarousel img {
    width: 100%;
    height: 190px;
    display: block;
    transition:
        transform 0.35s cubic-bezier(.25,.46,.45,.94),
        filter 0.35s cubic-bezier(.25,.46,.45,.94);
    filter: contrast(1) saturate(1);
}
.jcarousel li:hover img {
    transform: scale(1.08) perspective(600px) rotateY(8deg);
    filter: contrast(1.2) saturate(1.3) brightness(1.05);
}

.jcarousel .jcarou-title {
    position: absolute;
    margin-top: -45px;
    padding: 10px;
    width: 145px;
    background-color: rgba(0,0,0,0.7) !important;
    color: #FFF !important;
    font-weight: 700 !important;
    text-shadow: 0 2px 8px #fff !important;
    white-space: nowrap;
    overflow: hidden;
    overflow-wrap: break-word;
    text-overflow: ellipsis;
}
.jcarou-title2 {
    position: absolute;
    margin-top: -190px;
    padding: 5px;
    background-color: rgba(0,0,0,0.3);
    color: #FFF;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    overflow-wrap: break-word;
    text-overflow: ellipsis;
    float: right;
    margin-right: 25px;
    text-shadow: none;
}
.jcarou-title3 {
    position: absolute;
    margin-top: -215px;
    padding: 5px;
    background-color: rgba(0,0,0,0.3);
    color: #FFF;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    overflow-wrap: break-word;
    text-overflow: ellipsis;
    float: right;
    text-shadow: none;
}

.jcarousel-control-prev,
.jcarousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #8bb911 !important; /* FIX: colore valido (prima era #8bb91) */
    background-image: none !important;
    color: #fff !important;
    font-size: 22px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    z-index: 9999;
    cursor: pointer;
    transition: background 0.3s ease;
    opacity: 1 !important;
}
.jcarousel-control-prev:hover,
.jcarousel-control-next:hover {
    background: #6fa36f !important;
    background-image: none !important;
}
.jcarousel-control-prev { left: 10px; }
.jcarousel-control-next { right: 10px; }
.jcarousel-control-prev.inactive,
.jcarousel-control-next.inactive {
    opacity: .3 !important;
    pointer-events: none;
}

.jcarousel li a{
    display: block;
}

.jcarousel li .episode-badge{
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    width: calc(100% - 12px);
    margin: 6px auto 0;
    padding: 3px 6px;

    font-weight: 900;
    font-size: 10px;
    line-height: 1.1;

    /* ALTEZZA STANDARD = 2 righe */
    min-height: calc(2 * 1.1em + 6px); /* 2 righe + padding verticale (3px sopra/sotto) */

    white-space: normal;
    word-break: break-word;

    border-radius: 999px;
    background: linear-gradient(180deg, #fff2b3 0%, #f3c84b 45%, #d39b13 100%);
    border: 1px solid rgba(0,0,0,0.45);
    color: rgba(0,0,0,0.85);

    text-shadow: 0 1px 0 rgba(255,255,255,0.35);
    box-shadow: 0 10px 22px rgba(0,0,0,0.35), inset 0 -2px 0 rgba(0,0,0,0.12);

    pointer-events: none;
    box-sizing: border-box;
}

.jcarousel li .episode-badge::after{
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.45), rgba(255,255,255,0) 55%);
    pointer-events: none;
}


/* Badge: più “premium” */
.jcarousel li .episode-badge{
  border-color: rgba(0,0,0,0.55);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.32),
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -2px 0 rgba(0,0,0,0.14);
}

/* Shine controllato (solo hover sul poster) */
.jcarousel li .episode-badge::before{
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 999px;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.55) 45%,
    rgba(255,255,255,0) 60%
  );
  transform: translateX(-140%);
  opacity: 0;
  pointer-events: none;
}

.jcarousel li:hover .episode-badge{
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.50),
    inset 0 -2px 0 rgba(0,0,0,0.14);
}

.jcarousel li:hover .episode-badge::before{
  opacity: 1;
  animation: badgeShine 650ms ease-out forwards;
}

@keyframes badgeShine{
  to { transform: translateX(140%); }
}