/* Effects screen (CONF-FX §6) and the reaction overlay (§4).
   The panel sits on the calls' dark glass (conference.css variables, with fallbacks so it also
   works in the lobby and the demo). Controls are 40 px (--wf-control-h) with 2-5 px corners.
   Contrast (WCAG 2.2 AA) against the solid colours used here:
     #e8edff on #0b1224 16.0:1; #a9b4d0 on #0b1224 9.0:1; #a9b4d0 on #111a33 8.3:1;
     #03141c on #22d3ee 10.4:1; #fde68a on #0b1224 15.0:1; focus #7dd3fc on #0b1224 11.2:1;
     #ffb4b4 on #0b1224 11.0:1; control borders #6f80a8 on #0b1224 4.7:1 (non-text 3:1).
   Checked by tests/effects.node.test.js. */
.wfx-panel {
  --wfx-bg: var(--conf-glass, #0b1224);
  --wfx-bg-2: var(--conf-glass-2, #111a33);
  --wfx-edge: #6f80a8;
  --wfx-text: var(--conf-text, #e8edff);
  --wfx-muted: var(--conf-muted, #a9b4d0);
  --wfx-accent: var(--conf-cyan, #22d3ee);
  --wfx-on-accent: #03141c;
  --wfx-focus: var(--conf-focus, #7dd3fc);
  --wfx-h: var(--wf-control-h, 40px);
  --wfx-r: var(--wf-radius-lg, 5px);
  --wfx-r-sm: var(--wf-radius-sm, 3px);
  display: grid;
  gap: 10px;
  padding: 14px;
  max-width: 560px;
  color: var(--wfx-text);
  background: var(--wfx-bg);
  border: 1px solid #2a3b66;
  border-radius: var(--wfx-r);
  font: inherit;
}
.wfx-panel [hidden] { display: none !important; }
.wfx-title { margin: 0; font-size: 1.05rem; color: var(--wfx-text); letter-spacing: 0; }
.wfx-stage { position: relative; aspect-ratio: 16 / 9; background: #070b16; border-radius: var(--wfx-r); overflow: hidden; }
.wfx-preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.wfx-status { margin: 0; font-size: .85rem; color: var(--wfx-muted); }
.wfx-notice { margin: 0; padding: 6px 10px; font-size: .85rem; color: #fde68a; background: var(--wfx-bg-2); border-left: 3px solid #fde68a; border-radius: var(--wfx-r-sm); }
.wfx-message { margin: 0; min-height: 0; font-size: .85rem; color: #ffb4b4; }
.wfx-message:empty { display: none; }

.wfx-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid #2a3b66; }
.wfx-tabs [role=tab] {
  min-height: var(--wfx-h); padding: 0 12px; border: 0; border-bottom: 3px solid transparent;
  border-radius: var(--wfx-r-sm) var(--wfx-r-sm) 0 0; background: transparent; color: var(--wfx-muted);
  font: inherit; font-weight:600; cursor: pointer; white-space: nowrap;
}
.wfx-tabs [role=tab]:hover { color: var(--wfx-text); background: var(--wfx-bg-2); }
.wfx-tabs [role=tab][aria-selected=true] { color: var(--wfx-text); border-bottom-color: var(--wfx-accent); }
.wfx-tabpanel { display: grid; gap: 10px; padding-top: 4px; }

.wfx-choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.wfx-choices legend { padding: 0; margin-bottom: 6px; font-size: .85rem; font-weight:600; color: var(--wfx-muted); }
.wfx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.wfx-choice { position: relative; }
.wfx-choice input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wfx-thumb {
  display: grid; gap: 4px; justify-items: center; padding: 4px; min-height: var(--wfx-h);
  border: 2px solid transparent; border-radius: var(--wfx-r); background: var(--wfx-bg-2);
  color: var(--wfx-text); font-size: .8rem; text-align: center; cursor: pointer;
}
.wfx-thumb:hover { border-color: var(--wfx-edge); }
.wfx-choice input:checked + .wfx-thumb { border-color: var(--wfx-accent); box-shadow: 0 0 0 1px var(--wfx-accent) inset; }
.wfx-choice input:focus-visible + .wfx-thumb { outline: 3px solid var(--wfx-focus); outline-offset: 2px; }
.wfx-thumb.wfx-disabled { opacity: .55; cursor: not-allowed; }
.wfx-thumb-img { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: var(--wfx-r-sm); background: #070b16; }
.wfx-video-thumb { display: grid; place-items: center; color: var(--wfx-text); font-size: 1.1rem; }
.wfx-remove {
  position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; padding: 0; border: 1px solid var(--wfx-edge);
  border-radius: var(--wfx-r-sm); background: var(--wfx-bg); color: var(--wfx-text); font: inherit; line-height: 1; cursor: pointer;
}
.wfx-frame { box-sizing: border-box; background: #3b4b66; }
.wfx-frame-thin { border: 2px solid #22d3ee; }
.wfx-frame-rounded { border: 4px solid #0f1f2a; border-radius: 8px; outline: 1px solid #22d3ee; outline-offset: -4px; }
.wfx-frame-brand { border: 4px solid; border-image: linear-gradient(135deg, #0b5c57, #1e4f8f 55%, #3b3fc4) 1; }
.wfx-frame-glow { border: 2px solid #22d3ee; box-shadow: 0 0 8px #22d3ee inset; }

.wfx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.wfx-row > label { font-size: .88rem; color: var(--wfx-text); }
.wfx-row select, .wfx-row input[type=text] {
  min-height: var(--wfx-h); padding: 0 10px; border: 1px solid var(--wfx-edge); border-radius: var(--wfx-r);
  background: var(--wfx-bg-2); color: var(--wfx-text); font: inherit; min-width: 12rem; flex: 1 1 12rem;
}
.wfx-row input[type=color] { width: 56px; height: var(--wfx-h); padding: 2px; border: 1px solid var(--wfx-edge); border-radius: var(--wfx-r); background: var(--wfx-bg-2); }
.wfx-check { flex-wrap: nowrap; min-height: var(--wfx-h); }
.wfx-check input[type=checkbox] { width: 20px; height: 20px; margin: 0; accent-color: var(--wfx-accent); flex: 0 0 auto; }
.wfx-check input:disabled + label { color: var(--wfx-muted); }
.wfx-slider input[type=range] { flex: 1 1 10rem; min-height: var(--wfx-h); accent-color: var(--wfx-accent); }
.wfx-slider output { min-width: 3.5em; text-align: right; color: var(--wfx-muted); font-variant-numeric: tabular-nums; }
.wfx-hint { margin: 0; font-size: .8rem; color: var(--wfx-muted); }
.wfx-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.wfx-button {
  display: inline-flex; align-items: center; min-height: var(--wfx-h); padding: 0 14px; border-radius: var(--wfx-r);
  background: var(--wfx-accent); color: var(--wfx-on-accent) !important; font-weight:600; cursor: pointer;
}
.wfx-button.wfx-disabled { opacity: .55; cursor: not-allowed; }
.wfx-file:focus-visible + .wfx-hint, .wfx-row:focus-within .wfx-button { outline: 3px solid var(--wfx-focus); outline-offset: 2px; }
.wfx-panel :focus-visible { outline: 3px solid var(--wfx-focus); outline-offset: 2px; }

/* ---- reactions and raised hands over a tile (effects.js reactions) -------------------------- */
.wfx-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wfx-reaction-host { position: relative; }
.wfx-reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.wfx-reaction {
  position: absolute; left: var(--wfx-x, 40%); bottom: 8%; font-size: clamp(1.6rem, 6cqi, 2.6rem); line-height: 1;
  animation: wfx-float 5s ease-out forwards; filter: drop-shadow(0 2px 4px #0008);
}
.wfx-reaction.wfx-still { animation: wfx-fade 5s linear forwards; bottom: 40%; }
.wfx-hand {
  position: absolute; top: 8px; left: 8px; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: var(--wf-radius-lg, 5px); background: #fde68a; color: #03141c; font-size: 1.4rem;
  box-shadow: 0 0 0 2px #0b1224; animation: wfx-pop .3s ease-out;
}
.wfx-hand.wfx-still { animation: none; }
@keyframes wfx-float { 0% { transform: translateY(0) scale(.7); opacity: 0; } 10% { transform: translateY(-10%) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-260%) scale(1); opacity: 0; } }
@keyframes wfx-fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes wfx-pop { from { transform: scale(.6); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .wfx-reaction { animation: wfx-fade 5s linear forwards; bottom: 40%; }
  .wfx-hand { animation: none; }
}
@media (max-width: 480px) { .wfx-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); } .wfx-panel { padding: 10px; } }
