/* Guest world modal on landing — single panel, step flow */
.world-modal[hidden] {
  display: none !important;
}

.world-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.world-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.world-modal__panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(92dvh, 820px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-elevated, #101014);
  border: 1px solid var(--line, rgba(244, 241, 234, 0.08));
  border-radius: 20px;
  padding: 1.5rem 1.35rem 1.5rem;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  animation: worldPanelIn 0.35s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
  scrollbar-width: thin;
  scrollbar-color: #3a3a42 #0a0a0b;
}

.world-modal__panel::-webkit-scrollbar {
  width: 10px;
}

.world-modal__panel::-webkit-scrollbar-track {
  background: #0a0a0b;
}

.world-modal__panel::-webkit-scrollbar-thumb {
  background: #3a3a42;
  border-radius: 8px;
  border: 2px solid #0a0a0b;
}

.world-modal__panel::-webkit-scrollbar-thumb:hover {
  background: #4e4e58;
}

.world-modal.is-to-register .world-modal__panel {
  animation: worldToRegister 0.4s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

@keyframes worldPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes worldToRegister {
  0% {
    opacity: 0.85;
    transform: translateX(18px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

.world-modal__paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.35;
  overflow: visible;
}

.world-path {
  stroke: var(--accent, #d4a574);
  stroke-width: 1.25;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 480;
  stroke-dashoffset: 480;
  opacity: 0.55;
}

.world-modal.is-crossing .world-path {
  animation: worldDraw 0.7s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

.world-modal.is-crossing .world-path--b {
  animation-delay: 0.08s;
}

@keyframes worldDraw {
  to {
    stroke-dashoffset: 0;
    opacity: 0.85;
  }
}

.world-cross {
  fill: var(--accent, #d4a574);
  opacity: 0;
  transform-origin: center;
}

.world-modal.is-crossing .world-cross {
  animation: worldCrossPulse 0.55s 0.35s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

@keyframes worldCrossPulse {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }
  60% {
    opacity: 1;
    transform: scale(1.35);
  }
  100% {
    opacity: 0.9;
    transform: scale(1);
  }
}

.world-modal__back,
.world-modal__close {
  position: absolute;
  top: 0.75rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft, rgba(244, 241, 234, 0.72));
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.world-modal__back {
  left: 0.75rem;
}

.world-modal__back[hidden] {
  display: none !important;
}

.world-modal__back svg {
  width: 1.25rem;
  height: 1.25rem;
}

.world-modal__close {
  right: 0.85rem;
  font-size: 1.5rem;
  line-height: 1;
}

.world-modal__back:hover,
.world-modal__close:hover {
  color: var(--ink, #f4f1ea);
}

.world-modal__title {
  margin: 0.15rem 0 0.85rem;
  padding-right: 1.5rem;
  font-family: var(--font-display, "Syne", sans-serif);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.world-step {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.world-step[hidden] {
  display: none !important;
}

.world-step[data-step="context"],
.world-step[data-step="osm"],
.world-step[data-step="register"] {
  padding-top: 0.35rem;
}

.world-search {
  margin-top: 0.25rem;
}

.world-mine {
  margin-top: 1.25rem;
}

.world-mine[hidden] {
  display: none !important;
}

.world-success {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 165, 116, 0.28);
  background: rgba(212, 165, 116, 0.08);
  color: var(--ink-soft, rgba(244, 241, 234, 0.72));
  font-size: 0.95rem;
  line-height: 1.45;
  animation: worldFadeIn 0.35s ease both;
}

@keyframes worldFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.world-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

/* Stacked relation choices — no horizontal scroll */
.world-choice-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin: 0.85rem 0 0.5rem;
  overflow: visible;
}

.world-choice {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line, rgba(244, 241, 234, 0.08));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink, #f4f1ea);
  cursor: pointer;
  font: inherit;
  line-height: 1.35;
  box-sizing: border-box;
}

.world-choice:has(input:checked),
.world-choice:hover {
  border-color: rgba(212, 165, 116, 0.4);
  background: rgba(212, 165, 116, 0.08);
}

.world-choice input {
  flex-shrink: 0;
  margin: 0;
}

.world-choice span {
  min-width: 0;
  word-break: break-word;
}

.world-register {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.85rem;
}

.world-register .chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.world-modal .osm-results,
.world-modal .place-results {
  max-height: none;
  overflow: visible;
}

/* OSM-adresblok: geen fieldset-kader; straat breed, nr/postcode met vaste min-breedte */
.world-modal .osm-locked {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.world-modal .field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.75rem 6.25rem;
  gap: 0.65rem;
  min-width: 0;
  align-items: end;
}

.world-modal .field-row .field {
  min-width: 0;
}

.world-modal .field-row .field input {
  width: 100%;
  box-sizing: border-box;
}

.place-item.is-new {
  animation: worldCardIn 0.35s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

@keyframes worldCardIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.site-nav .btn,
.hero__cta .btn {
  font: inherit;
}

@media (max-width: 560px) {
  .world-modal {
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 0.75rem max(0.85rem, env(safe-area-inset-bottom, 0px));
    align-items: center;
  }

  .world-modal__panel {
    width: 100%;
    max-width: 100%;
    max-height: min(82dvh, 100%);
    border-radius: 16px;
    margin: auto;
  }

  .world-modal .field-row {
    grid-template-columns: 1fr 1fr;
  }

  .world-modal .field-row .field:first-child {
    grid-column: 1 / -1;
  }

  .world-actions {
    flex-direction: column;
  }

  .world-actions .btn {
    width: 100%;
  }
}
