/* ============================================================================
   AUTOMAT (/vlct/games/slots)

   Oprawa idzie za menu z gry (ui_mp/scriptmenus/slot_machine.menu): zlota obudowa
   z rzedem zarowek, ciemne okno bebnow i te same siedem symboli. Kolory symboli sa
   przepisane z tintow w menu, wiec automat na stronie i w grze wygladaja tak samo.

   Cala motoryka krecenia siedzi tutaj. Serwer wysyla wynik raz, a przegladarka
   przesuwa tasme symboli - dzieki temu rytm nie zalezy od opoznienia lacza.
   ========================================================================= */

.vlct-cab {
    --vlct-gold: #f0c246;
    --vlct-gold-dim: #8c6a12;

    position: relative;
    border-radius: 1rem;
    padding: 0.9rem;
    background: linear-gradient(180deg, #6b4c0d 0%, #4a3208 55%, #2b1d04 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 226, 150, 0.55),
        inset 0 -2px 0 rgba(0, 0, 0, 0.6),
        0 18px 45px rgba(0, 0, 0, 0.45);
}

.vlct-cab--jackpot {
    animation: vlct-cab-jackpot 0.65s ease-in-out 4;
}

@keyframes vlct-cab-jackpot {
    50% {
        box-shadow: inset 0 1px 0 rgba(255, 226, 150, 0.55), 0 0 60px rgba(240, 194, 70, 0.75);
    }
}

/* --- Zarowki -------------------------------------------------------------- */

.vlct-cab__bulbs {
    display: flex;
    justify-content: space-between;
    padding: 0 0.6rem 0.55rem;
}

.vlct-cab__bulb {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--vlct-gold-dim);
    box-shadow: 0 0 4px rgba(240, 194, 70, 0.4);
}

.vlct-cab__bulb--chase {
    animation: vlct-bulb 1.2s linear infinite;
    animation-delay: calc(var(--vlct-bulb) * 70ms);
}

@keyframes vlct-bulb {
    0%, 70% {
        background: var(--vlct-gold-dim);
        box-shadow: 0 0 4px rgba(240, 194, 70, 0.4);
    }
    35% {
        background: var(--vlct-gold);
        box-shadow: 0 0 10px rgba(255, 226, 150, 0.95);
    }
}

/* --- Szyld ---------------------------------------------------------------- */

.vlct-cab__sign {
    text-align: center;
    line-height: 1;
    padding-bottom: 0.75rem;
}

.vlct-cab__sign-text {
    display: block;
    font-size: clamp(1rem, 4vw, 1.35rem);
    font-weight: 900;
    letter-spacing: 0.42em;
    /* Wciecie kompensuje odstep doklejony po ostatniej literze. */
    text-indent: 0.42em;
    color: var(--vlct-gold);
    text-shadow: 0 0 14px rgba(240, 194, 70, 0.55), 0 2px 0 rgba(0, 0, 0, 0.6);
}

.vlct-cab__sign-sub {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.55em;
    text-indent: 0.55em;
    color: rgba(240, 194, 70, 0.65);
}

/* --- Okno bebnow ---------------------------------------------------------- */

.vlct-cab__window {
    position: relative;
    border-radius: 0.6rem;
    padding: 0.5rem;
    background: linear-gradient(180deg, #02040c 0%, #060a16 100%);
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.95), inset 0 0 0 1px rgba(240, 194, 70, 0.28);
}

.vlct-reels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
}

/*
    Okno jednego bebna: dokladnie trzy pola wysokosci. Tasma w srodku jest znacznie
    dluzsza i jedzie pod spodem, a overflow przycina to, czego nie widac.
*/
.vlct-reel {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 3;
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.02);
}

/* Cien u gory i u dolu okna - bez niego symbole wjezdzaja plaska krawedzia. */
.vlct-reel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 0.4rem;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 18%,
        rgba(0, 0, 0, 0) 82%, rgba(0, 0, 0, 0.55) 100%);
}

.vlct-reel__strip {
    display: flex;
    flex-direction: column;
    will-change: transform;
}

