:root {
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --accent-color: #FFE66D;
    --dark-color: #1A535C;
    --light-color: #F7FFF7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Jua', sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.8s;
}

.title {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--dark-color);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.game-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.card {
    width: 280px;
    height: 280px;
    perspective: 1000px;
    position: relative;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.card:active {
    transform: scale(0.97);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.card-front {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
    backface-visibility: hidden;
    animation: pulse 2s infinite;
}

.card-icon {
    width: 100px;
    height: 100px;
    margin-top: 1rem;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.tap-text {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.card-back {
    background-color: var(--accent-color);
    color: var(--dark-color);
    font-size: 4.5rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    display: none;
    letter-spacing: 0.5rem;
    animation: bounceIn 0.6s;
}

.countdown {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
    display: none;
    animation: zoomIn 0.3s;
}

.instructions {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.instructions h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-align: center;
}

.instructions ol {
    padding-left: 1.5rem;
}

.instructions li {
    margin: 0.5rem 0;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

.btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    font-family: 'Jua', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.hint-container {
    background-color: var(--accent-color);
    padding: 0.8rem;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    margin: 1rem 0;
    display: none;
    animation: fadeIn 0.5s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#hint-text {
    font-size: 1rem;
}

footer {
    text-align: center;
    margin-top: auto;
    padding: 1rem 0;
    background-color: var(--dark-color);
    color: white;
    border-radius: 10px;
    width: 100%;
}

.footer-text {
    margin-bottom: 0.5rem;
}

/* Confetti canvas styling */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Responsive designs */
@media (max-width: 480px) {
    .card {
        width: 250px;
        height: 250px;
    }
    
    .card-back {
        font-size: 3.8rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .instructions {
        font-size: 0.9rem;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }
}