* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #14161c; color: #f2efe8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: none; overscroll-behavior: none;
}
#game, #hud-top, #joy, #badge, #hint, #me { -webkit-user-select: none; user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; image-rendering: pixelated; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* HUD */
#hud-top {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 220px;
  display: flex; align-items: center; gap: 10px; pointer-events: none; z-index: 10;
}
.brand {
  font-family: 'Ultima', system-ui, sans-serif; font-weight: 400; letter-spacing: .32em; font-size: 13px; white-space: nowrap;
  background: #000000e6; border: 1px solid #ffffff26; border-radius: 10px; padding: 8px 12px 8px 10px;
  display: flex; align-items: center; gap: 8px;
}
.brand img { height: 16px; width: auto; display: block; }
.brand b { font-weight: 400; color: #ffffff; }
.brand span { color: #9a9a9a; letter-spacing: .28em; }
.pill {
  display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0;
  background: #0d0f14e6; border: 1px solid #ffffff1f; border-radius: 999px; padding: 8px 14px;
}
.pill b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: #9aa0ad; flex: none; }
.pill.in-room i { background: #4cd08a; box-shadow: 0 0 0 3px #4cd08a33; }

#hud-right {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 12;
  display: flex; align-items: center; gap: 8px;
}
#people-btn {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: #0d0f14e6; color: #f2efe8; border: 1px solid #ffffff1f; border-radius: 999px;
  padding: 8px 12px; font-size: 13px; font-weight: 700;
}
#people-btn .cnt { min-width: 18px; height: 18px; border-radius: 9px; background: #4cd08a; color: #0d0f14; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
#people-btn.on { border-color: #8fd3ff88; }
#me {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: #0d0f14e6; color: #f2efe8; border: 1px solid #ffffff1f; border-radius: 999px;
  padding: 7px 14px 7px 8px; font-size: 13px; font-weight: 600; max-width: 140px;
}
#me .dot { width: 20px; height: 20px; border-radius: 50%; flex: none; border: 2px solid #ffffff55; }
#me .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#menu {
  position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 46px); right: 12px; z-index: 12;
  background: #1a1d25; border: 1px solid #ffffff1f; border-radius: 12px; padding: 6px; min-width: 190px;
  box-shadow: 0 10px 30px #0008;
}
#menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0; color: #f2efe8;
  font-size: 14px; padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
#menu button:hover { background: #ffffff12; }
body:not(.is-admin) #menu .admin-only { display: none; }

#badge {
  position: fixed; bottom: 14px; right: 12px; z-index: 10;
  font-size: 11px; color: #c9c5bc; background: #0d0f14cc; border: 1px dashed #ffffff33;
  border-radius: 8px; padding: 6px 10px; pointer-events: none;
}

#toast {
  position: fixed; left: 50%; top: 64px; transform: translate(-50%, -8px); z-index: 11;
  background: #f2efe8; color: #14161c; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 6px 20px #0006; white-space: nowrap;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#hint {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 10;
  font-size: 12px; color: #c9c5bc; background: #0d0f14cc; border-radius: 8px; padding: 6px 12px;
  pointer-events: none; white-space: nowrap;
}

/* Joystick stile FIFA */
#joy {
  position: fixed; z-index: 20; display: none;
  left: max(24px, env(safe-area-inset-left)); bottom: max(28px, env(safe-area-inset-bottom));
  width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff14 0%, #ffffff0a 60%, #ffffff05 100%);
  border: 2px solid #ffffff40; touch-action: none;
}
#knob {
  position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px;
  border-radius: 50%; background: #f2efe8e6; border: 2px solid #ffffff;
  box-shadow: 0 4px 12px #0007; transition: transform .08s;
}
#joy.active #knob { transition: none; }
body.touch.playing #joy { display: block; }
body.touch #hint { display: none; }
body:not(.playing) #hint { display: none; }

