/* Shared glass surfaces: keep the Swarm visible without fading UI content. */
@supports (background:color-mix(in srgb,#000 46%,transparent)) {
  :root, :root[data-theme] {
    --panel:color-mix(in srgb,var(--bg) 46%,transparent);
  }
}
.panel,
.language-panel,
.home-about[open],
.drawing-color-picker,
.share-dialog,
.thread-journey,
.swarm-beacon-preview {
  background:var(--panel);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  box-shadow:0 10px 32px color-mix(in srgb,var(--panel-shadow,#0006) 35%,transparent);
  text-shadow:0 1px 2px var(--bg),0 0 6px var(--bg);
}

/* Floating controls use the same surface; icons, text and focus rings stay solid. */
.pill,
.sound-dock .pill,
.language-toggle,
.demo-worlds-launch,
.demo-entry-actions button,
.zoom .icon,
#drawMotionOption,
#toast {
  background:var(--panel);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  text-shadow:0 1px 2px var(--bg),0 0 6px var(--bg);
}
.swarm-beacon::before {
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

/* Avoid stacking another painted strip on top of a translucent panel. */
#motionPanel > .panel-top,
#soundPanel > .panel-top,
.demo-scene-tools {
  background:transparent;
}

/* Dialog backdrops must not obscure or blur the scene below the glass. */
.share-dialog::backdrop,
:root[data-theme] .share-dialog::backdrop,
.share-dialog-backdrop[data-fallback="true"] {
  background:#0002;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

/* Native option popups need a solid matching background for legible choices. */
select option, select optgroup {
  background:var(--bg);
  color:var(--ink);
}

/* Do not show unrelated controls through an overlapping mobile sheet. */
@media(max-width:640px) {
  body:has(#sparkPanel:not([hidden])) > .home-intro,
  body:has(#sparkPanel:not([hidden])) > .zoom,
  body:has(.thread-journey:not([hidden])) > .home-intro,
  body:has(.thread-journey:not([hidden])) > .zoom,
  body:has(.thread-journey:not([hidden])) > .theme-picker {
    visibility:hidden;
  }
}
@media(min-width:540px) and (max-height:500px) and (orientation:landscape) {
  body:has(#sparkPanel:not([hidden])) > .zoom { visibility:hidden; }
}
