* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html, body {
    height: 100%;
    overflow: hidden; 
}
body {
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #121212;
    color: #00ffff;
    padding: 10px 5px;
    touch-action: none;
}
h1 {
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.7);
    margin-bottom: 10px;
    flex-shrink: 0;
    font-size: 2.2em;
    text-transform: uppercase;
    letter-spacing: 2px;
}
#game-container {
     display: flex;
     flex-direction: column;
     align-items: center;
     width: 100%;
     flex-grow: 1;
     overflow: hidden;
     min-height: 0;
     padding-bottom: 5px;
}

#control-screen {
    background-color: #1e1e1e;
    padding: 20px;
    border: 2px solid #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    text-align: center;
    margin-bottom: 10px;
    display: block;
    flex-shrink: 0;
    color: #ffffff;
    max-width: 90%;
    width: 400px;
}
#control-screen.hidden {
     display: none;
}
#control-screen h2 {
     font-size: 1.4em;
     margin-bottom: 15px;
     color: #00ffff;
     text-transform: uppercase;
}
#difficulty-selection label {
    margin: 0 10px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    padding: 10px 0; 
    display: inline-block;
}
 #difficulty-selection input[type="radio"] {
     margin-right: 5px;
     vertical-align: middle;
     accent-color: #ff00ff;
     transform: scale(1.3); 
 }

/* Button Styles */
.action-btn {
     margin-top: 15px;
     padding: 15px 20px;
     font-size: 1.2em;
     font-family: 'Courier New', Courier, monospace;
     font-weight: bold;
     text-transform: uppercase;
     background-color: #ff00ff;
     color: #000;
     border: 2px solid #fff;
     cursor: pointer;
     transition: all 0.2s ease;
     width: 100%; 
}
 .action-btn.next-level {
     background-color: #00ffff;
 }
 .action-btn:active {
     background-color: #ffffff;
     transform: scale(0.98);
 }

/* Save/Load specific layout */
.save-load-container {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    flex-wrap: wrap;
    justify-content: center;
}
.action-btn.secondary {
    flex: 1;
    min-width: 80px;
    background-color: #1e1e1e;
    color: #00ffff;
    border-color: #00ffff;
    font-size: 0.9em;
    padding: 10px;
    margin-top: 10px;
}
.action-btn.secondary:active {
    background-color: #00ffff;
    color: #000;
}

#control-screen p {
     font-size: 0.9em;
     margin-top: 15px;
     color: #aaaaaa;
}

#canvas-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    min-height: 200px;
    overflow: hidden;
}
#canvas-wrapper.hidden {
     display: none;
}

#gameCanvas {
    background-color: #000000;
    display: block;
    border: 4px solid #333333;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    max-width: 100%;
    max-height: 100%;
    touch-action: none; 
    cursor: crosshair;
}

 .overlay-text {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    color: #00ffff;
    font-size: clamp(1.5em, 5vw, 2.5em);
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 4px;
    pointer-events: none;
    z-index: 10;
    display: none;
    text-transform: uppercase;
    text-shadow: 0 0 10px #00ffff;
 }
 .overlay-text.visible {
     display: flex;
 }
 .overlay-text small {
     font-size: 0.5em;
     margin-top: 10px;
     font-weight: normal;
     color: #aaaaaa;
     text-shadow: none;
 }

#game-info {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    display: none;
    flex-shrink: 0;
    width: 100%;
    margin-top: 5px;
    color: #ffffff;
}
 #game-info.visible {
     display: block;
 }
 #game-info span {
     margin: 0 10px;
     white-space: nowrap;
 }
 #score, #lives, #level {
     color: #ff00ff;
     text-shadow: 0 0 5px #ff00ff;
 }

#message {
    margin-top: 8px;
    font-weight: bold;
    color: #00ffff;
    min-height: 1.2em;
    text-align: center;
    font-size: 1em;
    flex-shrink: 0;
    width: 100%;
}