* { box-sizing: border-box; }

body {
    margin: 0;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1a2e;
    color: #eee;
}

.hidden { display: none !important; }

/* --- Auth screen --- */

#auth-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    background: #22223b;
    padding: 32px;
    border-radius: 12px;
    width: 300px;
    text-align: center;
}

.auth-box h1 {
    font-size: 20px;
    margin-bottom: 20px;
}

.auth-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2b2b45;
    color: #eee;
}

.auth-buttons {
    display: flex;
    gap: 8px;
}

.auth-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

#login-btn { background: #4361ee; color: white; }
#register-btn { background: #3a3a5c; color: #eee; }

.error {
    color: #f38ba0;
    font-size: 13px;
    min-height: 18px;
    margin-top: 10px;
}

/* --- Game screen --- */

#game-screen {
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#world-canvas {
    background: #0f3460;
    border-radius: 8px;
    border: 2px solid #444;
}

#chat-panel {
    width: 240px;
    height: 600px;
    display: flex;
    flex-direction: column;
    background: #22223b;
    border-radius: 8px;
    overflow: hidden;
}

#chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 13px;
}

#chat-log .msg { margin-bottom: 6px; word-wrap: break-word; }
#chat-log .msg .who { font-weight: 600; }

#chat-form { border-top: 1px solid #333; }

#chat-input {
    width: 100%;
    padding: 10px;
    border: none;
    background: #2b2b45;
    color: #eee;
}

#hint {
    position: absolute;
    bottom: 16px;
    left: 16px;
    font-size: 12px;
    color: #888;
}

#logout-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #3a3a5c;
    color: #eee;
    font-weight: 600;
    cursor: pointer;
}

#logout-btn:hover {
    background: #4a4a70;
}