*, *::before, *::after { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* ── Welcome screen ─────────────────────────────────────────── */
#welcome-screen {
    width: 100%;
    height: 100%;
    background: #111;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

#welcome-screen[hidden] { display: none !important; }

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #aaa;
}

#join-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,255,255,0.2);
    transition: transform 0.1s, opacity 0.2s;
}

#join-btn:active { transform: scale(0.95); }
#join-btn:disabled { opacity: 0.5; cursor: default; }

#status {
    margin-top: 2rem;
    color: #888;
    font-size: 0.9rem;
}

#debug-ui {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    font-family: monospace;
    font-size: 0.75rem;
    color: #444;
    text-align: left;
    pointer-events: none;
}

/* ── Canvas screen ───────────────────────────────────────────── */
#canvas-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

#canvas-screen[hidden] { display: none !important; }

#main-canvas {
    width: 100vw;
    height: 100vh;
    display: block;
}

/* ── Reconnect overlay ───────────────────────────────────────── */
#reconnect-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    z-index: 999;
}

#reconnect-overlay[hidden] { display: none !important; }
