/* M.B. Volley Live App — stile chiaro: blu notte, giallo, bianco */
:root {
  --navy: #1a1150; --navy-dark: #140b52; --violet: #2e1d72; --yellow: #f2d14b; --gold: #d4a600;
  --red: #ff3b30; --yt: #cc0000; --fb: #1877f2; --green: #34c759;
  --bg: #f5f6fb; --card: #ffffff; --text: #16133a; --muted: #9a9cab; --line: #d6d8e3;
  --shadow: 0 10px 28px rgba(20, 11, 82, .13);
  --font: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100dvh; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { opacity: .4; cursor: not-allowed; }
svg { display: block; }
.hidden { display: none !important; }
a { color: var(--navy); }

/* ------------------------------------------------ pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 10px; font-weight: 800; letter-spacing: .02em; transition: transform .1s, filter .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-yellow { background: var(--yellow); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.08); }
.btn-red { background: var(--red); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--line); }
.btn-outline { background: #fff; color: var(--text); border: 2px solid var(--text); border-radius: 3px; text-transform: uppercase; font-size: 13px; }
.btn-yt { background: var(--yt); color: #fff; }
.btn-fb { background: var(--fb); color: #fff; }
.btn-block { width: 100%; }
.link-btn { color: var(--navy); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: inherit; }
.icon-btn svg { width: 24px; height: 24px; }
.round-btn { width: var(--rb, 46px); height: var(--rb, 46px); border-radius: 50%; display: grid; place-items: center;
  font-size: calc(var(--rb, 46px) * .55); font-weight: 800; line-height: 1; flex: none; transition: transform .1s; }
.round-btn:active:not(:disabled) { transform: scale(.92); }
.round-btn.yellow { background: var(--yellow); color: var(--navy); }
.round-btn.outline { border: 2.5px solid #fff; color: #fff; }
.round-btn svg { width: 55%; height: 55%; }
.round-btn.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(242, 209, 75, .45); } }

/* ------------------------------------------------ intestazione (schermate verticali) */
.app-header { position: sticky; top: 0; z-index: 10; background: var(--navy-dark); color: #fff;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); min-height: 76px; }
.app-header .hdr-logo { height: 44px; width: auto; }
.app-header .hdr-sep { width: 1.5px; align-self: stretch; margin: 6px 0; background: #fff; opacity: .9; }
.app-header .hdr-title { font-weight: 800; font-size: 22px; line-height: .98; letter-spacing: .01em; text-transform: uppercase; }
.app-header .hdr-right { margin-left: auto; }
.app-header .icon-btn { width: 46px; height: 46px; }
.app-header .icon-btn svg { width: 42px; height: 42px; }
.app-header .hdr-back svg { width: 26px; height: 26px; }
.page { max-width: 520px; margin: 0 auto; padding: 22px 20px 120px; }
.legal { text-align: center; font-size: 12px; color: var(--muted); margin-top: 24px; }
.legal a { color: var(--muted); }

/* ------------------------------------------------ login */
#login .page { min-height: calc(100dvh - 76px); display: flex; flex-direction: column; justify-content: center; padding-bottom: 40px; }
.login-card { background: var(--violet); color: #fff; border-radius: 28px; padding: 34px 26px 30px; box-shadow: 4px 8px 14px rgba(0,0,0,.25); }
.login-card h2 { margin: 0 0 22px; font-size: 30px; font-weight: 800; text-align: center; letter-spacing: .02em; }
.login-btn { width: 100%; display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 12px; margin-bottom: 12px;
  font-size: 17px; font-weight: 800; letter-spacing: .02em; background: rgba(255,255,255,.08); border: 1.5px solid rgba(255,255,255,.25); color: #fff; }
.login-btn .ico { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.login-btn .ico svg { width: 22px; height: 22px; }
.login-btn.fb .ico { background: none; }
.login-btn.fb .ico svg { width: 34px; height: 34px; }
.login-btn:active { background: rgba(255,255,255,.16); }
.err { color: #c62828; font-size: 14px; text-align: center; min-height: 1em; margin: 12px 0 0; }

/* ------------------------------------------------ home */
.home-card { display: block; width: 100%; text-align: center; background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 30px 22px 34px; margin-bottom: 44px; transition: transform .15s; }
.home-card:active { transform: scale(.98); }
.home-card h2 { margin: 0; font-size: 20px; font-weight: 800; color: #000; }
.home-card p { margin: 0 0 18px; font-size: 13px; color: #000; }
.home-card svg.illu { width: min(240px, 80%); margin: 0 auto; }
.home-card.small { padding: 18px 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 14px; text-align: left; }
.home-card.small h2 { font-size: 16px; }
.home-card.small p { margin: 0; font-size: 12px; color: var(--muted); }
.resume-banner { display: flex; align-items: center; gap: 10px; background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 22px; }
.resume-banner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); flex: none; }
.resume-banner .btn { margin-left: auto; min-height: 36px; padding: 6px 12px; font-size: 13px; color: var(--navy); }

/* ------------------------------------------------ menu utente */
.drawer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.drawer .shade { position: absolute; inset: 0; background: rgba(10, 6, 40, .45); opacity: 0; transition: opacity .25s; }
.drawer .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--bg); transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1); overflow-y: auto; }
.drawer.open { pointer-events: auto; }
.drawer.open .shade { opacity: 1; }
.drawer.open .panel { transform: none; }
.drawer-head { position: sticky; top: 0; background: var(--navy-dark); color: #fff; min-height: 76px; display: flex; align-items: center; justify-content: center; padding-top: env(safe-area-inset-top); }
.drawer-head h2 { margin: 0; font-size: 21px; font-weight: 800; }
.drawer-head .icon-btn { position: absolute; right: 12px; }
.drawer-body { padding: 22px 20px 40px; }
.profile { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.profile .avatar { width: 66px; height: 66px; border-radius: 50%; background: #4a4a4a center/cover no-repeat; flex: none; display: grid; place-items: center; color: #fff; font-size: 26px; font-weight: 800; }
.profile b { display: block; font-size: 18px; }
.profile span { display: block; font-size: 13px; color: var(--muted); word-break: break-all; }
.profile .method { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--navy); background: #e7e5f5; border-radius: 999px; padding: 2px 8px; }
.section-title { font-size: 18px; font-weight: 800; text-align: center; margin: 4px 0 16px; }
.conn-card { background: var(--card); border-radius: 12px; box-shadow: 0 4px 14px rgba(20,11,82,.08); padding: 14px; margin-bottom: 14px; }
.conn-card .cc-label { font-size: 15px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.conn-card .cc-label svg { width: 22px; height: 22px; }
.conn-card .cc-row { display: flex; align-items: center; gap: 12px; }
.conn-card .cc-row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #ddd; }
.conn-card .cc-row b { display: block; font-size: 15px; }
.conn-card .cc-row small { color: var(--green); font-weight: 700; }
.conn-card .cc-links { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.conn-card .cc-links button { color: var(--navy); font-weight: 700; font-size: 13px; text-decoration: underline; padding: 3px; }
.conn-card .cc-links button.danger { color: #c62828; }
.conn-card .cc-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }
.conn-card .btn { width: 100%; }
.seg { display: flex; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 9px 4px; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }
.menu-foot { display: grid; gap: 10px; margin-top: 30px; }
.danger-link { color: #c62828; font-weight: 700; font-size: 14px; text-decoration: underline; padding: 10px; justify-self: center; }

/* ------------------------------------------------ passi 1 e 2 */
.stepper { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 26px; }
.stepper .st { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); display: grid; place-items: center; font-size: 17px; }
.stepper .st.on { border: 2.5px solid var(--navy); color: var(--navy); font-weight: 700; }
.stepper .st.done { background: var(--navy); border-color: var(--navy); color: #fff; }
.stepper .st.done svg { width: 18px; height: 18px; }
.stepper .ln { width: 40px; height: 1.5px; background: var(--muted); }
.stepper .ln.on { background: var(--navy); }
.flabel { display: block; font-size: 12px; color: var(--muted); margin: 18px 0 6px; }
.uline { width: 100%; border: 0; border-bottom: 1px solid #8f91a0; background: transparent; padding: 6px 0; font-size: 15px; outline: none; border-radius: 0; }
.uline:focus { border-bottom: 2px solid var(--navy); padding-bottom: 5px; }
.preview-strip { width: 100%; border-radius: 4px; display: block; }
.team-row { display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: end; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; margin-bottom: 6px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.slots.two { grid-template-columns: 1fr 1fr; gap: 0; justify-items: center; }
.slot-wrap { text-align: center; }
.slot-wrap .flabel { margin-top: 0; }
.slot { position: relative; width: 100%; max-width: 92px; aspect-ratio: 1; margin: 0 auto; border: 1px dashed #a9abb8; display: grid; place-items: center;
  color: #a5a5a5; font-size: 66px; font-weight: 300; line-height: 1; overflow: hidden; background: #fafbff; }
.slots:not(.two) .slot { max-width: 104px; }
.slot img, .slot video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.logo img { object-fit: contain; padding: 8px; background: #fff; }
.slot .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(20,11,82,.85); color: #fff; display: grid; place-items: center; z-index: 2; }
.slot .x svg { width: 12px; height: 12px; }
.slot .dur { position: absolute; bottom: 4px; left: 4px; font-size: 10px; font-weight: 700; color: #fff; background: rgba(0,0,0,.6); padding: 1px 5px; border-radius: 4px; }
.radio { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.radio input { width: 22px; height: 22px; accent-color: var(--navy); margin: 0; flex: none; }
.radio img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #ddd; }
.radio small { display: block; color: var(--muted); font-size: 12px; }
.thumb-box { width: 100%; aspect-ratio: 16/9; background: #d4d4d8 center/cover no-repeat; display: grid; place-items: center; color: #a8a8ae; }
.thumb-box svg { width: 70px; height: 70px; }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 14px; }
.title-row { display: flex; gap: 8px; align-items: flex-end; }
.title-row .regen { font-size: 12px; font-weight: 700; color: var(--navy); white-space: nowrap; padding: 6px 4px; }
.count-hint { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; }
.count-hint.over { color: #c62828; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { font-size: 12px; font-weight: 700; color: var(--navy); background: #e7e5f5; border-radius: 999px; padding: 5px 10px; }
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 20px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); z-index: 5; }
.cta-bar .btn { display: flex; width: 100%; max-width: 480px; margin: 0 auto; min-height: 56px; font-size: 19px; border-radius: 8px; box-shadow: 0 6px 14px rgba(0,0,0,.18); }
.cta-bar .btn svg { width: 26px; height: 20px; }
select.uline { appearance: none; background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6" fill="none" stroke="%2316133a" stroke-width="2"/></svg>') right center/18px no-repeat; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.swatches button.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--navy); }
.custom-color { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; font-weight: 700; }
.custom-color input { width: 46px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0; background: none; }

/* ------------------------------------------------ regia e controllo remoto (orizzontale) */
.land { --u: min(1vh, 0.5vw); height: 100dvh; overflow: hidden; background: #fff; display: grid; grid-template-columns: minmax(0, 1fr); padding: calc(var(--u) * 2.4) calc(var(--u) * 3) 0;
  padding-left: max(calc(var(--u) * 3), env(safe-area-inset-left)); padding-right: max(calc(var(--u) * 3), env(safe-area-inset-right)); }
.ncard { background: var(--navy); color: #fff; border-radius: calc(var(--u) * 3); }
#regia { grid-template-rows: minmax(0, 1fr) auto auto; gap: calc(var(--u) * 3.5); }
.top-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 1fr); gap: calc(var(--u) * 5); min-height: 0; align-items: start; }
.start-card { padding: calc(var(--u) * 4) calc(var(--u) * 3.5); text-align: center; }
.start-card h2 { margin: 0 0 calc(var(--u) * 2.5); font-size: calc(var(--u) * 7); font-weight: 800; line-height: 1.05; }
.start-btn { width: 100%; background: var(--red); color: #fff; border-radius: calc(var(--u) * 2.6); padding: calc(var(--u) * 2.6) 8px; font-size: calc(var(--u) * 4.2); font-weight: 800; letter-spacing: .02em; }
.start-btn.stop { background: #fff; color: var(--red); box-shadow: inset 0 0 0 3px var(--red); }
.start-btn.resume { background: #f77f00; }
.start-btn:disabled { opacity: .6; }
.preview-col { position: relative; padding-right: calc(var(--u) * 7); height: 100%; min-height: 0; }
.preview-card { padding: calc(var(--u) * 2) calc(var(--u) * 3.5) calc(var(--u) * 3.5); height: 100%; display: flex; flex-direction: column; min-height: 0; }
.pv-head { display: flex; align-items: center; gap: calc(var(--u) * 1.6); margin-bottom: calc(var(--u) * 1.4); font-weight: 800; font-size: calc(var(--u) * 4.2); }
.pv-head .live-dot { width: calc(var(--u) * 4.6); height: calc(var(--u) * 4.6); border-radius: 50%; background: #8d8aa8; }
.pv-head.live .live-dot { background: var(--red); animation: blink 1.6s infinite; }
.pv-head.recon .live-dot { background: #f77f00; }
.pv-head .pv-time { font-weight: 700; opacity: .8; font-size: .85em; }
.pv-head .icon-btn { margin-left: auto; width: calc(var(--u) * 7); height: calc(var(--u) * 7); }
.pv-head .icon-btn svg { width: 80%; height: 80%; }
@keyframes blink { 50% { opacity: .35; } }
.pv-screen { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; }
.pv-screen canvas, .cam-stage canvas { position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-radius: calc(var(--u) * 2.2); background: #a3a3a3; display: block; cursor: zoom-in; }
.mic-btn { position: absolute; right: 0; bottom: 0; width: calc(var(--u) * 6.5); height: calc(var(--u) * 8); color: var(--navy); }
.mic-btn svg { width: 100%; height: 100%; }
.mic-btn.off { color: var(--red); }
.remote-card { padding: calc(var(--u) * 3.5); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 800; font-size: calc(var(--u) * 3.4); line-height: 1.25; margin-bottom: calc(var(--u) * 3); }
.switch { position: relative; width: calc(var(--u) * 13); height: calc(var(--u) * 7.4); flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #8d8aa8; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 8%; left: 5%; width: 46%; height: 84%; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(98%); }
.pill-yellow { width: 100%; background: var(--yellow); color: #fff; border-radius: 999px; padding: calc(var(--u) * 2.8) 8px; font-weight: 800; font-size: calc(var(--u) * 3.6); letter-spacing: .02em; }
.pill-yellow:active { filter: brightness(.95); }

.controls-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr); gap: calc(var(--u) * 7); align-items: center; padding: 0 calc(var(--u) * 6); }
.team-card { background: var(--navy); color: #fff; border-radius: calc(var(--u) * 2.6); --rb: calc(var(--u) * 11.5); }
.tc-head { display: flex; align-items: center; gap: calc(var(--u) * 2); padding: calc(var(--u) * 2) calc(var(--u) * 3); border-bottom: 1.5px solid rgba(255,255,255,.75); }
.tc-logo { width: calc(var(--u) * 7); height: calc(var(--u) * 7); border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px #fff; }
.tc-name { font-weight: 800; font-size: calc(var(--u) * 4.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.tc-serve { width: calc(var(--u) * 3); height: calc(var(--u) * 3); border-radius: 50%; background: var(--yellow); visibility: hidden; flex: none; }
.team-card.serving .tc-serve { visibility: visible; }
.tc-body { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: calc(var(--u) * 1.2) 0; }
.tc-body .round-btn:first-child { margin-left: calc(var(--rb) * -.42); }
.tc-body .round-btn:last-child { margin-right: calc(var(--rb) * -.42); }
.tc-score { text-align: center; line-height: 1; }
.tc-score b { display: block; font-size: calc(var(--u) * 12.5); font-weight: 800; }
.tc-score small { font-size: calc(var(--u) * 1.8); font-weight: 700; letter-spacing: .04em; }
.ctl-center { display: grid; gap: calc(var(--u) * 3); justify-items: center; }
.timer-card { display: flex; align-items: center; gap: calc(var(--u) * 5); background: var(--navy); color: #fff; border-radius: calc(var(--u) * 2.6); padding: calc(var(--u) * 1.6) calc(var(--u) * 2) calc(var(--u) * 1.6) calc(var(--u) * 3); --rb: calc(var(--u) * 10); }
.tm-text { font-weight: 800; font-size: calc(var(--u) * 4.4); line-height: 1.15; }
.tm-text b { display: block; font-variant-numeric: tabular-nums; }
.tm-play { color: #fff !important; }
.tm-play svg { width: 50%; height: 50%; margin-left: 6%; }
.set-card { display: flex; align-items: center; gap: calc(var(--u) * 5); background: var(--navy); color: var(--yellow); border-radius: calc(var(--u) * 3); padding: calc(var(--u) * 1.6) calc(var(--u) * 2.4); --rb: calc(var(--u) * 9.5); width: 100%; justify-content: space-between; }
.set-text { text-align: center; line-height: 1.05; }
.set-text b { display: block; font-size: calc(var(--u) * 7); font-weight: 800; }
.set-text small { font-weight: 800; font-size: calc(var(--u) * 3); white-space: nowrap; }
.bottom-bar { margin: 0 calc(var(--u) * -3); height: calc(var(--u) * 9); background: var(--yellow); display: flex; align-items: center; padding-left: calc(var(--u) * 3);
  padding-left: max(calc(var(--u) * 3), env(safe-area-inset-left)); gap: calc(var(--u) * 3); font-weight: 800; color: #000; font-size: calc(var(--u) * 3.8); }
.batt { display: flex; align-items: center; gap: calc(var(--u) * 1.4); color: var(--navy); }
.batt span { color: #000; }
.batt svg { height: calc(var(--u) * 5.6); width: auto; }
.batt.low { color: #c62828; } .batt.low span { color: #c62828; }
.bb-status { font-size: .85em; font-weight: 700; color: var(--navy); }
.share-sq { margin-left: auto; height: 100%; aspect-ratio: 1; background: var(--navy); color: var(--yellow); display: grid; place-items: center; }
.share-sq svg { width: 55%; height: 55%; }
.rotate-hint { display: none; }
@media (orientation: portrait) {
  .land .rotate-hint { display: flex; position: fixed; inset: 0; z-index: 60; background: var(--navy-dark); color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 18px; font-weight: 800; font-size: 18px; text-align: center; padding: 30px; }
  .rotate-hint .phone { width: 60px; height: 100px; border: 4px solid #fff; border-radius: 12px; animation: rot 2s ease-in-out infinite; }
}
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ------------------------------------------------ vista fotocamera */
.cam-view { position: fixed; inset: 0; z-index: 30; background: var(--navy); display: grid; grid-template-columns: 1fr auto; gap: calc(var(--u) * 4);
  padding: calc(var(--u) * 4); padding-left: max(calc(var(--u) * 4), env(safe-area-inset-left)); padding-right: max(calc(var(--u) * 4), env(safe-area-inset-right)); --u: min(1vh, 0.5vw); }
.cam-stage { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; }
.cam-stage canvas { cursor: default; border-radius: calc(var(--u) * 2.4); }
.cam-tools { display: flex; flex-direction: column; justify-content: center; gap: calc(var(--u) * 2.6); }
.cam-tools button { width: calc(var(--u) * 13); height: calc(var(--u) * 13); border-radius: 50%; border: 2px solid #fff; color: #fff; display: grid; place-items: center; position: relative; }
.cam-tools button svg { width: 52%; height: 52%; }
.cam-tools button .x-txt { font-size: calc(var(--u) * 7); font-weight: 800; }
.cam-tools button .badge { position: absolute; right: -4px; bottom: -4px; background: var(--yellow); color: var(--navy); font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 5px; }
.cam-tools button.off { color: var(--red); border-color: var(--red); }
.cam-anim { position: fixed; z-index: 31; border-radius: 12px; overflow: hidden; pointer-events: none; }
.opt-grid { display: grid; gap: 12px; grid-template-columns: repeat(var(--cols, 2), 1fr); }
.opt { display: grid; gap: 6px; justify-items: center; font-weight: 700; font-size: 13px; color: var(--text); padding: 6px; border-radius: 10px; border: 2px solid transparent; }
.opt.on { border-color: var(--navy); background: #efeefa; }
.opt canvas { width: 100%; aspect-ratio: 16/9; border-radius: 6px; background: #a3a3a3; display: block; }
.opt .lens { width: 64px; height: 64px; border-radius: 50%; border: 2.5px solid var(--navy); display: grid; place-items: center; font-size: 18px; font-weight: 800; color: var(--navy); }
.opt small { font-weight: 600; color: var(--muted); font-size: 11px; text-align: center; }
.opt:disabled { opacity: .35; }

/* ------------------------------------------------ controllo remoto */
#remote { grid-template-rows: auto minmax(0, 1fr) auto; gap: calc(var(--u) * 4); }
#remote .controls-row { padding-top: calc(var(--u) * 1.5); }
.mid-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(var(--u) * 9); align-items: center; padding: 0 calc(var(--u) * 6); min-height: 0; }
.gfx-card { padding: calc(var(--u) * 3) calc(var(--u) * 3.2); }
.gfx-card h3 { margin: 0 0 calc(var(--u) * 2.4); font-size: calc(var(--u) * 3.4); font-weight: 800; }
.gfx-item { display: flex; align-items: center; background: var(--yellow); border-radius: 999px; margin-bottom: calc(var(--u) * 1.8); padding: calc(var(--u) * .9) calc(var(--u) * .9) calc(var(--u) * .9) calc(var(--u) * 3.5); }
.gfx-item:last-child { margin-bottom: 0; }
.gfx-item span { flex: 1; color: #fff; font-weight: 800; font-size: calc(var(--u) * 3.3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gfx-item button { width: calc(var(--u) * 7); height: calc(var(--u) * 7); border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; margin-left: calc(var(--u) * 1); }
.gfx-item button svg { width: 50%; height: 50%; }
.gfx-item.on { background: var(--red); }
.gfx-empty { font-size: calc(var(--u) * 3); opacity: .7; }
.remote-off { position: fixed; inset: 0; z-index: 50; background: rgba(20, 11, 82, .92); color: #fff; display: grid; place-items: center; text-align: center; padding: 30px; font-weight: 800; font-size: 18px; }

/* ------------------------------------------------ finestre e toast */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(10, 6, 40, .5); display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .2s; }
.modal.in { opacity: 1; }
.modal-card { width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow); transform: translateY(12px) scale(.98); transition: transform .2s; }
.modal.in .modal-card { transform: none; }
.modal.wide .modal-card { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 0 18px; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 800; color: var(--navy); }
.modal-head .icon-btn svg { width: 18px; height: 18px; }
.modal-body { padding: 12px 18px; font-size: 15px; line-height: 1.45; }
.modal-body p { margin: 0 0 8px; }
.modal-actions { display: flex; gap: 10px; padding: 4px 18px 18px; }
.modal-actions .btn { flex: 1; }
.warn-text { color: #c62828; font-size: 13px; }
.serve-modal .modal-actions { padding-top: 14px; }
.serve-btn { flex-direction: column; min-height: 110px; font-size: 16px; text-transform: uppercase; }
.serve-logo { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.qr { background: #fff; padding: 10px; width: fit-content; margin: 4px auto 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; transition: .25s; z-index: 90; max-width: min(92vw, 520px);
  background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); text-align: center; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.field-input { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 15px; outline: none; background: #fff; }
.field-input:focus { border-color: var(--navy); }
textarea.uline { resize: none; line-height: 1.4; font-family: inherit; }
.avatar-sm { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
#collabBox .btn { margin-bottom: 6px; }
