﻿* {
    font-family: sans-serif;
    box-sizing: border-box;
}

body {
    /* margin: 0; */
    background-color: rgb(0, 0, 0);
    /* display: flex;         /* Lägg flex även här för säkerhets skull
    justify-content: center;
    align-items: center;
    min-height: 100vh; */
}

main {
    position:relative;
    display: flex;
    flex-direction: column;
    align-items: center;    /* Centrerar kartan horisontellt */
    justify-content: center; /* Centrerar kartan vertikalt */
    min-height: 100vh;
}

canvas {
    display: block;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.space-background {
    background: radial-gradient(circle, #000033 0%, #000000 100%);
}

span {
    font-size: 16px;
}

.span-number {
    padding-right: 20px;
}

#gameContainer {
    position: relative;
    display: inline-block;
}

#ui-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    text-align: center;
    padding: 15px;
    gap: 15px;
    color: aliceblue;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: 5px solid rgba(255, 61, 255, 0.5);
    border-radius: 15px;
    box-shadow: 0px 5px 15px 1px rgba(255, 61, 255, 0.5), inset 0px 5px 15px 1px rgba(255, 61, 255, 0.5);
    width: 80%;
    height: auto;
    z-index: 1000;
}

button{
    margin: 15px;
    color: white;
    background-color: rgba(255, 61, 255, 0.5);
    /* border: 2px solid rgba(255, 61, 255, 0.5); */
    box-shadow: 0px 5px 15px 1px rgba(255, 61, 255, 0.5);
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    transition: all 0.2s ease;
}

button:hover {
    cursor: pointer;
    background-color: rgba(255, 128, 255, 0.5);
    transform: translateY(-2px);
}

button:active {
    background-color: rgba(235, 1, 235, 0.5);
    transform: translateY(0px);
}

#healthContainer {
    position: absolute;
    top: 10px;
    left: 40px;
    width: 150px;
    height: 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    overflow: hidden;
    z-index: 10;
}

#healthBar {
  height: 100%;
  width: 100%;
  background: lime;
  transition: width 0.2s ease;
}

.hidden {
    display: none !important;
}

@media (max-width: 650px) {
    body {
        align-items: flex-start; /* Flytta allt till toppen */
    }

    main {
        display: flex;
        padding-top: 10px; /* Lite marginal så det inte nuddar kanten */
        justify-content: flex-start;
        align-items: center;
        width: 100%;
    }

    #ui-overlay {
        top: 20%; 
        transform: translate(-50%, 0); /* Centrera bara horisontellt */
        width: 80%; /* Gör menyn lite bredare så den är lättare att klicka på */
    }
}