/* Game Container */
.psg-game-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    /* Background gradient applied via JavaScript */
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Game Title */
.psg-game-title {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
}

.psg-game-title h2 {
    font-size: 32px;
    margin: 0 0 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.psg-game-title p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

/* Game Stage */
.psg-game-stage {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 30px 20px;
    backdrop-filter: blur(10px);
}

/* Cards Wrapper */
.psg-cards-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    perspective: 1000px;
}

/* Card */
.psg-card {
    aspect-ratio: 3/4;
    position: relative;
    transition: transform 0.3s ease;
}

.psg-card:hover {
    transform: translateY(-5px);
}

.psg-card.psg-shuffling {
    /* Shuffle transition handled in JavaScript */
}

.psg-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.psg-card-inner.psg-flipped {
    transform: rotateY(180deg);
}

.psg-card-front,
.psg-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.psg-card-front {
    /* Gradient applied via JavaScript */
    color: #fff;
    font-size: 64px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.psg-card-back {
    /* Background color applied via JavaScript based on win/loss */
    color: #fff;
    transform: rotateY(180deg);
    padding: 20px;
    text-align: center;
}

.psg-prize-text {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    word-wrap: break-word;
}

/* Controls */
.psg-controls {
    text-align: center;
    margin-bottom: 20px;
}

.psg-shuffle-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.psg-shuffle-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.psg-shuffle-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.psg-shuffle-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* Instructions */
.psg-instructions {
    text-align: center;
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    min-height: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Modal */
.psg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.psg-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: psg-modal-pop 0.3s ease;
}

@keyframes psg-modal-pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.psg-modal-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: psg-icon-bounce 0.5s ease;
}

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

.psg-modal-content h3 {
    font-size: 28px;
    margin: 0 0 15px 0;
    color: #333;
}

.psg-modal-content p {
    font-size: 18px;
    color: #666;
    margin: 0 0 25px 0;
}

.psg-modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.psg-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.psg-modal-btn:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .psg-game-container {
        padding: 20px;
        margin: 20px auto;
    }
    
    .psg-game-title h2 {
        font-size: 24px;
    }
    
    .psg-game-title p {
        font-size: 14px;
    }
    
    .psg-cards-wrapper {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .psg-card-front {
        font-size: 48px;
    }
    
    .psg-prize-text {
        font-size: 14px;
    }
    
    .psg-shuffle-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .psg-instructions {
        font-size: 16px;
    }
    
    .psg-modal-content {
        padding: 30px 20px;
    }
    
    .psg-modal-icon {
        font-size: 60px;
    }
    
    .psg-modal-content h3 {
        font-size: 22px;
    }
    
    .psg-modal-content p {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .psg-cards-wrapper {
        gap: 10px;
    }
    
    .psg-card-front {
        font-size: 36px;
    }
    
    .psg-prize-text {
        font-size: 12px;
        padding: 10px;
    }
}
