body {
    font-family: 'Inter', sans-serif;
    touch-action: none;
}
#game-wrapper {
    /* 9:16 aspect ratio */
    width: 100vw;
    height: 100vh;
    max-width: 400px; /* Max width for larger screens */
    max-height: 800px;
    box-shadow: 0 0 40px rgba(0,0,0,0.2);
}
 #close-game-btn {
            position: absolute;
            top: 5px;
            right: 5px;
            width: 40px;
            height: 40px;
            background-color: rgba(0, 0, 0, 0.3);
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            text-decoration: none;
            z-index: 101;
            transition: transform 0.2s ease;
        }
        #close-game-btn:hover {
            transform: scale(1.1);
            background-color: rgba(0, 0, 0, 0.5);
        }

.puzzle-piece {
    transition: all 0.2s ease-in-out;
    cursor: grab;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.puzzle-piece:active {
    cursor: grabbing;
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.dragging {
    opacity: 0.5;
    transform: scale(1.1);
}

/* --- Attractive Game Screen Styles --- */
.game-btn {
    padding: 0.5rem 1rem;
    color: white;
    font-size: 1rem;
    font-family: 'Fredoka One', cursive;
    border-radius: 50px; /* Bubbly shape */
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    transition: all 0.1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 rgba(0,0,0,0.2);
}
.game-btn:active {
    transform: translateY(2px);
    box-shadow: 0 3px 0 rgba(0,0,0,0.2);
}
.stat-card {
    padding: 0.5rem;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #1e3a8a; /* dark blue */
    text-transform: uppercase;
}
.stat-value {
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: #1e40af; /* slightly lighter dark blue */
    line-height: 1.2;
}
#puzzle-container {
    background-color: rgba(255,255,255,0.3);
    border: 8px solid #fff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1), inset 0 0 10px rgba(0,0,0,0.1);
    padding: 8px;
    border-radius: 20px;
}

/* --- Difficulty Screen Styles --- */
#difficulty-screen {
    background: radial-gradient(circle, #fef08a, #fde047); /* Sunny yellow gradient */
}

.game-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(3rem, 15vw, 5rem);
    color: #2563eb; /* Brighter, richer blue */
    text-shadow: 
        -3px -3px 0 #fff,  
         3px -3px 0 #fff,
        -3px  3px 0 #fff,
         3px  3px 0 #fff,
         6px 6px 0px rgba(0,0,0,0.15);
    line-height: 1;
}
.difficulty-prompt {
    font-size: 1.2rem;
    color: #c2410c; /* warm orange */
    font-weight: 500;
    text-shadow: 1px 1px 1px rgba(255,255,255,0.7);
}

.splash-card {
     transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
     position: relative;
     overflow: hidden;
     border: 4px solid;
}
#select-easy { border-color: #22c55e; }
#select-medium { border-color: #eab308; }
#select-hard { border-color: #ef4444; }

.splash-card:hover {
    transform: translateY(-8px) scale(1.02);
}
#select-easy:hover { box-shadow: 0 10px 25px -5px rgba(34, 197, 94, 0.4); }
#select-medium:hover { box-shadow: 0 10px 25px -5px rgba(234, 179, 8, 0.4); }
#select-hard:hover { box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4); }

#completed-image {
    max-height: 200px;
    width: 100%;
    object-fit: cover;
    border: 4px solid #f1c40f;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}
@keyframes logoIntro {
    0% { transform: scale(0.8); opacity: 0; }
    30% { transform: scale(1); opacity: 1; }
    70% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.5s ease-in-out forwards; }
.fade-out { animation: fadeOut 0.5s ease-in-out forwards; }
.logo-intro { animation: logoIntro 3s ease-in-out forwards; }
.card-enter {
    animation: cardEnter 0.6s backwards;
}
#select-easy.card-enter { animation-delay: 0.2s; }
#select-medium.card-enter { animation-delay: 0.3s; }
#select-hard.card-enter { animation-delay: 0.4s; }

