/* The light/dark switch (`ModeSwitch`): the sky by day or by night */
.mode-switch {
  --t: 700ms;
  --ease: cubic-bezier(0.45, 0, 0.2, 1);
  position: relative;
  width: 80px;
  height: 36px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: inset 0 1px 3px rgb(0 0 0 / 0.35), 0 0 0 1px color-mix(in oklab, var(--color-base-content) 15%, transparent);
}
.mode-switch:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.mode-switch__sky,
.mode-switch__hills {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mode-switch__hills {
  z-index: 2;
}

/* The sky turning: night over day, the stars coming out, the clouds off */
.mode-switch__night {
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.mode-switch__stars {
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}
.mode-switch__stars circle {
  animation: mode-twinkle 2.4s ease-in-out infinite alternate;
}
@keyframes mode-twinkle {
  from { opacity: 1; }
  to { opacity: 0.35; }
}
.mode-switch__clouds {
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.mode-switch[data-mode='dark'] .mode-switch__night,
.mode-switch[data-mode='dark'] .mode-switch__stars {
  opacity: 1;
}
.mode-switch[data-mode='dark'] .mode-switch__clouds {
  transform: translateX(30px);
  opacity: 0;
}

/* The hills, green by day, dark by night */
.mode-switch__hill-back,
.mode-switch__hill-front {
  transition: fill var(--t) var(--ease);
}
.mode-switch__hill-back { fill: #7cc46a; }
.mode-switch__hill-front { fill: #4f9e45; }
.mode-switch[data-mode='dark'] .mode-switch__hill-back { fill: #1f3b3a; }
.mode-switch[data-mode='dark'] .mode-switch__hill-front { fill: #132a29; }

/* The knob: the sun up on the left, or the moon up on the right */
.mode-switch__knob {
  position: absolute;
  z-index: 1;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  transition: transform var(--t) var(--ease);
}
.mode-switch[data-mode='dark'] .mode-switch__knob {
  transform: translateX(46px);
}
.mode-switch__sun,
.mode-switch__moon {
  position: absolute;
  inset: 0;
  transition: transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
/* (the one sunk below the hills, rising as it slides over; the sun turning
   as it goes) */
.mode-switch__moon {
  transform: translateY(34px);
  filter: drop-shadow(0 0 4px rgb(255 248 220 / 0.6));
}
.mode-switch__sun {
  filter: drop-shadow(0 0 4px rgb(255 200 60 / 0.7));
}
.mode-switch[data-mode='dark'] .mode-switch__sun {
  transform: translateY(34px) rotate(90deg);
}
.mode-switch[data-mode='dark'] .mode-switch__moon {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .mode-switch,
  .mode-switch * {
    transition: none !important;
    animation: none !important;
  }
}

/* The hold-to-buy button (`HoldToBuy`): its fill, empty; held, sweeping full
   over the hold's length; let go, easing back */
.hold-to-buy__fill {
  transform: scaleX(0);
  transition: transform 0.25s ease-out;
}
.hold-to-buy[data-holding] .hold-to-buy__fill {
  transform: scaleX(1);
  transition: transform var(--hold) linear;
}

.settings {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  /* (at least the panel's height: the holiday scene, `SettingsScene`, sits
     at the bottom of it) */
  min-height: 100%;
}

.settings__header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 2px 4px;
}

.settings__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.settings__subtitle {
  font-size: 0.85rem;
  opacity: 0.6;
}

.settings__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings__group-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.5;
  padding: 0 4px;
}

.settings__group-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Card / accordion section */
.settings-card {
  border: 1px solid var(--color-base-300);
  border-radius: 1rem;
  background: var(--color-base-100);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.settings-card.is-open {
  border-color: color-mix(in oklch, var(--settings-accent, var(--color-primary)) 45%, var(--color-base-300));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.settings-card > .collapse-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 4rem;
  padding: 0.85rem 3rem 0.85rem 1rem;
  cursor: pointer;
}

.settings-card__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 0.75rem;
  font-size: 1.2rem;
  background: color-mix(in oklch, var(--settings-accent, var(--color-primary)) 16%, transparent);
}

.settings-card__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.settings-card__title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.25;
}

.settings-card__desc {
  font-size: 0.76rem;
  opacity: 0.6;
  line-height: 1.3;
}

/* Descendant, not `>` direct-child - the content sits inside a
   framer-motion wrapper (see `client.tsx`) that measures/animates its
   height, so it's a grandchild of `.settings-card` now, not a direct
   child. */
.settings-card .settings-card__content {
  padding: 0 1rem 1.1rem;
}

.settings-card .settings-card__content > * {
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-base-300);
}

/* Comfortable touch targets for inline sub-components */
.settings-card .toggle {
  width: 3rem;
  height: 1.6rem;
}

.settings-card .checkbox {
  width: 1.4rem;
  height: 1.4rem;
}

.settings-card .btn {
  min-height: 2.75rem;
}

