* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

body {
    background-color: #f0f0f0;
    color: #333;
    touch-action: manipulation;
}

header {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 2rem;
}

.main-container {
    display: flex;
    min-height: calc(100vh - 160px);
}

.ad-left, .ad-right {
    flex: 1;
    padding: 10px;
    background-color: #e9e9e9;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.game-container {
    flex: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: #87CEEB;
    position: relative;
    overflow: hidden;
}

.ad-placeholder {
    width: 100%;
    max-width: 300px;
    background-color: white;
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ad-placeholder p {
    margin-bottom: 10px;
    font-weight: bold;
    color: #666;
}

.ad-content {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

#gameCanvas {
    background-color: #87CEEB;
    border: 2px solid #333;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    touch-action: none;
}

#startScreen, #gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    width: 80%;
    max-width: 300px;
}

#gameOver {
    display: none;
}

#startScreen h2, #gameOver h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

#startScreen {
    z-index: 11; /* Higher than game over screen */
}

#gameOver {
    z-index: 10;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 15px;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 200px;
}

button:hover {
    background-color: #45a049;
}

.hidden {
    display: none;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;
}

footer p {
    margin-bottom: 10px;
    font-weight: bold;
}

.game-description {
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    
    .ad-left, .ad-right {
        flex: none;
        padding: 5px;
    }
    
    .game-container {
        order: -1;
        padding: 5px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
        max-height: 80vh;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .ad-content {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .game-description {
        font-size: 0.8rem;
    }
    
    #startScreen, #gameOver {
        padding: 15px;
    }
}