/* Painel compartilhado entre landing e sala, com estilos isolados. */
.cem-settings { position: fixed; inset: 0; margin: auto; width: min(510px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid #4a2b37; border-radius: 5px; background: #101013; color: #e8e2e7; font: 14px/1.5 "Courier New", monospace; box-shadow: 0 24px 90px #000a; text-align: left; overflow: auto; }
.cem-settings::backdrop { background: #000b; backdrop-filter: blur(5px); }
.cem-settings [hidden] { display: none !important; }
.cem-settings-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: #101013; border-bottom: 1px solid #29232b; z-index: 1; }
.cem-settings-head h2 { font: 400 18px/1.3 "Courier New", monospace; letter-spacing: 1px; margin: 0; color: #f0e8ed; }
.cem-settings button { display: inline-flex; align-items: center; justify-content: center; width: auto; height: auto; margin: 0; padding: 8px 11px; border: 1px solid #40333f; border-radius: 3px; background: #1a151c; color: #e1ccd5; font: 13px/1.4 "Courier New", monospace; letter-spacing: 0; cursor: pointer; }
.cem-settings button:hover { background: #30202a; border-color: #864054; }
.cem-settings button:focus-visible, .cem-settings input:focus-visible { outline: 2px solid #db617e; outline-offset: 3px; }
.cem-settings button:disabled { opacity: .4; cursor: default; }
.cem-settings .cem-close { width: 32px; height: 32px; padding: 0; font-size: 24px; border: 0; background: transparent; }
.cem-settings-body { padding: 0 22px; }
.cem-setting-section { padding: 20px 0; border-bottom: 1px solid #29232b; }
.cem-setting-section h3 { margin: 0 0 16px; color: #a998a7; font-size: 12px; font-weight: 400; text-transform: uppercase; letter-spacing: 2px; }
.cem-setting-label { margin: 0 0 8px; font-size: 14px; }
.cem-photo-row { display: flex; align-items: center; gap: 16px; }
.cem-photo { display: grid; place-items: center; flex: 0 0 58px; width: 58px; height: 58px; overflow: hidden; border: 1px solid #51303d; border-radius: 4px; color: #d95372; font-size: 26px; background: #1b141a; }
.cem-photo img, .avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.cem-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cem-mic-test { display: flex; align-items: center; gap: 14px; }
.cem-meter { flex: 1; height: 8px; overflow: hidden; background: #28202a; border-radius: 2px; }
.cem-meter span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg,#b65a76,#f3a9b1); }
.cem-hint { margin: 9px 0 0; color: #a699a4; font-size: 12px; line-height: 1.5; }
.cem-toggle { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0 0; cursor: pointer; }
.cem-toggle small { display: block; margin-top: 4px; color: #a699a4; font-size: 12px; }
.cem-settings input[type="checkbox"] { appearance: none; flex: 0 0 36px; width: 36px; height: 20px; margin: 0; padding: 2px; border: 1px solid #695362; border-radius: 12px; background: #28202a; cursor: pointer; }
.cem-settings input[type="checkbox"]::before { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: #c7b5c0; }
.cem-settings input[type="checkbox"]:checked { background: #79273e; border-color: #bd506f; }
.cem-settings input[type="checkbox"]:checked::before { transform: translateX(16px); background: #f6dce6; }
.cem-background-row { margin-top: 20px; }
.cem-background-preview { height: 82px; margin-bottom: 10px; background-position: center; background-size: cover; border: 1px solid #40333f; border-radius: 3px; }
.cem-settings-notice { min-height: 22px; margin: 12px 0; color: #e197ab; font-size: 12px; }
.cem-settings-footer { padding: 12px 22px; border-top: 1px solid #29232b; color: #95838f; font-size: 11px; }
body.effects-off::before, body.effects-off::after { display: none !important; }
body.effects-off *, body.effects-off *::before, body.effects-off *::after { animation: none !important; transition: none !important; }
body.effects-off .glitch-fragment { display: none !important; }
body.effects-off .retro-brand, body.effects-off .retro-cross { text-shadow: none !important; transform: none !important; }
body.cem-room.has-custom-background { background-image: linear-gradient(#08080999,#080809cc),var(--cem-background); background-position: center; background-size: cover; }
body.cem-room.has-custom-background .video-area { background-image: linear-gradient(#080809aa,#080809aa),var(--cem-background); background-position: center; background-size: cover; }
body.cem-room.has-custom-background #remoteVideo { background: #080809; }
.header-actions .room-settings { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; padding: 8px; border: 0; background: transparent; color: #aaa; }
.header-actions .room-settings:hover { color: #f2c7d5; background: #24151c; }
@media (max-width: 400px) { .cem-settings-head { padding: 14px 16px; } .cem-settings-body { padding: 0 16px; } .cem-mic-test { align-items: stretch; flex-direction: column; } .cem-meter { flex: auto; min-height: 8px; } }

/* Edição com confirmação: barra permanece visível durante a rolagem do painel. */
.cem-settings[open] { display: flex; flex-direction: column; overflow: hidden; }
.cem-settings-head { flex: 0 0 auto; }
.cem-settings-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.cem-settings .cem-photo-edit { position: relative; flex: 0 0 58px; width: 58px; height: 58px; padding: 0; overflow: hidden; border: 1px solid #51303d; background: #1b141a; }
.cem-photo-edit .cem-photo { width: 100%; height: 100%; border: 0; transition: filter .18s; }
.cem-photo-pencil { position: absolute; inset: 0; display: grid; place-items: center; background: #08080966; color: #fff; opacity: 0; transition: opacity .18s; pointer-events: none; }
.cem-photo-edit:hover .cem-photo, .cem-photo-edit:focus-visible .cem-photo { filter: blur(2px); }
.cem-photo-edit:hover .cem-photo-pencil, .cem-photo-edit:focus-visible .cem-photo-pencil { opacity: 1; }
.cem-settings-notice:empty { display: none; }
.cem-savebar { display: flex; flex: 0 0 auto; justify-content: flex-end; align-items: center; gap: 9px; margin: 12px 22px 16px; padding: 0; background: transparent; border: 0; box-shadow: none; }
/* Reserva o espaço das ações, sem aumentar a janela ao editar. */
.cem-settings .cem-savebar[hidden] { display: flex !important; visibility: hidden; pointer-events: none; }
.cem-settings .cem-save { background: #79273e; border-color: #b84d6b; color: #fff; min-width: 90px; }
.cem-settings .cem-save:hover { background: #97324e; }
.cem-settings .cem-discard { background: transparent; color: #d2bac7; }
@media (hover: none) { .cem-photo-pencil { opacity: 1; inset: auto 0 0 auto; padding: 3px; border-radius: 3px; } }
