/*lets do the css its pretty ez */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;800;900&display=swap');
:root {
    --dark: #0b0b1a;
    --neon: #00ffd5;
    --void: #4a008a;
    --steel: #5e5e7a;
    --white: #f8f9fa;
}
body{
    margin: 0;
    padding: 0;
    background-color: var(--dark);
    color: var(--white);
    height: 100vh;
    font-family: 'Inter','Segoe UI', system-ui, -apple-system, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}
#game-wrapper{
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
canvas{
    background: radial-gradient(circle at top, #16162d 0%, #0b0b1a 100%);
    display: block;
}
#hud{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-sizing: border-box;
}
.stat-label{
    margin-right: 5px;
    opacity: 0.6;
}
.stat-value{
    color: var(--neon);
    font-weight: 800;
}
#menu-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 11, 26, 0.92);/*spent time on a value behind decimal jst to make it look nice :sob*/
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    backdrop-filter: blur(8px);
}
.menu-content{
    max-width: 300px;
    padding: 20px;
}
h1{
    font-size: 42px;
    font-weight: 900;
    margin: 0 0 10px 0;
    background: linear-gradient(45deg,var(--neon), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
p{
    font-size: 15px;
    margin-bottom: 30px;
    opacity: 0.8;
    line-height: 1.6;
}
.btn-primary{
    background: var(--neon);
    font-weight: 800;
    color: var(--dark);
    padding: 16px 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s,box-shadow 0.2s;
}
.btn-primary:hover{
    transform: translateY(-2px);
}
.hidden{
    display: none !important;
}
/* 
Develog #1: MAde the HTML CSS and JS files, linked them and after that added basic styles so now moving to JS for the actual logic part.
*/
#health-container{
    width: 150px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--steel);
    position: absolute;
    top: 60px;
    left: 25px;
    left: 25px;
}
#health-bar{
    width: 100%;
    height: 100%;
    background: #ff4757;
    transition: width 0.3s;
}
@keyframes shake{
    0%{
        transform: translate(1px,1px) rotate(0deg);
    }
    10%{
        transform: translate(-1px,-2px) rotate(-1deg);
    }
    20%{
        transform: translate(-3px,0px) rotate(1deg);
    }
    30%{
        transform: translate(3px,2px) rotate(0deg);
    }
    40%{
        transform: translate(1px,-1px) rotate(1deg);
    }
    50%{
        transform: translate(-1px,2px) rotate(-1deg);
    }
    60%{
        transform: translate(-3px,1px) rotate(0deg);
    }
    70%{
        transform: translate(3px,1px) rotate(-1deg);
    }
    80%{
        transform: translate(-1px,-1px) rotate(1deg);
    }
    90%{
        transform: translate(1px,2px) rotate(0deg);
    }
    100%{
        transform: translate(1px,-2px) rotate(-1deg);
    }
}
/*lmao that was so much brain shaking*/
.shake{
    animation: shake 0.2s;
    animation-iteration-count: 1;
}



#minimap{
    height: 200px;
    width: 30px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.05);/*why am i like adding rgba everywhere lmao*/
    border-left: 1px solid var(--steel);
    overflow: hidden;
}
#map-player{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--neon);
    border-radius: 50%;
    z-index: 2;
}
.map-dot{
    position: absolute;
    left: 10%;
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}
.map-enemy{
    position: absolute;
    left: 50%;
    width: 4px;
    height: 4px;
    background: #ff4757;
    transform: translateX(-50%);
    border-radius: 50%;
}
.level-up-text{
    color: var(--neon); 
    position: absolute;
    top: 40%;
    left: 50%;
    font-size: 60px;
    font-weight: 900;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    animation: fadeup 1.5s forwards;
}
@keyframes fadeup{
    0%{
        opacity: 0;
        transform: translate(-50%,0%);
    }
    20%{
        opacity: 1;
    }
    100%{
        opacity: 0;
        transform: translate(-50%,-100%);
    }
}
.level-corner{
    position: absolute;
    bottom: 20px;
    left: 20px;
    text-align: left;
    pointer-events: none;
}
#lvldisplay{
    color: var(--neon);
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
}
.btn-secondary{
    background: transparent;
    border: 1px solid var(--steel);
    color: var(--white);
    padding: 10px 30px;
    margin-top: 10px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
}
#history-overlay{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
}
.history-box{
    width: 300px;
    background: #16162d;
    padding: 20px;
    border: 1px solid var(--neon);
    text-align: center;
}
#history-list{
    list-style: none;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    text-align: left;
    font-size: 12px;
    color: #aaa;
}
#history-list li{
    border-bottom: 1px solid #333;
    padding: 5px 0;
}