/* Direct Slots CSS - No iframe implementation */

/* Absolute minimal reset */
.slot-direct * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.slot-direct {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.1em;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 800px;
}

/* Minimal container - let JS control everything else */
.slot-direct .slot-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 0.1em;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Reels container - dimensions controlled by JS */
.slot-direct .reels-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #1a1a1a;
    border-radius: 10px;
    border: 2px solid #333;
    position: relative;
    /* All gap, padding set by JS via CSS custom properties */
    gap: var(--reel-gap, 15px);
    padding: var(--container-padding, 15px);
}

/* Individual reel - dimensions controlled by JS */
.slot-direct .reel {
    overflow: hidden;
    background: #333;
    border-radius: 3px;
    position: relative;
    border: 2px solid #222;
    background-image: url('images/sprite_reel_vertical_120px.png');
    background-repeat: repeat-y;
    background-position: 0 0;
    /* All dimensions set by JS */
    width: var(--reel-width, 120px);
    height: var(--reel-height, 360px);
    background-size: var(--reel-width, 120px) var(--sprite-height, 1200px);
}

/* Reel effects */
.slot-direct .reel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 15%,
        rgba(0, 0, 0, 0.08) 30%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0) 60%,
        rgba(0, 0, 0, 0.08) 70%,
        rgba(0, 0, 0, 0.3) 85%,
        rgba(0, 0, 0, 0.5) 100%
    );
    box-shadow: 
        inset 8px 0 12px -8px rgba(0, 0, 0, 0.4),
        inset -8px 0 12px -8px rgba(0, 0, 0, 0.4);
}

/* Glass overlay */
.slot-direct .glass-overlay {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
    background: linear-gradient(to bottom,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.08) 20%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0.08) 80%,
        rgba(255, 255, 255, 0.15) 100%
    );
    border-top: 2px solid rgba(255, 255, 255, 0.6);
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    /* Height set by JS based on reel width */
    height: var(--reel-width, 120px);
}

.slot-direct .center-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    top: 50%;
    transform: translateY(-50%);
    z-index: 11;
    pointer-events: none;
}

/* Spinning animations */
.slot-direct .reel.spinning {
    animation: spinReel 0.5s linear infinite;
}

.slot-direct #reel-1.spinning { animation: spinReel1 0.5s linear infinite; }
.slot-direct #reel-2.spinning { animation: spinReel2 0.55s linear infinite; }
.slot-direct #reel-3.spinning { animation: spinReel3 0.6s linear infinite; }

@keyframes spinReel { 0% { background-position: 0 0; } 100% { background-position: 0 -1200px; } }
@keyframes spinReel1 { 0% { background-position: 0 0; } 100% { background-position: 0 -1200px; } }
@keyframes spinReel2 { 0% { background-position: 0 0; } 100% { background-position: 0 -1200px; } }
@keyframes spinReel3 { 0% { background-position: 0 0; } 100% { background-position: 0 -1200px; } }

.slot-direct .reel:not(.spinning) {
    transition: background-position 0.3s ease-out;
}

/* Progress indicator - width controlled by JS */
.slot-direct .progress-indicator {
    height: 8px;
    background: #4a5568; /* Lighter grey background */
    border-radius: 4px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border: 1px solid #2d3748; /* Darker grey border */
    /* Width set by JS */
    width: var(--reels-container-width, 394px);
}

.slot-direct .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3CE74C 0%, #2DD93C 50%, #3CE74C 100%); /* Custom green gradient */
    border-radius: 3px;
    transition: width 0.3s ease-out;
}

/* Slots panel - natural sizing */
.slot-direct .slots-panel {
    background: #2c3e50;
    color: white;
    border-radius: 8px;
    margin: 0 auto;
    width: var(--reels-container-width, 394px);
    padding: 0;
}

.slot-direct .control-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.slot-direct .control-table td {
    text-align: center;
    vertical-align: middle;
    padding: calc(4px * var(--scale-factor, 1)) calc(6px * var(--scale-factor, 1));
    border-right: 2px solid #304357;
    background: #1a1a1a;
}

.slot-direct .control-table td:last-child {
    border-right: none;
}

.slot-direct .control-label {
    font-size: var(--control-label-size, 0.8rem);
    font-weight: bold;
    color: #ecf0f1;
    line-height: 1;
}

.slot-direct .control-value {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #f1c40f;
    transition: all 0.3s ease;
}

.slot-direct .spin-button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slot-direct .spin-button:hover {
    background: #c0392b;
}

