/* Блоки страниц: баннеры, поиск, вкладки, ряды и сетки игр, игра недели, выигрыши, провайдеры. */

/* ---------- прокручиваемые ленты со стрелками ---------- */

.scroller { position: relative; }
.scroller__track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.scroller__track::-webkit-scrollbar { display: none; }

.scroller__arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 48px;
    color: var(--text);
    transition: opacity .2s;
}
.scroller__arrow .icon {
    box-sizing: content-box;
    padding: 12px;
    border-radius: var(--r);
    background: var(--panel);
}
.scroller__arrow:hover .icon { background: var(--panel-2); }
.scroller__arrow--prev { left: 0; justify-content: start; background: linear-gradient(90deg, var(--bg) 40%, rgba(27, 14, 38, 0)); }
.scroller__arrow--next { right: 0; justify-content: end; background: linear-gradient(270deg, var(--bg) 40%, rgba(27, 14, 38, 0)); }
.scroller__arrow:disabled { opacity: 0; pointer-events: none; }
.scroller.is-static .scroller__arrow,
.scroller.is-static .arrows { display: none; }

/* ---------- баннеры ---------- */

.banners { position: relative; display: flow-root; }
/* Сверху запас на подъём баннера при наведении: дорожка прокручивается вбок и обрезала бы его. */
.banners__track {
    display: grid;
    grid-auto-columns: calc((100% - 16px) / 3);
    grid-auto-flow: column;
    gap: 8px;
    margin-top: -8px;
    padding-top: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.banners__track::-webkit-scrollbar { display: none; }

.banner {
    position: relative;
    display: block;
    height: 240px;
    overflow: hidden;
    border-radius: var(--r-xl);
    background: var(--panel);
    scroll-snap-align: start;
    transition: transform .15s cubic-bezier(.4, 0, 1, 1);
}
@media (hover: hover) and (pointer: fine) {
    .banner:hover { transform: translateY(-8px); transition-duration: .2s; transition-timing-function: cubic-bezier(.2, 0, 0, 1); }
}
.banner::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px var(--line);
    pointer-events: none;
}
.banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner__body {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    height: 100%;
    padding: 24px;
}
.banner__title {
    max-width: 62%;
    color: #fff;
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    line-height: 32px;
    letter-spacing: -1.2px;
}
.banner__btn {
    display: inline-flex;
    align-items: center;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--r);
    background: rgba(255, 255, 255, .2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    transition: background-color .2s;
}
.banner:hover .banner__btn { background: rgba(255, 255, 255, .3); }

.banners__dots {
    position: absolute;
    bottom: -8px;
    left: 50%;
    z-index: 2;
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, .01);
    border-radius: 8px;
    background: rgba(255, 255, 255, .05);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    transform: translateX(-50%);
}
.banners__dot { width: 5px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .32); transition: background-color .2s; }
.banners__dot.is-active { background: var(--text); }

/* Стрелки появляются, когда курсор над баннерами. */
.banners__arrow {
    position: absolute;
    top: 104px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #2e1c40;
    opacity: 0;
    transition: opacity .28s ease-in, background-color .2s;
}
.banners__arrow:hover { background: #3a2650; }
.banners__arrow--prev { left: -10px; }
.banners__arrow--next { right: -10px; }
.banners:hover .banners__arrow { opacity: 1; }

/* ---------- поиск и вкладки категорий ---------- */

.search-bar { display: flex; gap: 8px; margin-top: 32px; }
.search-bar__input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--r);
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
    transition: background-color .2s;
}
.search-bar__input:hover { background: var(--surface-hover); }
.search-bar__input .icon { width: 20px; height: 20px; }
.search-bar__providers {
    position: relative;
    height: 44px;
    padding: 12px 55px 12px 20px;
    border-radius: var(--r);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    transition: background-color .2s;
}
.search-bar__providers:hover { background: var(--surface-hover); }
.search-bar__providers img { position: absolute; top: -8px; right: -4px; width: 60px; height: 60px; transition: transform .3s; }
.search-bar__providers:hover img { transform: rotate(-10deg); }

.cat-tabs { margin-top: 16px; }
.cat-tabs__track { padding: 4px 0; }
.cat-tabs .icon { color: inherit; }

/* ---------- секции с играми ---------- */

