:root {
    --gold: #E6D39E;
    --black: #141414;
    --red: #C8102E;
    --white: #FFFFFF;
    --dark-gray: #1a1a1a;
    --green: #0a3d1a;
    --light-gold: #f5e6c8;
}

.slot-page {
    background: linear-gradient(180deg, var(--black) 0%, #0a0a0a 100%);
    min-height: 100vh;
}

.slot-main {
    padding: 2rem 1rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.slot-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.slot-header {
    text-align: center;
}

.slot-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(230, 211, 158, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { text-shadow: 0 0 20px rgba(230, 211, 158, 0.5), 3px 3px 6px rgba(0, 0, 0, 0.8); }
    100% { text-shadow: 0 0 30px rgba(230, 211, 158, 0.8), 3px 3px 6px rgba(0, 0, 0, 0.8); }
}

.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.mode-btn {
    padding: 0.75rem 2rem;
    background: var(--dark-gray);
    color: var(--gold);
    border: 2px solid rgba(230, 211, 158, 0.3);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--gold) 0%, #d4c189 100%);
    color: var(--black);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(230, 211, 158, 0.4);
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: linear-gradient(145deg, var(--dark-gray), var(--black));
    border: 2px solid rgba(230, 211, 158, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(230, 211, 158, 0.7);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
}

.jackpot-box {
    border-color: var(--red);
    background: linear-gradient(145deg, rgba(200, 16, 46, 0.2), var(--black));
    position: relative;
    overflow: hidden;
}

.jackpot-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(230, 211, 158, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.jackpot-value {
    color: var(--red);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.slot-machine {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(180deg, #2a1810 0%, #1a0f0a 100%);
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(230, 211, 158, 0.2);
    position: relative;
}

.machine-top {
    text-align: center;
    margin-bottom: 2rem;
}

.marquee-lights {
    height: 15px;
    background: repeating-linear-gradient(
        90deg,
        var(--gold) 0px, var(--gold) 10px,
        transparent 10px, transparent 20px
    );
    border-radius: 10px;
    margin-bottom: 1rem;
    animation: marquee 1s linear infinite;
}

@keyframes marquee {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.machine-sign {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold);
    letter-spacing: 3px;
}

.machine-body {
    background: var(--green);
    border: 4px solid #d4a574;
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

.reels-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 10px;
}

.reel {
    width: 120px;
    height: 360px;
    background: white;
    border: 3px solid #333;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.reel-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s linear;
}

.reel-symbol {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    border-bottom: 2px solid #eee;
    background: white;
}

.reel.spinning .reel-strip {
    animation: spin 0.1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-120px); }
}

.win-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(200, 16, 46, 0.5);
    transform: translateY(-50%);
    pointer-events: none;
}

.lever-container {
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.lever {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.lever-handle {
    width: 15px;
    height: 150px;
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    border: 2px solid #7f2c1f;
    border-radius: 10px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

.lever-ball {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, #e74c3c, #c0392b);
    border: 3px solid #7f2c1f;
    border-radius: 50%;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.lever:hover .lever-handle {
    background: linear-gradient(90deg, #e74c3c, #ff6b6b);
}

.lever:active .lever-handle,
.lever.pulling .lever-handle {
    transform: translateY(30px);
    transition: transform 0.2s ease-out;
}

.lever.returning .lever-handle {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.machine-bottom {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.bet-selector {
    text-align: center;
}

.bet-label {
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.bet-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.bet-btn {
    padding: 1rem 2rem;
    background: linear-gradient(145deg, var(--dark-gray), var(--black));
    color: var(--gold);
    border: 2px solid rgba(230, 211, 158, 0.3);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bet-btn:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 211, 158, 0.3);
}

.bet-btn.active {
    background: linear-gradient(135deg, var(--gold) 0%, #d4c189 100%);
    color: var(--black);
    border-color: var(--gold);
    box-shadow: 0 4px 15px rgba(230, 211, 158, 0.5);
}

.spin-button {
    padding: 1.5rem 3rem;
    background: linear-gradient(135deg, var(--red) 0%, #a00d24 100%);
    color: white;
    border: 3px solid var(--gold);
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(200, 16, 46, 0.4);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(200, 16, 46, 0.6);
}

.spin-button:active:not(:disabled) {
    transform: translateY(0);
}

.spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spin-cost {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.controls-panel {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, var(--dark-gray), var(--black));
    border: 2px solid rgba(230, 211, 158, 0.3);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.sound-icon.muted::after {
    content: '🔇';
}

.prize-pool-display {
    background: linear-gradient(145deg, var(--dark-gray), var(--black));
    border: 2px solid rgba(230, 211, 158, 0.3);
    border-radius: 12px;
    padding: 2rem;
}

.pool-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--gold);
    text-align: center;
    margin-bottom: 1.5rem;
}

.prize-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tier-display {
    background: rgba(230, 211, 158, 0.05);
    border: 2px solid;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.tier-display:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.tier-display.legendary { border-color: #9b59b6; }
.tier-display.epic { border-color: #e74c3c; }
.tier-display.rare { border-color: #3498db; }
.tier-display.common { border-color: #2ecc71; }

.tier-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.tier-name {
    display: block;
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tier-count {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.pool-total {
    text-align: center;
    color: rgba(230, 211, 158, 0.8);
    font-size: 1.1rem;
}

.recent-wins {
    background: linear-gradient(145deg, var(--dark-gray), var(--black));
    border: 2px solid rgba(230, 211, 158, 0.3);
    border-radius: 12px;
    padding: 2rem;
}

.wins-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
}

.wins-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.win-item {
    background: rgba(230, 211, 158, 0.05);
    border: 1px solid rgba(230, 211, 158, 0.2);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.win-details {
    flex: 1;
}

.win-prize {
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.win-time {
    font-size: 0.85rem;
    color: rgba(230, 211, 158, 0.6);
}

.win-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
}

.no-wins,
.no-history {
    text-align: center;
    padding: 2rem;
    color: rgba(230, 211, 158, 0.5);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(145deg, var(--dark-gray), var(--black));
    border: 3px solid var(--gold);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--red);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    transform: rotate(90deg);
    background: #ff0000;
}

.win-modal {
    max-width: 700px;
}

.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.win-message {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--gold);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px var(--gold);
    animation: winBounce 0.5s ease-out;
}

@keyframes winBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.prize-display {
    margin-bottom: 2rem;
}

.prize-image-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.prize-image {
    max-width: 250px;
    height: auto;
    border: 3px solid var(--gold);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.prize-details {
    text-align: center;
}

.prize-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.prize-tier {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.prize-tier.legendary { color: #9b59b6; }
.prize-tier.epic { color: #e74c3c; }
.prize-tier.rare { color: #3498db; }
.prize-tier.common { color: #2ecc71; }
.prize-tier.consolation { color: #95a5a6; }

.prize-value {
    font-size: 1.5rem;
    color: white;
    font-weight: 700;
}

.win-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), #d4c189);
    color: var(--black);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 211, 158, 0.4);
}

.btn-secondary {
    background: var(--dark-gray);
    color: var(--gold);
    border: 2px solid rgba(230, 211, 158, 0.3);
}

.btn-secondary:hover {
    border-color: var(--gold);
}

.info-modal h2,
.history-modal h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 1.5rem;
    text-align: center;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section h3 {
    color: var(--gold);
    margin-bottom: 1rem;
}

.info-section p,
.info-section li {
    color: white;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.info-section ol,
.info-section ul {
    padding-left: 1.5rem;
}

.odds-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.odds-table th,
.odds-table td {
    padding: 0.75rem;
    border: 1px solid rgba(230, 211, 158, 0.3);
    text-align: center;
}

.odds-table th {
    background: rgba(230, 211, 158, 0.1);
    color: var(--gold);
    font-weight: 700;
}

.odds-table td {
    color: white;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.history-stat {
    background: rgba(230, 211, 158, 0.05);
    border: 2px solid rgba(230, 211, 158, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.history-stat-label {
    font-size: 0.85rem;
    color: rgba(230, 211, 158, 0.7);
    margin-bottom: 0.5rem;
}

.history-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: rgba(230, 211, 158, 0.05);
    border: 1px solid rgba(230, 211, 158, 0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-spin-info {
    flex: 1;
}

.history-spin-bet {
    font-size: 0.9rem;
    color: rgba(230, 211, 158, 0.7);
}

.history-spin-result {
    font-weight: 700;
    color: var(--gold);
    margin-top: 0.25rem;
}

.history-spin-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
}

@media (max-width: 768px) {
    .game-stats {
        grid-template-columns: 1fr;
    }

    .reels-container {
        gap: 0.5rem;
        padding: 1rem;
    }

    .reel {
        width: 90px;
        height: 270px;
    }

    .reel-symbol {
        height: 90px;
        font-size: 3rem;
    }

    .lever-container {
        right: -50px;
    }

    .lever-handle {
        height: 120px;
    }

    .bet-buttons {
        flex-direction: column;
    }

    .bet-btn {
        width: 100%;
    }

    .prize-tiers {
        grid-template-columns: repeat(2, 1fr);
    }

    .win-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .slot-main {
        padding: 1rem 0.5rem 2rem;
    }

    .machine-body {
        padding: 1rem;
    }

    .reels-container {
        gap: 0.25rem;
        padding: 0.5rem;
    }

    .reel {
        width: 80px;
        height: 240px;
    }

    .reel-symbol {
        height: 80px;
        font-size: 2.5rem;
    }

    .lever-container {
        display: none;
    }
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--gold);
    animation: confetti-fall 3s linear forwards;
}

.reels-container.winning {
    animation: winShake 0.5s ease-in-out;
}

@keyframes winShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.reel.win-reel .reel-symbol {
    animation: winGlow 1s ease-in-out infinite;
}

@keyframes winGlow {
    0%, 100% { box-shadow: inset 0 0 20px rgba(230, 211, 158, 0.3); }
    50% { box-shadow: inset 0 0 40px rgba(230, 211, 158, 0.8); }
}
