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

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    font-family: 'Courier New', monospace;
    color: #00FF00;
    overflow-y: auto;
    overflow-x: hidden;
    user-select: none;
    padding-bottom: 20px;
}

.mute-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 4px;
    transition: transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    border-radius: 0;
    z-index: 10;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    min-height: 28px;
}

.mute-button:active {
    transform: scale(0.95);
    background: rgba(0, 255, 0, 0.3);
}

.mute-button:hover {
    background: rgba(0, 255, 0, 0.25);
}

.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border: 3px solid #00FF00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    border-radius: 5px;
}

.header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-right {
    text-align: right;
}

.score-item, .lives-item, .level-item, .speed-item {
    font-size: 16px;
    color: #FFFFFF;
    font-weight: bold;
}

.score-value, .lives-value, .level-value, .speed-value {
    font-size: 20px;
    color: #FFFFFF;
    font-weight: bold;
}

h1 {
    font-size: 32px;
    text-shadow: 0 0 10px #00FF00;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}

.powerup-status {
    font-size: 12px;
    color: #00FF00;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 16px;
    margin-top: 5px;
    font-weight: bold;
}

.powerup-icon {
    display: inline-block;
    margin: 0 4px;
    padding: 2px 6px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    vertical-align: top;
}

.powerup-missiles {
    border-color: #FFFF00;
    color: #FFFF00;
    background: rgba(255, 255, 0, 0.1);
}

.powerup-lava {
    border-color: #FF8800;
    color: #FF8800;
    background: rgba(255, 136, 0, 0.1);
}

.powerup-slow {
    border-color: #00FF00;
    color: #00FF00;
    background: rgba(0, 255, 0, 0.1);
}

.powerup-bomb {
    border-color: #FF00FF;
    color: #FF00FF;
    background: rgba(255, 0, 255, 0.1);
}

.powerup-timer-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 0, 0, 0.2);
    border-radius: 2px;
    margin-top: 3px;
    overflow: hidden;
}

.powerup-timer-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF0000, #FF4444);
    border-radius: 2px;
    transition: width 0.1s linear;
}

#gameCanvas {
    border: 3px solid #00FF00;
    background: #000000;
    display: block;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    cursor: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.info-panel {
    display: flex;
    justify-content: space-around;
    width: 800px;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 5px #00FF00;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.info-value {
    font-size: 24px;
    color: #00FF00;
}

.controls {
    text-align: center;
    font-size: 14px;
    color: #00FF00;
    width: 800px;
    line-height: 1.6;
}

.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border: 3px solid #00FF00;
}

.menu-overlay.hidden {
    display: none;
}

.menu-content {
    text-align: center;
    color: #00FF00;
}

.menu-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00FF00;
}

.menu-content p {
    font-size: 16px;
    margin: 10px 0;
    line-height: 1.6;
}

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

.blink {
    animation: blink 0.5s infinite;
}

.canvas-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 800px;
    touch-action: none;
}

#gameCanvas {
    width: 100%;
    height: auto;
    max-width: 800px;
}

.touch-controls {
    display: none;
    gap: 10px;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 128, 0, 0.2);
    border: 1px solid #00FF00;
    border-radius: 5px;
    width: 100%;
    max-width: 400px;
}

.touch-controls.visible {
    display: flex;
    justify-content: space-around;
}

.touch-controls.hidden {
    display: none !important;
}

.touch-btn {
    flex: 1;
    padding: 10px;
    background: #00FF00;
    color: #000000;
    border: 2px solid #00FF00;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.touch-btn:active {
    background: #00CC00;
    border-color: #00CC00;
}

@media (max-width: 900px) {
    .game-container {
        padding: 15px;
        gap: 15px;
    }

    .info-panel, .controls {
        width: auto;
        padding: 0 15px;
    }

    h1 {
        font-size: 24px;
    }

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

    .controls {
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding: 15px 10px 10px 10px;
        gap: 10px;
        border-width: 2px;
    }

    .mute-button {
        bottom: 10px;
        right: 10px;
        font-size: 20px;
        padding: 2px 4px;
        line-height: 1.1;
        min-height: 28px;
    }

    .header {
        gap: 10px;
        margin-bottom: 5px;
    }

    h1 {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .header-left, .header-right {
        min-width: 50px;
    }

    .score-item, .lives-item, .level-item {
        font-size: 12px;
    }

    .score-value, .lives-value, .level-value {
        font-size: 16px;
    }

    .controls {
        font-size: 11px;
        padding: 0 10px;
    }

    .menu-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .menu-content p {
        font-size: 13px;
        margin: 8px 0;
    }

    #gameCanvas {
        border-width: 2px;
    }

    .canvas-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 12px 8px 8px 8px;
        gap: 8px;
    }

    .mute-button {
        bottom: 10px;
        right: 10px;
        font-size: 18px;
        padding: 2px 4px;
        line-height: 1.1;
        min-height: 24px;
    }

    .header {
        gap: 8px;
    }

    h1 {
        font-size: 18px;
    }

    .header-left, .header-right {
        min-width: 45px;
    }

    .score-item, .lives-item, .level-item {
        font-size: 11px;
    }

    .score-value, .lives-value, .level-value {
        font-size: 14px;
    }

    .controls {
        font-size: 10px;
        line-height: 1.4;
    }

    .touch-controls {
        margin-top: 5px;
        padding: 5px;
        gap: 5px;
    }

    .touch-btn {
        padding: 8px 5px;
        font-size: 12px;
    }
}

.game-footer {
    margin-top: 15px;
    font-size: 14px;
    color: #00FF00;
    font-family: 'Courier New', monospace;
}

.game-footer a {
    color: #00FF00;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.game-footer a:hover {
    color: #00FFFF;
    text-shadow: 0 0 10px #00FFFF;
}
