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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 540px;
    aspect-ratio: 20 / 9;
    background: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

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

#score-display {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
}

#game-message {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, 0);
    font-size: 48px;
    font-weight: bold;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.3s;
}

#game-message.show {
    opacity: 1;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 72px;
    margin-bottom: 30px;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.8);
    color: #ffd700;
}

.screen p {
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.screen .controls {
    font-size: 18px;
    color: #ccc;
    margin-top: 20px;
}

.screen button {
    margin-top: 30px;
    padding: 20px 50px;
    font-size: 28px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    pointer-events: auto;
}

.screen button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.screen button:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    #game-container {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    #score-display {
        font-size: 24px;
        top: 10px;
        right: 10px;
        padding: 8px 15px;
    }

    .screen h1 {
        font-size: 48px;
    }

    .screen p {
        font-size: 18px;
    }

    .screen button {
        padding: 15px 40px;
        font-size: 24px;
    }
}

@media (orientation: portrait) {
    body::before {
        content: 'Please rotate your device to landscape mode';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        display: flex;
        justify-content: center;
        align-items: center;
        color: #fff;
        font-size: 24px;
        text-align: center;
        padding: 20px;
        z-index: 1000;
    }
}
