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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0a0a2a 0%, #1a1a4a 100%);
    overflow: hidden;
    color: white;
    touch-action: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#score-board {
    padding: 15px;
    display: flex;
    gap: 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, transparent 100%);
}

.score-item {
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

#controls-info {
    padding: 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.5) 0%, transparent 100%);
    font-size: 14px;
    text-align: center;
}

#controls-info p {
    margin: 3px 0;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 100;
}

#start-screen h1, #game-over-screen h2 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #4da6ff;
    text-shadow: 0 0 20px rgba(77, 166, 255, 0.6);
}

#start-screen p, #game-over-screen p {
    font-size: 20px;
    margin-bottom: 30px;
    text-align: center;
    max-width: 600px;
}

button {
    padding: 15px 40px;
    font-size: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff4757 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 71, 87, 0.6);
}

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

.hidden {
    display: none !important;
}

#mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    pointer-events: auto;
    z-index: 50;
}

.control-row {
    display: flex;
    gap: 20px;
}

.control-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.control-btn:active {
    background: rgba(255, 255, 255, 0.4);
}

#btn-left, #btn-right {
    width: 70px;
    height: 70px;
    font-size: 28px;
}

#btn-shot, #btn-missile {
    width: 90px;
    height: 90px;
    font-size: 16px;
    border-radius: 20px;
}

#btn-missile {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
}

@media (min-width: 768px) {
    #mobile-controls {
        display: none !important;
    }
    
    #controls-info {
        display: block;
    }
}