/* ------------------------------------------------------------
   Landfall: the drawing surface and its furniture.
   Shares the stage, panel, toast and gazetteer styles with the
   atlas (atlas/atlas.css). The chart carries its own colours.
   ------------------------------------------------------------ */

.lf-chart,
.lf-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.lf-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.lf-ink {
  pointer-events: none;
  overflow: visible;
  transition: opacity 0.8s ease;
}

.lf-ink-line {
  fill: none;
  stroke: var(--map-ink);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lf-ink.is-fading { opacity: 0; }

.lf-stage.is-empty .lf-viewport,
.lf-stage.is-adding .lf-viewport {
  cursor: crosshair;
}

/* ---------- the invitation ---------- */
.lf-prompt {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(24rem, calc(100% - 2rem));
  padding: 1.4rem 1.6rem 1.3rem;
  border: 1px solid var(--map-ink);
  outline: 1px solid var(--map-ink);
  outline-offset: 3px;
  background: var(--map-land);
  box-shadow: 0 0 0 3px var(--map-land), 0 10px 30px -14px rgba(40, 25, 10, 0.45);
  color: var(--map-ink);
  font-family: var(--fell);
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.lf-prompt[hidden] { display: block; opacity: 0; visibility: hidden; }
.lf-stage.is-drawing .lf-prompt { opacity: 0; visibility: hidden; }

.lf-kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--map-red);
}

.lf-title {
  margin: 0.35rem 0 0.4rem;
  font-family: var(--fell);
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 400;
  line-height: 1.05;
}

.lf-sub {
  margin: 0;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.35;
}

.lf-random {
  appearance: none;
  margin-top: 0.9rem;
  padding: 0.2rem 0.1rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: none;
  color: var(--map-red);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  pointer-events: auto;
}

.lf-random:hover { color: var(--map-ink); }

.lf-adding-hint {
  position: absolute;
  top: 1rem;
  left: 50%;
  z-index: 3;
  margin: 0;
  padding: 0.45rem 0.55rem 0.45rem 0.9rem;
  border: 1px solid var(--map-ink-soft);
  border-radius: 999px;
  background: var(--map-land);
  color: var(--map-ink);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
  transform: translateX(-50%);
}

.lf-sighted {
  position: absolute;
  top: 1rem;
  left: 50%;
  z-index: 3;
  max-width: calc(100% - 2rem);
  margin: 0;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--map-red);
  border-radius: 999px;
  background: var(--map-land);
  color: var(--map-ink);
  font-family: var(--fell);
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 10px 26px -16px rgba(40, 25, 10, 0.5);
  animation: tools-in 0.4s ease 1.6s both;
}

.lf-sighted[hidden] { display: none; }
.lf-sighted a { margin-left: 0.4rem; color: var(--map-red); font-family: var(--mono); font-size: 0.7rem; white-space: nowrap; }
.has-panel .lf-sighted { visibility: hidden; }

.lf-adding-hint button {
  appearance: none;
  margin-left: 0.5rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--map-ink-soft);
  border-radius: 999px;
  background: none;
  color: var(--map-red);
  font: inherit;
  cursor: pointer;
}

/* ---------- tools ---------- */
.lf-tools {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border: 1px solid var(--map-ink-soft);
  border-radius: 999px;
  background: var(--map-land);
  box-shadow: 0 10px 26px -16px rgba(40, 25, 10, 0.5);
  transform: translateX(-50%);
  animation: tools-in 0.4s ease 0.9s both;
}

.lf-tools[hidden] { display: none; }

@keyframes tools-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.lf-tools button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--map-ink);
  font-family: var(--mono);
  font-size: 0.7rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lf-tools button:hover { background: var(--map-sea); color: var(--map-red); }
.lf-tools button.is-armed { background: var(--map-red); color: var(--map-land); }

.lf-tools svg {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lf-tools .pip { fill: currentColor; stroke: none; }

.lf-stage .atlas-controls[hidden] { display: none; }

/* ---------- the chart: hover, focus, arrival ---------- */
.lf .place { cursor: pointer; outline: none; }
.lf .place:hover .lab,
.lf .place.is-active .lab,
.lf .place:focus-visible .lab { fill: var(--map-red); }
.lf .place:focus-visible .hit {
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
  stroke-opacity: 1;
  vector-effect: non-scaling-stroke;
}

.lf-stage.is-revealing .lf-web { animation: lf-fade 1.4s ease both; }
.lf-stage.is-revealing .lf-rings { animation: lf-fade 1.1s ease 0.1s both; }
.lf-stage.is-revealing .lf-lands { animation: lf-fade 0.5s ease both; }
.lf-stage.is-revealing .lf-relief > *,
.lf-stage.is-revealing .lf-marks > *,
.lf-stage.is-revealing .lf-labels > * { animation: lf-fade 0.5s ease var(--d, 0.6s) both; }
.lf-stage.is-revealing .lf-cartouche { animation: lf-fade 0.8s ease 1.9s both; }
.lf-stage.is-relabelling .lf-labels > *,
.lf-stage.is-relabelling .lf-cartouche { animation: lf-fade 0.45s ease var(--d, 0s) both; }

@keyframes lf-fade { from { opacity: 0; } }

/* ---------- the panel's rename form ---------- */
.lf-rename {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--rule);
}

.lf-rename label {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.lf-rename-row { display: flex; gap: 0.4rem; }

.lf-rename input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fell);
  font-size: 1.05rem;
}

.lf-rename input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.lf-rename button {
  appearance: none;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: none;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.lf-rename button:hover { background: var(--accent); color: var(--accent-ink); }

.lf-short { display: none; }

.lf-report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin: 0.2rem 0 1rem !important; }

.lf-report-send {
  appearance: none;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 0.74rem;
  cursor: pointer;
}

.lf-report-send:hover { filter: brightness(1.08); }
.lf-report-send:disabled { background: none; color: var(--accent); cursor: default; filter: none; }
.lf-report-status { flex: 1 1 12rem; font-size: 0.9rem; line-height: 1.4; color: var(--ink-soft); }
.panel-body abbr { text-decoration: none; font-variant: small-caps; letter-spacing: 0.04em; }

.panel-particulars {
  font-size: 0.92em;
  color: var(--ink-soft);
}

.lf-text .gz-entry:first-child .gz-name { font-size: 1.9rem; }

/* ---------- small screens ---------- */
@media (max-width: 52rem) {
  .lf-tools .lf-long { display: none; }
  .lf-tools .lf-short { display: inline; }
}

@media (max-width: 40rem) {
  .lf-tools {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
    justify-content: space-between;
    transform: none;
    animation-name: tools-in-sm;
  }

  @keyframes tools-in-sm {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }

  .lf-tools button { flex-direction: column; gap: 0.2rem; padding: 0.4rem 0.3rem; font-size: 0.56rem; border-radius: 14px; }
  .lf-tools { border-radius: 18px; }
  .has-panel .lf-tools { visibility: hidden; }
  .lf-prompt { padding: 1.1rem 1.1rem 1rem; }
  .lf-sub { font-size: 1rem; }
  .lf-adding-hint { top: auto; bottom: 0.6rem; font-size: 0.64rem; }
  .lf-sighted { top: 0.6rem; left: 0.6rem; right: 3.9rem; max-width: none; font-size: 0.92rem; border-radius: 14px; transform: none; animation-name: tools-in-sm; }
}

@media (prefers-reduced-motion: reduce) {
  .lf-tools { animation: none; }
  .lf-ink { transition: none; }
}
