/* Slot Game Styles */

.slot-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.slot-machine {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #ecf0f1;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.slot-header {
    text-align: center;
    margin-bottom: 20px;
}

.slot-header h2 {
    color: #f1c40f;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    font-size: 2rem;
}

.slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    background: #1a1a1a;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #f1c40f;
    margin-bottom: 20px;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative; /* Ensure proper stacking context for the grid */
}

#payline-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none; /* Make sure it doesn't interfere with mouse events */
    z-index: 20;
    opacity: 0.5;
}

.slot-cell {
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    height: 80px;
    width: 80px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible; /* Changed from hidden to visible so falling symbols can appear above other slots */
}

.slot-cell.multiplier-2::before {
    content: 'x2';
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(46, 204, 113, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    z-index: 10; /* Ensure it appears above the cell content */
}

.slot-cell.multiplier-4::before {
    content: 'x4';
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(241, 196, 15, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    z-index: 10; /* Ensure it appears above the cell content */
}

.slot-cell.multiplier-8::before {
    content: 'x8';
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(231, 76, 60, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    z-index: 10; /* Ensure it appears above the cell content */
}

.slot-cell.multiplier-16::before {
    content: 'x16';
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(155, 89, 182, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    z-index: 10; /* Ensure it appears above the cell content */
}

.slot-cell.multiplier-32::before {
    content: 'x32';
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(52, 152, 219, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
    z-index: 10; /* Ensure it appears above the cell content */
}

.slot-cell-body {
    position: relative; /* Added position so z-index works */
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-cell-body.spinning {
    filter: blur(2px);
}

.slot-cell-body.dropping {
    z-index: 100 !important;
    position: relative !important;
}

.slot-cell-body.pop-in {
    animation: popIn 0.3s ease-out forwards;
}
@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.slot-cell-body.possible-winning-cell {
    background: linear-gradient(145deg, #fff3cd, #ffeeba);
    border-color: #ffc107;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.slot-cell-body.possible-winning-cell2 {
    background: linear-gradient(145deg, #d1c4e9, #9575cd);
    border-color: #7e57c2;
    box-shadow: 0 0 10px rgba(126, 87, 194, 0.5);
}

.slot-cell-body.winning-cell {
    background: linear-gradient(145deg, #c8e6c9, #4caf50);
    border-color: #2e7d32;
    animation: glow 1s ease-in-out infinite alternate;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
}


@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
    }
    to {
        box-shadow: 0 0 30px rgba(76, 175, 80, 1), 0 0 40px rgba(76, 175, 80, 0.8);
    }
}

.slot-controls {
    text-align: center;
    margin-bottom: 20px;
}

.slot-spin-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.slot-spin-btn:hover:not(:disabled) {
    background: linear-gradient(145deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
}

.slot-spin-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.slot-spin-btn:disabled {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.slot-auto-spin {
    margin-top: 15px;
}

.slot-auto-spin.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.slot-auto-spin input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
}

.slot-auto-spin label {
    color: #ecf0f1;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.slot-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.slot-stats h3 {
    color: #f1c40f;
    margin-top: 0;
    text-align: center;
}

.slot-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    text-align: center;
}

.slot-stat-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.slot-stat-label {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.slot-stat-value {
    color: #f1c40f;
    font-size: 1.2rem;
    font-weight: bold;
}

.current-win {
    color: #2ecc71 !important;
}

/* Upgrade cards specific to slot game */
.slot-upgrades .upgrade-card {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border: 1px solid #f1c40f;
}

.slot-upgrades .upgrade-card h4 {
    color: #f1c40f;
}

.slot-upgrades .upgrade-info span {
    color: #ecf0f1;
}

/* Payline visualization (optional future feature) */
.payline-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(241, 196, 15, 0.3);
    border: 2px solid #f1c40f;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.slot-cell.winning-cell .payline-indicator {
    opacity: 1;
}

