/* ============================================
   Tech Invaders — Future Ready: The Game
   Main Stylesheet
   ============================================ */


/* === Base Layout === */

html,
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100dvh;
    /* dvh = Dynamic Viewport Height (ignores mobile address bars perfectly!) */
    overflow: hidden;
    /* Stops the screen from bouncing/scrolling */
    background-color: #000000;
    touch-action: none;
    /* Tells the browser to ignore pull-to-refresh and swiping! */
}

#start-screen,
#name-input-screen,
#game-container {
    position: absolute;
    top: 50px;
    height: calc(100% - 100px);
    width: calc(100% - 32px);
    max-width: 1100px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
}


/* === Start Screen === */

#start-screen {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    font-family: 'Press Start 2P', monospace;
    color: white;
    text-align: center;
}

.game-title {
    font-size: 48px;
    color: #ffffff;
    text-shadow: 4px 4px 0px #9C27E8;
    line-height: 1.2;
    margin: 0 0 30px 0;
}

.game-subtitle {
    font-size: 32px;
    color: #17F0E6;
    text-shadow: 4px 4px 0px #9C27E8;
    line-height: 1.2;
    margin: 0 0 30px 0;
}

#play-button {
    background-color: #9C27E8;
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 18px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s, background-color 0.2s;
}

#play-button:hover {
    background-color: #AB52E5;
    transform: scale(1.05);
}


/* === Name Input Screen === */

#name-input-screen {
    background-color: transparent !important;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 500;
}

.input-modal {
    background-color: #2a2a2a;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #555;
}

#player-name-input {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    font-family: 'Courier', monospace;
    font-size: 18px;
    border: none;
    border-radius: 6px;
    box-sizing: border-box;
}

#name-error-msg {
    color: #ff4444;
    font-family: 'Courier', monospace;
    font-size: 14px;
    min-height: 20px;
    margin-top: 0;
    margin-bottom: 15px;
}

#submit-name-button {
    background-color: #16D372;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-family: 'Press Start 2P', monospace;
    cursor: pointer;
    border-radius: 6px;
}

#submit-name-button:hover {
    background-color: #3CDE8B;
}


/* === Game Container === */

#game-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    display: block;
}


/* === Responsive: Mobile Safe Zones === */
/* This rule only activates on screens smaller than 600px wide (phones and small tablets) */

@media (max-width: 600px) {

    #start-screen,
    #name-input-screen,
    #game-container {
        top: 50px !important;
        height: calc(100% - 180px) !important;
        width: calc(100% - 8px) !important;
    }
}