/* General Body Styles */
body {
    font-family: 'Arial', sans-serif;
    background-color: #1a1a1a;
    color: #fff;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

/* Game Container Styles */
#game-container {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    width: 95%;
    max-width: 400px;
    text-align: center;
    margin: 20px auto;
}

/* Info Box Styles (e.g., for displaying score, bet, etc.) */
.info-box {
    background-color: #333;
    padding: 10px 15px;
    border-radius: 5px;
    min-width: 100px;
}

.info-box span {
    display: block;
}

.info-box span:first-child {
    font-size: 0.8em;
    color: #aaa;
}

/* Slot Machine Section */
#slot-machine {
    margin-bottom: 10px;
}

/* Grid for the reels */
#reels-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 5px;
    background-color: #111;
    border: 5px solid #001aff;
    border-radius: 10px;
    padding: 10px;
    height: 400px;
    overflow: hidden;
    position: relative;
}

/* Individual reel cell styling */
.reel-cell {
    background-color: #444;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease-out;
}

/* Styling for gold-colored cells */
.gold {
    text-shadow: 0 0 5px #ffd700, 0 0 10px #ffd700, 0 0 15px #ffc107;
    background-color: #4a4a2a;
}

/* Keyframe Animations */

/* Fade out animation for symbols */
@keyframes fade-out {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.8); }
}

/* Winning effect animation */
.winning-cell {
    animation: winning-pulse 0.5s infinite;
}

@keyframes winning-pulse {
    0% { transform: scale(1); box-shadow: 0 0 5px #ffd700; }
    50% { transform: scale(1.05); box-shadow: 0 0 15px #ffec80; }
    100% { transform: scale(1); box-shadow: 0 0 5px #ffd700; }
}

/* Transforming cell animation */
@keyframes transform-pulse {
    0% { transform: scale(1); box-shadow: 0 0 5px #9d00ff; }
    50% { transform: scale(1.1); box-shadow: 0 0 20px #c36aff; }
    100% { transform: scale(1); box-shadow: 0 0 5px #9d00ff; }
}
.transforming {
    animation: transform-pulse 0.3s 1;
}

/* Control Section (buttons, inputs) */
#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.control-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* General button styling */
#controls button {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #001aff;
    color: #eee;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#controls button:hover {
    background-color: #e6c300;
    color: #111;
}

/* Symbol Specific Styling */
.symbol-Spade, .symbol-Club {
    color: #ccc;
}
.symbol-Heart, .symbol-Diamond {
    color: #ff6b6b;
}

.symbol-A, .symbol-K, .symbol-Q, .symbol-J {
    color: #ffda77;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

/* Styling for Joker symbols, using pseudo-elements for multi-line text */
.symbol-BigJoker, .symbol-SmallJoker {
    color: #da9eff;
    font-size: 1em;
    line-height: 1.1;
    text-indent: -9999px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Common pseudo-element styling for Joker symbols */
.symbol-BigJoker::before, .symbol-SmallJoker::before {
    text-indent: 0;
    display: block;
    white-space: pre;
    text-align: center;
}

/* Content for Small Joker */
.symbol-SmallJoker::before {
    content: "Small\A Joker";
}

/* Content for Big Joker */
.symbol-BigJoker::before {
    content: "Big\A Joker";
}

/* Styling for Scatter symbol */
.symbol-Scatter {
    color: #84ffb1;
    font-size: 1em;
}

/* Game Footer Section */
#game-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: #333;
    border-radius: 8px;
}

/* Multiplier values display */
#multiplier-display {
    display: flex;
    gap: 5px;
    justify-content: center;
    align-items: center;
    padding: 5px;
    border-radius: 5px;
    background-color: #333;
}

/* Individual multiplier value item styling */
.multiplier-value-item {
    padding: 5px 8px;
    border-radius: 3px;
    background-color: #555;
    color: #eee;
    font-size: 0.9em;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
}

/* Active multiplier item styling */
.multiplier-value-item.active {
    background-color: #ffd700;
    color: #1a1a1a;
    box-shadow: 0 0 8px #ffd700;
    transform: scale(1.1);
}

/* Modal Styles */
#paytable-modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #2a2a2a;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: #eee;
    text-align: left;
}

.modal-content h2 {
    text-align: center;
    color: #ffd700;
    margin-top: 0;
    margin-bottom: 20px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Paytable Content Styling */
#paytable-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.paytable-entry {
    display: flex;
    align-items: center;
    background-color: #333;
    padding: 10px;
    border-radius: 5px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.symbol-name {
    font-size: 1.8em;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    margin-right: 15px;
}

.payouts {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
    align-items: flex-start;
}

.payouts p {
    margin: 0;
    font-size: 0.9em;
    background-color: #444;
    padding: 5px 10px;
    border-radius: 3px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    #paytable-content {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .modal-content {
        max-width: 800px;
    }
}

/* Win Popup Styles */
#win-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 3em;
    font-weight: bold;
    z-index: 10;
    animation: win-popup-animation 1.5s ease-out forwards;
}

@keyframes win-popup-animation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Bet Options Modal Grid */
#bet-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

#bet-options-grid button {
    padding: 15px 0;
    font-size: 1.1em;
    background-color: #444;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
    text-align: center;
}

#bet-options-grid button:hover {
    background-color: #5a5a5a;
    border-color: #777;
}

#bet-options-grid button.active-bet {
    background-color: #ffd700;
    color: #1a1a1a;
    border-color: #ffd700;
    font-weight: bold;
}

/* Bet Popup Styles */
#bet-modal {
    display: none;
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 110;
    width: 280px;
}

/* Override some modal-content styles for the popup version */
#bet-modal .modal-content {
    width: 100%;
    max-width: none;
    margin: 0;
}