/* ================================================================
   RoboSlots – Slot Machine Styles
   Uses LuckyLobby theme CSS variables
   ================================================================ */

/* ── Layout ────────────────────────────────────────────────────── */

.roboslots-wrapper {
    display: flex;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
    font-family: var(--font-body);
    color: var(--text);
    position: relative;
}

.roboslots-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.roboslots-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* ── Sidebar panels ───────────────────────────────────────────── */

.sidebar-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.panel-label {
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.balance-value {
    font-family: var(--font-head);
    font-size: 22px;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.free-spins-panel {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(212,168,83,0.08), transparent);
}

.free-spins-value {
    font-family: var(--font-head);
    font-size: 28px;
    color: var(--accent);
    text-align: center;
}

.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
}

.history-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(42,42,62,0.5);
    font-size: 13px;
}

.history-list li:last-child {
    border-bottom: none;
}

.history-empty {
    color: var(--text-muted);
    font-style: italic;
    justify-content: center !important;
}

.history-bet {
    color: var(--text-muted);
}

.history-payout {
    font-family: var(--font-head);
    font-size: 12px;
}

.history-payout.win {
    color: var(--success);
}

.history-payout.loss {
    color: var(--danger);
}

.history-payout.free {
    color: var(--accent);
}

.paytable-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.25s;
}

.paytable-toggle-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.paytable-toggle-btn.open svg {
    transform: rotate(180deg);
}

/* ── Slot machine frame ───────────────────────────────────────── */

.slot-machine {
    width: 100%;
    max-width: 680px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    box-shadow:
        0 0 40px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.03);
}

.machine-header {
    text-align: center;
    margin-bottom: 16px;
}

.machine-title {
    font-family: var(--font-head);
    font-size: 32px;
    margin: 0;
    letter-spacing: 4px;
    color: var(--text);
}

.machine-title .accent {
    color: var(--accent);
    text-shadow: 0 0 30px var(--accent-glow);
}

.machine-subtitle {
    font-family: var(--font-head);
    font-size: 10px;
    letter-spacing: 6px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Win display ──────────────────────────────────────────────── */

.win-display {
    text-align: center;
    padding: 12px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(212,168,83,0.15), rgba(212,168,83,0.05));
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    animation: win-pulse 1.5s ease-in-out infinite;
}

@keyframes win-pulse {
    0%, 100% { box-shadow: 0 0 10px var(--accent-glow); }
    50% { box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(212,168,83,0.15); }
}

.win-label {
    font-family: var(--font-head);
    font-size: 12px;
    letter-spacing: 3px;
    color: var(--accent);
}

.win-amount {
    font-family: var(--font-head);
    font-size: 36px;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

/* ── Free spin banner ─────────────────────────────────────────── */

.free-spin-banner {
    text-align: center;
    padding: 8px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, transparent, rgba(212,168,83,0.2), transparent);
    border-radius: var(--radius);
    font-family: var(--font-head);
    font-size: 14px;
    letter-spacing: 3px;
    color: var(--accent);
    animation: banner-glow 2s ease-in-out infinite;
}

@keyframes banner-glow {
    0%, 100% { text-shadow: 0 0 10px var(--accent-glow); }
    50% { text-shadow: 0 0 25px var(--accent-glow), 0 0 50px rgba(212,168,83,0.2); }
}

/* ── Reels ────────────────────────────────────────────────────── */

.reels-frame {
    position: relative;
    background: #0a0a0f;
    border: 3px solid var(--accent);
    border-radius: 14px;
    padding: 6px;
    box-shadow:
        inset 0 0 30px rgba(0,0,0,0.6),
        0 0 15px var(--accent-glow);
}

