/* ===== SLOT 5x5 RC STYLES ===== */

.slot-game {
    --slot-layout-gap: 10px;
    --slot-controls-width: 224px;
    --slot-section-pad: 7px;
    --slot-section-gap: 8px;
    --slot-grid-gap: 3px;
    --slot-cabinet-pad: 8px;
    --slot-grid-pad: 4px;
    --slot-title-size: 15px;
    --slot-title-gap: 6px;
    --slot-cell-font: 27px;
    --slot-cell-font-compact: 31px;
    --slot-result-height: 52px;
    --slot-result-main-size: 17px;
    --slot-bottom-height: 162px;
    --slot-panel-gap: 6px;
    --slot-bill-width: 66px;
    --slot-bill-height: 26px;
    --slot-bill-btn: 24px;
    --slot-spin-pad: 10px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 100%;
    width: 100%;
    padding: 8px 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.game-area[data-game="slot"] {
    height: 100%;
    min-height: 100%;
    display: flex;
}

.game-area[data-game="slot"] > .slot-game {
    flex: 1 1 auto;
}

.slot-game.tight {
    --slot-layout-gap: 8px;
    --slot-controls-width: 204px;
    --slot-section-pad: 6px;
    --slot-section-gap: 6px;
    --slot-grid-gap: 2px;
    --slot-cabinet-pad: 7px;
    --slot-grid-pad: 3px;
    --slot-title-size: 14px;
    --slot-title-gap: 4px;
    --slot-cell-font: 24px;
    --slot-cell-font-compact: 28px;
    --slot-result-height: 46px;
    --slot-result-main-size: 15px;
    --slot-bottom-height: 160px;
    --slot-panel-gap: 5px;
    --slot-bill-width: 60px;
    --slot-bill-height: 24px;
    --slot-bill-btn: 20px;
    --slot-spin-pad: 8px;
}

.slot-game.ultra-tight {
    --slot-controls-width: 186px;
    --slot-section-pad: 5px;
    --slot-grid-gap: 2px;
    --slot-title-size: 13px;
    --slot-cell-font: 21px;
    --slot-cell-font-compact: 25px;
    --slot-result-height: 40px;
    --slot-result-main-size: 13px;
    --slot-bottom-height: 138px;
    --slot-bill-width: 54px;
    --slot-bill-height: 22px;
    --slot-bill-btn: 18px;
    --slot-spin-pad: 7px;
}

.slot-layout {
    display: flex;
    gap: var(--slot-layout-gap);
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.slot-controls {
    width: var(--slot-controls-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--slot-section-gap);
    min-height: 0;
    overflow: hidden;
}

.slot-section {
    background: var(--card-bg, rgba(20,14,8,0.92));
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.24);
    border-radius: 10px;
    padding: var(--slot-section-pad);
}

.slot-label {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.6px;
    color: var(--border-color, #b89b7a);
    margin-bottom: 6px;
}

.slot-bills {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 6px;
}

.slot-bill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.slot-bill-icon {
    width: var(--slot-bill-width);
    height: var(--slot-bill-height);
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.5);
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.slot-bill-icon:hover {
    border-color: var(--accent, #ffd700);
}

.slot-bill-ops {
    display: flex;
    gap: 4px;
}

.slot-bill-btn {
    width: var(--slot-bill-btn);
    height: var(--slot-bill-btn);
    border-radius: 6px;
    border: 1px solid;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
    background: #120d08;
}

.slot-bill-btn.plus { color: #fff; border-color: #1dcf5f; }
.slot-bill-btn.minus { color: #fff; border-color: #e05050; }

.slot-bet-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
}

.slot-bet-input {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.35);
    border-radius: 8px;
    color: var(--accent, #ffd700);
    font-size: 17px;
    font-weight: 900;
    text-align: center;
    padding: 6px 8px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.slot-dbl-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.35);
    background: rgba(0,0,0,0.35);
    color: var(--text-color, #e0d3b0);
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.slot-autoplay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.slot-mode-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.slot-mode-btn {
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.35);
    background: rgba(0,0,0,0.35);
    color: var(--text-color, #e0d3b0);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    padding: 6px 0;
    cursor: pointer;
}

.slot-mode-btn.active {
    border-color: rgba(255,215,0,0.55);
    color: #ffd700;
    background: rgba(255,215,0,0.12);
}

.slot-auto-toggle {
    width: 18px;
    height: 18px;
}

.slot-auto-label {
    font-size: 12px;
    color: var(--text-color, #e0d3b0);
}

.slot-spin-btn {
    width: 100%;
    padding: var(--slot-spin-pad);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--accent, #ffd700), #d08d00);
    color: #140b00;
    cursor: pointer;
}

.slot-spin-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.slot-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.slot-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.slot-stat-row.total {
    margin-top: 4px;
    border-top: 1px dashed rgba(var(--border-color-rgb,184,155,122),0.28);
    padding-top: 5px;
}

.slot-stat-val {
    font-weight: 800;
}

.slot-stat-val.pos { color: #4caf50; }
.slot-stat-val.neg { color: #e05050; }

.slot-reset-stats {
    margin-top: 6px;
    width: 100%;
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.35);
    background: rgba(0,0,0,0.35);
    color: var(--text-color, #e0d3b0);
    border-radius: 8px;
    padding: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.slot-paytable-title {
    color: var(--accent, #ffd700);
    font-size: 13px;
    letter-spacing: .8px;
    font-weight: 900;
    margin-bottom: 4px;
}

.slot-paytable-meta {
    font-size: 11px;
    color: var(--border-color, #b89b7a);
    line-height: 1.15;
    margin-bottom: 4px;
}

.slot-paytable-row {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 5px;
    align-items: center;
}

.slot-paytable-head {
    display: none;
    font-size: 10px;
    color: rgba(224,211,176,0.7);
    border-bottom: 1px solid rgba(var(--border-color-rgb,184,155,122),0.2);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

.slot-paytable-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 8px;
    overflow: hidden;
    max-height: none;
}

.slot-paytable {
    min-height: 0;
}

.slot-paytable-row {
    font-size: 12px;
    color: var(--text-color, #e0d3b0);
    padding: 1px 0;
}

.slot-pay-sym {
    font-size: 15px;
}

.slot-pay-hit {
    color: rgba(224,211,176,0.78);
    font-size: 11px;
}

.slot-pay-mult {
    justify-self: end;
    font-weight: 800;
}

.slot-machine {
    flex: 1;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--slot-section-gap);
    min-height: 0;
}

.slot-cabinet {
    background: linear-gradient(165deg, rgba(30,20,10,0.96), rgba(9,5,2,0.96));
    border: 2px solid rgba(var(--border-color-rgb,184,155,122),0.38);
    border-radius: 16px;
    padding: var(--slot-cabinet-pad);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.slot-cabinet.win-flash-small {
    animation: slotCabinetWin .38s ease-out;
}

.slot-cabinet.win-flash-medium {
    animation: slotCabinetWin .55s ease-out;
}

.slot-cabinet.win-flash-big {
    animation: slotCabinetBigWin .74s ease-out;
}

.slot-cabinet.win-flash-jackpot {
    animation: slotCabinetJackpot 1s cubic-bezier(0.19, 0.82, 0.22, 1);
}

.slot-title {
    text-align: center;
    color: var(--accent, #ffd700);
    font-weight: 900;
    letter-spacing: 1.4px;
    margin-bottom: var(--slot-title-gap);
    font-size: var(--slot-title-size);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-grid-wrap {
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.24);
    border-radius: 10px;
    padding: var(--slot-grid-pad);
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    contain: layout paint;
}

.slot-grid-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: radial-gradient(130% 85% at 50% 8%, rgba(255,215,120,0.07), rgba(255,215,120,0));
    z-index: 0;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--slot-grid-gap);
    height: 100%;
    position: relative;
    z-index: 1;
    --slot-rows: 5;
    --slot-gap: var(--slot-grid-gap);
}

.slot-grid.mode-3x1 {
    grid-template-columns: repeat(3, 1fr);
}

.slot-reel {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.14));
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.14);
    contain: content;
    backface-visibility: hidden;
}

.slot-reel::before,
.slot-reel::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 14%;
    pointer-events: none;
    z-index: 2;
}

.slot-reel::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.36), rgba(0,0,0,0));
}

.slot-reel::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.36), rgba(0,0,0,0));
}

.slot-reel.stop-hit {
    animation: slotReelStopHit .08s ease-out;
}

.slot-grid.spinning .slot-reel {
    box-shadow: inset 0 0 16px rgba(0,0,0,0.24);
}

.slot-reel-strip {
    display: grid;
    grid-auto-rows: calc((100% - (var(--slot-gap) * (var(--slot-rows) - 1))) / var(--slot-rows));
    gap: var(--slot-gap);
    height: 100%;
    will-change: transform;
    backface-visibility: hidden;
    transform: translate3d(0, 0, 0);
}

.slot-cell {
    min-height: 0;
    border-radius: 10px;
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.22);
    background:
        radial-gradient(120% 110% at 50% 4%, rgba(255,255,255,0.07), rgba(255,255,255,0) 45%),
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(0,0,0,0.22));
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: var(--slot-cell-font);
    text-shadow: 0 1px 1px rgba(0,0,0,0.5);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .2s ease;
    aspect-ratio: auto;
}

