* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }

body { background-color: #050510; color: #fff; overflow: hidden; width: 100vw; height: 100vh; }

#gameContainer { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

canvas { display: block; background: url('images/tiledbackground-sheet0.png') repeat; width: 100%; height: 100%; object-fit: contain; }

/* UI Panels */
.ui-panel { position: absolute; z-index: 10; background: rgba(15, 15, 30, 0.85); backdrop-filter: blur(15px); border: 1px solid rgba(99, 102, 241, 0.3); padding: 40px; border-radius: 24px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.5); min-width: 320px; transition: opacity 0.3s, transform 0.3s; }
.ui-panel.hidden { opacity: 0; pointer-events: none; transform: scale(0.95); }

.ui-panel h1 { font-size: 2.5rem; background: linear-gradient(135deg, #a5b4fc, #e0e7ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 5px; }
.ui-panel h2 { color: #e0e7ff; margin-bottom: 15px; }
.subtitle { color: #818cf8; font-size: 1rem; margin-bottom: 30px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }

.menu-actions { display: flex; flex-direction: column; gap: 15px; }

/* Buttons & Inputs */
.btn { padding: 12px 20px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: all 0.2s; border: none; font-size: 1rem; }
.btn.primary { background: #6366f1; color: #fff; }
.btn.primary:hover { background: #4f46e5; box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); }
.btn.secondary { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.btn.secondary:hover { background: rgba(99, 102, 241, 0.3); }
.btn.ghost { background: transparent; color: rgba(255,255,255,0.6); }
.btn.ghost:hover { color: #fff; background: rgba(255,255,255,0.1); }

.join-section { display: flex; gap: 10px; }
.join-section input { flex: 1; padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.3); color: #fff; font-size: 1rem; text-align: center; font-weight: bold; letter-spacing: 2px; }
.join-section input:focus { outline: none; border-color: #6366f1; }

hr { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 10px 0; }

.error-msg { color: #ef4444; margin-top: 15px; font-size: 0.9rem; min-height: 20px; }

.room-code-display { font-size: 2.5rem; font-weight: 900; letter-spacing: 5px; color: #6366f1; background: rgba(0,0,0,0.3); padding: 15px; border-radius: 12px; margin: 20px 0; border: 1px dashed rgba(99, 102, 241, 0.5); }

/* Spinner */
.spinner { width: 40px; height: 40px; border: 4px solid rgba(99, 102, 241, 0.2); border-top-color: #6366f1; border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* HUD */
#hud { position: absolute; top: 0; left: 0; width: 100%; padding: 20px; display: flex; justify-content: space-between; align-items: center; z-index: 5; font-weight: bold; pointer-events: none; text-shadow: 0 2px 5px rgba(0,0,0,0.8); }
#hud.hidden { display: none; }
.hud-left { color: #4ade80; font-size: 1.2rem; }
.hud-right { color: #f87171; font-size: 1.2rem; }
.hud-center { color: #a5b4fc; font-size: 1rem; background: rgba(0,0,0,0.5); padding: 5px 15px; border-radius: 20px; }
