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

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    touch-action: none;
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    width: 100vw;
    height: 100vh;
    /* iOS safe area support */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

#score-display {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    display: flex;
    gap: 20px;
    z-index: 10;
    font-size: 18px;
    max-width: calc(100% - 40px);
}

.score-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

#start-screen, #game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#start-screen h1, #game-over h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #333;
}

#start-screen p, #game-over p {
    font-size: 18px;
    margin-bottom: 15px;
    color: #666;
}

button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

button:hover {
    background: #45a049;
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

.hidden {
    display: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #score-display {
        font-size: 14px;
        padding: 10px 15px;
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #start-screen, #game-over {
        padding: 30px;
        width: 90%;
        max-width: 350px;
    }
    
    #start-screen h1, #game-over h2 {
        font-size: 28px;
    }
    
    #start-screen p, #game-over p {
        font-size: 16px;
    }
    
    button {
        font-size: 18px;
        padding: 12px 25px;
    }
}

/* Prevent text selection */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Canvas styling */
canvas {
    display: block;
    width: 100%;
    height: 100%;
}