* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a2e;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 1000px;
    text-align: center;
}

.game-title {
    font-size: 3rem;
    color: #e94560;
    text-shadow: 0 0 15px rgba(233, 69, 96, 0.6);
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.main-layout {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    margin-top: 20px;
    width: 100%;
}

.slot-machine {
    width: 380px;
    background: #111424;
    border: 3px solid #e94560;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.side-panel {
    width: 250px;
    background: #162447;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    text-align: left;
}

.side-panel h3 {
    font-size: 1.1rem;
    color: #4ecca3;
    margin-bottom: 15px;
    border-bottom: 2px solid #1f4068;
    padding-bottom: 5px;
    text-align: center;
}

.paytable ul {
    list-style: none;
}

.paytable li {
    font-size: 1.05rem;
    padding: 6px 0;
    border-bottom: 1px dashed #1f4068;
    display: flex;
    justify-content: space-between;
}

#collect-list {
    list-style: none;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #1f4068;
    font-size: 0.95rem;
}

.score-item strong {
    color: #4ecca3;
}

.reels-container {
    display: flex;
    justify-content: space-between;
    background: #0f1123;
    padding: 15px;
    border-radius: 8px;
    gap: 10px;
    margin-bottom: 20px;
}

.reel {
    width: 90px;
    height: 120px;
    background: #ffffff;
    border: 3px solid #4ecca3;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
}

.symbol {
    font-size: 3.5rem;
    user-select: none;
    display: inline-block;
    transform: translateZ(0);
}

@keyframes slot-spin {
    0% { transform: translateY(-100%) scaleY(1.5); filter: blur(8px); opacity: 0.7; }
    50% { transform: translateY(100%) scaleY(1.5); filter: blur(8px); opacity: 0.7; }
    100% { transform: translateY(-100%) scaleY(1.5); filter: blur(8px); opacity: 0.7; }
}

.spinning .symbol {
    animation: slot-spin 0.08s infinite linear;
}

.display-panel {
    background: #0f1123;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #1f4068;
}

.credits {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

#credits-val {
    color: #4ecca3;
}

#message {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4ecca3;
    min-height: 24px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
}

#spin-btn {
    background-color: #4ecca3;
    color: #1a1a2e;
}

#spin-btn:hover:not(:disabled) {
    background-color: #45b691;
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.4);
}

.double-btn {
    background: linear-gradient(135deg, #ff9f43, #ff5252) !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

.double-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ffb167, #ff6b6b) !important;
    box-shadow: 0 0 15px rgba(255, 159, 67, 0.6);
}

#collect-btn {
    background-color: #f5a623;
    color: #1a1a2e;
}

#collect-btn:hover:not(:disabled) {
    background-color: #e2951b;
}

#reset-btn {
    background-color: #1f4068;
    color: #fff;
}

#reset-btn:hover:not(:disabled) {
    background-color: #163152;
}

.mute-btn {
    background-color: #34495e;
    color: #fff;
    font-size: 0.9rem;
    padding: 8px;
}

.mute-btn.muted {
    background-color: #7f8c8d;
}

button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gold-boost {
    border: 4px solid #f1c40f !important;
    animation: gold-glow 1.5s infinite ease-in-out !important;
}

@keyframes gold-glow {
    0% { box-shadow: 0 0 10px #f1c40f, inset 0 0 10px #f1c40f; }
    50% { box-shadow: 0 0 30px #f39c12, inset 0 0 20px #f39c12; }
    100% { box-shadow: 0 0 10px #f1c40f, inset 0 0 10px #f1c40f; }
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: #162447;
    padding: 30px;
    border-radius: 12px;
    border: 3px solid #4ecca3;
    text-align: center;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 0 25px rgba(78, 204, 163, 0.4);
    position: relative;
}

.close-x {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.8rem;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.1s ease;
}

.close-x:hover {
    color: #e94560;
}

.modal-content h2 {
    color: #4ecca3;
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border: 2px solid #1f4068;
    border-radius: 6px;
    background-color: #0f1123;
    color: #fff;
    text-align: center;
    margin-bottom: 20px;
    outline: none;
}

.modal-content input:focus {
    border-color: #4ecca3;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#save-score-btn {
    background-color: #4ecca3;
    color: #1a1a2e;
}

.cancel-btn {
    background-color: #e94560 !important;
    color: #fff !important;
}

.cancel-btn:hover {
    background-color: #c32f49 !important;
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .slot-machine, .side-panel {
        width: 100% !important;
        max-width: 360px;
        box-sizing: border-box;
    }

    .reel {
        width: 80px;
        height: 105px;
    }

    .symbol {
        font-size: 2.8rem;
    }

    .controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    #mute-btn {
        grid-column: span 2;
    }
}