.slot-cell.compact {
    font-size: var(--slot-cell-font-compact);
}

.slot-cell.win {
    border-color: #ffd700;
    background:
        radial-gradient(140% 130% at 50% 6%, rgba(255,230,140,0.2), rgba(255,230,140,0) 48%),
        linear-gradient(180deg, rgba(255,216,102,0.12), rgba(0,0,0,0.22));
    box-shadow: inset 0 0 10px rgba(255,215,0,0.22), 0 0 7px rgba(255,215,0,0.2);
    transform: translateY(-1px) scale(1.018);
    animation: slotWinCellPulse .36s ease-out;
}

.slot-cell.win-strong {
    animation: slotWinStrong .52s ease-out;
}

.slot-cell.wild {
    box-shadow: inset 0 0 14px rgba(255,0,224,0.28);
}

.slot-grid.spinning .slot-cell { animation: none; }

.slot-lines-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 40;
    opacity: 0;
    transition: opacity .18s ease;
}

.slot-lines-layer.active {
    opacity: 1;
}

.slot-lines-layer.tier-small .slot-win-line { animation-duration: .42s; }
.slot-lines-layer.tier-medium .slot-win-line { animation-duration: .56s; }
.slot-lines-layer.tier-big .slot-win-line {
    animation-duration: .72s;
    filter: drop-shadow(0 0 7px rgba(255,215,0,0.52));
}
.slot-lines-layer.tier-jackpot .slot-win-line {
    animation-duration: .9s;
    filter: drop-shadow(0 0 9px rgba(255,215,0,0.65));
}

