* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    background: #090d16;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

/* Auth / Hub Container */
.hub-container {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #1e293b;
    padding: 35px;
    border-radius: 14px;
    width: 400px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    text-align: center;
}
.hub-container h1, .hub-container h2 {
    margin-bottom: 20px;
    color: #38bdf8;
}
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #334155;
}
.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #94a3b8;
    padding: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.tab-btn.active {
    color: #38bdf8;
    border-bottom: 2px solid #38bdf8;
}
.form-content input {
    width: 100%;
    padding: 12px 14px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    margin-bottom: 12px;
}
.form-content input:focus { border-color: #38bdf8; }
.btn-main {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    margin-top: 5px;
}
.btn-main:hover { opacity: 0.9; }

.error-msg { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #fca5a5; padding: 8px; border-radius: 6px; font-size: 13px; margin-bottom: 15px; }
.success-msg { background: rgba(34, 197, 94, 0.2); border: 1px solid #22c55e; color: #86efac; padding: 8px; border-radius: 6px; font-size: 13px; margin-bottom: 15px; }

/* Dashboard Stanze */
.user-welcome { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 14px; color: #94a3b8; }
.logout-link { color: #ef4444; text-decoration: none; font-weight: bold; }
.rooms-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.room-card {
    background: #1e293b;
    border: 1px solid #334155;
    padding: 15px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.2s;
}
.room-card:hover { border-color: #38bdf8; transform: translateY(-2px); }
.room-card h3 { font-size: 16px; color: #38bdf8; margin-bottom: 3px; text-align: left; }
.room-card p { font-size: 12px; color: #94a3b8; text-align: left; }
.play-btn { background: #0284c7; color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: bold; }

/* Canvas e UI Gioco */
#ui-top {
    position: absolute;
    top: 15px;
    display: flex;
    gap: 40px;
    background: rgba(15, 23, 42, 0.9);
    padding: 10px 25px;
    border-radius: 8px;
    border: 1px solid #1e293b;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 10;
}
.team-blue { color: #38bdf8; }
.team-red { color: #f43f5e; }
canvas {
    background: #111827;
    border: 3px solid #1f2937;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    cursor: crosshair;
}
#controls-tip {
    position: absolute;
    bottom: 15px;
    font-size: 13px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.8);
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid #1e293b;
}
.logout-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ef4444;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
}