/* Core Layout Reset */
* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #05030a;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Fullscreen Game Viewport Wrapper */
#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at center, #140d33 0%, #060414 100%);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Heads-Up Display Styling */
#hud {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 10;
    pointer-events: none;
}

.hud-item {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
    font-family: monospace;
}

/* Interactive UI Screens Layer */
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 3, 10, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

#overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

#menu-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    border-radius: 20px;
    background: rgba(20, 13, 51, 0.6);
    border: 2px solid rgba(186, 12, 248, 0.4);
    box-shadow: 0 0 40px rgba(186, 12, 248, 0.2);
    backdrop-filter: blur(10px);
    margin: 20px;
}

#title {
    color: #fff;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ba0cf8, 0 0 40px #00f2fe;
}

#instructions {
    color: #b0a8d6;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

#score-board {
    margin-bottom: 30px;
    color: #ff3366;
    font-weight: bold;
    letter-spacing: 1px;
}

#score-board h2 {
    color: #00f2fe;
    font-size: 2rem;
    margin-top: 10px;
    text-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
}

/* Touch-Friendly Navigation Elements */
#action-btn {
    background: linear-gradient(45deg, #ba0cf8, #00f2fe);
    color: #fff;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 300px;
}

#action-btn:active {
    transform: scale(0.96);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.hidden {
    display: none !important;
}