.slot-lines-layer.tier-jackpot .slot-win-node {
    animation-duration: .56s;
}

.slot-win-line {
    fill: none;
    stroke-width: 3.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(255,215,0,0.35));
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: slotLineReveal .42s ease-out forwards, slotLineGlow .9s ease-in-out infinite alternate;
}

.slot-win-line.row {
    stroke: #ffd54a;
}

.slot-win-line.col {
    stroke: #59e2ff;
}

.slot-win-line.mixed {
    stroke: #ffb86b;
}

.slot-win-line.scatter {
    stroke: #67ff9a;
    stroke-width: 3.1;
    stroke-dasharray: 7 6;
    filter: drop-shadow(0 0 4px rgba(86,255,150,0.45));
}

.slot-win-node {
    stroke-width: 1.2;
    transform-origin: center;
    opacity: 0;
    animation: slotNodePop .42s ease-out forwards;
}

.slot-win-node.row {
    fill: #ffe9a7;
    stroke: #ffd54a;
}

.slot-win-node.col {
    fill: #a6f0ff;
    stroke: #59e2ff;
}

.slot-win-node.mixed {
    fill: #ffd6a9;
    stroke: #ffb86b;
}

.slot-win-node.scatter {
    fill: #b8ffd4;
    stroke: #67ff9a;
}

.slot-result {
    text-align: center;
    min-height: var(--slot-result-height);
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 2px;
    padding-bottom: 2px;
    overflow: visible;
}

.slot-result-main {
    font-size: var(--slot-result-main-size);
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-color, #e0d3b0);
}

