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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
    overflow: hidden;
}

#game-wrapper {
    position: relative;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 90vh;
    max-height: 900px;
    min-height: 700px;
    background: linear-gradient(180deg, #0a0e27 0%, #1a1445 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.3);
    margin: 0 auto;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.stat {
    background: rgba(10, 14, 39, 0.8);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.stat-label {
    font-size: 12px;
    opacity: 0.7;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
    transition: transform 0.2s;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s;
    padding: 30px 25px 40px 25px;
    overflow-y: auto;
}

#start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

h1 {
    font-size: 42px;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #00d4ff, #9f7aea);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

.welcome-box {
    background: rgba(10, 14, 39, 0.8);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    max-width: 450px;
    width: 100%;
    backdrop-filter: blur(10px);
}

.welcome-box h2 {
    font-size: 24px;
    color: #00d4ff;
    margin-bottom: 15px;
}

.how-to-play {
    background: rgba(0, 212, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.how-to-play h3 {
    color: #00d4ff;
    font-size: 16px;
    margin-bottom: 12px;
}

.how-to-play p {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    opacity: 0.9;
}

.controls-section {
    display: flex;
    gap: 15px;
    justify-content: space-around;
}

.control-method {
    flex: 1;
    text-align: center;
}

.control-method h4 {
    color: #00d4ff;
    font-size: 14px;
    margin-bottom: 12px;
}

.control-method p {
    font-size: 12px;
    opacity: 0.8;
    margin: 8px 0;
}

.key-display {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    margin: 8px 0;
}

.key {
    background: rgba(0, 212, 255, 0.2);
    border: 2px solid rgba(0, 212, 255, 0.4);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #00d4ff;
    min-width: 32px;
    display: inline-block;
}

.space-key {
    padding: 6px 20px;
    font-size: 12px;
}

.key-label {
    font-size: 11px;
    opacity: 0.6;
}

.mobile-icons {
    font-size: 20px;
    margin-top: 8px;
}

button {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 25px rgba(0, 212, 255, 0.5);
    pointer-events: all;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.6);
}

button:active {
    transform: translateY(0);
}

#game-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(10, 14, 39, 0.98);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    border: 2px solid rgba(252, 129, 129, 0.5);
    box-shadow: 0 10px 50px rgba(252, 129, 129, 0.3);
    min-width: 300px;
}

#game-message.show {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
}

#game-message h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #fc8181;
    text-shadow: 0 0 20px rgba(252, 129, 129, 0.5);
}

#final-score {
    font-size: 24px;
    margin-bottom: 15px;
    color: #00d4ff;
    font-weight: bold;
}

#high-score-message {
    font-size: 16px;
    color: #ffd700;
    margin-bottom: 25px;
    min-height: 20px;
    font-weight: bold;
}

#mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50;
    pointer-events: none;
}

#mobile-controls.show {
    display: flex;
}

.control-group {
    display: flex;
    gap: 10px;
}

.control-btn {
    width: 60px;
    height: 60px;
    background: rgba(0, 212, 255, 0.3);
    border: 2px solid rgba(0, 212, 255, 0.5);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    pointer-events: all;
    transition: all 0.2s;
}

.control-btn:active {
    background: rgba(0, 212, 255, 0.5);
    transform: scale(0.95);
}

#btn-shoot {
    width: 70px;
    height: 70px;
    background: rgba(252, 129, 129, 0.3);
    border-color: rgba(252, 129, 129, 0.5);
}

#btn-shoot:active {
    background: rgba(252, 129, 129, 0.5);
}

@media (max-width: 600px) {
    .controls-section {
        flex-direction: column;
        gap: 12px;
    }

    .welcome-box {
        padding: 18px;
    }

    h1 {
        font-size: 36px;
    }

    .welcome-box h2 {
        font-size: 20px;
    }

    .how-to-play p {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    #game-wrapper {
        padding: 10px;
    }

    #game-container {
        height: 85vh;
        min-height: 600px;
    }

    h1 {
        font-size: 32px;
        margin-bottom: 10px;
    }

    .stat {
        padding: 8px 15px;
    }

    .stat-value {
        font-size: 20px;
    }

    button {
        padding: 15px 40px;
        font-size: 18px;
    }

    #start-screen {
        padding: 20px 20px 30px 20px;
    }
}