/* PuzzleVuzzle settings UI — homepage hero + native app sidebar */

/* Website homepage hero — settings in top-right of purple banner */
.pv-home-hero-settings {
  position: absolute;
  top: clamp(0.7rem, 2.4vw, 1.1rem);
  right: clamp(0.7rem, 2.4vw, 1.1rem);
  z-index: 2;
}

.pv-home-hero-settings__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.14);
  color: #faf5ff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.pv-home-hero-settings__btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.pv-home-hero-settings__btn:focus-visible {
  outline: 2px solid rgba(250, 245, 255, 0.9);
  outline-offset: 2px;
}

.pv-home-hero-settings__btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.62);
}

.pv-home-hero-settings__icon {
  display: block;
}

.pv-home-hero-settings__panel {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 5;
  width: min(17.5rem, calc(100vw - 2rem));
  padding: 0.85rem;
  border-radius: 1rem;
  border: 1px solid var(--border, rgba(19, 27, 45, 0.12));
  background: var(--surface-strong, #fff);
  color: var(--text, #131b2d);
  box-shadow: 0 16px 40px rgba(47, 38, 80, 0.18);
  display: grid;
  gap: 0.85rem;
  text-align: left;
}

.pv-home-hero-settings__panel[hidden] {
  display: none !important;
}

.pv-home-hero-settings__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

[data-theme="dark"] .pv-home-hero-settings__panel {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}

/* Native app homepage sidebar */
.pv-native-sidebar-open {
  position: fixed;
  z-index: 850;
  top: calc(0.65rem + env(safe-area-inset-top, 0px));
  left: calc(0.65rem + env(safe-area-inset-left, 0px));
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  border: 1px solid var(--border, rgba(19, 27, 45, 0.12));
  background: var(--surface-strong, #fff);
  color: var(--text, #131b2d);
  box-shadow: 0 4px 16px rgba(19, 27, 45, 0.1);
  cursor: pointer;
}

.pv-native-sidebar-open:focus-visible {
  outline: 2px solid var(--focus-ring, #7c3aed);
  outline-offset: 2px;
}

.pv-native-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 860;
  background: rgba(10, 14, 24, 0.45);
}

.pv-native-sidebar-backdrop[hidden] {
  display: none !important;
}

.pv-native-sidebar {
  position: fixed;
  z-index: 870;
  top: 0;
  left: 0;
  height: 100%;
  width: min(17rem, 86vw);
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: var(--surface-strong, #fff);
  color: var(--text, #131b2d);
  box-shadow: 4px 0 24px rgba(19, 27, 45, 0.12);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pv-native-sidebar.is-open {
  transform: translateX(0);
}

.pv-native-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pv-native-sidebar__title {
  margin: 0;
  font-size: 1.05rem;
}

.pv-native-sidebar__close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.pv-native-sidebar__section {
  display: grid;
  gap: 0.65rem;
}

.pv-native-sidebar__label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #5c6478);
}

.pv-native-sidebar__toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.6rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent, #7c3aed) 16%, var(--border, rgba(19, 27, 45, 0.12)));
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--accent-soft, #ede4ff) 55%, var(--surface-strong, #fff)),
    var(--bg-elevated, #f7f8fc)
  );
  color: var(--text, #131b2d);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 80%, transparent) inset,
    0 4px 14px color-mix(in srgb, var(--accent, #7c3aed) 8%, transparent);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.pv-native-sidebar__toggle:hover {
  border-color: color-mix(in srgb, var(--accent, #7c3aed) 28%, var(--border, rgba(19, 27, 45, 0.12)));
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 80%, transparent) inset,
    0 6px 18px color-mix(in srgb, var(--accent, #7c3aed) 14%, transparent);
}

.pv-native-sidebar__toggle:active {
  transform: scale(0.985);
}

.pv-native-sidebar__toggle:focus-visible {
  outline: 2px solid var(--focus-ring, #7c3aed);
  outline-offset: 2px;
}

.pv-native-sidebar__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--accent-soft, #ede4ff) 70%, transparent);
  color: var(--accent-strong, #5b21b6);
}

.pv-native-sidebar__toggle-svg {
  display: block;
}

.pv-native-sidebar__toggle-svg--sun,
.pv-native-sidebar__toggle-svg--sound-off {
  display: none;
}

.pv-native-sidebar__toggle.is-active .pv-native-sidebar__toggle-svg--moon,
.pv-native-sidebar__toggle.is-active .pv-native-sidebar__toggle-svg--sound-off {
  display: none;
}

.pv-native-sidebar__toggle.is-active .pv-native-sidebar__toggle-svg--sun,
.pv-native-sidebar__toggle.is-active .pv-native-sidebar__toggle-svg--sound-on {
  display: block;
}

.pv-native-sidebar__toggle-text {
  flex: 1;
  min-width: 0;
}

.pv-native-sidebar__toggle-track {
  position: relative;
  flex-shrink: 0;
  width: 2.85rem;
  height: 1.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted, #6d6485) 28%, var(--border, rgba(19, 27, 45, 0.12)));
  transition: background 0.25s ease;
}

.pv-native-sidebar__toggle.is-active .pv-native-sidebar__toggle-track {
  background: linear-gradient(135deg, var(--accent, #7c3aed), var(--accent-2, #6366f1));
}

.pv-native-sidebar__toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.6rem - 4px);
  height: calc(1.6rem - 4px);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(47, 38, 80, 0.18);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.pv-native-sidebar__toggle.is-active .pv-native-sidebar__toggle-knob {
  transform: translateX(calc(2.85rem - 1.6rem));
}

body.is-pv-native-sidebar-open {
  overflow: hidden;
}

[data-theme="dark"] .pv-native-sidebar-open {
  box-shadow: none;
}

[data-theme="dark"] .pv-native-sidebar__toggle {
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset;
}

[data-theme="dark"] .pv-native-sidebar__toggle:hover {
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset;
}
