*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;color:#172033}body{min-height:100vh;background:linear-gradient(135deg,#eaf2ff 0,#f8fbff 48%,#e8f0fa 100%)}[hidden]{display:none!important}.stage{min-height:100vh;display:grid;place-items:center;padding:30px}.flash-window{background:#fff;border:1px solid #cdd9e8;border-radius:14px;box-shadow:0 24px 70px rgba(32,55,88,.18);overflow:hidden}.lobby-window{width:min(900px,96vw)}.window-head{height:72px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;background:linear-gradient(180deg,#253b5b,#1c304c);color:#fff}.brand{display:flex;align-items:center;gap:11px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:9px;background:#3b82f6;color:#fff;font-size:22px;font-weight:800;box-shadow:inset 0 0 0 1px rgba(255,255,255,.2)}.brand b{display:block;font-size:18px}.brand small{display:block;color:#b8c8dc;margin-top:1px}.server-online{font-size:13px;color:#dce8f6}.server-online i,.room-title i{display:inline-block;width:8px;height:8px;border-radius:50%;background:#3ed598;margin-right:6px}.window-title{text-align:center;padding:28px 20px 23px;border-bottom:1px solid #e8edf4}.window-title h1{font-size:25px;margin:0 0 6px}.window-title p{margin:0;color:#748196}.room-list-head{display:grid;grid-template-columns:1fr 90px;padding:10px 26px;background:#f6f8fb;color:#8a96a8;font-size:11px;font-weight:800;letter-spacing:.08em}.room-list{height:390px;overflow:auto;padding:0 18px 10px}.room-row{display:grid;grid-template-columns:54px minmax(0,1fr) 100px;align-items:center;gap:12px;width:100%;min-height:72px;padding:12px 16px;border-bottom:1px solid #e5ebf2;cursor:pointer;transition:.15s}.room-row:hover{background:#f2f7ff}.room-row.selected{background:#dcecff;box-shadow:inset 4px 0 #3478df}.room-row.selected .room-info b{color:#1f5fae}.room-dot{width:42px;height:42px;border-radius:10px;display:grid;place-items:center;background:#e8f1ff;color:#2f70d5;font-size:22px;font-weight:800}.room-info b{display:block;font-size:15px}.room-info small{display:block;color:#7b8798;margin-top:3px}.room-users{text-align:center;font-weight:800;color:#42536a}.room-users small{display:block;font-size:10px;font-weight:500;color:#9aa4b2}.room-arrow{display:none}.window-foot{height:45px;background:#f7f9fc;border-top:1px solid #e7edf4;display:flex;align-items:center;justify-content:space-between;padding:0 25px;font-size:11px;color:#8b97a7}.window-foot span:first-child{color:#55916f}.login-window{width:min(480px,94vw)}.back-btn{border:0;background:rgba(255,255,255,.1);color:white;width:36px;height:36px;border-radius:8px;font-size:28px;cursor:pointer;margin-right:12px}.login-window .window-head{justify-content:flex-start}.login-body{text-align:center;padding:34px 48px 38px}.room-symbol{display:grid;place-items:center;margin:0 auto 13px;width:58px;height:58px;border-radius:14px;background:#e8f1ff;color:#3478df;font-size:30px;font-weight:800}.selected-label{font-size:10px;letter-spacing:.12em;font-weight:800;color:#8794a6}.login-body h2{margin:5px 0;font-size:26px}.login-body>p{color:#7a8799;margin:0 0 24px}.login-fields{text-align:left}.login-fields label{display:block;font-size:12px;font-weight:750;margin:13px 0 5px}.login-fields label small{font-weight:400;color:#929dad}.login-fields input{display:block;width:100%;margin-top:6px;border:1px solid #d4deea;border-radius:8px;padding:12px 13px;font-size:14px;outline:0}.login-fields input:focus{border-color:#4c88e8;box-shadow:0 0 0 3px rgba(76,136,232,.12)}.enter-btn{width:100%;border:0;border-radius:8px;padding:13px;margin-top:19px;background:#3478df;color:white;font-weight:800;font-size:14px;cursor:pointer}.guest-note{font-size:11px!important;margin:12px 0 0!important}.error{color:#d64a4a!important;font-size:12px;margin-top:12px!important}.chat-screen{height:100vh;background:#eef3f9;display:flex;flex-direction:column}.chat-header{height:68px;flex:none;background:#203652;color:#fff;display:grid;grid-template-columns:220px 1fr auto;align-items:center;padding:0 20px;box-shadow:0 2px 10px rgba(23,42,68,.18)}.compact .brand-mark{width:34px;height:34px}.room-title{text-align:center}.room-title b{display:block;font-size:17px}.room-title small{display:block;color:#b9c9dc;font-size:11px;margin-top:2px}.me{display:flex;align-items:center;gap:9px;font-size:13px}.role-pill{padding:3px 7px;border-radius:10px;background:#385270;color:#dce8f7;font-size:10px;text-transform:uppercase}.me button{border:1px solid #60758e;background:transparent;color:#fff;border-radius:7px;padding:7px 10px;cursor:pointer}.chat-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;min-height:0;flex:1;padding:12px;gap:12px}.conversation,.user-panel{background:#fff;border:1px solid #dbe3ed;border-radius:10px;min-height:0;overflow:hidden}.conversation{display:flex;flex-direction:column}.messages{flex:1;overflow:auto;padding:18px 22px;background:linear-gradient(#fff,#fbfcfe)}.welcome-chat{text-align:center;font-size:11px;color:#9aa5b3;margin-bottom:18px}.msg,.sys,.private{padding:5px 8px;font-size:14px;line-height:1.45}.nick{font-weight:800;color:#2867bd}.sys{color:#8895a5;font-style:italic}.private{background:#fff6dc;border-radius:6px;color:#725514}.composer{height:66px;display:flex;align-items:center;gap:8px;padding:10px 13px;border-top:1px solid #e4eaf1;background:#f8fafc}.composer input{flex:1;border:1px solid #d3dde8;border-radius:8px;padding:11px 13px;font-size:14px;outline:0}.tool{border:0;background:#eaf0f7;border-radius:8px;width:40px;height:40px;font-size:20px}.sendbtn{border:0;background:#3478df;color:white;border-radius:8px;padding:11px 18px;font-weight:800}.user-panel{display:flex;flex-direction:column}.panel-head{padding:15px 16px;border-bottom:1px solid #e4eaf1;display:flex;justify-content:space-between;align-items:center}.panel-head b{display:block}.panel-head small{display:block;color:#929dad;font-size:10px}.panel-head>span{background:#e8f1ff;color:#3478df;border-radius:12px;padding:3px 8px;font-size:11px;font-weight:800}.users{flex:1;overflow:auto;padding:7px}.user{display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:8px;padding:8px;border-radius:8px;cursor:pointer}.user:hover{background:#f1f6fc}.avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#dce9f9;color:#38638e;font-size:11px;font-weight:800}.user-name{font-size:13px;font-weight:700}.role{font-size:9px;text-transform:uppercase;color:#8592a2}.panel-foot{padding:10px;text-align:center;border-top:1px solid #e8edf3;color:#9aa5b3;font-size:9px}@media(max-width:760px){.stage{padding:10px}.room-list-head{grid-template-columns:1fr 60px}.room-row{grid-template-columns:44px 1fr 55px 15px;padding:12px 5px}.login-body{padding:28px 24px}.chat-header{grid-template-columns:1fr auto}.chat-header .compact{display:none}.room-title{text-align:left}.chat-layout{grid-template-columns:1fr;padding:5px}.user-panel{display:none}}

