header:has(nav) {
  background: rgba(11, 11, 14, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.24);
  backdrop-filter: blur(14px);
}

label:has(input[name="pairs-theme"]) {
  align-items: center;
  background: rgba(15, 23, 42, 0.72) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 999px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78) !important;
  display: inline-flex;
  min-height: 38px;
  padding: 0.46rem 0.82rem !important;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, color 160ms ease, transform 160ms ease;
}

label:has(input[name="pairs-theme"]:checked) {
  background: linear-gradient(135deg, #5eead4, #facc15) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 10px 24px rgba(94, 234, 212, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  color: #0f172a !important;
  font-weight: 700;
}

label:has(input[name="pairs-theme"]):hover {
  border-color: rgba(94, 234, 212, 0.55) !important;
  color: #fff !important;
  transform: translateY(-1px);
}

button:has(img[src^="/assets/themes/"]) {
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.18), transparent 30%),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.88)) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 18px !important;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, filter 160ms ease, transform 160ms ease;
}

button:has(img[src^="/assets/themes/"]):hover {
  border-color: rgba(94, 234, 212, 0.55) !important;
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.34), 0 0 0 1px rgba(94, 234, 212, 0.18);
  transform: translateY(-2px) scale(1.012);
}

button:has(img[src^="/assets/themes/"]):active {
  transform: translateY(0) scale(0.992);
}

button:has(img[src^="/assets/themes/"]) img {
  border-radius: 16px !important;
  filter: saturate(1.08) contrast(1.04);
  object-fit: cover;
  transform: scale(1.01);
}

button:disabled:has(img[src^="/assets/themes/"]) {
  filter: none;
  opacity: 1 !important;
}

button[aria-label="Carte masquée"] {
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(145deg, #0f766e 0%, #1d4ed8 52%, #7c3aed 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82) !important;
  overflow: hidden;
  position: relative;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.32);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button[aria-label="Carte masquée"]::before {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 34%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0 6px, transparent 6px 18px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  content: "";
  inset: 12%;
  pointer-events: none;
  position: absolute;
}

button[aria-label="Carte masquée"]:hover {
  border-color: rgba(250, 204, 21, 0.62) !important;
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.34), 0 0 0 1px rgba(250, 204, 21, 0.18);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  label:has(input[name="pairs-theme"]) {
    min-height: 34px;
    padding: 0.38rem 0.62rem !important;
  }

  button:has(img[src^="/assets/themes/"]),
  button[aria-label="Carte masquée"] {
    border-radius: 14px !important;
  }

  button:has(img[src^="/assets/themes/"]) img {
    border-radius: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  label:has(input[name="pairs-theme"]),
  button:has(img[src^="/assets/themes/"]),
  button[aria-label="Carte masquée"] {
    transition: none;
  }

  label:has(input[name="pairs-theme"]):hover,
  button:has(img[src^="/assets/themes/"]):hover,
  button[aria-label="Carte masquée"]:hover {
    transform: none;
  }
}
