* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

@keyframes bgDrift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-color: #000;
    font-family: 'Fredoka One', cursive, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, #2d7a2d, #5cb85c, #87CEEB, #2d7a2d);
    background-size: 400% 400%;
    animation: bgDrift 20s ease infinite;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* UI Elements */
#top-bar {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: auto;
    z-index: 10;
}

.stat-box {
    background: linear-gradient(180deg, #ffffff 0%, #fff0f5 100%);
    border: 4px solid #fff;
    border-radius: 30px;
    padding: 10px 25px;
    display: flex;
    align-items: center;
    font-size: 32px;
    color: #333;
    box-shadow: 0 8px 0 #ccc, 0 15px 25px rgba(0,0,0,0.3);
    position: relative;
}

.stat-box::after {
    content: '';
    position: absolute;
    top: 2px; left: 10%; width: 80%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    border-radius: 20px;
}

.icon {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 50%;
    box-shadow: inset 0 -4px 0 rgba(0,0,0,0.2), 0 4px 8px rgba(0,0,0,0.3);
}

.banana-icon { background: radial-gradient(circle at 30% 30%, #fff, #ffd700, #ffaa00); }
.heart-icon { background: radial-gradient(circle at 30% 30%, #fff, #ff3333, #aa0000); }
.world-icon { background: radial-gradient(circle at 30% 30%, #fff, #33ccff, #0066aa); }

/* Screens */
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(50px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 122, 45, 0.7);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 100;
}

.screen:not(.hidden) {
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hidden {
    display: none !important;
}

.logo-thumb {
    width: 350px;
    height: 210px;
    border-radius: 30px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 8px rgba(255,255,255,0.3);
    border: 6px solid #8b4513;
    object-fit: cover;
    animation: floatTitle 4s ease-in-out infinite;
}

@keyframes floatTitle {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

h1 {
    font-size: 64px;
    background: linear-gradient(180deg, #ffffff 0%, #ffcc00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 0 #cc4400) drop-shadow(0 15px 20px rgba(0,0,0,0.5));
    margin-bottom: 15px;
    text-align: center;
    animation: floatTitle 3s ease-in-out infinite reverse;
}

p {
    color: #fff;
    font-size: 28px;
    margin-bottom: 40px;
    text-shadow: 0 4px 0 rgba(0,0,0,0.4);
    background: rgba(0,0,0,0.3);
    padding: 10px 30px;
    border-radius: 20px;
}

@keyframes pulseBtn {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

button {
    font-family: 'Fredoka One', cursive, sans-serif;
    background: linear-gradient(180deg, #ff8800 0%, #cc4400 100%);
    color: white;
    padding: 20px 60px;
    font-size: 36px;
    border-radius: 50px;
    border: 4px solid #ffcc00;
    cursor: pointer;
    box-shadow: 
        0 12px 0 #882200,
        0 20px 30px rgba(0,0,0,0.5),
        inset 0 5px 0 rgba(255,255,255,0.5);
    transition: all 0.1s;
    animation: pulseBtn 2s infinite;
}

button:active {
    transform: translateY(12px) !important;
    box-shadow: 
        0 0px 0 #882200,
        0 5px 10px rgba(0,0,0,0.5),
        inset 0 5px 0 rgba(255,255,255,0.5);
    animation: none;
}

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    bottom: 30px;
    left: 20px;
    right: 20px;
    height: 150px;
    pointer-events: none;
    z-index: 10;
}

.control-group {
    position: absolute;
    bottom: 0;
    display: flex;
    gap: 20px;
    pointer-events: auto;
}

.left-controls { left: 0; }
.right-controls { right: 0; }

.control-btn {
    width: 80px;
    height: 80px;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(200,200,200,0.9));
    border: 4px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 36px;
    color: #555;
    box-shadow: 0 10px 0 #aaa, 0 15px 20px rgba(0,0,0,0.4);
    position: relative;
    transition: all 0.1s;
}

.control-btn::after {
    content: '';
    position: absolute;
    top: 5px; left: 15%; width: 70%; height: 30%;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    border-radius: 20px;
}

.control-btn:active {
    transform: translateY(10px);
    box-shadow: 0 0px 0 #aaa, 0 5px 10px rgba(0,0,0,0.4);
    background: linear-gradient(180deg, rgba(200,200,200,0.9), rgba(150,150,150,0.9));
}

.action-btn {
    background: linear-gradient(180deg, #ff6666, #cc0000);
    color: white;
    border-color: #ffaaaa;
    box-shadow: 0 10px 0 #880000, 0 15px 20px rgba(0,0,0,0.4);
    width: 90px;
    height: 90px;
    font-size: 42px;
}
.action-btn:active {
    box-shadow: 0 0px 0 #880000, 0 5px 10px rgba(0,0,0,0.4);
    background: linear-gradient(180deg, #cc0000, #990000);
}

@media (max-width: 768px) {
    .desktop-only { display: none; }
    h1 { font-size: 48px; }
    .stat-box { font-size: 20px; padding: 5px 15px; }
    .icon { width: 24px; height: 24px; }
    .control-btn { width: 60px; height: 60px; font-size: 24px; }
    .action-btn { width: 70px; height: 70px; font-size: 30px; }
}
@media (min-width: 769px) {
    .mobile-only { display: none !important; }
}
/* CG-batch-overlay-fix */
#game-canvas, canvas#game-canvas { touch-action: none; }
#game-ui.screen,
#game-ui.screen.active { pointer-events: none !important; }
