:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --accent-color: #38bdf8;
    --enemy-color: #ff00ff;
    --player-color: #00f0ff;
    --grid-color: rgba(255, 255, 255, 0.05);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 800px;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

header {
    text-align: center;
    width: 100%;
    font-size: 1.2rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 12px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

canvas {
    background-color: #1e293b;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
    max-width: 100%;
    width: 100%;
    flex-grow: 1;
    min-height: 0;
    image-rendering: pixelated;
}

.controls-hint {
    color: #94a3b8;
    font-size: 0.9rem;
}

.back-btn {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(5px);
}

.hidden {
    display: none;
}

.modal-content {
    background: #1e293b;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 2rem;
    margin: 0 0 10px 0;
    color: var(--player-color);
    text-shadow: 0 0 20px var(--player-color);
}

.modal-content p {
    font-size: 1.2rem;
    margin: 10px 0 20px 0;
}

button {
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    border: none;
    padding: 12px 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 15px;
    display: block;
    width: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.4);
}

.menu-btn {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-top: 10px;
    font-size: 0.9rem;
}

.menu-btn:hover {
    color: white;
}

#game-over-modal .modal-content h2 {
    color: var(--enemy-color);
    text-shadow: 0 0 20px var(--enemy-color);
}


