/* ============================================
   News Roulette — Fixed Right Sidebar
   ============================================
   
   Фиксированный сайдбар справа:
   - Свернутое: 5 полосок (7px), отступ 25px
   - При наведении: раскрывается до 400×350px
   - Вертикальный барабан: карточки стопкой, выравнивание по правому краю
   - Карточки задвигаются под контент страницы
   - Полоски плавно перетекают в карточки (без подложки)
   - Скролл мышкой переключает новости вверх/вниз
   - Убрал курсор — сворачивается
   
   ============================================ */

/* ---------- Контейнер рулетки (фиксированный) ---------- */

.news-roulette-widget {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 100px;
    overflow: visible;
    cursor: pointer;
    user-select: none;
    z-index: 998;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-roulette-widget.expanded {
    right: 20px;
    width: 400px;
    height: 350px;
}

/* ---------- Свернутое состояние: полоски ---------- */

.news-roulette-bars {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 2;
}

.news-roulette-bar {
    width: 26px;
    height: 7px;
    background: var(--text-primary, #ffffff);
    border-radius: 4px;
    opacity: 0.6;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Полоски уходят при раскрытии рулетки */
.news-roulette-bars.hidden .news-roulette-bar {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Полоски возвращаются с растяжением при сворачивании */
.news-roulette-bars.hidden .news-roulette-bar:nth-child(1) {
    transform: translateX(-50px);
    transition-delay: 0s;
}

.news-roulette-bars.hidden .news-roulette-bar:nth-child(2) {
    transform: translateX(-45px);
    transition-delay: 0.05s;
}

.news-roulette-bars.hidden .news-roulette-bar:nth-child(3) {
    transform: translateX(-40px);
    transition-delay: 0.1s;
}

.news-roulette-bars.hidden .news-roulette-bar:nth-child(4) {
    transform: translateX(-45px);
    transition-delay: 0.15s;
}

.news-roulette-bars.hidden .news-roulette-bar:nth-child(5) {
    transform: translateX(-50px);
    transition-delay: 0.2s;
}

/* ---------- Развёрнутое состояние: карточки ---------- */

.news-roulette-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    visibility: hidden;
}

.news-roulette-content.visible {
    visibility: visible;
}

.news-roulette-items {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

/* Плавное появление каждой карточки */
.news-roulette-content .news-roulette-item {
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-roulette-content.visible .news-roulette-item[data-position="0"] {
    opacity: 1;
    transition-delay: 0s;
}

.news-roulette-content.visible .news-roulette-item[data-position="1"],
.news-roulette-content.visible .news-roulette-item[data-position="-1"] {
    opacity: 1;
    transition-delay: 0.05s;
}

.news-roulette-content.visible .news-roulette-item[data-position="2"],
.news-roulette-content.visible .news-roulette-item[data-position="-2"] {
    opacity: 1;
    transition-delay: 0.1s;
}

.news-roulette-content.visible .news-roulette-item[data-position="3"],
.news-roulette-content.visible .news-roulette-item[data-position="-3"] {
    opacity: 1;
    transition-delay: 0.15s;
}

.news-roulette-content.visible .news-roulette-item[data-position="4"],
.news-roulette-content.visible .news-roulette-item[data-position="-4"] {
    opacity: 1;
    transition-delay: 0.2s;
}

/* ---------- Скрытые элементы ---------- */

.news-roulette-nav,
.news-roulette-progress {
    display: none;
}

/* ---------- Лента карточек (вертикальный барабан) ---------- */

.news-roulette-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
}

/* ---------- Отдельная карточка ---------- */

.news-roulette-item {
    flex-shrink: 0;
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    position: relative;
    text-align: right;
    box-sizing: border-box;
}

.news-roulette-item[data-position="0"] {
    width: 100%;
    margin-left: -90px;
}

/* ---------- Эффект барабана: размеры карточек ---------- */

/* Центральная карточка (максимальная) */
.news-roulette-item[data-position="0"] {
    background: rgba(18, 23, 30, 0.65);
    border: none;
    border-radius: 20px 4px 4px 20px;
}

/* Карточки рядом с центром (выше/ниже) */
.news-roulette-item[data-position="1"],
.news-roulette-item[data-position="-1"] {
    opacity: 0.65;
    background: rgba(18, 23, 30, 0.4);
    border: none;
    border-radius: 16px 4px 4px 16px;
}

.news-roulette-item[data-position="2"],
.news-roulette-item[data-position="-2"] {
    opacity: 0.5;
    background: rgba(18, 23, 30, 0.2);
    border: none;
    border-radius: 12px 4px 4px 12px;
}

.news-roulette-item[data-position="3"],
.news-roulette-item[data-position="-3"] {
    opacity: 0.35;
    background: rgba(18, 23, 30, 0.1);
    border: none;
    border-radius: 8px 4px 4px 8px;
}

.news-roulette-item[data-position="4"],
.news-roulette-item[data-position="-4"] {
    opacity: 0.2;
    background: transparent;
    border: none;
    border-radius: 4px 4px 4px 4px;
}

/* ---------- Заголовок новости ---------- */

.news-roulette-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Уменьшение текста от центра */
.news-roulette-item[data-position="0"] .news-roulette-title {
    font-size: 1rem;
}

.news-roulette-item[data-position="1"] .news-roulette-title,
.news-roulette-item[data-position="-1"] .news-roulette-title {
    font-size: 0.92rem;
}

.news-roulette-item[data-position="2"] .news-roulette-title,
.news-roulette-item[data-position="-2"] .news-roulette-title {
    font-size: 0.84rem;
}

.news-roulette-item[data-position="3"] .news-roulette-title,
.news-roulette-item[data-position="-3"] .news-roulette-title {
    font-size: 0.76rem;
}

.news-roulette-item[data-position="4"] .news-roulette-title,
.news-roulette-item[data-position="-4"] .news-roulette-title {
    font-size: 0.5rem;
}

.news-roulette-item:hover .news-roulette-title {
    color: var(--accent-cyan, #2eabe1);
}



/* ---------- Адаптация ---------- */

@media (max-width: 1400px) {
    .news-roulette-widget {
        right: 10px;
        width: 350px;
        height: 300px;
    }
    
    .news-roulette-item {
        width: 340px;
    }
    
    .news-roulette-title {
        font-size: 0.88rem;
    }
}

@media (max-width: 1200px) {
    .news-roulette-widget {
        right: 5px;
        width: 300px;
        height: 260px;
    }
    
    .news-roulette-item {
        width: 290px;
    }
    
    .news-roulette-item[data-position="1"],
    .news-roulette-item[data-position="-1"] {
        transform: scale(0.92);
    }
    
    .news-roulette-title {
        font-size: 0.82rem;
    }
}

@media (max-width: 992px) {
    .news-roulette-widget {
        display: none;
    }
}