.games-section { margin-top: 32px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 32px;
}
.section-head__actions { display: flex; align-items: center; gap: 16px; }
.section-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 600;
    line-height: 20px;
}
.section-title a:hover { color: #fff; }
.arrows { display: flex; gap: 4px; }

.games-row {
    display: grid;
    grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
    grid-auto-flow: column;
    gap: var(--gap);
    margin-top: 4px;
    padding: 12px 0 0;
    scroll-snap-type: x mandatory;
}
.games-row > * { scroll-snap-align: start; }

.games-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: var(--gap);
    margin-top: 16px;
}
.games-section > .games-grid:first-child { margin-top: 0; }

/* ---------- карточка игры ---------- */

.game-card {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--r-m);
    background: var(--surface);
    transition: transform .25s ease;
}
.game-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px var(--line);
    pointer-events: none;
}
.game-card__img { width: 100%; height: 100%; object-fit: cover; }
.game-card--skeleton { background: linear-gradient(100deg, var(--surface) 30%, rgba(188, 133, 255, .2) 50%, var(--surface) 70%) 0 0 / 200% 100%; animation: skeleton 1.2s linear infinite; }
@keyframes skeleton { to { background-position: -200% 0; } }
.game-card__hover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: rgba(27, 14, 38, .72);
    opacity: 0;
    transition: opacity .2s;
}
.game-card__play {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 8px 24px rgba(182, 51, 254, .45);
}
.game-card__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #fff;
    transform: translate(-50%, -50%);
}
.game-card__name { font-size: 13px; font-weight: 600; line-height: 16px; text-align: center; }

@media (hover: hover) and (pointer: fine) {
    .game-card:hover { transform: translateY(-4px); }
    .game-card:hover .game-card__hover { opacity: 1; }
}

.more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    aspect-ratio: 3 / 4;
    padding: 12px;
    border-radius: var(--r-m);
    background: var(--panel);
    text-align: center;
    transition: background-color .2s;
}
.more-card:hover { background: var(--panel-2); }
.more-card b { font-size: 16px; font-weight: 600; line-height: 22px; }
.more-card span { color: var(--muted); font-size: 14px; line-height: 20px; }

/* ---------- «Показать еще» ---------- */

.grid-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 24px; }
.grid-more__text { color: var(--muted); font-size: 14px; line-height: 20px; }
.grid-more__bar {
    width: 130px;
    height: 4px;
    overflow: hidden;
    border: 0;
    border-radius: 2px;
    background: var(--surface);
    -webkit-appearance: none;
    appearance: none;
}
.grid-more__bar::-webkit-progress-bar { background: var(--surface); }
.grid-more__bar::-webkit-progress-value { border-radius: 2px; background: var(--text); transition: width .3s; }
.grid-more__bar::-moz-progress-bar { border-radius: 2px; background: var(--text); }
.grid-more .btn { margin-top: 12px; }

/* ---------- лучшая игра недели ---------- */

