/* «Главная» Fast Bag (js/ui/hub.js; редизайн 2026-10-18 по образцу Squidly, палитра наша).
   Сверху лента LIVE, потом большие баннеры главных игр (Фортуна, Дурак) и плитки быстрых игр в две колонки.
   У каждой игры свой цвет --g (styles/previews.css): им залита карточка поверх тёмно-зелёного фона, на ней играет
   живое превью. Экран — обычный раздел (видимость — styles/shell.css), а не слой поверх Фортуны. */

.games-hub { display: block; }

/* ── лента LIVE ──────────────────────────────────────────────────────── */
.home-live {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 calc(-1 * var(--pad-x)) 14px;
    padding: 0 0 0 var(--pad-x);
    height: 58px;
    overflow: hidden;
}
.home-live[hidden] { display: none; }
.wins-tag {
    flex: none;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    color: var(--accent-money);
}
.wins-tag::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-money);
    box-shadow: 0 0 10px var(--accent-money);
    animation: wins-dot 1.4s ease-in-out infinite;
}
@keyframes wins-dot { 50% { opacity: .3; } }
.wins-track {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 8px;
    padding-right: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 28px), transparent);
}
.wins-track::-webkit-scrollbar { display: none; }
/* Свежий выигрыш въезжает слева: раскрывается по ширине (соседи плавно отъезжают) и проявляется. */
.wins-chip.is-new { animation: wins-in .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes wins-in {
    from { max-width: 0; margin-right: -8px; padding-left: 0; padding-right: 0; opacity: 0; transform: translateX(-24px) scale(.9); }
    60% { opacity: 1; }
    to { max-width: 260px; margin-right: 0; opacity: 1; transform: none; }
}
.wins-chip.is-new::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: inset 0 0 0 1.5px var(--accent-money), inset 0 0 18px color-mix(in srgb, var(--accent-money) 40%, transparent);
    animation: wins-glow 1.8s ease-out both;
}
@keyframes wins-glow { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wins-chip.is-new, .wins-chip.is-new::after { animation: none; } }
.wins-chip {
    position: relative;
    overflow: hidden;
    flex: none;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 58px;
    padding: 0 12px 0 6px;
    border-radius: 16px;
    background: linear-gradient(160deg, color-mix(in srgb, var(--g) 40%, var(--ink-1)), var(--ink-1));
    border: 1px solid color-mix(in srgb, var(--g) 45%, transparent);
}
.wins-ico { flex: none; width: 40px; height: 40px; margin-left: 4px; display: grid; place-items: center; border-radius: 50%; background: var(--g); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--g) 60%, transparent); }
.wins-ico svg { width: 26px; height: 26px; }
.wins-txt { display: flex; flex-direction: column; line-height: 1.2; }
.wins-sum { font-size: 14px; font-weight: 800; color: var(--accent-money); }
.wins-who { font-size: 11px; color: var(--txt-2); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }

/* ── карточки ────────────────────────────────────────────────────────── */
.hub-mains { display: grid; gap: 12px; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 600px) { .hub-grid { grid-template-columns: repeat(3, 1fr); } }

.hub-sect {
    margin: 22px 2px 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--txt-2);
}

.hub-key {
    --g: var(--gold);
    position: relative;
    display: flex;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid color-mix(in srgb, var(--g) 55%, rgba(255, 255, 255, .08));
    background:
        radial-gradient(120% 90% at 85% 15%, color-mix(in srgb, var(--g) 70%, transparent), transparent 62%),
        linear-gradient(155deg, color-mix(in srgb, var(--g) 62%, var(--ink-1)) 0%, color-mix(in srgb, var(--g) 26%, var(--ink-1)) 60%, var(--ink-1) 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
    color: #fff;
    text-decoration: none;
    font: inherit;
    text-align: left;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .18s cubic-bezier(.3, .7, .2, 1), box-shadow .2s ease;
}
.hub-key:active { transform: scale(.965); }
.hub-key::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .10) 50%, transparent 60%);
    transform: translateX(-120%);
    animation: hub-shine 6s ease-in-out infinite;
}
.hub-key:nth-child(2n)::after { animation-delay: -3s; }
.hub-key.is-off::after { animation-play-state: paused; }
@keyframes hub-shine { 0%, 70% { transform: translateX(-120%); } 90%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .hub-key::after { animation: none; display: none; } }

.hub-scene { position: absolute; pointer-events: none; }
.hub-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hub-name { font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.hub-sub { color: rgba(255, 255, 255, .78); line-height: 1.25; }
.hub-live {
    align-self: flex-start;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
    background: var(--accent-money);
    box-shadow: 0 0 14px rgba(126, 207, 192, .45);
}
.hub-live[hidden] { display: none; }

/* Большой баннер: текст слева, сцена справа */
.hub-key-main { min-height: 148px; align-items: center; padding: 18px 20px; }
.hub-key-main .hub-scene { right: -6px; top: 50%; width: 58%; height: 132px; transform: translateY(-50%); }
.hub-key-main .hub-body { max-width: 52%; }
.hub-key-main .hub-name { font-size: 30px; letter-spacing: -.01em; line-height: 1.05; }
.hub-key-main .hub-sub { font-size: 14px; }
.hub-key-main[data-game="fastbag"] { min-height: 172px; }
.hub-key-main[data-game="fastbag"] .hub-scene { height: 160px; }
.hub-key-main[data-game="fastbag"]::before {
    content: 'ХИТ';
    position: absolute;
    top: 14px;
    left: 18px;
    z-index: 2;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    color: #B8801C;
    background: #FFF7E3;
}
html[lang="en"] .hub-key-main[data-game="fastbag"]::before { content: 'HOT'; }
.hub-key-main[data-game="fastbag"] .hub-body { padding-top: 22px; }

/* Плитка быстрой игры: сцена сверху, название снизу */
.hub-key-tile { flex-direction: column; justify-content: flex-end; min-height: 176px; padding: 12px 14px 14px; }
.hub-key-tile .hub-scene { left: 0; right: 0; top: 6px; height: 104px; }
.hub-key-tile .hub-name { font-size: 19px; line-height: 1.1; }
.hub-key-tile .hub-sub { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 359.98px) {
    .hub-key-main .hub-name { font-size: 25px; }
    .hub-key-tile { min-height: 158px; }
    .hub-key-tile .hub-scene { height: 90px; }
    .hub-key-tile .hub-name { font-size: 16px; }
}