.lobby-actions{min-height:66px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:10px 24px;background:#f7f9fc;border-top:1px solid #e1e8f0}.selected-room-text{font-size:13px;color:#64748b;font-weight:600}.login-selected{min-width:118px;border:1px solid #2368c7;border-radius:6px;padding:10px 22px;background:linear-gradient(#4b8ce8,#2f70d5);color:#fff;font-weight:800;font-size:14px;cursor:pointer;box-shadow:inset 0 1px rgba(255,255,255,.25)}.login-selected:hover:not(:disabled){filter:brightness(1.05)}.login-selected:disabled{background:#d6dde7;border-color:#c7d0dc;color:#8d99a8;cursor:not-allowed;box-shadow:none}.room-list::-webkit-scrollbar{width:10px}.room-list::-webkit-scrollbar-thumb{background:#c4cfdd;border-radius:10px;border:2px solid #fff}
/* V1.5 lobby: struttura room list ispirata al layout classico 123FlashChat */
.lobby-window{width:min(980px,97vw);height:min(690px,94vh);display:flex;flex-direction:column}
.lobby-head{height:62px;flex:none;padding:0 18px}
.head-actions{display:flex;align-items:center;gap:16px}
.lobby-head .login-selected{min-width:92px;padding:7px 20px;border-color:#1f5fae;background:linear-gradient(#5b98ec,#3478df);box-shadow:inset 0 1px rgba(255,255,255,.3),0 1px 2px rgba(0,0,0,.18)}
.roomlist-toolbar{height:62px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:8px 18px;background:linear-gradient(#f9fbfd,#edf2f7);border-bottom:1px solid #cbd6e2}
.roomlist-toolbar b{display:block;font-size:15px;color:#26384e}.roomlist-toolbar small{display:block;margin-top:3px;color:#7b8798;font-size:11px}.selected-room-text{padding:6px 10px;border:1px solid #ccd7e3;border-radius:4px;background:#fff;color:#52657d;font-size:11px;font-weight:700;white-space:nowrap}
.room-list-head{grid-template-columns:54px minmax(150px,.7fr) minmax(260px,1.5fr) 88px;padding:7px 12px;height:30px;flex:none;border-bottom:1px solid #d7e0ea;background:#e8eef5;color:#63748a}.room-list-head span:first-child{grid-column:1/3}.room-list-head span:nth-child(2){grid-column:3}.room-list-head span:nth-child(3){grid-column:4;text-align:center}
.room-list{height:auto;flex:1;min-height:0;overflow-y:auto;padding:0;background:#fff;border-bottom:1px solid #d7e0ea}
.room-row{grid-template-columns:46px minmax(150px,.7fr) minmax(260px,1.5fr) 88px;gap:8px;width:100%;height:52px;min-height:52px;padding:3px 12px;border-bottom:1px solid #e2e7ed;border-radius:0;transition:none}
.room-row:nth-child(even){background:#f8fafc}.room-row:hover{background:#edf5ff}.room-row.selected{background:linear-gradient(#dcecff,#cfe3fb);box-shadow:inset 3px 0 #2f70d5}.room-dot{width:36px;height:35px;border-radius:4px;background:#e5edf7;border:1px solid #c7d4e3;font-size:19px}.room-info b{font-size:13px;color:#26384e}.room-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#748196;font-size:11px}.room-users{font-size:12px}.room-users b{font-size:13px}.room-users small{display:inline;margin-left:4px;font-size:9px}.window-foot{height:36px;flex:none}
@media(max-width:760px){.lobby-window{height:94vh}.roomlist-toolbar small,.room-description{display:none}.room-list-head{grid-template-columns:44px 1fr 65px}.room-list-head span:first-child{grid-column:1/3}.room-list-head span:nth-child(2){display:none}.room-list-head span:nth-child(3){grid-column:3}.room-row{grid-template-columns:38px 1fr 65px;height:50px;min-height:50px}.head-actions .server-online{display:none}.roomlist-toolbar{height:52px}.selected-room-text{max-width:140px;overflow:hidden;text-overflow:ellipsis}}

/* V1.6 - lobby fullscreen, nessuna finestra esterna */
#lobby.stage{display:block;width:100vw;height:100vh;min-height:0;padding:0;margin:0;overflow:hidden;background:#fff}
#lobby .flash-window.lobby-window{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;border-radius:0;box-shadow:none;display:flex;flex-direction:column;overflow:hidden;background:#fff}
#lobby .lobby-head{width:100%;border-radius:0;flex:0 0 62px}
#lobby .roomlist-toolbar{width:100%;flex:0 0 62px}
#lobby .room-list-head{width:100%;flex:0 0 30px}
#lobby .room-list{width:100%;flex:1 1 auto;min-height:0;height:auto;overflow-y:auto;padding:0;margin:0}
#lobby .room-row{width:100%;max-width:none;margin:0;border-left:0;border-right:0}
#lobby .window-foot{width:100%;flex:0 0 36px;border-radius:0}
@media(max-width:760px){#lobby.stage{padding:0}#lobby .flash-window.lobby-window{width:100%;height:100%;border-radius:0}}

/* V1.7 - tema adattato da stile.css fornito dall'utente */
html,body{height:100%;overflow:hidden;font-family:Tahoma,'Segoe UI',Arial,sans-serif;background:#e7ebf7;color:#333;font-size:12px}
#lobby.stage{background:#e7ebf7}
#lobby .lobby-head{height:50px;flex-basis:50px;padding:0 15px;background:linear-gradient(to bottom,#fff,#e7ebf7);border-bottom:1px solid #8593a0;color:#333}
#lobby .brand-mark{width:34px;height:34px;border-radius:3px;background:linear-gradient(to bottom,#6fa1df,#3b6bb0);box-shadow:none;font-size:19px}
#lobby .brand b{color:#015bb6;font-size:15px}#lobby .brand small{color:#667;font-size:10px}
#lobby .server-online{color:#3f596f}
#lobby .login-selected{min-width:96px;padding:6px 18px;border:1px solid #bdc1d9;border-radius:0;background:linear-gradient(to bottom,#fff,#dde6f6);color:#333;box-shadow:none;font-family:Tahoma,Arial,sans-serif;font-weight:700}
#lobby .login-selected:hover{background:linear-gradient(to bottom,#fff,#cdd8ed);color:#06c}
#lobby .roomlist-toolbar{height:48px;flex-basis:48px;padding:6px 12px;background:#f3f6fb;border-bottom:1px solid #8593a0}
#lobby .roomlist-toolbar b{color:#015bb6;font-size:14px}#lobby .roomlist-toolbar small{color:#667}
#lobby .selected-room-text{border:1px solid #a1b5c7;border-radius:0;background:#fff;color:#333;padding:5px 9px}
#lobby .room-list-head{height:28px;flex-basis:28px;padding:6px 10px;background:linear-gradient(to bottom,#cddfee,#fff);border-bottom:1px solid #8593a0;color:#333;font-size:10px}
#lobby .room-list{background:#f3f6fb}
#lobby .room-row{height:56px;min-height:56px;padding:4px 10px;border-bottom:1px solid #d6e0e8;background:#fff}
#lobby .room-row:nth-child(even){background:#f8fafc}#lobby .room-row:hover{background:#abc8dc}
#lobby .room-row.selected{background:linear-gradient(to bottom,#dcedfb,#a9c6dd);box-shadow:none;border-bottom-color:#8593a0}
#lobby .room-dot{width:38px;height:38px;border:1px solid #a0b4c5;border-radius:4px;background:#eef3f7;color:#2668b6}
#lobby .room-info b{font-family:Tahoma,Arial,sans-serif;font-size:13px;color:#1f4f7a}#lobby .room-description{color:#4f5965;font-size:11px}
#lobby .room-users{color:#333}#lobby .window-foot{height:30px;flex-basis:30px;padding:0 12px;background:#d8e2eb;border-top:1px solid #8593a0;color:#52606c}
.login-window{border:1px solid #8593a0;border-radius:0;box-shadow:0 4px 20px rgba(0,0,0,.3)}
.login-window .window-head{height:50px;padding:0 12px;background:linear-gradient(to bottom,#5987c9,#3b6bb0);border-radius:0}.login-window .brand-mark{border-radius:3px}.back-btn{border-radius:0}
.login-body{background:#f3f6fb}.room-symbol{border-radius:4px;background:#dcedfb;color:#2668b6}.login-fields input{border:1px solid #a1b5c7;border-radius:4px;font-family:Tahoma,Arial,sans-serif}.enter-btn{border:1px solid #a1b5c7;border-radius:4px;background:linear-gradient(to bottom,#cfd8e9,#e5eaf3);color:#333}.enter-btn:hover{color:#2668b6;background:linear-gradient(to bottom,#99abcf,#dae1ee)}
.chat-screen{background:#e7ebf7}.chat-header{height:50px;background:linear-gradient(to bottom,#fff,#e7ebf7);border-bottom:1px solid #8593a0;color:#333;box-shadow:none}.chat-header .brand b{color:#015bb6}.room-title b{color:#015bb6}.room-title small{color:#52606c}.me button{border:1px solid #a1b5c7;background:linear-gradient(to bottom,#fff,#dde6f6);color:#333;border-radius:4px}.role-pill{background:#d8e2eb;color:#333}
.chat-layout{display:flex;gap:1px;padding:0;background:#8593a0}.conversation{flex:1;border:0;border-radius:0;background:#f0f5fb}.user-panel{width:260px;flex:none;border:0;border-radius:0;background:#f3f6fb}.messages{background:#f0f5fb;padding:12px}.composer{height:70px;border-top:1px solid #8593a0;background:#fff}.composer input{border:1px solid #a1b5c7;border-radius:5px;font-family:Tahoma,Arial,sans-serif}.tool,.sendbtn{border:1px solid #a1b5c7;border-radius:5px;background:linear-gradient(to bottom,#cfd8e9,#e5eaf3);color:#333}.sendbtn:hover{color:#2668b6;background:linear-gradient(to bottom,#99abcf,#dae1ee)}
.panel-head{background:linear-gradient(to bottom,#dcedfb,#a9c6dd);border-bottom:1px solid #8593a0;color:#000}.panel-head>span{background:#fff;color:#2668b6}.users{padding:5px}.user{border:1px solid #e4ebf0;border-radius:5px;background:#fff;padding:6px 8px;margin-bottom:2px}.user:hover{background:#abc8dc}.avatar{border-radius:4px;background:#dcedfb;color:#1f4f7a}.panel-foot{border-top:1px solid #8593a0;background:#d8e2eb;color:#52606c}
::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-track{background:#d8e2eb}::-webkit-scrollbar-thumb{background:#8593a0;border-radius:6px}::-webkit-scrollbar-thumb:hover{background:#5987c9}
@media(max-width:760px){.chat-layout{display:block}.conversation{height:100%}.user-panel{display:none}#lobby .room-row{height:52px;min-height:52px}}
