/* ---------------------------------------------------------------- */
/* Footer "Settings" button — same treatment as the fullscreen hint.   */
/* ---------------------------------------------------------------- */

.settings-hint {
  background: transparent;
  border: 1px solid rgba(201, 164, 100, 0.3);
  color: var(--c-brass-300);
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity var(--dur-med) var(--ease-bridge), all var(--dur-fast) var(--ease-bridge);
}

.settings-hint:hover {
  background: rgba(201, 164, 100, 0.08);
  border-color: rgba(201, 164, 100, 0.6);
}

/* Fullscreen used to hide this unconditionally, on top of the idle
   fade below - meaning it vanished the instant fullscreen was entered
   and stayed gone permanently, with no way on a touchscreen to bring
   it back (no Escape key to fall back on). It now just follows the
   same idle-based fade as windowed mode in both cases: gone during
   genuinely passive viewing, but a tap always brings it right back. */
body.idle .settings-hint {
  opacity: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------- */
/* First-run / settings overlay.                                     */
/* ---------------------------------------------------------------- */

.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(5, 7, 8, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* `display: flex` above otherwise outranks the UA stylesheet's
   `[hidden] { display: none }` - both are single-selector rules of
   equal specificity, so whichever comes later in the cascade wins, and
   this one does. Without this, setting the overlay's `hidden` property
   to true from JS has no visual effect at all: the whole modal card -
   the entire setup screen - stays fully visible regardless, so a
   perfectly successful save looks indistinguishable from one that did
   nothing. See the identical fix on .setup-secondary-btn below, which
   is what caught this pattern the first time - this rule should have
   been added right alongside it back then. */
.setup-overlay[hidden] {
  display: none;
}

.setup-card {
  width: 100%;
  max-width: 30rem;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--c-hull-800), var(--c-hull-950));
  border: 1px solid rgba(201, 164, 100, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6), 0 0 40px var(--c-brass-glow);
  padding: var(--space-5);
}

.setup-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.setup-brand .brand-mark {
  font-size: 1.5rem;
  color: var(--c-brass-500);
}

.setup-brand h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--c-brass-100);
}

.setup-intro {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--c-text-300);
  margin-bottom: var(--space-4);
}

.setup-preview-btn {
  display: block;
  width: 100%;
  background: rgba(201, 164, 100, 0.08);
  border: 1px solid rgba(201, 164, 100, 0.4);
  color: var(--c-brass-100);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-bridge);
}

.setup-preview-btn:hover {
  background: rgba(201, 164, 100, 0.16);
  border-color: rgba(201, 164, 100, 0.7);
}

.setup-preview-btn[hidden] {
  display: none;
}

.setup-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--c-text-700);
  margin: var(--space-3) 0 var(--space-4);
}

.setup-divider::before,
.setup-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(201, 164, 100, 0.16);
}

.setup-label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-500);
  margin-bottom: var(--space-3);
}

.setup-optional {
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.setup-label input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 164, 100, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--c-text-100);
}

.setup-label input:focus {
  outline: none;
  border-color: rgba(201, 164, 100, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 164, 100, 0.15);
}

.setup-row {
  display: flex;
  gap: var(--space-3);
}

.setup-row .setup-label {
  flex: 1;
}

.setup-coord {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.setup-coord input {
  margin-top: 0;
  flex: 1;
  min-width: 0;
}

.setup-hemi {
  flex: 0 0 auto;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 164, 100, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--c-text-100);
}

.setup-hemi:focus {
  outline: none;
  border-color: rgba(201, 164, 100, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 164, 100, 0.15);
}

.setup-error {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--c-bad);
  margin: 0.5rem 0 0;
}

.setup-secondary-btn {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(79, 179, 192, 0.35);
  color: var(--c-water-300);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: var(--space-4);
  transition: all var(--dur-fast) var(--ease-bridge);
}

/* `display: block` above otherwise outranks the UA stylesheet's
   `[hidden] { display: none }`, since both are single-selector rules
   and this one comes later in the cascade - so it has to be restated
   explicitly here rather than relying on the hidden attribute alone. */
.setup-secondary-btn[hidden] {
  display: none;
}

.setup-secondary-btn:hover {
  background: rgba(79, 179, 192, 0.08);
  border-color: rgba(79, 179, 192, 0.6);
}

.setup-secondary-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.setup-geocode-results {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: -0.2rem 0 var(--space-4);
}

.setup-geocode-results[hidden] {
  display: none;
}

.setup-geocode-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 164, 100, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-bridge);
}

.setup-geocode-result:hover {
  background: rgba(201, 164, 100, 0.08);
  border-color: rgba(201, 164, 100, 0.5);
}

.setup-geocode-result strong {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--c-text-100);
}

.setup-geocode-result span {
  font-size: 0.72rem;
  color: var(--c-text-500);
}

.setup-advanced {
  margin-bottom: var(--space-4);
  border: 1px solid rgba(201, 164, 100, 0.16);
  border-radius: var(--radius-sm);
  padding: 0 0.8rem;
}

.setup-advanced[open] {
  padding-bottom: 0.6rem;
}

.setup-advanced summary {
  padding: 0.6rem 0;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--c-text-500);
  cursor: pointer;
  list-style: none;
}

.setup-advanced summary::-webkit-details-marker {
  display: none;
}

.setup-advanced summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--c-brass-500);
  transition: transform var(--dur-fast) var(--ease-bridge);
}

.setup-advanced[open] summary::before {
  transform: rotate(90deg);
}

.setup-advanced .setup-label:first-of-type {
  margin-top: 0.2rem;
}

.setup-advanced .setup-secondary-btn {
  margin-bottom: 0.2rem;
}

.setup-hint {
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--c-text-500);
  margin: 0.5rem 0 var(--space-4);
}

.setup-hint-tight {
  margin: -0.6rem 0 var(--space-3);
}

.setup-hint a {
  color: var(--c-brass-300);
}

.setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.setup-actions .setup-secondary-btn {
  width: auto;
  margin-bottom: 0;
}

.setup-submit-btn {
  background: var(--c-brass-500);
  border: 1px solid var(--c-brass-500);
  color: var(--c-hull-950);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-bridge);
}

.setup-submit-btn:hover {
  background: var(--c-brass-300);
  border-color: var(--c-brass-300);
}
