/* MiniGames shared theme widgets.
 * Pure visual styles for the 3-way theme toggle and the hub's small icon button.
 * Palette variables themselves live in each game's own stylesheet so per-game
 * accents stay scoped. This file is theme-orthogonal to reduced-motion / colorblind.
 */

/* 3-way segmented toggle (Light / Dark / Auto) used inside each game's Settings */
.theme-toggle {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  background: rgba(127, 127, 127, 0.12);
  border: 1px solid rgba(127, 127, 127, 0.28);
  border-radius: 999px;
  padding: 2px;
  font-family: inherit;
}
.theme-toggle button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  border: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-radius: 999px;
  cursor: pointer;
  min-width: 52px;
  font-family: inherit;
  line-height: 1;
  opacity: 0.7;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.theme-toggle button:hover { opacity: 1; }
.theme-toggle button[aria-pressed="true"] {
  background: rgba(127, 127, 127, 0.28);
  opacity: 1;
}
:root[data-theme="light"] .theme-toggle button[aria-pressed="true"] {
  background: rgba(21, 25, 46, 0.10);
  color: #15192e;
}
:root[data-theme="dark"] .theme-toggle button[aria-pressed="true"],
:root:not([data-theme]) .theme-toggle button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.16);
  color: #f5f7ff;
}
.theme-toggle button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Small icon button for hub header (cycles light -> dark -> system) */
.theme-cycle-btn {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(127, 127, 127, 0.14);
  border: 1px solid rgba(127, 127, 127, 0.28);
  color: inherit;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.theme-cycle-btn:hover { background: rgba(127, 127, 127, 0.22); }
.theme-cycle-btn:active { transform: scale(0.94); }
.theme-cycle-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
