/*Gagalin font used this to make the UI of the game so i am using this everywhere.
Because this font is now my universal font for everything i like this to muck now 

Also the THing you see in UI is all own made no AI 0% Ai 
Loading gagalin font*/
@font-face {
    font-family: 'Gagalin';
    src: url('Gagalin-Regular.otf') format('opentype'), url('https://raw.githubusercontent.com/nemobgs/mrBurger/master/fonts/wpid-gagalin/Gagalin-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-dark: #0d0d0d;
    --accent-red: #f25349;
    --accent-dark-red: #5e1e26;
    --accent-green: #4ade80;
    --accent-dark-green: #166534;
    --text-white: #ffffff;
    --font-main: 'Gagalin', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    user-select: none;
}

.ui-layer {
    width: 100%;
    max-width: 1280px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px 30px;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.left-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.level-badge {
    font-size: 2.2rem;
    color: var(--text-white);
    letter-spacing: 1.5px;
    line-height: 1;
}

.title-block {
    text-align: center;
    margin-top: -10px;
}

h1 {
    font-size: 5.5rem;
    text-transform: uppercase;
    color: var(--text-white);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    line-height: 0.85;
    letter-spacing: 2px;
    margin-bottom: 10px;
    animation: floatTitle 4s ease-in-out infinite;
}

.subtitle {
    font-family: var(--font-main);
    font-size: 1.4rem;
    color: var(--accent-red);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-wrapper {
    position: relative;
    width: 100%;
    flex-grow: 1;
    background: #000;
    border-radius: 15px;
    border: 2px solid #333;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 13, 0.96);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s;
}

.overlay h2 {
    font-size: 4.5rem;
    color: var(--accent-red);
    margin-bottom: 30px;
    letter-spacing: 3px;
}

.overlay p {
    font-size: 1.8rem;
    color: #ccc;
    margin: 8px 0;
    letter-spacing: 1px;
    text-align: center;
}

.overlay span {
    color: var(--accent-red);
    text-decoration: underline;
}

/*buttons in overlay*/
.overlay-buttons {
    display: flex;
    gap: 20px;
}

#levelGrid {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.level-btn {
    width: 80px;
    height: 80px;
    border-radius: 15px;
    font-size: 2.5rem;
    font-family: var(--font-main);
    cursor: pointer;
    background-color: var(--accent-red);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 0 var(--accent-dark-red);
    transition: transform 0.1s;
}

.level-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--accent-dark-red);
}

.level-btn.locked {
    background-color: #333;
    color: #555;
    box-shadow: 0 6px 0 #111;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

footer {
    width: 100%;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-hint {
    font-size: 1.3rem;
    letter-spacing: 1px;
    color: #666;
}

.controls-hint span {
    margin-right: 25px;
    background: #1a1a1a;
    padding: 10px 15px;
    border-radius: 10px;
    color: #999;
    border: 1px solid #333;
}

button {
    font-family: var(--font-main);
    border: none;
    cursor: pointer;
    border-radius: 40px;
    padding: 12px 35px;
    font-size: 1.5rem;
    letter-spacing: 1.5px;
    transition: all 0.1s ease-in-out;
    background-color: var(--accent-red);
    color: white;
    box-shadow: 0 4px 0 var(--accent-dark-red);
}

button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--accent-dark-red);
}

button:hover {
    filter: brightness(1.1);
}

.btn-green {
    background-color: var(--accent-green);
    box-shadow: 0 4px 0 var(--accent-dark-green);
}

.btn-green:active {
    box-shadow: 0 2px 0 var(--accent-dark-green);
}

.btn-small {
    font-size: 1rem;
    padding: 8px 20px;
    background-color: #f25349;
    color: white;
    box-shadow: 0 3px 0 var(--accent-dark-red);
    border-radius: 20px;
}

.btn-small:hover {
    filter: brightness(1.3);
}

@keyframes floatTitle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

#scopeBtn{
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60;
    cursor: pointer;
    z-index: 50;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.1s;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

#scopeBtn:hover{
    opacity: 1.0;
    transform: scale(1.1);
}

#scopeBtn:active {
    transform: scale(0.9);
}