* {
    box-sizing: border-box;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#starCanvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#gameCanvas {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    display: block;
    max-width: 100%;
    /* Fixes overflow on small screens */
}

.screen,
.modal {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.9);
    text-align: center;
}

.hidden {
    display: none !important;
}

/* Tutorial Modal Styling */
.modal-content {
    background: #050505;
    border: 4px solid #55ff55;
    box-shadow: 0 0 20px #55ff55;
    padding: 30px;
    border-radius: 10px;
    max-width: 90%;
    width: 500px;
}

.tut-header {
    color: #55ff55;
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px #000;
}

.tut-grid {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.tut-option h3 {
    color: #ff5555;
    font-size: 0.7rem;
    margin-bottom: 10px;
}

.tut-option p {
    font-size: 0.5rem;
    line-height: 2;
    margin: 5px 0;
}

/* UI Elements */
.title-main {
    color: #55ff55;
    font-size: 2.8rem;
    margin: 10px;
}

.title-sub {
    color: #ff5555;
    font-size: 3.0rem;
    margin: 10px;
}

.pixel-btn {
    background: transparent;
    border: 3px solid #55ff55;
    color: #55ff55;
    padding: 12px 30px;
    font-family: 'Press Start 2P';
    cursor: pointer;
    transition: 0.3s;
}

.pixel-btn:hover {
    background: #55ff55;
    color: #000;
}

/* Back Button styling */
#top-left-ui {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 150;
}

.back-btn {
    background: transparent;
    border: 2px solid #ff5555;
    color: #ff5555;
    font-family: 'Press Start 2P';
    font-size: 0.6rem;
    padding: 8px 12px;
    cursor: pointer;
    transition: 0.3s;
}

.back-btn:hover {
    background: #ff5555;
    color: black;
}

#top-ui {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 150;
    display: flex;
    gap: 15px;
}

.ui-icon {
    font-size: 1.5rem;
    cursor: pointer;
    color: #55ff55;
}

#tutorial-icon {
    margin-top: 6px;
}

#game-hud {
    position: absolute;
    top: 70px;
    /* Moved down to avoid overlapping buttons */
    width: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 1.2rem;
    z-index: 10;
    pointer-events: none;
}

.pixel-icon {
    width: 70px;
}

.alien-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .title-main {
        font-size: 1.8rem;
    }

    .pixel-icon {
        width: 40px;
    }

    .title-sub {
        font-size: 2.0rem;
    }

    #game-hud {
        font-size: 0.7rem;

    }
}