/*
    Jazda tasmy. Bezier startuje szybko i konczy z lekkim przestrzeleniem - beben
    "siada", zamiast zatrzymywac sie w miejscu. Przestrzelenie ma co pokazac, bo za
    wynikiem jest jeszcze jeden symbol ogonowy.

    forwards zostawia tasme w pozycji koncowej po zakonczeniu animacji.
*/
.vlct-reel__strip--landing {
    animation: vlct-reel-drop var(--vlct-spin, 1150ms) cubic-bezier(0.22, 0.9, 0.2, 1.06)
        var(--vlct-delay, 0ms) both;
}

@keyframes vlct-reel-drop {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(calc(var(--vlct-shift, 0) * -1%));
    }
}

/* Rozmycie tylko na czas jazdy; znika razem z animacja. */
.vlct-reel__strip--landing .vlct-reel__cell {
    animation: vlct-reel-blur var(--vlct-spin, 1150ms) linear var(--vlct-delay, 0ms) both;
}

@keyframes vlct-reel-blur {
    0%, 70% {
        filter: blur(2.5px) brightness(1.2);
    }
    100% {
        filter: none;
    }
}

.vlct-reel__cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    flex: none;
    background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.3));
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.vlct-reel__cell--hit {
    box-shadow: inset 0 0 0 2px var(--vlct-gold), 0 0 18px rgba(240, 194, 70, 0.45);
    background: radial-gradient(circle at 50% 35%, rgba(240, 194, 70, 0.22), rgba(0, 0, 0, 0.35));
}

/* Dwa symbole z trzech - przygaszone zloto, wyraznie slabsze niz trafienie. */
.vlct-reel__cell--near {
    box-shadow: inset 0 0 0 1px rgba(240, 194, 70, 0.45);
    background: radial-gradient(circle at 50% 35%, rgba(240, 194, 70, 0.08), rgba(0, 0, 0, 0.3));
}

/* Wariant do tabeli wyplat: pojedyncze pole poza bebnem. */
.vlct-reel__cell--chip {
    width: 1.9rem;
    border-radius: 0.35rem;
    box-shadow: none;
}

/*
    Ikona symbolu. Grafike podaje zmienna --vlct-icon, wiec ten sam styl obsluguje
    oba warianty: kolorowa ilustracje jako tlo i ksztalt jako maske.
*/
.vlct-reel__icon {
    position: relative;
    width: 72%;
    height: 72%;
    background-image: var(--vlct-icon);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55));
}

/*
    Ksztalt bez wlasnych barw: grafika sluzy za maske, a kolor daje tint z menu modu.
    Bez tego biala ikona na ciemnym polu bylaby nie do odroznienia od pozostalych.
*/
.vlct-reel__icon--mask {
    background-image: none;
    mask-image: var(--vlct-icon);
    mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-image: var(--vlct-icon);
    -webkit-mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
}

/*
    Delikatna poswiata w kolorze symbolu. Daje polu barwna tozsamosc, ktora w grze
    niesie tint - ale nie dotyka samego rysunku.
*/
.vlct-reel__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at 50% 45%,
        color-mix(in srgb, var(--vlct-tint) 22%, transparent) 0%,
        transparent 68%);
}

.vlct-reel__fallback {
    font-size: 1.25rem;
    font-weight: 800;
    color: rgba(148, 163, 184, 0.7);
}

/* --- Linia wyplat --------------------------------------------------------- */

.vlct-reels__payline {
    position: absolute;
    inset: 0.5rem;
    pointer-events: none;
}

/* Kropka siada na srodku pola z trafionej linii. Wspolrzedne licza sie z tego samego
   ukladu siatki co bebny, wiec nie trzeba niczego mierzyc w pikselach. */
.vlct-reels__payline-dot {
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    margin: -0.25rem 0 0 -0.25rem;
    border-radius: 999px;
    background: var(--vlct-gold);
    box-shadow: 0 0 10px rgba(240, 194, 70, 0.9);
    left: calc((var(--vlct-col) + 0.5) * 20%);
    top: calc((var(--vlct-row) + 0.5) * 33.333%);
    animation: vlct-payline 1s ease-in-out infinite;
}

@keyframes vlct-payline {
    50% {
        transform: scale(1.6);
    }
}

/* --- Wyswietlacz ---------------------------------------------------------- */

