* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent text selection and zooming on mobile */
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

body, html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #1a1a1a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #f0f0f0;
}

/* UI Layer sits on top of canvas */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas when UI is not active */
    z-index: 10;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 2rem;
    pointer-events: auto; /* Re-enable clicks for active UI elements */
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
}

#game-ui {
    /* Different from waiting room, game UI is an overlay, not a solid background */
    background: transparent;
    pointer-events: none; /* Let clicks pass to canvas */
    justify-content: flex-start;
    align-items: flex-start;
}

#game-ui.active {
    display: block; /* Overwrite flex from generic active */
}

#game-ui button, #game-ui #diagnosis {
    pointer-events: auto; /* Enable clicks on specific UI elements */
}

button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    margin: 10px;
}

button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 242, 254, 0.4);
}

#diagnosis {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2rem;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}
