@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@700&family=Rajdhani:wght@600&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #020202;
    background-image: radial-gradient(#1a1a1a 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Rajdhani', sans-serif;
    overflow: hidden;
    color: white;
}

#gameContainer {
    position: relative;
    width: 800px;
    height: 600px;
    box-shadow: 0 0 60px rgba(255, 0, 50, 0.15);
    border: 3px solid #222;
    background: #000;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.ui-box {
    font-family: 'Courier Prime', monospace;
    font-size: 24px;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.death-box { color: #f33; text-shadow: 0 0 10px rgba(255, 50, 50, 0.5); }

#menu, #msgOverlay {
    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;
    transition: opacity 0.3s;
}

h1.glitch {
    font-family: 'Courier Prime', monospace;
    font-size: 72px;
    color: #f33;
    text-shadow: 4px 4px 0 #500;
    margin-bottom: 5px;
    letter-spacing: -4px;
}

.subtitle {
    color: #888;
    font-size: 20px;
    letter-spacing: 2px;
    margin-bottom: 40px;
}

.controls-info {
    margin-bottom: 30px;
    text-align: center;
    color: #ccc;
    font-size: 18px;
}

.key {
    display: inline-block;
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #555;
    color: #fff;
    font-family: monospace;
    font-size: 16px;
}

/* Seletor de Nível */
.level-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    background: #111;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 8px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#levelInput {
    background: #000;
    border: 2px solid #0ff;
    color: #0ff;
    font-family: 'Courier Prime', monospace;
    font-size: 28px;
    width: 80px;
    text-align: center;
    padding: 5px;
    outline: none;
}

.nav-btn {
    background: #333;
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin: 0;
    padding: 0;
    box-shadow: none;
}

.nav-btn:hover { background: #555; transform: none; }

/* Botão Iniciar */
button#startBtn {
    background: linear-gradient(to bottom, #f33, #c00);
    color: #fff;
    border: none;
    padding: 15px 60px;
    font-size: 24px;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 0 #800, 0 0 20px rgba(255, 0, 0, 0.4);
    transition: transform 0.1s;
    text-transform: uppercase;
}

button#startBtn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

button#startBtn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #800;
}

.hidden { display: none !important; }