.vlct-cab__display {
    margin-top: 0.7rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    min-height: 3.6rem;
    text-align: center;
    background: rgba(2, 4, 12, 0.85);
    box-shadow: inset 0 0 0 1px rgba(240, 194, 70, 0.22);
}

.vlct-cab__headline {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    font-weight: 900;
    letter-spacing: 0.2em;
    color: var(--vlct-gold);
    text-shadow: 0 0 18px rgba(240, 194, 70, 0.8);
    animation: vlct-headline 0.5s ease-in-out 3;
}

@keyframes vlct-headline {
    50% {
        transform: scale(1.07);
    }
}

.vlct-cab__win {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    font-weight: 900;
    color: #4ade80;
    text-shadow: 0 0 16px rgba(74, 222, 128, 0.55);
}

.vlct-cab__message {
    font-size: 0.8125rem;
    color: rgba(226, 232, 240, 0.6);
}

.vlct-cab__message--error {
    color: #f87171;
}

/* --- Pasek do wymuszonego trafienia --------------------------------------- */

.vlct-cab__pity {
    height: 0.3rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    overflow: hidden;
}

.vlct-cab__pity-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(240, 194, 70, 0.5), #f0c246);
    transition: width 0.3s ease;
}

/* --- Historia rund -------------------------------------------------------- */

.vlct-cab__pip {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.3);
}