.reels-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.reel {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reel-cell {
    width: 100%;
    aspect-ratio: 1 / 0.85;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    background: linear-gradient(180deg, #111118 0%, #0d0d14 100%);
    border-radius: 8px;
    border: 1px solid rgba(42,42,62,0.4);
    position: relative;
    transition: transform 0.15s, box-shadow 0.3s;
    user-select: none;
    line-height: 1;
}

.reel-cell.spinning {
    filter: blur(1.5px);
    transition: none;
}

.reel-cell.landing {
    animation: cell-land 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cell-land {
    0% { transform: translateY(-8px) scale(1.05); filter: blur(2px); }
    60% { transform: translateY(2px) scale(0.98); }
    100% { transform: translateY(0) scale(1); filter: blur(0); }
}

.reel-cell.win-highlight {
    animation: cell-win 0.6s ease-in-out infinite alternate;
    border-color: var(--accent);
    z-index: 2;
}

@keyframes cell-win {
    0% {
        box-shadow: 0 0 8px var(--accent-glow);
        background: linear-gradient(180deg, #111118 0%, #0d0d14 100%);
    }
    100% {
        box-shadow: 0 0 25px var(--accent-glow), inset 0 0 15px rgba(212,168,83,0.1);
        background: linear-gradient(180deg, #1a1820 0%, #141218 100%);
    }
}

.reel-cell.scatter-highlight {
    animation: scatter-flash 0.5s ease-in-out infinite alternate;
    border-color: var(--success);
}

@keyframes scatter-flash {
    0% { box-shadow: 0 0 8px rgba(74,222,128,0.3); }
    100% { box-shadow: 0 0 30px rgba(74,222,128,0.5), inset 0 0 10px rgba(74,222,128,0.1); }
}

/* ── Payline indicators ───────────────────────────────────────── */

.payline-indicators {
    position: absolute;
    top: 6px;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.payline-ind {
    position: absolute;
    font-size: 10px;
    color: var(--accent);
    opacity: 0.4;
}

.payline-ind.left { left: -14px; }
.payline-ind.right { right: -14px; }

.payline-ind[data-row="0"] { top: 14%; transform: translateY(-50%); }
.payline-ind[data-row="1"] { top: 50%; transform: translateY(-50%); }
.payline-ind[data-row="2"] { top: 86%; transform: translateY(-50%); }

/* ── Info bar ─────────────────────────────────────────────────── */

.info-bar {
    display: flex;
    justify-content: space-around;
    margin-top: 14px;
    padding: 10px;
    background: rgba(0,0,0,0.25);
    border-radius: var(--radius);
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-family: var(--font-head);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.info-value {
    font-family: var(--font-head);
    font-size: 16px;
    color: var(--text);
}

/* ── Controls panel ───────────────────────────────────────────── */

.controls-panel {
    width: 100%;
    max-width: 680px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-family: var(--font-head);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-muted);
}

/* ── Chip selector ────────────────────────────────────────────── */

.chip-selector {
    display: flex;
    gap: 6px;
}

.chip {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chip::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.08);
}

.chip:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.chip.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(212,168,83,0.2), rgba(212,168,83,0.05));
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ── Lines selector ───────────────────────────────────────────── */

.lines-selector {
    display: flex;
    gap: 6px;
}

.line-btn {
    width: 40px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.line-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.line-btn.active {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(212,168,83,0.2), rgba(212,168,83,0.05));
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ── Spin button ──────────────────────────────────────────────── */

.spin-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spin-btn {
    width: 110px;
    height: 54px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(180deg, #e8c36a 0%, #c9952f 50%, #a67b1e 100%);
    color: #0d0d12;
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow:
        0 4px 15px rgba(212,168,83,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -2px 0 rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.spin-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255,255,255,0.15) 50%,
        transparent 60%
    );
    transition: transform 0.6s;
    transform: translateX(-100%);
}

.spin-btn:hover::after {
    transform: translateX(100%);
}

.spin-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 25px rgba(212,168,83,0.5),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -2px 0 rgba(0,0,0,0.15);
}

.spin-btn:active {
    transform: translateY(1px);
    box-shadow:
        0 2px 8px rgba(212,168,83,0.3),
        inset 0 1px 0 rgba(255,255,255,0.2),
        inset 0 -1px 0 rgba(0,0,0,0.1);
}

.spin-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.spin-btn.spinning .spin-text {
    animation: spin-pulse 0.8s ease-in-out infinite;
}

@keyframes spin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ── Auto-spin ────────────────────────────────────────────────── */

.auto-spin-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-toggle {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.auto-toggle input {
    display: none;
}

.toggle-track {
    display: block;
    width: 40px;
    height: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 11px;
    position: relative;
    transition: all 0.25s;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.25s;
}

.auto-toggle input:checked + .toggle-track {
    background: rgba(212,168,83,0.2);
    border-color: var(--accent);
}

.auto-toggle input:checked + .toggle-track .toggle-thumb {
    left: 20px;
    background: var(--accent);
}

.auto-count-select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-head);
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.auto-count-select:focus {
    border-color: var(--accent);
}

/* ── Paytable panel ───────────────────────────────────────────── */

.paytable-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-card);
    border-top: 2px solid var(--accent);
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    max-height: 60vh;
    overflow-y: auto;
}

.paytable-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

.paytable-title {
    font-family: var(--font-head);
    font-size: 20px;
    letter-spacing: 4px;
    text-align: center;
    color: var(--accent);
    margin: 0 0 20px;
}

.paytable-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pt-row {
    display: grid;
    grid-template-columns: 160px repeat(3, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(42,42,62,0.3);
}

.pt-row.highlight {
    border-color: rgba(212,168,83,0.2);
    background: rgba(212,168,83,0.04);
}

.pt-row.premium {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(212,168,83,0.1), rgba(212,168,83,0.02));
}

.pt-row.wild {
    border-color: var(--success);
    background: rgba(74,222,128,0.05);
}

.pt-symbol {
    font-size: 15px;
    font-weight: 600;
}

.pt-pays {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.pt-pays b {
    color: var(--accent);
}

.pt-note {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 900px) {
    .roboslots-wrapper {
        flex-direction: column;
    }

    .roboslots-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-panel {
        flex: 1;
        min-width: 140px;
    }

    .history-panel {
        flex-basis: 100%;
    }

    .paytable-toggle-btn {
        flex-basis: 100%;
    }
}

@media (max-width: 600px) {
    .slot-machine {
        padding: 14px;
    }

    .machine-title {
        font-size: 22px;
    }

    .reel-cell {
        font-size: 28px;
    }

    .controls-panel {
        gap: 10px;
    }

    .chip {
        width: 36px;
        height: 36px;
        font-size: 11px;
    }

    .line-btn {
        width: 34px;
        height: 30px;
        font-size: 11px;
    }

    .spin-btn {
        width: 90px;
        height: 46px;
        font-size: 15px;
    }

    .win-amount {
        font-size: 26px;
    }

    .pt-row {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ── Win counter animation ────────────────────────────────────── */

@keyframes win-count-up {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

.win-display.counting .win-amount {
    animation: win-count-up 0.4s ease-out;
}

/* ── Free spins awarded flash ─────────────────────────────────── */

@keyframes free-spins-flash {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.free-spins-awarded {
    animation: free-spins-flash 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Scrollbar styling ────────────────────────────────────────── */

.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}
