* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #8B4513, #A0522D);
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Prevent hover effects on mobile */
@media (hover: none) and (pointer: coarse) {
    * {
        cursor: none !important;
    }
    
    #gameCanvas {
        cursor: none !important;
    }
    
    /* Allow cursor on game over screen */
    .game-over #gameCanvas {
        cursor: auto !important;
    }
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #8B4513, #A0522D);
    padding: 10px 0 0 0;
    margin: 0;
}

#gameCanvas {
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 30%),
        radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 40%),
        linear-gradient(45deg, #DEB887, #F5DEB3);
    border: 2px solid #8B4513;
    border-radius: 8px;
    box-shadow: 
        0 0 15px rgba(0, 0, 0, 0.3),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
    max-width: 100vw;
    max-height: 100vh;
    width: min(400px, 95vw);
    height: min(680px, 95vh);
}


.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.score {
    position: absolute;
    top: 10px;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 12px;
    border-radius: 0 0 15px 0;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: scale(var(--game-scale, 1));
    transform-origin: top left;
}

#scoreBreakdown {
    position: relative;
}

.level {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.fly-counter {
    position: absolute;
    top: 10px;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 12px;
    border-radius: 0 0 0 15px;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    transform: scale(var(--game-scale, 1));
    transform-origin: top right;
}

.fly-counter span {
    position: relative;
}

.effects-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: visible;
}

.fade-away-number {
    position: absolute;
    color: #FFD700;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: fadeAway 1s ease-out forwards;
    pointer-events: none;
    transform: translate(-50%, -50%); /* Center the element on its position */
    white-space: nowrap; /* Prevent text wrapping */
}

.fade-away-number.fruit {
    color: #FFD700;
}

.fade-away-number.fly {
    color: #FFD700;
}

@keyframes fadeAway {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px) scale(1.2);
    }
}

.instructions {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 12px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 85%;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .game-container {
        align-items: flex-start;
        padding-top: 5px;
    }
    
    .score {
        font-size: 14px;
        padding: 6px 10px;
        top: 5px;
        left: 0;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 0 0 15px 0;
        transform: scale(var(--game-scale, 1));
        transform-origin: top left;
    }
    
    .level {
        font-size: 14px;
        padding: 6px 10px;
        top: 5px;
    }
    
    .fly-counter {
        font-size: 14px;
        padding: 6px 10px;
        top: 5px;
        right: 0;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 0 0 0 15px;
        transform: scale(var(--game-scale, 1));
        transform-origin: top right;
    }
    
    .instructions {
        font-size: 11px;
        padding: 6px 12px;
        bottom: 5px;
        max-width: 90%;
    }
    
    #gameCanvas {
        width: 98vw;
        height: 94vh;
        border: 1px solid #8B4513;
        border-radius: 4px;
    }
    
    
    /* Ensure no hover cursors on mobile */
    * {
        cursor: none !important;
    }
    
    /* Allow cursor on game over screen */
    .game-over #gameCanvas {
        cursor: auto !important;
    }
}

/* Prevent zoom on double tap */
@media (max-width: 768px) {
    * {
        touch-action: manipulation;
    }
}
