body, html {
    margin: 0;
    padding: 0;
}

* {
    font-family: sans-serif;
}

.fullscreen {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.fullscreen > * {
    width: 100%;
    height: 100%;
}

.overlay {
    position: fixed;
    left: 0;
    top: 0;
}

.no-touch {
    touch-action: none;
}

.pixelated {
    image-rendering: pixelated;
}

.loader-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 100px;
    height: 100px;

    border: 15px solid transparent;
    border-radius: 50%;
    border-top-color: #999;
    border-bottom-color: #999;

    animation: spin 2s ease-in-out infinite;
}

@keyframes spin {
      0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}

.main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease-out;
    pointer-events: auto;
}

.main-menu.hidden {
    opacity: 0;
    pointer-events: none;
}

.menu-content {
    text-align: center;
    color: white;
}

.menu-content h1 {
    font-size: 4rem;
    margin: 0 0 2rem 0;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

.game-goal {
    font-size: 1.2rem;
    margin: 0 0 1.5rem 0;
    color: #e0e0e0;
    max-width: 500px;
    line-height: 1.6;
}

.controls-list {
    margin: 1.5rem 0 2rem 0;
    font-size: 1rem;
    color: #d0d0d0;
}

.controls-list p {
    margin: 0.5rem 0;
    line-height: 1.4;
}

.controls-list strong {
    color: #f68497;
    font-weight: bold;
}

.play-button {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: #f68497;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(246, 132, 151, 0.4);
}

.play-button:hover {
    background-color: #f55a7b;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(246, 132, 151, 0.6);
}

.play-button:active {
    transform: scale(0.98);
}

#hud {
    position: fixed;
    top: 16px;
    left: 0;
    width: 100%;
    height: auto;
    pointer-events: none; /* clicks pass through */
    z-index: 900;
    display: flex;
    justify-content: space-between;
    padding: 0 24px;
    box-sizing: border-box;
}

#hud > div {
    background: rgba(0, 0, 0, 0.55);
    color: white;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#hud.hidden {
    opacity: 0;
}

#msg.hidden {
    opacity: 0;
}

#cursor {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 15px;
    transform: translate(-50%, -50%);
    align-items: center;
}

#cursor #cursor-img {
    filter: invert();
    width: 15px;
    height: 15px;
}