.app-content--settings {
  background: transparent;
}

.settings-screen {
  position: relative;
  display: grid;
  gap: clamp(16px, 2.2dvh, 24px);
  /* The shared top bar already reserves the iPhone's top safe area. */
  padding: 18px 0 28px;
  max-width: var(--mobile-panel-width);
  min-height: calc(100dvh - var(--top-bar-height));
  animation: screenFadeIn 260ms ease;
  overflow: hidden;
}

.settings-screen::before,
.settings-screen::after {
  position: fixed;
  z-index: 0;
  display: block;
  content: "";
  pointer-events: none;
}

.settings-screen::before {
  left: max(12px, calc(50vw - var(--mobile-shell-active-width) / 2 - 44px));
  top: 106px;
  width: 112px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,.56);
  filter: drop-shadow(0 8px 12px rgba(38, 84, 110, .1));
  box-shadow:
    28px -16px 0 8px rgba(255,255,255,.44),
    58px -5px 0 5px rgba(255,255,255,.5);
}

.settings-screen::after {
  right: max(10px, calc(50vw - var(--mobile-shell-active-width) / 2 - 26px));
  bottom: 118px;
  width: 54px;
  height: 60px;
  border-radius: 12px;
  background: var(--brand-tile-bg);
  border: 3px solid rgba(189, 72, 37, .72);
  box-shadow: 0 7px 0 rgba(169, 58, 34, .72), 0 12px 16px rgba(47, 63, 93, .14);
  transform: rotate(11deg);
}

.settings__section {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin-bottom: 0;
}

.settings__section-title {
  justify-self: start;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff2a8 0%, #ffbf63 100%);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(132, 80, 22, .16), 0 8px 16px rgba(43, 61, 91, .12);
  font-size: .82rem;
  font-family: var(--font-heading);
  font-weight: 900;
  color: #663c13;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: -2px;
}

.settings__group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-panel);
  background: var(--surface-panel);
  border: var(--surface-border);
  box-shadow: var(--shadow-game-panel);
  overflow: visible;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.settings__item {
  position: relative;
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-control);
  background:
    linear-gradient(180deg, rgba(255,255,255,.94) 0%, rgba(237, 249, 251, .9) 100%);
  border: 3px solid rgba(255,255,255,.78);
  box-shadow:
    inset 0 4px 0 rgba(255,255,255,.45),
    inset 0 -5px 0 rgba(36, 51, 70, .07),
    0 9px 18px rgba(43, 61, 91, .12);
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
  text-align: left;
}

.settings__item:last-child {
  border-bottom: 3px solid rgba(255,255,255,.78);
}

.settings__item:hover {
  filter: saturate(1.06);
  transform: translateY(-1px);
}

.settings__item-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-icon-badge);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.42), inset 0 -4px 0 rgba(18, 74, 105, .22), 0 6px 12px rgba(43, 61, 91, .12);
}

.settings__item-icon .app-icon {
  width: 25px;
  height: 25px;
  font-size: 25px;
}

.settings__item-icon--primary { background: var(--gradient-icon-blue); }
.settings__item-icon--success { background: var(--gradient-menu-green); color: #103e36; }
.settings__item-icon--warning { background: var(--gradient-menu-gold); color: #5b3712; }
.settings__item-icon--error   { background: var(--gradient-secondary); color: #fff; }
.settings__item-icon--language {
  background: rgba(255, 244, 173, .96);
  color: #754414;
  box-shadow:
    inset 0 3px 0 rgba(255,255,255,.42),
    inset 0 -4px 0 rgba(132, 80, 22, .14),
    0 6px 12px rgba(43, 61, 91, .12);
}

.settings__language-flag {
  width: 36px;
  height: 36px;
}

.settings__item-content {
  min-width: 0;
  flex: 1;
}

.settings__item-label {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1rem;
  color: #1d2a41;
  line-height: 1.05;
}

.settings__item-desc {
  margin-top: 4px;
  font-size: .78rem;
  color: #65728a;
  font-weight: 700;
  line-height: 1.2;
}

.settings__item-value {
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 900;
  color: #526079;
}

.settings__item-arrow {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-icon-badge);
  background: rgba(45, 198, 161, .14);
  color: #16806f;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.settings__password-field {
  margin-bottom: var(--space-md);
}

.settings__password-field--last {
  margin-bottom: var(--space-sm);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 58px;
  height: 34px;
  flex-shrink: 0;
}

.toggle input {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  background: #9aa8ba;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
  cursor: pointer;
  box-shadow: inset 0 3px 6px rgba(35, 53, 76, .2), inset 0 -2px 0 rgba(255,255,255,.34);
}

.toggle__slider::before {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,.95) 0 16%, transparent 17%),
    linear-gradient(135deg, #fff7b9 0%, #ffbd54 100%);
  left: 3px;
  top: 3px;
  transition: transform var(--transition-fast);
  box-shadow: inset 0 -3px 0 rgba(132, 80, 22, .2), 0 4px 8px rgba(43, 61, 91, .18);
}

.toggle input:checked + .toggle__slider {
  background: linear-gradient(135deg, #2dc6a1 0%, #1b9bd7 100%);
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(24px);
}

.settings__danger {
  margin-top: clamp(4px, 1dvh, 10px);
}

.settings__version {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #425472;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 900;
  margin-top: 2px;
  padding-bottom: 0;
}

/* Tablet */
@media (min-width: 640px) {
  .settings-screen {
    padding: var(--space-lg) var(--mobile-shell-gutter) calc(var(--nav-height) + var(--safe-area-bottom) + 32px);
  }

  .settings__item-label {
    font-size: var(--text-base);
  }

  .settings__item-desc {
    font-size: var(--text-sm);
  }

  .settings__item {
    padding: 13px 14px;
  }

  .settings__item-icon {
    width: 52px;
    height: 52px;
  }

  .settings__item-icon .app-icon {
    width: 28px;
    height: 28px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .settings-screen {
    padding: var(--space-xl) var(--mobile-shell-gutter) calc(var(--nav-height) + 38px);
  }
}
.settings__password-reveal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 20px;
  font-size: 0.9rem;
}

.settings__password-reveal input {
  width: 18px;
  height: 18px;
}