.vlct-cab__pip--win {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

/* --- Schemat linii -------------------------------------------------------- */

.vlct-cab__linemap {
    display: grid;
    grid-template-columns: repeat(5, 0.35rem);
    gap: 0.15rem;
    padding: 0.35rem;
    border-radius: 0.35rem;
    background: rgba(2, 4, 12, 0.6);
}

.vlct-cab__linemap-dot {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 0.1rem;
    background: rgba(148, 163, 184, 0.2);
}

.vlct-cab__linemap-dot--on {
    background: var(--vlct-gold, #f0c246);
}

/* --- Sterowanie ----------------------------------------------------------- */

.vlct-cab__stake {
    min-width: 3.4rem;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.08);
    color: rgba(148, 163, 184, 0.9);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.vlct-cab__stake--active {
    border-color: #f0c246;
    background: rgba(240, 194, 70, 0.14);
    color: #f0c246;
}

.vlct-cab__stake:disabled {
    opacity: 0.3;
}

.vlct-cab__spin {
    min-width: 12rem;
    padding: 0.85rem;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #2b1d04;
    background: linear-gradient(180deg, #ffdf85 0%, #f0c246 45%, #c99a1e 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 18px rgba(240, 194, 70, 0.25);
    transition: filter 0.15s;
}

.vlct-cab__spin:hover:not(:disabled) {
    filter: brightness(1.08);
}

.vlct-cab__spin:disabled {
    opacity: 0.35;
    box-shadow: none;
}

.vlct-cab__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.8125rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(148, 163, 184, 0.08);
    color: rgba(148, 163, 184, 0.9);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.vlct-cab__toggle--on {
    border-color: #f0c246;
    background: rgba(240, 194, 70, 0.14);
    color: #f0c246;
}

/* --- Waski ekran ---------------------------------------------------------- */

@media (max-width: 480px) {
    .vlct-cab {
        padding: 0.6rem;
    }

    /* Przy pieciu kolumnach na telefonie pole ma okolo 55 px - ikona musi zajac wiecej,
       zeby symbol dalo sie rozpoznac. */
    .vlct-reel__icon {
        width: 82%;
        height: 82%;
    }

    .vlct-cab__bulb {
        width: 0.3rem;
        height: 0.3rem;
    }

    .vlct-cab__spin {
        min-width: 100%;
    }
}

/* --- Mniej ruchu ---------------------------------------------------------- */

/*
    Przy wlaczonej preferencji tasma nie jedzie, tylko od razu stoi w pozycji koncowej.
    Wynik pojawia sie natychmiast - zadna informacja nie ginie, znika sam ruch.
*/
@media (prefers-reduced-motion: reduce) {
    .vlct-reel__strip--landing {
        animation: none;
        transform: translateY(calc(var(--vlct-shift, 0) * -1%));
    }

    .vlct-reel__strip--landing .vlct-reel__cell,
    .vlct-cab__bulb--chase,
    .vlct-cab--jackpot,
    .vlct-cab__headline,
    .vlct-reels__payline-dot {
        animation: none;
    }
}

/* ==========================================================================
   WSPOLNY POKOJ
   Kilka automatow obok siebie: swoj sterowalny, cudze do ogladania.
   ========================================================================== */

.vlct-room__seat {
    position: relative;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid var(--color-line, #2a2a33);
    background: linear-gradient(180deg, #16161d 0%, #101016 100%);
}

/* Wlasne krzeslo ma byc rozpoznawalne bez czytania podpisu. */
.vlct-room__seat--me {
    border-color: rgba(255, 190, 60, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 190, 60, 0.12), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.vlct-room__seat-head,
.vlct-room__seat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.vlct-room__seat-head {
    margin-bottom: 0.5rem;
}

.vlct-room__seat-foot {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.vlct-room__state {
    flex-shrink: 0;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid transparent;
}

.vlct-room__state--playing {
    color: #7ee2a8;
    border-color: rgba(126, 226, 168, 0.35);
    background: rgba(126, 226, 168, 0.08);
}

.vlct-room__state--idle {
    color: #8a8a98;
    border-color: rgba(138, 138, 152, 0.3);
}

.vlct-room__state--onserver {
    color: #f0b95e;
    border-color: rgba(240, 185, 94, 0.35);
    background: rgba(240, 185, 94, 0.08);
}

/* --- Reakcje --- */

/*
    Emotka wyplywa nad automatem tego, kto ja wyslal, i gasnie sama. Element dostaje
    klucz rosnacy z kazda reakcja, wiec animacja odtwarza sie takze wtedy, gdy ktos
    wysle dwa razy to samo.
*/
.vlct-room__reaction {
    position: absolute;
    left: 50%;
    bottom: 2.5rem;
    font-size: 2rem;
    pointer-events: none;
    animation: vlct-room-float 2.2s ease-out forwards;
}

@keyframes vlct-room-float {
    0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
    15% { opacity: 1; transform: translate(-50%, -0.5rem) scale(1.15); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -5rem) scale(1); }
}

/* --- Odliczanie do wspolnego spinu --- */

.vlct-room__countdown {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: #ffd166;
    text-shadow: 0 0 18px rgba(255, 209, 102, 0.5);
    animation: vlct-room-tick 1s ease-out infinite;
}

@keyframes vlct-room-tick {
    0% { transform: scale(1.25); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* --- Wielka wygrana: nakladka u wszystkich w pokoju --- */

.vlct-room__celebration {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.85));
    animation: vlct-room-fade 0.25s ease-out;
}

.vlct-room__celebration-card {
    text-align: center;
    padding: 2rem 3rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 209, 102, 0.5);
    background: linear-gradient(180deg, rgba(40, 32, 10, 0.95), rgba(20, 16, 6, 0.95));
    box-shadow: 0 0 60px rgba(255, 190, 60, 0.35);
    animation: vlct-room-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.vlct-room__celebration-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #ffd166;
}

.vlct-room__celebration-name {
    margin-top: 0.35rem;
    font-size: 1rem;
    color: #e8e8ef;
}

.vlct-room__celebration-amount {
    margin-top: 0.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    color: #7ee2a8;
}

@keyframes vlct-room-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vlct-room-pop {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* --- Czat --- */

/*
    Odwrocona kolumna: pierwsze dziecko lezy na dole, a przewijanie samo trzyma sie konca.
    Dzieki temu nowa wiadomosc jest widoczna bez ani jednej linii JavaScriptu -
    strona rysuje liste od najnowszej.
*/
.vlct-room__chat {
    max-height: 11rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.15rem;
}

.vlct-room__emoji {
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 1.1rem;
    line-height: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-line, #2a2a33);
    transition: transform 0.1s ease, background 0.15s ease;
}

.vlct-room__emoji:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.09);
}

@media (prefers-reduced-motion: reduce) {
    .vlct-room__reaction,
    .vlct-room__countdown,
    .vlct-room__celebration,
    .vlct-room__celebration-card {
        animation: none;
    }
}
