/* Modal shell — Settings and Patch Notes overlay the screen behind them.
   Leadlight register: gilt hairline on a deep, slightly warm panel. */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(4, 5, 9, .72);
  backdrop-filter: blur(3px);
  animation: modal-fade .16s var(--ease-out, ease-out);
}

.modal-dialog {
  position: relative;
  box-sizing: border-box;
  width: min(34rem, 100%);
  max-height: min(80vh, 44rem);
  overflow-y: auto;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1.5px solid transparent;
  border-radius: 14px;
  color: var(--bone);
  background:
    linear-gradient(180deg, rgba(24, 25, 31, .985), rgba(14, 15, 20, .985)) padding-box,
    var(--gilt-lit) border-box;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .72);
  animation: modal-rise .18s var(--ease-out, ease-out);
}

.modal-title {
  margin: 0 0 1rem;
  padding-right: 2rem;
  font-family: var(--font-display), serif;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 400;
  letter-spacing: .06em;
  color: var(--gold-bright);
}

.modal-body { font-family: var(--font-body), Georgia, serif; line-height: 1.45; }

.modal-close {
  position: absolute;
  top: .7rem;
  right: .9rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ash);
  background: transparent;
  cursor: pointer;
  transition: color .14s, background .14s;
}
.modal-close:hover, .modal-close:focus-visible {
  color: var(--gold-bright);
  background: rgba(227, 180, 94, .12);
  outline: none;
}

/* the page behind a dialog must not scroll under it */
body.modal-open { overflow: hidden; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal-dialog { animation: none; }
}

@media (max-width: 640px) {
  .modal-backdrop { box-sizing: border-box; align-items: flex-start; padding: 16px; overflow-y: auto; }
  .modal-dialog { width: 100%; max-height: calc(100vh - 32px); padding: 1.25rem; overflow: hidden; }
  .modal-body { max-height: calc(100vh - 11rem); overflow-y: auto; padding-right: 4px; }
  .modal-close { width: 44px; height: 44px; top: .4rem; right: .45rem; }
  .modal-settings .settings-row { min-height: 44px; box-sizing: border-box; }
  .landing-gear { width: 44px; height: 44px; }
}

/* --- settings rows inside the dialog ------------------------------------- */
.modal-settings { display: flex; flex-direction: column; gap: .55rem; }
.modal-settings .settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid rgba(227, 180, 94, .22);
  border-radius: 9px;
  font-family: var(--font-chrome), serif;
  font-size: .92rem;
  letter-spacing: .04em;
  color: var(--bone);
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  transition: border-color .14s, background .14s, color .14s;
}
.modal-settings .settings-row:hover,
.modal-settings .settings-row:focus-visible {
  border-color: var(--gold);
  background: rgba(227, 180, 94, .08);
  outline: none;
}
/* toggle rows carry a real sliding switch (no On/Off text); concede is a plain
   action row with no indicator at all. */
.modal-settings .settings-switch {
  flex-shrink: 0; width: 44px; height: 23px; border-radius: 999px; position: relative;
  background: rgba(0, 0, 0, .5); border: 1px solid var(--came);
  transition: background .16s var(--ease-out), border-color .16s var(--ease-out);
}
.modal-settings .settings-switch::after {
  content: ''; position: absolute; top: 1px; left: 1px; width: 19px; height: 19px;
  border-radius: 50%; background: var(--ash);
  transition: transform .16s var(--ease-out), background .16s var(--ease-out);
}
.modal-settings .settings-toggle.on .settings-switch { background: var(--gold); border-color: var(--gold); }
.modal-settings .settings-toggle.on .settings-switch::after { transform: translateX(21px); background: #14151a; }
.modal-settings .settings-row.concede { justify-content: center; color: #ffb3b3; border-color: rgba(196, 31, 63, .45); }
.modal-settings .settings-row.concede:hover { background: rgba(196, 31, 63, .2); border-color: rgba(196, 31, 63, .7); }
/* Language row matches the toggle rows exactly (same shell) — no gilt slab. */
.modal-settings .settings-language {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; box-sizing: border-box; padding: .7rem 1rem;
  border: 1px solid rgba(227, 180, 94, .22); border-radius: 9px;
  font-family: var(--font-chrome), serif; font-size: .92rem; letter-spacing: .04em; color: var(--bone);
  background: rgba(255, 255, 255, .02);
}

/* --- the settings cog, top-right of the landing screen -------------------- */
.landing-gear {
  position: absolute;
  top: clamp(1rem, 2.4vh, 2rem);
  right: clamp(1rem, 2.4vw, 2.4rem);
  z-index: 6;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  /* U18 — a hairline at 28% alpha over a bright meadow reads as an unstyled
     glyph. Give it the same gilt-on-dark container as the rest of the chrome. */
  border: 1.5px solid transparent;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--gold);
  background:
    linear-gradient(180deg, rgba(20, 22, 28, .88), rgba(10, 11, 17, .88)) padding-box,
    var(--gilt-lit) border-box;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .5);
  backdrop-filter: blur(2px);
  cursor: pointer;
  transition: color .16s, border-color .16s, transform .3s var(--ease-out, ease-out), background .16s;
}
.landing-gear:hover, .landing-gear:focus-visible {
  color: var(--gold-bright);
  /* Keep the gilt border-box layer: a flat `background` here would replace both
     layers and erase the ring the container depends on. */
  background:
    linear-gradient(180deg, rgba(48, 40, 26, .92), rgba(28, 23, 15, .92)) padding-box,
    var(--gilt-lit) border-box;
  transform: rotate(60deg);
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .landing-gear:hover, .landing-gear:focus-visible { transform: none; }
}
