/* ============================================================
   SLOTS.CSS – DEDYKOWANE STYLE I ANIMACJE DLA AUTOMATÓW
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(ellipse at 50% 20%, #1a1a2e, #06060c);
    color: #eee;
    font-family: 'Segoe UI', 'Poppins', Roboto, sans-serif;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-machine {
    max-width: 880px;
    width: 100%;
    padding: 28px;
    background: linear-gradient(160deg, #1c1c2e, #10101a);
    border-radius: 36px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border: 2px solid #2a2a44;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

/* Animacja całego automatu przy trafieniu Jackpota */
.slot-machine.jackpot-glow {
    animation: jackpotFlash 1s infinite alternate;
}

@keyframes jackpotFlash {
    0% {
        border-color: #f1c40f;
        box-shadow: 0 0 50px rgba(241, 196, 15, 0.6), inset 0 0 30px rgba(241, 196, 15, 0.4);
    }
    100% {
        border-color: #e74c3c;
        box-shadow: 0 0 80px rgba(231, 76, 60, 0.9), inset 0 0 50px rgba(231, 76, 60, 0.6);
    }
}

h1 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #d4af37 0%, #f7e68a 50%, #b8962e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- PANEL JACKPOTÓW ---------- */
.jackpot-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.jackpot-box {
    background: #151522;
    border: 1px solid #2a2a44;
    padding: 10px 6px;
    border-radius: 16px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #8899bb;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
}

.jackpot-box.hit-target {
    animation: jackpotBoxPulse 0.6s infinite alternate;
}

@keyframes jackpotBoxPulse {
    0% { transform: scale(1); border-color: #f1c40f; box-shadow: 0 0 10px #f1c40f; }
    100% { transform: scale(1.08); border-color: #ffffff; box-shadow: 0 0 25px #f1c40f; }
}

.jackpot-value {
    font-size: clamp(0.75rem, 2vw, 1.25rem) !important;
    font-weight: 900;
    color: #d4af37;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.5px;
    margin-top: 4px;
}

/* ---------- PANEL INFORMACYJNY ---------- */
.info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px;
    border: 1px solid #2a2a44;
    margin-bottom: 20px;
}

.info-panel .balance {
    font-size: 1.1rem;
    font-weight: 700;
}

.info-panel .balance span {
    color: #d4af37;
    font-size: 1.3rem;
}

.audio-btn, .lobby-btn {
    background: #2a2a44;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.audio-btn:hover, .lobby-btn:hover { filter: brightness(1.2); }
.lobby-btn { background: #8e44ad; }

/* ---------- SIATKA BĘBNÓW ---------- */
.reels-grid-5x3 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    background: #0d0d15;
    padding: 16px;
    border-radius: 24px;
    border: 2px solid #d4af37;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
    height: 270px;
    position: relative;
    overflow: hidden;
}

.reel-col {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.reel-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    top: 0; left: 0; width: 100%;
    will-change: transform;
}

/* Motion blur podczas szybkiego rolowania */
.reel-strip.rolling {
    animation: rollStrip 0.18s linear infinite;
}

@keyframes rollStrip {
    0% { transform: translateY(0); filter: blur(3px); }
    100% { transform: translateY(-330px); filter: blur(4px); }
}

/* Miękkie sprężynowanie (bounce) w momencie zatrzymania kolumny */
.reel-strip.bounce-stop {
    animation: reelBounceStop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes reelBounceStop {
    0% { transform: translateY(-12px); }
    70% { transform: translateY(6px); }
    100% { transform: translateY(0); }
}

.symbol-box {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #1c1c2a, #12121e);
    border-radius: 14px;
    font-size: 2.5rem;
    border: 1px solid #2a2a44;
    user-select: none;
    flex-shrink: 0;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Animacja podświetlania wygranych symboli na siatce */
.symbol-box.winning-symbol {
    animation: winSymbolPulse 0.5s infinite alternate ease-in-out;
    border-color: #f1c40f !important;
    box-shadow: inset 0 0 15px rgba(241, 196, 15, 0.8), 0 0 25px rgba(241, 196, 15, 0.9);
    z-index: 10;
}

@keyframes winSymbolPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.12); filter: brightness(1.4); }
}

/* ---------- CONTROLS ---------- */
.bet-control-container { margin: 16px 0; }
.bet-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}
.bet-control button {
    background: #1a1a2a;
    color: #d4af37;
    border: 1px solid #2a2a44;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 700;
    cursor: pointer;
}
.bet-control .bet-label {
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(0,0,0,0.3);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid #2a2a44;
}
.bet-control .bet-label span { color: #d4af37; }

.action-buttons-container { display: flex; gap: 12px; margin-top: 10px; }
.spin-btn {
    flex: 2;
    padding: 16px;
    border: none;
    border-radius: 18px;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(145deg, #d4af37, #b8962e);
    color: #111;
    transition: transform 0.1s, filter 0.2s;
}
.spin-btn:active { transform: scale(0.97); }
.spin-btn.auto-btn { flex: 1; background: #8e44ad; color: #fff; }

.autospin-controls {
    display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 10px; font-size: 0.9rem;
}
.autospin-controls select {
    background: #11111e; color: #fff; border: 1px solid #2a2a44; padding: 4px 8px; border-radius: 6px;
}

.message {
    margin-top: 14px; font-size: 1rem; text-align: center; padding: 10px;
    border-radius: 14px; background: rgba(255, 255, 255, 0.03); min-height: 2.8rem;
    display: flex; align-items: center; justify-content: center;
}
.message.win { color: #2ecc71; font-weight: 700; }
.message.lose { color: #ff6b6b; }
.message.info { color: #74b9ff; }