.slot-direct .spin-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.slot-direct .bet-btn-inline {
    background: #3498db;
    color: white;
    border: none;
    width: 28px;
    height: 20px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-direct .bet-btn-inline:hover {
    background: #2980b9;
}

/* Action row styling - second row in control table */
.slot-direct .action-row {
    border-top: 2px solid #304357; /* Separator line above action buttons */
}

.slot-direct .action-cell {
    padding: 6px 4px;
    vertical-align: middle;
    border-right: 2px solid #304357;
}

.slot-direct .action-cell:last-child {
    border-right: none;
}

/* Style buttons in action cells */
.slot-direct .action-cell .flip-button,
.slot-direct .action-cell .faucet-countdown-btn {
    width: 100%;
    height: calc(40px * var(--scale-factor, 1));
    margin: 0;
    font-size: calc(0.9rem * var(--scale-factor, 1));
    padding: 0 calc(10px * var(--scale-factor, 1));
}

/* Action buttons - scaled */
.slot-direct .action-buttons {
    display: flex;
    justify-content: center;
    gap: calc(20px * var(--scale-factor, 1));
    margin: calc(20px * var(--scale-factor, 1)) 0;
}

.slot-direct .flip-button, .slot-direct .faucet-btn {
    background: #f39c12;
    color: white;
    border: none;
    padding: calc(10px * var(--scale-factor, 1)) calc(20px * var(--scale-factor, 1));
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(1rem * var(--scale-factor, 1));
    font-weight: bold;
    transition: background 0.3s ease;
}

.slot-direct .flip-button:hover, .slot-direct .faucet-btn:hover {
    background: #e67e22;
}

.slot-direct .faucet-btn {
    background: #27ae60;
}

.slot-direct .faucet-btn:hover {
    background: #229954;
}

/* Faucet countdown button styles - matches progress bar theme */
.slot-direct .faucet-countdown-btn {
    background: #4a5568; /* Match progress bar background */
    color: #e2e8f0; /* Light grey text for good contrast */
    border: none;
    padding: calc(10px * var(--scale-factor, 1)) calc(20px * var(--scale-factor, 1));
    border-radius: 4px;
    cursor: pointer;
    font-size: calc(1rem * var(--scale-factor, 1));
    font-weight: bold;
    transition: all 0.3s ease;
    border: 1px solid #2d3748; /* Match progress bar border */
}

.slot-direct .faucet-countdown-btn:not(:disabled) {
    background: linear-gradient(90deg, #3CE74C 0%, #2DD93C 50%, #3CE74C 100%); /* Match progress fill */
    border: 1px solid #2ABB38;
    color: #1a202c; /* Dark text on green for good contrast */
}

.slot-direct .faucet-countdown-btn:not(:disabled):hover {
    background: linear-gradient(90deg, #4FED5C 0%, #3FE64F 50%, #4FED5C 100%); /* Lighter green on hover */
}

.slot-direct .faucet-countdown-btn:disabled {
    cursor: not-allowed;
}

.slot-direct .faucet-countdown-btn:disabled:hover {
    background: #718096; /* Slightly lighter on hover even when disabled */
}

.slot-direct .faucet-countdown-btn .btn-text {
    font-weight: bold;
}

/* Fade Machine Styles */
.slot-direct .slot-machine {
    position: relative;
}

.slot-direct .machine-front, .slot-direct .machine-back {
    transition: opacity 0.5s ease-in-out;
}

.slot-direct .machine-front {
    opacity: 1;
}

.slot-direct .machine-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
}

.slot-direct .slot-machine.flipped .machine-front {
    opacity: 0;
    pointer-events: none;
}

.slot-direct .slot-machine.flipped .machine-back {
    opacity: 1;
    pointer-events: auto;
}

/* Prize Display Styles */
.slot-direct .prize-display-container {
    background: #2c3e50;
    border-radius: 8px;
    padding: calc(10px * var(--scale-factor, 1));
    margin: calc(5px * var(--scale-factor, 1)) auto;
    max-width: 100%;
}

.slot-direct .prize-table {
    width: 100%;
    border-collapse: collapse;
    font-size: calc(0.9rem * var(--scale-factor, 1));
}

.slot-direct .prize-cell {
    padding: calc(8px * var(--scale-factor, 1));
    text-align: center;
    border: 1px solid #34495e;
    background: #1a1a1a;
    vertical-align: middle;
}

.slot-direct .prize-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: calc(4px * var(--scale-factor, 1));
    margin-bottom: calc(5px * var(--scale-factor, 1));
}

.slot-direct .prize-symbol {
    width: calc(40px * var(--scale-factor, 1));
    height: calc(40px * var(--scale-factor, 1));
    object-fit: contain;
}

.slot-direct .prize-payout {
    font-weight: bold;
    color: #f1c40f;
    font-size: calc(1.1rem * var(--scale-factor, 1));
}

.slot-direct .empty-symbol {
    display: inline-block;
    width: calc(40px * var(--scale-factor, 1));
    height: calc(40px * var(--scale-factor, 1));
    line-height: calc(40px * var(--scale-factor, 1));
    text-align: center;
    font-weight: bold;
    color: #95a5a6;
    font-size: calc(1rem * var(--scale-factor, 1));
}

/* Ultra-small screen optimizations - 290px support */
@media (max-width: 360px) {
    .slot-direct .control-label {
        font-size: 0.65rem !important; /* Smaller labels on tiny screens */
    }
    
    .slot-direct .control-value {
        font-size: 1.1rem !important; /* Smaller values on tiny screens */
    }
    
    .slot-direct .spin-button {
        font-size: 0.9rem !important; /* Smaller spin button text */
        padding: 0 10px !important; /* Less horizontal padding */
    }
    
    .slot-direct .bet-btn-inline {
        width: 16px !important; /* Smaller bet buttons */
        height: 12px !important;
        font-size: 0.5rem !important;
    }
    
    .slot-direct .action-cell .flip-button,
    .slot-direct .action-cell .faucet-countdown-btn {
        font-size: 0.8rem !important;
        padding: 0 8px !important;
    }
}
