/* RedLink – grafica famiglia Red */
:root {
  --red: #C00000; --red-soft: #ffd9d9; --ok: #060; --muted: #666;
  --green: #1e8e3e; --green-h: #17762f; --grey: #c8c8c8;
  --dark: #202124; --dark2: #2b2c30; --dark3: #3c4043;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: #222; background: #f3f3f3; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.ok { color: var(--ok); }
.err { color: var(--red); }
.warn { color: #8a5a00; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
a { color: var(--red); }

/* --- intestazione --- */
.rl-bar { background: var(--red); color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; gap: 12px; min-height: 52px; }
.rl-title { font: bold 18pt/1 var(--font); display: flex; align-items: center; gap: 10px; }
.rl-ico { width: 30px; height: 30px; }
.rl-sub { color: var(--red-soft); font-size: 13px; text-align: right; }

/* --- pagine di gestione --- */
.rl-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.rl-card { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 18px 20px; margin: 0 0 16px; }
.rl-card.narrow { max-width: 460px; margin: 40px auto; }
.rl-card h1 { margin: 0 0 10px; font-size: 22px; }
.rl-card h2 { margin: 0 0 12px; font-size: 18px; color: var(--red); }
.rl-card h3 { margin: 6px 0 8px; font-size: 15px; }
.rl-topline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rl-form { display: flex; flex-direction: column; gap: 10px; }
.rl-form.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.rl-form .grow { flex: 1 1 260px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #444; }
input, select, textarea { font: 14px var(--font); padding: 7px 9px; border: 1px solid #bbb; border-radius: 4px; background: #fff; color: #222; }
textarea { width: 100%; resize: vertical; font-size: 13px; }
.btn { font: 14px var(--font); padding: 7px 14px; border: 1px solid #aaa; border-radius: 4px; background: #f7f7f7; cursor: pointer; color: #222; text-decoration: none; display: inline-block; }
.btn:hover { background: #ececec; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-h); }
.btn.primary:disabled { background: var(--grey); border-color: var(--grey); color: #fff; cursor: not-allowed; }
.btn.big { font-size: 17px; padding: 12px 22px; font-weight: 600; }
.btn.danger { color: var(--red); border-color: #e0a0a0; }
.flash { padding: 8px 12px; background: #fff; border-left: 4px solid currentColor; border-radius: 4px; }
.invite .inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.invite textarea { margin-bottom: 6px; }
.rl-table { width: 100%; border-collapse: collapse; }
.rl-table th { background: var(--red); color: #fff; text-align: left; font-weight: 600; padding: 7px 8px; font-size: 13px; }
.rl-table td { border-bottom: 1px solid #e3e3e3; padding: 8px; vertical-align: top; }
.rl-table tr.expired td { opacity: .55; }
.rl-table .actions { white-space: nowrap; text-align: right; }
details.inline { display: inline-block; position: relative; }
details.inline summary { list-style: none; }
details.inline summary::-webkit-details-marker { display: none; }
details.inline .menu { position: absolute; right: 0; top: 30px; z-index: 5; background: #fff; border: 1px solid #ccc; border-radius: 6px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); min-width: 260px; }
details.inline .menu form { display: flex; gap: 6px; }
details.inline .menu input { flex: 1; }
form.inline { display: inline; }
.rl-users { padding-left: 18px; }
.rl-users li { margin: 4px 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .invite .inv-grid, .two { grid-template-columns: 1fr; } .rl-sub { display: none; } }

/* --- stanza --- */
body.room { background: var(--dark); color: #e8eaed; display: flex; flex-direction: column; }
body.room #app { display: flex; flex-direction: column; height: 100%; }
body.room .rl-card { background: #fff; color: #222; }
.lobby { flex: 1; display: flex; gap: 24px; align-items: flex-start; justify-content: center; padding: 28px 18px; flex-wrap: wrap; overflow: auto; }
.lobby-preview { flex: 1 1 520px; max-width: 680px; }
.preview-box { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 10px; overflow: hidden; }
.preview-box video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview-off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #aaa; font-size: 18px; }
.meter-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: #bbb; font-size: 13px; }
.meter-row .muted { color: #aaa; }
.meter { flex: 1; height: 8px; background: #3c4043; border-radius: 4px; overflow: hidden; }
.meter div { height: 100%; width: 0; background: linear-gradient(90deg, #1e8e3e 0%, #1e8e3e 70%, #f2c200 85%, #e53935 100%); background-size: 100% 100%; transition: width .05s; }
.meter div.clip { box-shadow: inset -6px 0 0 #e53935; }
.hint { background: #3a2f12; color: #ffe08a; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.lobby-form { flex: 0 1 400px; margin: 0 !important; }
.lobby-form label { margin-bottom: 10px; }
.devform select { width: 100%; }
fieldset.modes { border: 1px solid #ddd; border-radius: 6px; padding: 8px 10px; margin: 0 0 10px; }
fieldset.modes legend { font-size: 13px; color: #444; padding: 0 4px; }
label.radio { flex-direction: row; align-items: flex-start; gap: 8px; margin: 4px 0 !important; color: #222; font-size: 14px; cursor: pointer; }
label.radio small { color: var(--muted); font-size: 12px; }
.devform .row { display: flex; gap: 10px; }
.devform .row label { flex: 1; }
#btnJoin { width: 100%; margin-top: 6px; }

.call { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 30; background: #3c4043; color: #fff;
  padding: 8px 16px; border-radius: 6px; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.4); max-width: 90%; }
.banner.err { background: var(--red); }
.banner.warn { background: #8a5a00; }
.banner.info { background: #1a73e8; }
.call-body { flex: 1; display: flex; min-height: 0; }

/* riquadri: la posizione la decide redlink.js (vista relatore o griglia) */
.tiles { flex: 1; display: grid; gap: 8px; padding: 8px; min-width: 0; min-height: 0; }
.tile { position: relative; background: var(--dark2); border-radius: 10px; overflow: hidden; min-height: 0; min-width: 0; border: 2px solid transparent; transition: border-color .15s; }
.tiles.speaker .tile.thumb { cursor: pointer; }
.tile.speaking { border-color: #8ab4f8; }
.tile.pinned { box-shadow: inset 0 0 0 2px #f2c200; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile.screen video, .tile.main video { object-fit: contain; }
.tile.me video { transform: scaleX(-1); }
.tile .avatar { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: var(--dark2); }
.tile .avatar span { width: 76px; height: 76px; border-radius: 50%; background: var(--red); color: #fff; font-size: 34px; display: flex; align-items: center; justify-content: center; }
.tile.thumb .avatar span { width: 44px; height: 44px; font-size: 20px; }
.tile.cam-off .avatar { display: flex; }
.tile.cam-off video { visibility: hidden; }
.tile .label { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; pointer-events: none; }
.tile .name { background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 4px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile.thumb .name { font-size: 12px; }
.bd { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.6); display: inline-flex; align-items: center; color: #fff; }
.bd svg { width: 14px; height: 14px; fill: #fff; }
.bd.hq { background: var(--red); }
.bd.p2p { background: rgba(30,142,62,.9); }
.bd.relay { background: rgba(176,110,0,.95); }
.bd.bad { background: var(--red); }
.bd.mute { background: rgba(192,0,0,.9); }
.bd.handb { background: #f2c200; color: #000; }
.bd.staff { background: #5f6368; }
.bd.rtt { background: #3c4043; }
.bd.wait { background: #5f6368; }
.tile.hand { border-color: #f2c200; }
.tactions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.tbtn { border: 0; border-radius: 4px; background: rgba(0,0,0,.6); padding: 4px; cursor: pointer; }
.tbtn svg { width: 18px; height: 18px; fill: #fff; display: block; }
.tile.pinned .pinb { background: #f2c200; }
.tile.pinned .pinb svg { fill: #000; }
.tvol { position: absolute; top: 6px; left: 6px; display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.6); border-radius: 4px; padding: 3px 6px; opacity: 0; transition: opacity .15s; }
.tvol svg, .pvol svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.tvol input { width: 90px; }
.tvol .volv, .pvol .volv { font-size: 11px; min-width: 34px; text-align: right; }
.tile:hover .tactions, .tile:hover .tvol { opacity: 1; }
.tile.mine { outline: 2px dashed #8ab4f8; outline-offset: -2px; }
.tile:fullscreen { border-radius: 0; }
.tile:fullscreen video { object-fit: contain; }

.side { flex: 0 0 340px; background: #fff; color: #222; margin: 8px 8px 8px 0; border-radius: 10px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #eee; }
.icon-btn { border: 0; background: none; font-size: 16px; cursor: pointer; color: #555; }
.people-pane { flex: 1; overflow-y: auto; padding: 6px 0; }
.prow { padding: 8px 14px; border-bottom: 1px solid #f0f0f0; }
.prow.speaking .pav { box-shadow: 0 0 0 3px #8ab4f8; }
.prow.pinned { background: #fff8d6; }
.ptop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pav { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.pname { font-weight: 600; }
.pbadges { display: flex; gap: 3px; flex-wrap: wrap; }
.pact { margin: 6px 0 0 38px; display: flex; flex-direction: column; gap: 6px; }
.pvol { display: flex; align-items: center; gap: 6px; color: #444; }
.pvol input { flex: 1; }
.pbtns { display: flex; gap: 4px; flex-wrap: wrap; }
.chat-pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 14px; }
.msg { margin-bottom: 10px; }
.msg .who { font-size: 12px; }
.msg .txt { white-space: pre-wrap; word-break: break-word; }
.msg.mine .who b { color: var(--red); }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #eee; }
.chat-form input { flex: 1; }
.set-pane { padding: 14px; overflow-y: auto; flex: 1; }
.set-pane .hint { margin-top: 8px; }

/* barra in basso (stile Jitsi) */
.toolbar-wrap { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 6px 14px 12px; gap: 10px; }
.tb-side { flex: 1; font-size: 13px; color: #aaa; }
.tb-side.right { text-align: right; }
.toolbar { display: flex; gap: 4px; background: #131417; border-radius: 10px; padding: 6px; }
.tb-group { display: flex; }
.tb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; color: #e8eaed;
  border-radius: 6px; padding: 7px 10px 5px; cursor: pointer; font: 11px var(--font); min-width: 58px; }
.tb:hover { background: #2b2c30; }
.tb .ic svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.tb.off { color: #ff6b6b; }
.tb.on { background: #3c4043; color: #8ab4f8; }
.tb.leave { background: var(--red); color: #fff; margin-left: 6px; }
.tb.leave:hover { background: #a00000; }
.tb-group .tb { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tb-caret { border: 0; background: transparent; color: #aaa; border-radius: 0 6px 6px 0; padding: 0 5px; cursor: pointer; font-size: 11px; }
.tb-caret:hover { background: #2b2c30; color: #fff; }
.badge { position: absolute; top: 2px; right: 8px; background: var(--red); color: #fff; border-radius: 9px; font-size: 10px; padding: 1px 5px; }
.badge.grey { background: #5f6368; }
.pill { background: var(--dark3); padding: 4px 10px; border-radius: 12px; font-size: 12px; color: #e8eaed; }
.pill.hq { background: var(--red); color: #fff; }
#ended { color: #222; }

/* test */
.testbox { margin-top: 14px; background: #fff; color: #222; border-radius: 8px; padding: 10px 14px; }
.testbox.light { padding: 10px 0 0; }
.trow { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eee; align-items: flex-start; }
.trow .tic { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: #bbb; }
.trow.ok .tic { background: var(--green); }
.trow.warn .tic { background: #e8a200; }
.trow.err .tic { background: var(--red); }
.trow.info .tic { background: #5f6368; }
.tdet { font-size: 13px; color: var(--muted); margin-top: 2px; }
.trow.err .tdet { color: var(--red); }
.tsum { margin-top: 10px; padding: 8px 10px; border-radius: 6px; font-weight: 600; }
.tsum.ok { background: #e6f4ea; color: var(--ok); }
.tsum.warn { background: #fff4d6; color: #7a5300; }
.tsum.err { background: #fde7e7; color: var(--red); }
.btn.wide { width: 100%; margin-bottom: 8px; }

/* pagina stanze */
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #e8e8e8; color: #444; margin-left: 4px; vertical-align: middle; }
.tag.red { background: var(--red); color: #fff; }
.small { font-size: 12px; }
.top-actions { display: flex; gap: 6px; align-items: center; }
label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.live-room { border: 1px solid #e3e3e3; border-left: 4px solid var(--green); border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
.live-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.live-acts { margin-left: auto; }
.live-people { margin: 6px 0 0; padding-left: 18px; }
.live-people li { margin: 2px 0; }
.note { background: #f6f6f6; border-left: 4px solid var(--red); padding: 8px 12px; margin: 8px 0; }
.row-btns { display: flex; gap: 10px; align-items: center; margin-top: 10px; }

@media (max-width: 760px) {
  .tb .lb { display: none; }
  .tb { min-width: 0; padding: 9px; }
  .tb-caret, #btnView, #btnInvite { display: none; }
  .tb-side { display: none; }
  .toolbar-wrap { justify-content: center; padding: 6px 4px 10px; }
  .toolbar { gap: 0; overflow-x: auto; max-width: 100%; }
  .side { position: absolute; inset: 0 0 64px 0; margin: 0; border-radius: 0; z-index: 20; }
  .lobby { padding: 12px; }
  .tactions, .tvol { opacity: 1; }
  .tile.thumb .tvol, .tile.thumb .tactions { display: none; }
  .popmenu { bottom: 64px; }
}

/* ===== 0.1.2: menu a comparsa scuri ===== */
.popmenu { position: absolute; bottom: 74px; z-index: 40; background: #1b1c1f; color: #e8eaed; border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; box-shadow: 0 18px 48px rgba(0,0,0,.55); padding: 8px; min-width: 300px; max-width: 400px; max-height: 70vh; overflow-y: auto; }
.mtitle { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9aa0a6; padding: 8px 10px 6px; }
.mtitle svg { width: 16px; height: 16px; fill: #9aa0a6; }
.mrow { display: flex; align-items: center; gap: 6px; border-radius: 10px; }
.mrow.checked { background: rgba(192,0,0,.22); }
.mitem { flex: 1; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 9px 10px; font: 14px var(--font); cursor: pointer; color: #e8eaed; border-radius: 10px; min-width: 0; }
.mitem:hover { background: #2b2d31; }
.mrow.checked .mitem { color: #fff; }
.mrow.checked .mitem:hover { background: rgba(192,0,0,.12); }
.mitem .mtx { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitem .mic svg { width: 18px; height: 18px; fill: #c4c7c5; display: block; }
.mitem .mck svg { width: 18px; height: 18px; fill: #ff8a8a; display: block; }
.mitem.danger { color: #ff8a8a; }
.mitem.danger .mic svg { fill: #ff8a8a; }
.msep { height: 1px; background: rgba(255,255,255,.07); margin: 6px 4px; }
.mseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 4px 4px; }
.msegbtn { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: none; color: #e8eaed; cursor: pointer; font: 14px var(--font); }
.msegbtn small { font-size: 12px; color: #9aa0a6; }
.msegbtn:hover { background: #2b2d31; }
.msegbtn.active { border-color: #ff5a5a; background: rgba(192,0,0,.22); color: #fff; }
.msegbtn.active small { color: #ffb3b3; }
.mkeys { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px; font-size: 12px; color: #9aa0a6; }
.mkeys kbd { font: 11px var(--font); padding: 2px 7px; border-radius: 6px; background: #34363b; color: #e8eaed; }
.popmenu .playbtn { flex: none; border: 0; border-radius: 999px; background: #34363b; color: #e8eaed; padding: 5px 11px; margin-right: 4px; font-size: 12px; font-weight: 600; }
.popmenu .playbtn:hover { background: #45474d; }
.popmenu .playbtn.playing, .playbtn.playing { background: var(--red) !important; color: #fff !important; border-color: var(--red) !important; }

/* ===== 0.1.2: anteprima ===== */
.lobby { gap: 28px; padding: 32px 40px; }
.lobby-preview { flex: 1 1 560px; max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.preview-box { border-radius: 16px; background: #2b2c30; }
.preview-off { display: flex; align-items: center; justify-content: center; }
.preview-off span { width: 120px; height: 120px; border-radius: 50%; background: #3c4043; color: #e8eaed; font-size: 52px; display: flex; align-items: center; justify-content: center; }
.preview-name { position: absolute; left: 16px; bottom: 16px; background: rgba(0,0,0,.6); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: #fff; }
.preview-ctl { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; gap: 10px; }
.roundbtn { width: 48px; height: 48px; border-radius: 50%; background: rgba(32,33,36,.85); border: 1px solid rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.roundbtn svg { width: 22px; height: 22px; fill: #fff; }
.roundbtn:hover { background: rgba(60,64,67,.95); }
.roundbtn.off { background: #ea4335; border-color: #ea4335; }
.meter-row { margin-top: 0; }
.meter-row .mlabel { color: #9aa0a6; width: 110px; font-size: 12px; }
.meter-row .mdb { color: #9aa0a6; width: 70px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
.meter { height: 10px; border-radius: 5px; }
.testcard { background: #2b2c30; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.testhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn.darkbtn { background: #3c4043; border-color: #3c4043; color: #e8eaed; }
.btn.darkbtn:hover { background: #4a4e52; }
.btn.darkbtn:disabled { opacity: .6; }
.testbox.cards { margin: 0; padding: 0; background: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.testbox.cards .trow { flex-direction: column; gap: 6px; background: #202124; border-radius: 10px; padding: 10px; border: 0; color: #e8eaed; }
.testbox.cards .trow b { font-size: 12px; font-weight: 600; color: #9aa0a6; }
.testbox.cards .tdet { color: #e8eaed; font-size: 12px; }
.testbox.cards .trow.ok .tdet { color: #81c995; }
.testbox.cards .trow.warn .tdet { color: #fdd663; }
.testbox.cards .trow.err .tdet { color: #f28b82; }
.testbox.cards .trow .tic { width: 20px; height: 20px; font-size: 12px; }
.testbox.cards .tsum { grid-column: 1 / -1; margin-top: 0; }
.testbox.cards .btn { background: #3c4043; color: #e8eaed; border-color: #3c4043; margin: 2px 2px 0 0; }
.lobby-form { flex: 0 1 420px; border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.lobby-form h1 { font-size: 24px; margin-bottom: 2px; }
.lobby-form input, .lobby-form select, .set-pane select { border-radius: 10px; padding: 9px 12px; border-color: #ccc; }
.fgroup { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.flabel { font-size: 13px; color: #444; }
.modeseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.modebtn { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid #ccc; background: #fff; cursor: pointer; font: 14px var(--font); color: #222; }
.modebtn small { font-size: 12px; color: #666; }
.modebtn:hover { border-color: #999; }
.modebtn.active { border: 2px solid var(--red); padding: 9px 11px; background: #fff3f3; }
.modebtn.active b { color: var(--red); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plabel { font-size: 12px; color: #666; margin-right: 2px; }
.pgap { width: 8px; }
.pill-btn { border: 0; border-radius: 999px; background: #f1f1f1; color: #444; padding: 4px 10px; font: 12px var(--font); cursor: pointer; }
.pill-btn:hover { background: #e4e4e4; }
.pill-btn.active { background: #222; color: #fff; font-weight: 600; }
.warnbox { margin: 2px 0 0; font-size: 12px; color: #8a5a00; background: #fff4d6; border-radius: 8px; padding: 6px 10px; }
.outrow { display: flex; gap: 8px; }
.outrow select { flex: 1; min-width: 0; }
.playbtn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; border-radius: 10px; background: #f1f1f1; border-color: #f1f1f1; }
.playbtn .pic { font-size: 11px; }
.joinbtn { width: 100%; margin-top: 8px; border-radius: 12px; padding: 14px; font-size: 17px; }
#lobbyInfo { margin: 0 0 8px; }

/* ===== 0.1.2: avviso dello staff ===== */
.notice { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 35; width: min(440px, 92%); background: #1b1c1f; border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; color: #e8eaed; }
.notice .nic { width: 34px; height: 34px; border-radius: 10px; background: var(--red); flex: none; display: flex; align-items: center; justify-content: center; }
.notice .nic svg { width: 18px; height: 18px; fill: #fff; }
.notice .nbody { display: flex; flex-direction: column; gap: 4px; }
.notice .nbody b { color: #fff; font-size: 14px; }
.notice .nbody span { font-size: 13px; color: #c4c7c5; }
.notice .nact { display: flex; gap: 8px; margin-top: 6px; }
.notice .nact .btn:not(.primary) { background: #34363b; border-color: #34363b; color: #e8eaed; }

/* ===== 0.1.2: audio del partecipante (staff) ===== */
.paudio { display: flex; flex-direction: column; gap: 6px; }
.plab { font-size: 12px; color: #666; }
.pseg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.psegb { padding: 6px 10px; border-radius: 8px; border: 1px solid #ccc; background: #fff; font: 13px var(--font); cursor: pointer; color: #444; }
.psegb.active { border-color: var(--red); background: var(--red); color: #fff; font-weight: 600; }
.ppills { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ppills button { border: 0; border-radius: 999px; background: #f1f1f1; color: #444; padding: 3px 8px; font: 12px var(--font); cursor: pointer; }
.ppills button.active { background: #222; color: #fff; font-weight: 600; }
.ppills i { width: 6px; }
.pstat { font-size: 12px; }
.pstat.ok { color: var(--ok); }
.pstat.wait { color: #8a5a00; }

@media (max-width: 760px) {
  .lobby { padding: 12px; }
  .testbox.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .popmenu { min-width: 260px; }
}

/* ===== 0.1.3: scheda di accesso scura (proposta B, grafite) ===== */
.rl-sub { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.langsw { display: inline-flex; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; overflow: hidden; flex: none; }
.langsw a { padding: 3px 10px; font-size: 12px; color: #fff; text-decoration: none; }
.langsw a.on { background: #fff; color: var(--red); font-weight: 700; }
body.room .lobby-form.dark { background: #2b2c30; border: 1px solid rgba(255,255,255,.06); color: #e8eaed; box-shadow: 0 18px 48px rgba(0,0,0,.35); }
body.room .lobby-form.dark h1 { color: #fff; }
body.room .lobby-form.dark .muted { color: #a8acb0; }
body.room .lobby-form.dark label, body.room .lobby-form.dark .flabel { color: #c4c7c5; }
body.room .lobby-form.dark input, body.room .lobby-form.dark select { background: #202124; color: #e8eaed; border: 1px solid rgba(255,255,255,.14); }
body.room .lobby-form.dark input:focus, body.room .lobby-form.dark select:focus { outline: 2px solid rgba(138,180,248,.6); outline-offset: 0; }
body.room .lobby-form.dark select option { background: #202124; color: #e8eaed; }
body.room .lobby-form.dark .modebtn { background: #202124; border-color: rgba(255,255,255,.14); color: #e8eaed; }
body.room .lobby-form.dark .modebtn small { color: #a8acb0; }
body.room .lobby-form.dark .modebtn:hover { border-color: rgba(255,255,255,.3); }
body.room .lobby-form.dark .modebtn.active { border: 1px solid #ff5a5a; padding: 10px 12px; background: rgba(192,0,0,.22); }
body.room .lobby-form.dark .modebtn.active b { color: #fff; }
body.room .lobby-form.dark .modebtn.active small { color: #ffb3b3; }
body.room .lobby-form.dark .plabel { color: #a8acb0; }
body.room .lobby-form.dark .pill-btn { background: #34363b; color: #c4c7c5; }
body.room .lobby-form.dark .pill-btn:hover { background: #45474d; }
body.room .lobby-form.dark .pill-btn.active { background: #fff; color: #202124; }
body.room .lobby-form.dark .warnbox { color: #fdd663; background: rgba(242,194,0,.12); }
body.room .lobby-form.dark .playbtn { background: #34363b; border-color: #34363b; color: #e8eaed; }
body.room .lobby-form.dark .playbtn:hover { background: #45474d; }
body.room .lobby-form.dark .err { color: #f28b82; }
.waitbox { display: flex; gap: 12px; align-items: flex-start; background: #202124; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; margin: 2px 0 10px; }
.waitbox > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.waitbox b { color: #fff; font-size: 14px; }
.waitbox span { font-size: 13px; color: #c4c7c5; }
.waitbox .wcount { color: #8ab4f8; font-weight: 600; font-variant-numeric: tabular-nums; }
.wspin { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: #8ab4f8; animation: rlspin 1s linear infinite; margin-top: 2px; }
@keyframes rlspin { to { transform: rotate(360deg); } }
.btn.wide { width: 100%; }
/* pagina stanze */
.langpick { display: inline-flex; border: 1px solid #ccc; border-radius: 999px; overflow: hidden; margin-left: 10px; vertical-align: middle; }
.langpick button { border: 0; background: #fff; padding: 3px 10px; font: 12px var(--font); cursor: pointer; color: #444; }
.langpick button.on { background: var(--red); color: #fff; font-weight: 600; }
.tag.blue { background: #1a73e8; color: #fff; }
.hidden { display: none !important; }
@media (max-width: 760px) { .rl-sub > span:first-child { display: none; } .rl-sub { display: flex; } }
body.room .lobby-form.dark .btn.primary:disabled { background: #45474d; border-color: #45474d; color: #a8acb0; }

/* ===== 0.1.3.1: lingua dentro la scheda, canali su una riga propria ===== */
.cardhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cardhead h1 { min-width: 0; overflow-wrap: anywhere; }
body.room .lobby-form.dark .langsw { border-color: rgba(255,255,255,.18); background: #202124; margin-top: 4px; }
body.room .lobby-form.dark .langsw a { color: #c4c7c5; padding: 4px 11px; }
body.room .lobby-form.dark .langsw a:hover { color: #fff; }
body.room .lobby-form.dark .langsw a.on { background: var(--red); color: #fff; }
.hqopts { display: flex; flex-direction: column; gap: 6px; }
.hqopts .plabel { min-width: 52px; }

/* ===== 0.1.4: condivisione, apertura anticipata, accesso ricordato ===== */
.bd.sharet { background: #1a73e8; }
.popmenu .mnote { font-size: 12px; color: #9aa0a6; flex: none; }
.popmenu .mrow.checked .mnote { color: #ffb3b3; }
.popmenu .mitem .mck { width: 18px; flex: none; }
.popmenu .minfo { font-size: 12px; color: #9aa0a6; padding: 2px 12px 8px; line-height: 1.4; }
.pshare { display: flex; flex-direction: column; gap: 6px; }
.pshare.hidden { display: none !important; }
.tag.green { background: #e6f4ea; color: #060; }
.opennow { display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--red); background: #fff3f3; border-radius: 6px; padding: 8px; }
.opennow form { display: block !important; }
.opennow .btn { width: 100%; }
#btnJoinNoOpen { margin-top: 6px; border-radius: 12px; padding: 11px; font-size: 15px; }
#openNote { margin: 4px 0 0; font-size: 12px; }
body.room .lobby-form.dark #openNote { color: #a8acb0; }
.rl-form label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: #222; }

/* 0.1.4.1: Spegni mic a tutti */
.ptools { padding: 8px 14px; border-bottom: 1px solid #eee; display: flex; justify-content: flex-end; }
.ptools.hidden { display: none !important; }
.ptools .btn:disabled { opacity: .55; cursor: default; }