.game-week {
    position: relative;
    height: 240px;
    margin-top: 64px;
    padding: 32px;
    border-radius: 32px;
    background: linear-gradient(0deg, #ca60ff 0%, #430d61 100%);
}
.game-week__content { position: relative; z-index: 5; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; width: 266px; height: 100%; }
.game-week__title { color: #fff; font-family: var(--font-head); font-size: 28px; font-weight: 700; line-height: 32px; }
.game-week__provider { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 14px; font-weight: 600; line-height: 20px; }
.game-week__provider img { width: 32px; height: 32px; }
.game-week__content .btn { margin-top: auto; height: 36px; padding: 0 16px; border-radius: var(--r-s); }

.game-week__art { position: absolute; top: -32px; right: 0; bottom: 0; width: calc(100% - 208px); pointer-events: none; }
.game-week__bg { position: absolute; inset: 32px 0 0; width: 100%; height: calc(100% - 32px); object-fit: cover; border-radius: 0 32px 32px 0; }
.game-week__decor { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; }
.game-week__podium { position: absolute; right: 133px; bottom: 0; z-index: 3; width: 248px; height: 52px; }
.game-week__card-bg { position: absolute; top: 12px; right: 169px; z-index: 4; width: 175px; height: 229px; }
.game-week__card {
    position: absolute;
    top: -11px;
    right: 176px;
    z-index: 5;
    width: 160px;
    height: 213px;
    overflow: hidden;
    border-radius: var(--r-m);
    transition: transform .25s;
}
.game-week__card img { width: 100%; height: 100%; object-fit: cover; }
.game-week__card:hover { transform: translateY(-4px); }

/* ---------- последние выигрыши ---------- */

.last-wins__list { display: flex; gap: 8px; margin-top: 12px; padding-bottom: 4px; overflow-x: auto; scrollbar-width: none; }
.last-wins__list::-webkit-scrollbar { display: none; }
.win {
    display: flex;
    flex: none;
    align-items: center;
    gap: 12px;
    width: 220px;
    padding: 12px;
    border-radius: var(--r-m);
    background: var(--panel);
    animation: win-in .5s ease both;
}
.win:nth-child(2) { animation-delay: .08s; }
.win:nth-child(3) { animation-delay: .16s; }
.win:nth-child(4) { animation-delay: .24s; }
.win:nth-child(5) { animation-delay: .32s; }
.win:nth-child(6) { animation-delay: .4s; }
.win__img { flex: none; width: 48px; height: 64px; border-radius: 8px; object-fit: cover; }
.win__info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.win__amount { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 999px; background: #05bd7d; color: #fff; font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.win__text { display: flex; flex-direction: column; max-width: 100%; }
.win__game, .win__user { overflow: hidden; font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.win__game { color: #fff; font-weight: 600; }
.win__user { color: var(--muted); }
@keyframes win-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- провайдеры ---------- */

.providers-row { margin-top: 12px; }
.provider-chip {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 88px;
    height: 77px;
    padding: 12px 16px;
    border-radius: var(--r-m);
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    transition: background-color .2s;
}
.provider-chip:hover { background: var(--surface-hover); }
.provider-chip img { width: auto; max-width: 64px; height: 24px; object-fit: contain; }
.games-section.scroller > .scroller__arrow { top: 44px; }

/* ---------- пустые страницы ---------- */

.empty-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 480px;
    margin: 0 auto;
    padding: 80px 0;
    text-align: center;
}
.empty-page__img { width: 96px; height: 96px; margin-bottom: 8px; border-radius: 24px; }
.empty-page__code { font-family: var(--font-head); font-size: 96px; font-weight: 800; line-height: 1; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.empty-page__title { font-family: var(--font-head); font-size: 28px; font-weight: 700; line-height: 34px; }
.empty-page__text { color: var(--muted); font-size: 15px; line-height: 22px; }
.empty-page .btn { margin-top: 12px; }

/* ---------- ширина экрана → сколько карточек в ряду ---------- */

@media (min-width: 1920px) { :root { --cols: 8; } }
@media (max-width: 1439px) { :root { --cols: 6; } }
@media (max-width: 1279px) { :root { --cols: 5; } }

@media (max-width: 1023px) {
    :root { --cols: 4; --gap: 8px; }

    .banners { margin: 0 calc(-1 * var(--pad)); }
    .banners__track { grid-auto-columns: 100%; padding: 0 var(--pad); scroll-padding: 0 var(--pad); }
    .banner { height: auto; aspect-ratio: 358 / 239; }
    .banners__arrow { display: none; }
    .banner__title { font-size: 24px; line-height: 28px; letter-spacing: -1px; }

    .search-bar { margin-top: 32px; }
    .cat-tabs { margin: 4px calc(-1 * var(--pad)) 0; }
    .cat-tabs__track { padding: 4px var(--pad); }
    .chip { height: 36px; padding: 0 12px; }
    .scroller__arrow { display: none; }

    .games-section { margin-top: 33px; }
    .arrows { display: none; }
    .games-row { margin: 0 calc(-1 * var(--pad)); padding: 12px var(--pad); scroll-padding: 0 var(--pad); }
    .providers-row, .last-wins__list { margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); }

    .game-week { height: 216px; margin-top: 48px; padding: 24px; }
    .game-week__content { width: 186px; }
    .game-week__title { font-size: 24px; line-height: 26px; }
    .game-week__art { top: 0; width: calc(100% - 114px); }
    .game-week__bg { inset: 0; height: 100%; }
    .game-week__decor { display: none; }
    .game-week__podium { right: -10px; width: 170px; height: 44px; }
    .game-week__card-bg { top: 37px; right: 19px; width: 114px; height: 149px; }
    .game-week__card { top: 43px; right: 24px; width: 104px; height: 139px; border-radius: 12px; }
}

/* Планшет: два баннера в ряд. */
@media (min-width: 600px) and (max-width: 1023px) {
    .banners__track { grid-auto-columns: calc((100% - 8px) / 2); }
}

@media (max-width: 599px) {
    :root { --cols: 3; }
    .search-bar__providers { padding-right: 56px; }
    .section-title { font-size: 18px; }
}

/* ---------- переход между категориями без перезагрузки ---------- */

.casino-view { transition: opacity .15s; }
.casino-view.is-pending { opacity: .55; }
.casino-view.is-entering { animation: casino-in .2s ease-out; }
@keyframes casino-in { from { opacity: .4; } }
