body{
    background-color:#111;
    color:#ddd;
    font-family:"Courier New", Courier, monospace;
    margin: 0;
    padding: 0;
    display:flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    touch-action: none;
}

h1{
    font-size: 1.5rem;
    margin: 10px 0 5px 0;
    color:#fff;
    letter-spacing: 2px;
}

.header-panel{
    text-align: center;
    margin-bottom: 10px;
    max-width: 90vw;
}

#score-board{
    font-size: 1.2rem;
    font-weight: bold;
}

#status{
    color:#ffaa00;
    font-size: 1rem;
    margin-top: 5px;
    font-weight: bold;
}

#weirdo-msg{
    font-size:0.75rem;
    color:#888;
    margin-top: 5px;
    margin-bottom: 10px;
    max-width: 400px;
    line-height: 1.3;
}

#game-container{
    position: relative;
    display: flex;
    justify-content: center;
}

canvas{
    background-color:#000;
    border: 3px solid #444;
    background-image: linear-gradient(#222 1px, transparent 1px), linear-gradient(90deg, #222 1px, transparent 1px);
    background-size: 20px 20px;
    image-rendering: pixelated ;
    display: block;
}


#game-over-screen{
    position:absolute;
    top:0; 
    left:0; 
    width:100%; 
    height: 100%; 
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

#game-over-text{
    color: white; 
    font-size: 2rem;
    font-weight: bold; 
    margin-bottom: 10px;
}


 .reason-text{
    color:#ff0800; 
    font-size: 0.9rem; 
    margin-bottom: 20px;
    text-align: center;
    padding: 0 10px;
 }

 #retry-btn{
    background-color:#444;
    color:white;
    border: 2px solid #666;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 5px;
 }

 #retry-btn:active{
    background-color:#666;
 }


#d-pad{
    display: grid;
    grid-template-columns: repeat(3,60px);
    grid-template-rows: repeat(3,60px);
    gap: 10px;
    margin-top: 20px;
}

.d-btn{
    background-color:#222;
    color:#888;
    border: 2px solid #444;
    border-radius: 8px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    cursor: pointer;
}

.d-btn:active{
    background-color:#444;
    color:#fff;
}

#btn-up{
    grid-column: 2;
    grid-row: 1;
}

#btn-right{
    grid-column: 3;
    grid-row: 2;
}

#btn-left{
    grid-column: 1;
    grid-row: 2;
}

#btn-down{
    grid-column: 2;
    grid-row: 3;
}

@media(min-width: 768px){
    #d-pad{display: none;}
}

.hidden{
    display:none !important;
}