/* Finestre */
.overlay {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: #0d0f14d9; padding: 20px; touch-action: auto;
}
#auth { background: #000000c7; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.card {
  width: 100%; max-width: 380px; max-height: 100%; overflow: auto; -webkit-overflow-scrolling: touch;
  background: #1a1d25; border: 1px solid #ffffff1a; border-radius: 18px; padding: 24px; text-align: center;
}
.card.wide { max-width: 720px; text-align: left; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-head h2 { font-size: 18px; }
.card h3 { font-size: 14px; margin: 18px 0 10px; color: #c9c5bc; text-transform: uppercase; letter-spacing: .08em; }
.x { background: none; border: 0; color: #c9c5bc; font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 8px; }
@font-face { font-family: 'Ultima'; src: url('brand/UltimaFont-Regular.otf') format('opentype'); font-display: swap; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px 0 2px; }
.logo img { width: 190px; max-width: 70%; height: auto; display: block; }
.logo span { font-family: 'Ultima', system-ui, sans-serif; letter-spacing: .6em; font-size: 12px; color: #9a9a9a; margin-right: -.6em; }
.sub { margin: 14px 0 16px; color: #c9c5bc; }
.note { margin-top: 14px; font-size: 12px; color: #8a8f9a; line-height: 1.45; }
.note.left { text-align: left; margin: 0 0 12px; }
.note b { color: #c9c5bc; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 12px; padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer; border: 0;
}
.btn-primary { background: #f2efe8; color: #14161c; }
.btn-primary:hover { background: #ffffff; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-secondary { background: #2a2e3a; color: #f2efe8; border: 1px solid #ffffff1f; }
.btn-small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }

/* Personaggi */
#chars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
#chars button {
  background: #242833; border: 2px solid transparent; border-radius: 12px; padding: 10px 4px 8px; cursor: pointer;
  color: #c9c5bc; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 6px;
}
#chars button canvas { image-rendering: pixelated; width: 48px; height: 60px; }
#chars button.sel { border-color: #8fd3ff; color: #f2efe8; }

/* Gestisci persone */
.person {
  background: #242833; border: 1px solid #ffffff12; border-radius: 12px; padding: 12px; margin-bottom: 8px;
}
.person .top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.person .top .mail { font-size: 13px; color: #c9c5bc; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .top canvas { image-rendering: pixelated; width: 24px; height: 30px; flex: none; }
.person.off { opacity: .6; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #8a8f9a; }
.grid input, .grid select {
  background: #14161c; color: #f2efe8; border: 1px solid #ffffff22; border-radius: 8px;
  padding: 9px 10px; font-size: 14px; font-family: inherit; width: 100%; min-width: 0;
}
.person .actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.person .actions .msg { font-size: 12px; color: #8a8f9a; }
.person .actions .msg.err { color: #ff8a80; }
.person .actions .msg.ok { color: #4cd08a; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin-right: auto; }
.switch input { width: 18px; height: 18px; accent-color: #4cd08a; }
#add-form { margin-top: 8px; }
#add-form .btn-primary { margin-top: 12px; }
#add-form .msg { font-size: 12px; margin-top: 8px; }

@media (max-width: 640px) {
  #hud-top { right: 168px; }
  .brand { display: none; }
  .brand { font-size: 12px; padding: 7px 10px; }
  .pill { font-size: 12px; padding: 7px 12px; }
  #me { max-width: 100px; }
  #badge { bottom: max(28px, env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: 1fr 1fr; }
  #chars { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}

/* Persone */
#people-panel {
  position: fixed; z-index: 11; right: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 52px);
  width: 310px; max-height: calc(100% - 140px); overflow: auto; -webkit-overflow-scrolling: touch;
  background: #1a1d25f2; border: 1px solid #ffffff1f; border-radius: 16px; padding: 10px; box-shadow: 0 10px 30px #0008;
  touch-action: auto;
}
.pp-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.pp-head b { font-size: 15px; }
.pp-head #pp-sub { font-size: 12px; color: #8a8f9a; margin-right: auto; }
.pp-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; }
.pp-row:hover { background: #ffffff0a; }
.pp-row canvas { image-rendering: pixelated; width: 24px; height: 30px; flex: none; }
.pp-row.off canvas { filter: grayscale(1) brightness(.8); opacity: .7; }
.pp-row .info { flex: 1; min-width: 0; }
.pp-row .nm { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pp-row .nm i { width: 8px; height: 8px; border-radius: 50%; background: #6b7080; flex: none; }
.pp-row.on .nm i { background: #4cd08a; }
.pp-row .wh { font-size: 12px; color: #8a8f9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-row button {
  flex: none; background: #2a2e3a; color: #f2efe8; border: 1px solid #ffffff1f; border-radius: 9px;
  padding: 7px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.pp-row button:hover { background: #343947; }
.pp-row .you { font-size: 12px; color: #8a8f9a; }
@media (max-width: 640px) {
  #people-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 62%; border-radius: 18px 18px 0 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  body.panel-open #joy, body.panel-open #badge { display: none !important; }
  .pp-row button { padding: 10px 14px; font-size: 13px; }
}

/* Call */
#call { position: fixed; inset: 0; pointer-events: none; z-index: 9; }
#tiles {
  position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 52px); left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; max-width: calc(100% - 24px); overflow-x: auto; padding: 2px; pointer-events: auto;
}
.tile {
  position: relative; flex: none; width: 176px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  background: #232733; border: 2px solid #ffffff1a; box-shadow: 0 6px 18px #0007; cursor: pointer;
}
.tile.screen { width: 288px; aspect-ratio: 16 / 9; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #111; }
.tile.screen video { object-fit: contain; }
.tile.mirror video { transform: scaleX(-1); }
.tile .ph { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: #c9c5bc; background: #2a2e3a; }
.tile.novideo video { display: none; }
.tile.novideo .ph { display: flex; }
.tile.speaking { border-color: #4cd08a; }
.tile .lbl { position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 4px; background: #0d0f14cc; border-radius: 6px; padding: 3px 7px; font-size: 12px; font-weight: 600; max-width: calc(100% - 12px); }
.tile .lbl .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .lbl .mic svg { width: 13px; height: 13px; color: #ff8a80; display: block; }
#bigwrap { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: #0d0f14d9; pointer-events: auto; padding: 16px; }
.tile.big { width: min(92vw, 1100px); max-height: 82vh; aspect-ratio: 16 / 9; }
.tile.big:not(.screen) { aspect-ratio: 4 / 3; width: min(92vw, 800px); }
#call-bar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px; pointer-events: auto;
  background: #0d0f14e6; border: 1px solid #ffffff1f; border-radius: 16px; padding: 8px 10px; box-shadow: 0 8px 24px #0008;
}
#call-label { font-size: 13px; font-weight: 600; color: #c9c5bc; padding: 0 8px 0 4px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.cbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: #2a2e3a; color: #f2efe8; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cbtn:hover { background: #343947; }
.cbtn.off { background: #f2efe8; color: #14161c; }
.cbtn.on { background: #8fd3ff; color: #0d0f14; }
.cbtn.danger { background: #d64545; }
.cbtn.danger:hover { background: #e05555; }
#c-audio { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; background: #f2efe8; color: #14161c; border: 0; border-radius: 12px; padding: 14px 20px; font-weight: 700; font-size: 15px; cursor: pointer; }
body.in-call #hint { display: none; }
body.in-call #toast { top: auto; bottom: 90px; }
body.in-call #badge { display: none; }
@media (max-width: 640px) {
  #tiles { top: calc(max(12px, env(safe-area-inset-top)) + 48px); }
  .tile { width: 108px; }
  .tile.screen { width: 180px; }
  .tile .lbl { font-size: 11px; padding: 2px 5px; }
  #call-bar { left: auto; right: 12px; transform: none; bottom: max(84px, calc(env(safe-area-inset-bottom) + 64px)); padding: 6px; gap: 6px; }
  #call-label { display: none; }
  .cbtn { width: 46px; height: 46px; }
  body.in-call #toast { bottom: 180px; }
}

/* Fase 5: lucchetto, porta, popup, stato */
#lock-btn {
  pointer-events: auto; flex: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  background: #0d0f14e6; border: 1px solid #ffffff1f; color: #f2efe8; display: inline-flex; align-items: center; justify-content: center;
}
#lock-btn.on { background: #f2c14e; color: #14161c; border-color: #f2c14e; }
#lock-btn svg { width: 17px; height: 17px; }
#me .dot { box-shadow: 0 0 0 2px #4cd08a; }
#me.busy .dot { box-shadow: 0 0 0 2px #e5534b; }
#door-prompt {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; z-index: 14;
  display: flex; align-items: center; gap: 12px; background: #1a1d25f2; border: 1px solid #ffffff22;
  border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 10px 30px #0008; font-size: 14px; max-width: calc(100% - 24px);
}
#door-prompt .act { background: #f2efe8; color: #14161c; border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
#door-prompt .act:disabled { opacity: .5; cursor: default; }
#door-prompt .act.hidden { display: none; }
#popups { position: fixed; top: calc(max(12px, env(safe-area-inset-top)) + 56px); left: 50%; transform: translateX(-50%); z-index: 28; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100% - 24px)); }
.popup {
  background: #f2efe8; color: #14161c; border-radius: 16px; padding: 14px; box-shadow: 0 14px 40px #000a;
  display: flex; align-items: center; gap: 12px; animation: pop .25s ease-out;
}
.popup canvas { image-rendering: pixelated; width: 32px; height: 40px; flex: none; }
.popup .txt { flex: 1; min-width: 0; }
.popup .txt b { display: block; font-size: 15px; }
.popup .txt span { font-size: 13px; color: #4a4f5c; }
.popup .btns { display: flex; gap: 6px; flex: none; }
.popup button { border: 0; border-radius: 10px; padding: 10px 12px; font-weight: 700; font-size: 13px; cursor: pointer; }
.popup .yes { background: #1f8a5a; color: #fff; }
.popup .nope { background: #e3ded3; color: #14161c; }
.popup.ringing { box-shadow: 0 0 0 3px #4cd08a, 0 14px 40px #000a; }
@keyframes pop { from { transform: translateY(-8px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.pp-row .st { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.pp-row.on .nm i.busy { background: #e5534b; }
.pp-row .btns { display: flex; gap: 6px; flex: none; }
@media (max-width: 640px) {
  #door-prompt { bottom: 180px; }
  .popup { flex-wrap: wrap; }
  .popup .btns { width: 100%; }
  .popup .btns button { flex: 1; padding: 12px; }
}

/* Fase 6: chat */
#chat-btn {
  position: relative; display: flex; align-items: center; cursor: pointer;
  background: #0d0f14e6; color: #f2efe8; border: 1px solid #ffffff1f; border-radius: 999px; padding: 8px 11px;
}
#chat-btn.on { border-color: #8fd3ff88; }
#chat-btn .cnt { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: #e5534b; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
#chat-panel {
  position: fixed; z-index: 11; right: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 52px);
  width: 340px; height: min(560px, calc(100% - 140px)); display: flex; flex-direction: column;
  background: #1a1d25f2; border: 1px solid #ffffff1f; border-radius: 16px; box-shadow: 0 10px 30px #0008; touch-action: auto; overflow: hidden;
}
.cp-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; border-bottom: 1px solid #ffffff12; }
.cp-head .tabs { display: flex; gap: 6px; flex: 1; min-width: 0; }
.cp-head .tabs button { background: #242833; color: #c9c5bc; border: 1px solid #ffffff12; border-radius: 9px; padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; display: inline-flex; align-items: center; gap: 6px; }
.cp-head .tabs button.on { background: #f2efe8; color: #14161c; }
.cp-head .tabs .u { width: 8px; height: 8px; border-radius: 50%; background: #e5534b; flex: none; }
#cp-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }
#cp-list .empty { color: #8a8f9a; font-size: 13px; text-align: center; margin: auto 0; }
.msg-row { display: flex; gap: 8px; align-items: flex-start; }
.msg-row canvas { image-rendering: pixelated; width: 20px; height: 25px; flex: none; margin-top: 2px; }
.msg-row .b { min-width: 0; }
.msg-row .h { font-size: 12px; color: #8a8f9a; }
.msg-row .h b { font-size: 13px; margin-right: 6px; }
.msg-row .t { font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.msg-row.mine .h b { color: #8fd3ff !important; }
.day-sep { text-align: center; font-size: 11px; color: #6b7080; margin: 4px 0; }
#cp-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #ffffff12; }
#cp-input { flex: 1; min-width: 0; background: #14161c; color: #f2efe8; border: 1px solid #ffffff22; border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; }
#cp-form button { background: #f2efe8; color: #14161c; border: 0; border-radius: 10px; width: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 640px) {
  #chat-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 68%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #cp-input { font-size: 16px; }
  #hud-top { right: 172px; }
  #me .nm { display: none; }
  #me { padding-right: 8px; }
  #where { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
}

/* Fase 7: zoom */
#zoom { position: fixed; right: 12px; bottom: 76px; z-index: 12; display: none; flex-direction: column; gap: 6px; }
body.playing #zoom { display: flex; }
#zoom button {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid #ffffff22; background: #14161ce0; color: #f2efe8;
  font-size: 20px; font-weight: 600; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px #0005;
}
#zoom button:hover { background: #22252e; }
#zoom #zoom-me { display: none; align-items: center; justify-content: center; background: #ff7a2f; color: #14161c; border-color: #ff7a2f; }
body.cam-free #zoom #zoom-me { display: inline-flex; }
body.panel-open #zoom { display: none; }
@media (max-width: 640px) { #zoom { bottom: max(112px, calc(env(safe-area-inset-bottom) + 96px)); } }
body.in-call #zoom { bottom: 96px; }
#auth .card { background: #0a0a0b; border-color: #ffffff22; }

/* Fase 8: obiettivi dalla bacheca */
#goals-btn {
  position: relative; display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: #000000e6; color: #ffffff; border: 1px solid #ffffff26; border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 700;
}
#goals-btn.on { border-color: #ffffffaa; }
#goals-btn .cnt { font-variant-numeric: tabular-nums; }
#goals-btn .cnt.all { color: #4cd08a; }
#goals-panel {
  position: fixed; z-index: 11; right: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 52px);
  width: 360px; height: min(620px, calc(100% - 140px)); display: flex; flex-direction: column;
  background: #0b0b0df5; border: 1px solid #ffffff22; border-radius: 16px; box-shadow: 0 10px 30px #0008; overflow: hidden;
}
#goals-panel .tabs button.on { background: #ffffff; color: #000; }
#gp-body { flex: 1; overflow-y: auto; padding: 12px 14px 16px; -webkit-overflow-scrolling: touch; }
#gp-open { display: block; text-align: center; padding: 11px; border-top: 1px solid #ffffff14; color: #cfcfcf; font-size: 13px; text-decoration: none; font-weight: 600; }
#gp-open:hover { color: #fff; background: #ffffff0a; }
.gp-who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
.gp-who b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-who .cnt, .gg summary .cnt, .gp-p .cnt { color: #a9a9ad; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.gp-back { background: none; border: 0; color: #a9a9ad; font-size: 13px; padding: 0 0 8px; cursor: pointer; }
.gp-sub { margin: 8px 0 12px; color: #d7d7d7; font-size: 13px; font-weight: 600; }
.gp-empty { color: #8a8f9a; font-size: 13px; margin: 12px 0; }
.gp-note { color: #7d7d82; font-size: 12px; line-height: 1.45; margin-top: 14px; }
/* quadratini (come in bacheca) */
.gq { display: flex; flex-wrap: wrap; gap: 3px; }
.gq i { width: 8px; height: 10px; border-radius: 2px; border: 1.5px solid var(--c); box-sizing: border-box; display: block; }
.gq.big { gap: 4px; margin: 4px 0 6px; }
.gq.big i { width: 13px; height: 16px; border-radius: 3px; }
.gq i.s-done { background: var(--c); }
.gq i.s-checked { background: color-mix(in srgb, var(--c) 45%, transparent); }
.gq i.s-wait { border-color: #6b6f78; background: #6b6f78; }
.gq i.s-missed { border-color: #e5534b; opacity: .6; }
.gp-list { display: flex; flex-direction: column; gap: 6px; }
.gg { background: #ffffff08; border: 1px solid #ffffff10; border-radius: 12px; padding: 4px 8px 6px; }
.gg summary { display: flex; justify-content: space-between; gap: 8px; cursor: pointer; padding: 6px 2px; font-size: 13px; font-weight: 700; color: #e9e9ea; list-style: none; }
.gg summary::-webkit-details-marker { display: none; }
.gg > div { display: flex; flex-direction: column; gap: 6px; }
.gt { background: #ffffff0a; border-radius: 10px; padding: 9px 10px; }
.gt-h { display: flex; align-items: flex-start; gap: 9px; }
.gt-h.has-note { cursor: pointer; }
.gt-i { width: 18px; height: 18px; border-radius: 6px; border: 2px solid var(--c); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: #000; margin-top: 1px; }
.gt.st-done .gt-i { background: var(--c); }
.gt.st-checked .gt-i { background: color-mix(in srgb, var(--c) 50%, transparent); color: #fff; }
.gt.st-wait .gt-i { border-color: #6b6f78; color: #ccc; }
.gt.st-missed .gt-i { border-color: #e5534b; color: #e5534b; }
.gt-t { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; color: #f2f2f3; }
.gt.st-done .gt-t { color: #9a9aa0; text-decoration: line-through; text-decoration-color: #ffffff40; }
.gt-m { margin: 4px 0 0 27px; font-size: 11.5px; color: #8f8f95; }
.gt-n { margin: 7px 0 2px 27px; font-size: 12.5px; color: #c9c9cd; white-space: pre-wrap; line-height: 1.45; overflow-wrap: anywhere; }
.gt-b { flex: none; background: #ffffff; color: #000; border: 0; border-radius: 8px; padding: 6px 11px; font-size: 12px; font-weight: 800; cursor: pointer; }
.gt-b.on { background: #2a2a2e; color: #d0d0d4; }
.gt-b:disabled { opacity: .5; }
.gp-people { display: flex; flex-direction: column; gap: 4px; margin: 10px 0 18px; }
.gp-p { display: grid; grid-template-columns: 10px 64px 1fr auto; align-items: center; gap: 9px; background: #ffffff08; border: 1px solid #ffffff0d; border-radius: 10px; padding: 9px 10px; color: #f2f2f3; cursor: pointer; text-align: left; font-size: 13.5px; font-weight: 600; }
.gp-p:hover { background: #ffffff12; }
.gp-p .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-week h4 { font-family: 'Ultima', system-ui, sans-serif; font-weight: 400; letter-spacing: .22em; font-size: 11px; color: #a9a9ad; margin: 0 0 10px; text-transform: uppercase; }
.gw { background: #ffffff08; border-radius: 10px; padding: 10px; margin-bottom: 7px; }
.gw-t { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.gw-t .dots { display: inline-flex; gap: 2px; margin-top: 4px; flex: none; }
.gw-t .dot { width: 7px; height: 7px; }
.gw-bar { display: flex; gap: 2px; margin: 8px 0 5px; }
.gw-bar i { flex: 1; height: 5px; border-radius: 2px; background: #ffffff1c; }
.gw-bar i.on { background: #ffffff; }
.gw-m { font-size: 11.5px; color: #8f8f95; }
#near-pill {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 140px; z-index: 13;
  display: flex; align-items: center; gap: 10px; background: #000000eb; border: 1px solid #ffffff2a;
  border-radius: 999px; padding: 6px 6px 6px 16px; box-shadow: 0 8px 24px #0008; font-size: 13.5px; font-weight: 600; max-width: calc(100% - 24px);
}
#near-pill .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#near-pill .act { background: #fff; color: #000; border: 0; border-radius: 999px; padding: 7px 13px; font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
#near-pill kbd { font-family: inherit; font-size: 10px; border: 1px solid #0003; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
body.touch #near-pill kbd { display: none; }
body.panel-open #near-pill { display: none; }
.pp-goals { display: inline-flex; align-items: center; gap: 6px; margin-top: 5px; background: none; border: 0; padding: 0; color: #a9a9ad; font-size: 11px; font-weight: 700; cursor: pointer; }
.pp-goals .gq i { width: 6px; height: 8px; border-width: 1.2px; border-radius: 1.5px; }
@media (max-width: 640px) {
  #goals-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 74%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #near-pill { bottom: max(190px, calc(env(safe-area-inset-bottom) + 176px)); }
  #goals-btn { padding: 8px 9px; }
  #goals-btn .cnt { display: none; }
  #hud-top { right: 214px; }
}

/* Schermo condiviso grande: occupa tutta la finestra, si vede intero; pulsante per lo schermo intero del monitor */
#bigwrap { padding: 10px; background: #000000eb; }
.tile.big.screen { width: calc(100vw - 20px); height: calc(100vh - 20px); max-height: none; aspect-ratio: auto; border-radius: 12px; background: #000; }
.tile.big.screen video { object-fit: contain; background: #000; }
.tile .bigctl { display: none; position: absolute; top: 10px; right: 10px; gap: 8px; z-index: 2; }
.tile.big .bigctl { display: flex; }
.tile .bigctl button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #ffffff2a; background: #000000c0; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.tile .bigctl button:hover { background: #222; }
.tile:fullscreen { width: 100vw !important; height: 100vh !important; border-radius: 0; border: 0; background: #000; }
.tile:fullscreen video { object-fit: contain; }
.tile:fullscreen .bigctl .cl { display: none; }
.tile:-webkit-full-screen { width: 100vw !important; height: 100vh !important; border-radius: 0; background: #000; }

/* Fase 9: classifica, prenota */
.gp-rank { margin: 6px 0 18px; }
.gp-rank h4 { font-family: 'Ultima', system-ui, sans-serif; font-weight: 400; letter-spacing: .22em; font-size: 11px; color: #a9a9ad; margin: 0 0 10px; text-transform: uppercase; }
.rk { display: grid; grid-template-columns: 22px 10px 70px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; background: #ffffff08; border-radius: 10px; margin-bottom: 5px; font-size: 13.5px; }
.rk.zero { opacity: .55; }
.rk .md { font-size: 16px; text-align: center; }
.rk .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk .bar { height: 6px; background: #ffffff12; border-radius: 3px; overflow: hidden; }
.rk .bar i { display: block; height: 100%; border-radius: 3px; }
.rk b { font-size: 12px; color: #e9e9ea; white-space: nowrap; }
#near-pill .act2 { background: #d4a72c; color: #000; border-radius: 999px; padding: 7px 13px; font-weight: 800; font-size: 13px; text-decoration: none; white-space: nowrap; }
#near-pill .act.hidden, #near-pill .act2.hidden { display: none; }
.btn-link { display: inline-flex; align-items: center; background: #d4a72c; color: #000; border-radius: 9px; padding: 7px 10px; font-size: 12px; font-weight: 800; text-decoration: none; }
#bigwrap { z-index: 60; }
body.big-open #call { z-index: 60; }

/* Call a griglia: tutti grandi */
#call.gallery::before { content: ''; position: absolute; inset: 0; background: #0b0d12f2; pointer-events: auto; }
#call.gallery #tiles {
  position: absolute; top: 20px; left: 20px; right: 20px; bottom: 100px; transform: none; max-width: none;
  display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 10px; overflow: hidden; padding: 0;
}
#call.gallery .tile, #call.gallery .tile.screen { aspect-ratio: 16 / 9; box-sizing: border-box; }
#call.gallery .tile .ph { font-size: 64px; }
#call.gallery .tile .lbl { font-size: 14px; padding: 4px 9px; left: 10px; bottom: 10px; }
body.gallery-open #call { z-index: 55; }
@media (max-width: 640px) { #call.gallery #tiles { top: 12px; left: 8px; right: 8px; bottom: 130px; } }

/* Reazioni e mani alzate in call */
#react-pick { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 70px); pointer-events: auto;
  display: flex; gap: 4px; background: #0d0f14f0; border: 1px solid #ffffff1f; border-radius: 14px; padding: 6px; box-shadow: 0 8px 24px #0008; z-index: 3; }
#react-pick button { width: 42px; height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: 24px; cursor: pointer; }
#react-pick button:hover { background: #ffffff14; transform: scale(1.12); }
#react-fly { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
#react-fly .fly { position: absolute; font-size: 40px; transform: translate(-50%, 0); animation: hq-fly 2.1s ease-out forwards; text-shadow: 0 4px 12px #0007; }
@keyframes hq-fly { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -220px) scale(1); } }
#hands { position: absolute; left: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 74px); pointer-events: auto; z-index: 3;
  background: #0d0f14f0; border: 1px solid #f2c94c66; border-radius: 14px; padding: 10px 14px; min-width: 170px; box-shadow: 0 8px 24px #0008; font-size: 14px; }
#hands b { display: block; color: #f2c94c; font-size: 13px; margin-bottom: 6px; }
#hands ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
#hands li.can { cursor: pointer; }
#hands li.can:hover { text-decoration: line-through; color: #ff8a80; }
.tile.hand::after { content: '✋'; position: absolute; top: 8px; left: 8px; font-size: 22px; animation: hq-wave .8s ease-in-out infinite alternate; transform-origin: 70% 90%; }
.tile.hand { border-color: #f2c94c; }
@keyframes hq-wave { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@media (max-width: 640px) { #react-pick { left: auto; right: 12px; transform: none; bottom: max(150px, calc(env(safe-area-inset-bottom) + 130px)); flex-wrap: wrap; width: 200px; } #hands { bottom: 150px; } }

/* Musica */
#music-btn {
  position: relative; display: flex; align-items: center; cursor: pointer;
  background: #0d0f14e6; color: #f2efe8; border: 1px solid #ffffff1f; border-radius: 999px; padding: 8px 11px;
}
#music-btn.on { color: #1ed760; border-color: #1ed76066; }
#music-btn.open { border-color: #ffffffaa; }
#music-panel {
  position: fixed; z-index: 11; right: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 52px);
  width: 340px; max-height: calc(100% - 140px); overflow: auto; display: flex; flex-direction: column;
  background: #121418f5; border: 1px solid #ffffff22; border-radius: 16px; box-shadow: 0 10px 30px #0008; color: #f2efe8;
}
.mp-head { display: flex; align-items: center; padding: 12px 12px 8px 16px; border-bottom: 1px solid #ffffff12; }
.mp-head b { flex: 1; font-size: 15px; }
.mp-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.mp-now { display: flex; align-items: center; gap: 10px; background: #ffffff0a; border-radius: 12px; padding: 9px 11px; }
.mp-now > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-now small { font-size: 11px; color: #9aa0ab; text-transform: uppercase; letter-spacing: .05em; }
.mp-now b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-now span { font-size: 12px; color: #9aa0ab; }
.mp-now button { border: 0; border-radius: 9px; background: #ffffff18; color: #fff; padding: 7px 11px; cursor: pointer; font-weight: 600; }
.mp-form { display: flex; flex-direction: column; gap: 8px; }
.mp-form input { width: 100%; box-sizing: border-box; background: #0b0c0f; color: #fff; border: 1px solid #ffffff26; border-radius: 10px; padding: 10px 11px; font-size: 14px; }
.mp-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-picks button { border: 1px solid #ffffff22; background: transparent; color: #f2efe8; border-radius: 999px; padding: 6px 10px; font-size: 12px; cursor: pointer; }
.mp-picks button.on, .mp-picks button:hover { background: #1ed760; color: #0b0c0f; border-color: #1ed760; }
.mp-go { display: flex; gap: 8px; }
.mp-go button { flex: 1; border: 0; border-radius: 10px; padding: 10px; font-weight: 700; cursor: pointer; background: #1ed760; color: #0b0c0f; font-size: 13px; }
.mp-go button.room { background: #ffffff; }
.mp-go button:disabled { opacity: .4; cursor: default; }
.mp-me { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c9c5bc; }
.mp-note { margin: 0; font-size: 11.5px; color: #8a909b; line-height: 1.45; }
#music-mini { position: fixed; z-index: 10; left: 12px; bottom: max(14px, env(safe-area-inset-bottom)); width: 320px;
  background: #121418f0; border: 1px solid #ffffff1f; border-radius: 14px; padding: 6px 6px 0; box-shadow: 0 8px 24px #0008; }
#music-mini .mm-top { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px 6px; font-size: 12px; color: #c9c5bc; }
#music-mini .what { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#music-mini .off { border: 0; background: transparent; color: #9aa0ab; font-size: 18px; cursor: pointer; width: 26px; height: 22px; }
#music-mini .embed iframe { display: block; border-radius: 10px; }
body.in-call #music-mini { bottom: 92px; }
body.touch #music-mini { left: 8px; right: 8px; width: auto; top: calc(max(12px, env(safe-area-inset-top)) + 52px); bottom: auto; }
@media (max-width: 640px) { #music-panel { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 80%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); } }

/* Festa del lunedì */
#party-banner { position: fixed; z-index: 13; left: 50%; transform: translateX(-50%); top: calc(max(12px, env(safe-area-inset-top)) + 54px);
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; color: #14161c;
  background: linear-gradient(90deg, #ff4a12, #f2c94c, #7ee081, #4fc3f7, #e57cd8); background-size: 300% 100%; animation: hq-party 6s linear infinite; box-shadow: 0 10px 28px #0008; max-width: calc(100% - 24px); }
#party-banner .x { border: 0; background: #14161c22; border-radius: 8px; width: 28px; height: 28px; font-size: 18px; cursor: pointer; color: #14161c; }
@keyframes hq-party { from { background-position: 0% 0; } to { background-position: 300% 0; } }

/* Focus */
body.focus-on #me { box-shadow: 0 0 0 2px #8f7bff; }

.cbtn.locked { opacity: .55; cursor: not-allowed; background: #3a2a2a; color: #ff8a80; }

/* Stanze coworking: pannello del timer */
#cowork { position: fixed; z-index: 12; left: 50%; transform: translateX(-50%); top: calc(max(12px, env(safe-area-inset-top)) + 54px);
  width: min(380px, calc(100% - 24px)); box-sizing: border-box; background: #121418f2; color: #f2efe8; border: 1px solid #ffffff22;
  border-radius: 16px; padding: 14px 16px; box-shadow: 0 10px 30px #0008; display: flex; flex-direction: column; gap: 8px; }
#cowork.cw-work { border-color: #e5533d99; }
#cowork.cw-short, #cowork.cw-long { border-color: #4cd08a99; }
#cowork.cw-countdown { border-color: #f2c94c; animation: hq-pulse 1s ease-in-out infinite; }
#cowork.cw-focus { background: #07080ff2; border-color: #8f7bff88; }
@keyframes hq-pulse { 50% { box-shadow: 0 0 0 4px #f2c94c55, 0 10px 30px #0008; } }
#cowork .cw-title { font-size: 15px; }
#cowork .cw-sub { margin: 0; font-size: 12.5px; color: #a9aeb8; line-height: 1.4; }
#cowork .cw-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
#cowork .cw-phase { font-size: 14px; }
#cowork .cw-time { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
#cowork.cw-countdown .cw-time { color: #f2c94c; }
#cowork .cw-bar { height: 6px; background: #ffffff14; border-radius: 3px; overflow: hidden; }
#cowork .cw-bar i { display: block; height: 100%; background: #e5533d; border-radius: 3px; transition: width .25s linear; }
#cowork.cw-short .cw-bar i, #cowork.cw-long .cw-bar i { background: #4cd08a; }
#cowork.cw-focus .cw-bar i { background: #8f7bff; }
#cowork .cw-cfg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#cowork .cw-cfg label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: #a9aeb8; }
#cowork .cw-cfg input { width: 100%; box-sizing: border-box; background: #0b0c0f; color: #fff; border: 1px solid #ffffff26; border-radius: 8px; padding: 7px 6px; font-size: 14px; }
#cowork .cw-opts { display: flex; gap: 6px; }
#cowork .cw-opts button { flex: 1; border: 1px solid #ffffff26; background: transparent; color: #f2efe8; border-radius: 9px; padding: 8px 0; cursor: pointer; font-weight: 600; }
#cowork .cw-opts button.on { background: #8f7bff; border-color: #8f7bff; color: #fff; }
#cowork .cw-go { border: 0; border-radius: 10px; padding: 11px; font-weight: 700; cursor: pointer; background: #e5533d; color: #fff; font-size: 14px; }
#cowork .cw-btns { display: flex; gap: 8px; }
#cowork .cw-btns button { flex: 1; border: 0; border-radius: 9px; padding: 8px; cursor: pointer; background: #ffffff14; color: #fff; font-weight: 600; }
body.panel-open #cowork { display: none; }
@media (max-width: 640px) { #cowork { top: auto; bottom: 150px; } }

/* Compleanno */
#bday-banner { position: fixed; z-index: 13; left: 50%; transform: translateX(-50%); top: calc(max(12px, env(safe-area-inset-top)) + 104px);
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; font-weight: 600; font-size: 14px;
  background: #fff4d6; color: #14161c; box-shadow: 0 10px 28px #0008; max-width: calc(100% - 24px); }
#bday-banner .x { border: 0; background: #14161c18; border-radius: 8px; width: 28px; height: 28px; font-size: 18px; cursor: pointer; }

/* Presenza in ufficio (classifica) */
.gp-rank .rk .prize { font-size: 11px; font-weight: 700; color: #14161c; background: #f2c94c; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.gp-days { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.gp-days th, .gp-days td { padding: 4px 3px; text-align: right; border-bottom: 1px solid #ffffff10; white-space: nowrap; }
.gp-days th:first-child, .gp-days td:first-child { text-align: left; }
.gp-days td.z { color: #ff8a80; }
.gp-days tr.tot td { font-weight: 700; color: #c9c5bc; }
body.in-call #cowork { top: calc(max(12px, env(safe-area-inset-top)) + 200px); }
body.gallery-open #cowork { display: none; }

/* Musica v17: pannello più chiaro e video YouTube */
.mp-h { font-size: 12px; color: #9aa0ab; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.mp-other { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #c9c5bc; padding: 0 4px; }
.mp-other span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-other button { border: 0; border-radius: 8px; background: #ffffff14; color: #fff; padding: 4px 9px; cursor: pointer; font-size: 12px; }
.mp-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mp-scope button { text-align: left; border: 1px solid #ffffff26; background: transparent; color: #f2efe8; border-radius: 12px; padding: 9px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.mp-scope button b { font-size: 13px; }
.mp-scope button span { font-size: 11.5px; color: #9aa0ab; line-height: 1.3; }
.mp-scope button.on { border-color: #1ed760; background: #1ed76018; }
.mp-scope button:disabled { opacity: .4; cursor: default; }
.mp-play { border: 0; border-radius: 11px; padding: 11px; font-weight: 700; cursor: pointer; background: #1ed760; color: #0b0c0f; font-size: 14px; }
#music-mini.expanded.yt .embed { aspect-ratio: 16 / 9; }
#music-mini.yt .embed iframe { width: 100%; height: 100%; border-radius: 10px; }
#music-mini { padding-bottom: 6px; }

/* Lettore musica compatto (v19) */
#music-mini { width: auto; max-width: min(360px, calc(100% - 24px)); padding: 0; border-radius: 999px; overflow: visible; }
#music-mini .mm-top { padding: 4px 6px 4px 4px; gap: 6px; }
#music-mini .pp { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: #1ed760; color: #0b0c0f; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#music-mini .pp .i-pause { display: none; }
#music-mini.playing .pp .i-play { display: none; }
#music-mini.playing .pp .i-pause { display: block; }
#music-mini .what { max-width: 170px; font-size: 12px; }
#music-mini .vol { width: 64px; accent-color: #1ed760; }
#music-mini:not(.yt) .vol { display: none; }
#music-mini .big { border: 0; background: transparent; color: #9aa0ab; width: 24px; height: 24px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
#music-mini.expanded .big svg { transform: rotate(180deg); }
/* video nascosto ma acceso (così la musica continua) */
#music-mini .embed { position: fixed; left: 0; bottom: 0; width: 220px; height: 124px; opacity: 0; pointer-events: none; z-index: -1; overflow: hidden; }
#music-mini.expanded { border-radius: 14px; }
#music-mini.expanded .embed { position: static; opacity: 1; pointer-events: auto; z-index: auto; width: 300px; height: auto; padding: 0 6px 6px; }
#music-mini.expanded:not(.yt) .embed { height: 86px; }
#music-mini.expanded.yt .embed { aspect-ratio: 16 / 9; height: auto; }
#music-mini .what { max-width: 120px; }
#music-mini .vol { width: 56px; }
body:has(#music-mini:not(.hidden)) #hint { display: none; }
