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

body {
    background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    color: white;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

h1 {
    color: #00ff41;
    font-size: 2.5em;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #00ff41;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
}

#gameCanvas {
    background: #000;
    border: 2px solid #00ff41;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
    display: block;
    margin: 0 auto;
}

.controls {
    margin-top: 20px;
    font-size: 0.9em;
    color: #ccc;
    line-height: 1.5;
}

.game-over, .start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border: 2px solid #ff0000;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    z-index: 1000;
}

.start-screen {
    border-color: #00ff41;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.5);
}

.game-over h2, .start-screen h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.start-screen h2 {
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.game-over p, .start-screen p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

button {
    background: linear-gradient(45deg, #00ff41, #00cc33);
    color: black;
    border: none;
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: linear-gradient(45deg, #00cc33, #00ff41);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

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

.hidden {
    display: none !important;
}

@keyframes explosion {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

.explosion {
    animation: explosion 0.3s ease-out;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.blink {
    animation: blink 0.3s infinite;
}

/* レスポンシブデザイン */
@media (max-width: 900px) {
    #gameCanvas {
        width: 100%;
        max-width: 800px;
        height: auto;
    }
    
    .game-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .score-board {
        font-size: 1em;
        flex-direction: column;
        gap: 5px;
    }
}

/* 操作切り替えボタン */
.control-toggle {
    margin-bottom: 15px;
}

.control-toggle button {
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    color: white;
    padding: 10px 20px;
    font-size: 0.9em;
}

/* モバイル用操作ボタン - レトロアーケード風 */
.mobile-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.button-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-btn {
    width: 80px;
    height: 80px;
    border: 3px solid #00ff41;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.3em;
    font-weight: bold;
    color: #00ff41;
    background: #000000;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    box-shadow: 
        0 0 10px rgba(0, 255, 65, 0.3),
        inset 0 0 10px rgba(0, 255, 65, 0.1);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.8);
    position: relative;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 4px;
    pointer-events: none;
}

.move-btn {
    background: 
        linear-gradient(45deg, transparent 30%, rgba(0, 255, 65, 0.1) 50%, transparent 70%),
        #000000;
}

.shoot-btn {
    width: 100px;
    height: 100px;
    font-size: 1em;
    border-color: #ff4757;
    color: #ff4757;
    text-shadow: 0 0 5px rgba(255, 71, 87, 0.8);
    box-shadow: 
        0 0 15px rgba(255, 71, 87, 0.4),
        inset 0 0 10px rgba(255, 71, 87, 0.1);
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 71, 87, 0.1) 50%, transparent 70%),
        #000000;
}

.shoot-btn::before {
    border-color: rgba(255, 71, 87, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 
        0 0 20px rgba(0, 255, 65, 0.6),
        inset 0 0 20px rgba(0, 255, 65, 0.3);
    background: rgba(0, 255, 65, 0.2);
    border-color: #ffffff;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 1);
}

.shoot-btn:active {
    box-shadow: 
        0 0 25px rgba(255, 71, 87, 0.8),
        inset 0 0 20px rgba(255, 71, 87, 0.4);
    background: rgba(255, 71, 87, 0.2);
    border-color: #ffffff;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 1);
}

/* モバイル表示時の調整 */
@media (max-width: 900px) {
    .mobile-buttons {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        background: rgba(0, 0, 0, 0.95);
        padding: 15px;
        border-radius: 10px;
        border: 2px solid #00ff41;
        box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    }
    
    .control-btn {
        width: 70px;
        height: 70px;
        font-size: 1.2em;
    }
    
    .shoot-btn {
        width: 85px;
        height: 85px;
        font-size: 0.9em;
    }
    
    /* レトロ風のスキャンライン効果 */
    .mobile-buttons::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 65, 0.03) 2px,
            rgba(0, 255, 65, 0.03) 4px
        );
        pointer-events: none;
        border-radius: 8px;
    }
}