.slot-result-main.win { color: #4caf50; }
.slot-result-main.big-win { color: var(--accent, #ffd700); }
.slot-result-main.loss { color: #c58f7d; }
.slot-result-main.rolling { color: #b89b7a; }

.slot-result-sub {
    font-size: 11px;
    line-height: 1.2;
    color: var(--border-color, #b89b7a);
    margin-top: 1px;
    white-space: normal;
    overflow-wrap: anywhere;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slot-bottom-panels {
    display: flex;
    gap: 0;
    flex: 0 0 var(--slot-bottom-height);
    min-height: 0;
    height: var(--slot-bottom-height);
}

.slot-panel {
    border: 1px solid rgba(var(--border-color-rgb,184,155,122),0.2);
    border-radius: 12px;
    background: rgba(0,0,0,0.24);
    padding: 6px;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.slot-panel-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent, #ffd700);
    margin-bottom: 3px;
}



@keyframes slotCabinetWin {
    0% { box-shadow: 0 0 0 rgba(255,215,0,0); }
    35% { box-shadow: 0 0 22px rgba(255,215,0,0.18); }
    100% { box-shadow: 0 0 0 rgba(255,215,0,0); }
}

@keyframes slotCabinetBigWin {
    0% { box-shadow: 0 0 0 rgba(255,215,0,0); transform: translateY(0); }
    35% { box-shadow: 0 0 28px rgba(255,215,0,0.24); transform: translateY(-1px); }
    100% { box-shadow: 0 0 0 rgba(255,215,0,0); transform: translateY(0); }
}

@keyframes slotCabinetJackpot {
    0% { box-shadow: 0 0 0 rgba(255,215,0,0); transform: translateY(0) scale(1); }
    28% { box-shadow: 0 0 26px rgba(255,215,0,0.28); transform: translateY(-1px) scale(1.01); }
    58% { box-shadow: 0 0 36px rgba(255,215,120,0.33); transform: translateY(-1px) scale(1.015); }
    100% { box-shadow: 0 0 0 rgba(255,215,0,0); transform: translateY(0) scale(1); }
}

@keyframes slotWinCellPulse {
    0% { transform: translateY(-1px) scale(1.012); }
    50% { transform: translateY(-2px) scale(1.03); }
    100% { transform: translateY(-1px) scale(1.018); }
}

@keyframes slotWinStrong {
    0% { transform: translateY(-1px) scale(1.018); }
    45% { transform: translateY(-2px) scale(1.05); }
    100% { transform: translateY(-1px) scale(1.018); }
}

@keyframes slotReelStopHit {
    0% { transform: translateY(0); }
    40% { transform: translateY(0.5px); }
    100% { transform: translateY(0); }
}

@keyframes slotLineReveal {
    0% { stroke-dashoffset: 500; opacity: .2; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes slotLineGlow {
    0% { filter: drop-shadow(0 0 2px rgba(255,215,0,0.22)); }
    100% { filter: drop-shadow(0 0 7px rgba(255,215,0,0.48)); }
}

@keyframes slotNodePop {
    0% { transform: scale(0.35); opacity: 0; }
    65% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.slot-cabinet.reels-stop {
    animation: slotReelsSettled .28s ease-out;
}

@keyframes slotReelsSettled {
    0% { transform: translateY(0); }
    45% { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

@media (max-width: 920px) {
    .slot-game {
        --slot-bottom-height: 136px;
    }

    .slot-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .slot-controls {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        overflow: visible;
    }

    .slot-controls .slot-section:nth-of-type(1),
    .slot-controls .slot-section.slot-stats,
    .slot-spin-btn {
        grid-column: 1 / -1;
    }

    .slot-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 10px;
    }

    .slot-stat-row.total,
    .slot-reset-stats {
        grid-column: 1 / -1;
    }

    .slot-spin-btn {
        margin-top: 1px;
    }

    .slot-machine {
        min-height: 440px;
    }
}

@media (max-width: 700px) {
    .slot-game {
        padding: 6px;
    }

    .slot-layout {
        flex-direction: column;
        gap: 6px;
    }

    .slot-machine {
        order: 1;
        min-height: 320px;
    }

    .slot-controls {
        order: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        max-height: 40vh;
        overflow: auto;
        align-content: start;
    }

    .slot-controls .slot-section:nth-of-type(1),
    .slot-controls .slot-section.slot-stats,
    .slot-spin-btn {
        grid-column: 1 / -1;
    }

    .slot-section {
        padding: 6px;
    }

    .slot-label {
        margin-bottom: 4px;
        font-size: 11px;
    }

    .slot-bills {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .slot-bill-row {
        min-width: 0;
    }

    .slot-bottom-panels {
        display: none;
    }

    .slot-machine {
        min-height: 360px;
    }

    .slot-spin-btn {
        position: sticky;
        bottom: 0;
        z-index: 8;
        box-shadow: 0 -6px 10px rgba(0,0,0,0.35);
    }
}
