body {
    margin: 0;
    padding: 0;
    background-color: #050510;
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    flex-direction: column;
}

.game-container {
    position: relative;
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.game-title {
    margin: 28px 0 10px;
    font-size: 24px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px #00ffff;
}

.score-display {
    font-size: 20px;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #00ffff, 0 0 20px rgba(0, 255, 255, 0.5);
    background: rgba(0, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.best-display {
    font-size: 11px;
    color: #8ed9dc;
    margin: -6px 0 10px;
    line-height: 1.45;
}

canvas {
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    aspect-ratio: 3 / 4;
    touch-action: none;
}

.game-over, .overlay {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00ffff;
    padding: 40px;
    z-index: 20;
    text-align: center;
    min-width: 300px;
}

.overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    border-color: #00ffff;
    box-shadow: 0 0 30px #00ffff;
}

.game-over { border-color: #ff0000; color: #ff0000; box-shadow: 0 0 30px #ff0000; }

.game-over h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.game-over button, .overlay button {
    background: #00ffff;
    color: #000;
    border: none;
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 2px;
    transition: all 0.3s;
}

.game-over button { background: #ff0000; }

.game-over button:hover, .overlay button:hover {
    background: #fff;
    transform: scale(1.1);
}

.controls {
    margin-top: 15px;
    color: #888;
    font-size: 12px;
}

.touch-guide {
    display: none;
    margin: 6px 0 0;
    font-size: 11px;
    color: rgba(170, 237, 242, 0.82);
}

.mobile-controls {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(0, 6, 20, 0.78);
    z-index: 15;
}

.control-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.action-pad {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-btn,
.action-btn {
    border: 1px solid rgba(0, 255, 255, 0.6);
    background: rgba(0, 20, 34, 0.9);
    color: #c8fdff;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.control-btn {
    width: 52px;
    height: 44px;
    border-radius: 10px;
    font-size: 20px;
}

.action-btn {
    width: 102px;
    height: 54px;
    border-radius: 14px;
    font-size: 16px;
    letter-spacing: 1px;
}

.shoot-btn {
    border-color: rgba(0, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.bomber-btn {
    border-color: rgba(255, 90, 170, 0.9);
    color: #ffd8f1;
    box-shadow: 0 0 10px rgba(255, 90, 170, 0.28);
}

.game-meta {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    font-size: 10px;
    color: rgba(188, 221, 227, 0.78);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.4;
    z-index: 25;
    text-align: right;
}

.bottom-hud {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    margin-top: 10px;
    border: 2px solid #5500ff;
    box-shadow: 0 0 15px #5500ff;
    border-radius: 10px;
}

.hud-item {
    font-size: 20px;
    color: #fff;
    text-shadow: 0 0 8px #fff, 0 0 15px #00ffff;
    font-weight: bold;
}

.back-link {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    color: rgba(188, 255, 255, 0.84);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 0.03em;
    transition: opacity 0.3s, color 0.3s;
    z-index: 25;
}

.back-link:hover {
    color: #00ffff;
    opacity: 1;
    text-shadow: 0 0 5px #00ffff;
}

@media (max-width: 700px), (hover: none) and (pointer: coarse) {
    body {
        align-items: stretch;
        justify-content: flex-start;
        min-height: 100dvh;
        height: 100dvh;
        overflow: hidden;
    }

    .game-container {
        width: 100vw;
        max-width: none;
        min-height: 100dvh;
        height: 100dvh;
        justify-content: flex-start;
        padding: calc(8px + env(safe-area-inset-top)) 8px calc(10px + env(safe-area-inset-bottom));
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .game-title {
        margin-top: 24px;
    }

    .best-display {
        font-size: 9px;
        margin: -2px 0 8px;
    }

    canvas {
        max-height: 46dvh;
        margin-bottom: 4px;
    }

    .mobile-controls {
        display: flex;
        position: sticky;
        bottom: calc(8px + env(safe-area-inset-bottom));
        padding: 10px;
        margin-top: 12px;
    }

    .touch-guide {
        display: block;
        font-size: 9px;
        margin-top: 4px;
    }

    .bottom-hud {
        padding: 8px;
        margin-top: 8px;
    }

    .hud-item {
        font-size: 16px;
    }

    .game-meta {
        top: calc(8px + env(safe-area-inset-top));
        right: 8px;
        font-size: 8px;
    }

    .back-link {
        top: calc(8px + env(safe-area-inset-top));
        left: 8px;
        font-size: 8px;
    }
}
