/* reveal controls on hover */
#controls-list:hover #controls-expanded { display:block; }
#controls-list #controls-collapsed { pointer-events:none; }
/* allow programmatic opening of controls via a class toggle */
body.controls-open #controls-list #controls-expanded { display:block; }

/* secret centered-bottom hover dropdown: relocated to sit just below the canvas inside #viewport
   Expanded invisible hover area so users can hover where the box will appear (below the canvas)
   to reveal the dropdown — the visible trigger symbol remains but is made invisible. */
#viewport #secret-actions {
  position: absolute;
  left: 50%;
  /* moved further down so the secret widget becomes its own hover target below the canvas */
  bottom: -89px;
  transform: translateX(-50%);
  z-index: 220;
  pointer-events: auto;
  font-family: monospace;
  line-height: 1;
  width: auto;
  text-align: center;
  /* minimal hit area so hovering where the box will appear (below the canvas) works,
     but avoid large vertical padding that displaced the UI from its trigger */
  padding-top: 6px;
  padding-bottom: 6px;
}
/* tiny trigger is visually hidden but still present to maintain semantics and click behavior */
#viewport #secret-trigger {
  background: transparent;
  color: transparent;
  padding: 2px 4px;
  border: none;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 20px;
  box-shadow: none;
  user-select: none;
  /* fully invisible but still interactive */
  opacity: 0;
}
/* dropdown positioned immediately above the (invisible) trigger so it appears on top of the button */
/* shrink to fit only the two buttons; allow pointer to remain over drop to keep it visible */
#viewport #secret-drop {
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: #f3f3f3;
  color: #000;
  padding: 4px;
  border: 1px solid #777;
  border-radius: 3px;
  display: none;
  min-width: auto;
  width: auto;
  box-shadow: none;
  text-align: left;
  white-space: nowrap;
}
/* show dropdown when hovering the larger hover area (so hovering the future box location works),
   or when hovering the dropdown itself so it doesn't vanish while moving into it */
#viewport #secret-actions:hover #secret-drop,
#viewport #secret-drop:hover {
  display: block;
}
#viewport #secret-drop > div { display:inline-flex; align-items:center; gap:8px; }
#viewport #secret-drop button {
  background: #e0e0e0;
  border: 1px solid #999;
  color: #000;
  padding: 6px 10px;
  border-radius: 3px;
  cursor: pointer;
  margin: 0;
  font-size: 13px;
  box-shadow: none;
}
#viewport #secret-drop button + button { margin-left: 8px; }
#viewport #secret-drop button:hover { background: #d0d0d0; }