:root {
    --bg-color: #87CEEB; /* Sky Blue */
    --card-color: #FFD700; /* Gold */
    --card-back-color: #4682B4; /* Steel Blue */
    --text-color: #FFFFFF;
    --matched-color: #90EE90; /* Light Green */
    --font-family: 'Press Start 2P', cursive;
}

body {
    background-color: var(--bg-color);
    font-family: var(--font-family);
    color: var(--text-color);
    text-align: center;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ and Edge */
    user-select: none; /* Standard syntax */
}

h1, h2, h3, p {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#game-container {
    max-width: 95vw;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    perspective: 1000px;
}

.card {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.card.flipped, .card.matched {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-front {
    background-color: var(--card-color);
    transform: rotateY(180deg);
}

.card-front img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.card-back {
    background-color: var(--card-back-color);
    background-image: url('card_back.png');
    background-size: 60%;
    background-repeat: no-repeat;
    background-position: center;
    border: 3px solid white;
}

.hidden {
    display: none !important;
}

#surprise-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#gumball-machine {
    width: 250px;
    cursor: pointer;
    transition: transform 0.2s;
}

#gumball-machine:active {
    transform: scale(0.95);
}

#prize-dispenser {
    margin-top: 20px;
}

#surprise-ball {
    width: 80px;
    cursor: pointer;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

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

#prize-modal-content {
    background-color: #4CAF50;
    padding: 30px;
    border-radius: 15px;
    border: 5px solid white;
    position: relative;
    max-width: 80%;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

#prize-image {
    width: 150px;
    margin-top: 10px;
}

#close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    cursor: pointer;
}

button {
    font-family: var(--font-family);
    background-color: var(--card-color);
    color: #333;
    border: 3px solid white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    margin-top: 20px;
    text-shadow: none;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #ffd000;
}


/* Mobile adjustments */
@media (max-width: 420px) {
    #game-board {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .card {
        width: 75px;
        height: 75px;
    }
}

