:root {
  --bg0: #02050b;
  --bg1: #050913;
  --bg2: #08111f;
  --panel: rgba(10, 15, 26, 0.84);
  --panel-border: rgba(173, 197, 243, 0.18);
  --text: #f5f7fb;
  --muted: rgba(231, 236, 246, 0.9);
  --muted-2: rgba(220, 228, 242, 0.72);
  --line: rgba(229, 236, 246, 0.16);
  --blue: #2d66ff;
  --blue-2: #66b6ff;
  --orange: #ff7d31;
  --orange-2: #ffb169;
  --green: #34c759;
  --red: #ff5b63;
  --shadow-deep: 0 30px 70px rgba(0, 0, 0, 0.42);
  --field-bg: rgba(4, 8, 15, 0.75);
  --field-border: rgba(255,255,255,0.12);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 69%, rgba(86, 158, 255, 0.22), transparent 12%),
    radial-gradient(circle at 17% 73%, rgba(155, 211, 255, 0.12), transparent 6%),
    radial-gradient(circle at 84% 67%, rgba(255, 120, 41, 0.18), transparent 13%),
    radial-gradient(circle at 86% 60%, rgba(255, 181, 129, 0.10), transparent 8%),
    radial-gradient(circle at 50% 35%, rgba(40, 82, 166, 0.18), transparent 28%),
    linear-gradient(180deg, #01040a 0%, #030711 46%, #02050b 100%);
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle at 5% 38%, rgba(255,255,255,0.75) 0 1px, transparent 1.5px),
    radial-gradient(circle at 10% 71%, rgba(255,255,255,0.70) 0 1px, transparent 1.5px),
    radial-gradient(circle at 13% 76%, rgba(255,255,255,0.68) 0 1px, transparent 1.5px),
    radial-gradient(circle at 79% 22%, rgba(255, 152, 82, 0.75) 0 1.1px, transparent 1.6px),
    radial-gradient(circle at 86% 31%, rgba(255, 184, 126, 0.78) 0 1.1px, transparent 1.6px),
    radial-gradient(circle at 90% 75%, rgba(255,255,255,0.70) 0 1px, transparent 1.5px),
    radial-gradient(circle at 94% 67%, rgba(255,255,255,0.62) 0 1px, transparent 1.4px),
    radial-gradient(circle at 6% 62%, rgba(128, 188, 255, 0.66) 0 1px, transparent 1.5px);
  opacity: 0.65;
}

body::after {
  background: linear-gradient(transparent 96%, rgba(255,255,255,0.012) 100%);
  background-size: 100% 4px;
  opacity: 0.11;
}

.page-glow {
  position: fixed;
  pointer-events: none;
  filter: blur(34px);
  z-index: 0;
}

.page-glow-left {
  left: 3%;
  top: 47%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(88, 176, 255, 0.56), rgba(88, 176, 255, 0));
}

.page-glow-right {
  right: 3%;
  top: 47%;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 128, 61, 0.48), rgba(255, 128, 61, 0));
}

.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1262px, calc(100% - 64px));
  margin: 28px auto 36px;
}

.portal-shell::before {
  content: "";
  position: absolute;
  left: 24%;
  top: 124px;
  width: 40%;
  height: 74%;
  background: radial-gradient(circle, rgba(40, 115, 255, 0.13), transparent 70%);
  filter: blur(34px);
  pointer-events: none;
}

.portal-shell::after {
  content: "";
  position: absolute;
  right: 0;
  top: 178px;
  width: 30%;
  height: 52%;
  background: radial-gradient(circle, rgba(255, 118, 42, 0.12), transparent 72%);
  filter: blur(28px);
  pointer-events: none;
}

.glass {
  background: linear-gradient(180deg, rgba(22, 33, 55, 0.56), rgba(7, 11, 20, 0.78));
  border: 1px solid var(--panel-border);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    inset 0 0 0 1px rgba(255,255,255,0.018),
    var(--shadow-deep);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-lite {
  background: linear-gradient(180deg, rgba(17, 25, 42, 0.66), rgba(6, 10, 19, 0.76));
  border: 1px solid rgba(201, 220, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.topbar {
  min-height: 78px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(8, 12, 23, 0.92) 0%, rgba(22, 40, 74, 0.92) 34%, rgba(12, 21, 38, 0.9) 69%, rgba(7, 11, 20, 0.92) 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.45), 0 0 38px rgba(42, 108, 255, 0.11);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-stack {
  display: grid;
  gap: 2px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: block;
}

.brand-name {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.38rem;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-block { color: #ff5b63; }
.brand-cord { color: #57a8ff; }
.brand-s { color: #34c759; }

.brand-subtitle {
  color: var(--muted-2);
  font-size: 0.82rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links a,
.nav-button {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  text-decoration: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-links a:hover,
.nav-button:hover {
  background: rgba(255,255,255,0.08);
}

.tool-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin-top: 24px;
}

.tool-copy {
  padding: 26px 4px 8px;
}

.eyebrow,
.tool-section-label,
.side-card__label {
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.tool-copy h1 {
  margin: 12px 0 12px;
  font-size: clamp(2.3rem, 4vw, 4.3rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.tool-copy p {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hero-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.availability,
.session-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight: 600;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(180deg, #67ff8e, #1fae45);
  box-shadow: 0 0 14px rgba(72, 255, 125, 0.55);
}

.feature-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
}

.feature-card--tool {
  min-height: 340px;
}

.feature-art {
  position: relative;
  min-height: 240px;
  padding: 26px;
  background: radial-gradient(circle at 24% 18%, rgba(78, 155, 255, 0.18), transparent 26%), radial-gradient(circle at 80% 78%, rgba(255, 130, 64, 0.18), transparent 27%), linear-gradient(180deg, rgba(11, 19, 35, 0.92), rgba(6, 10, 18, 0.72));
}

.feature-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.72;
}

.feature-light-left {
  left: -28px;
  top: 40px;
  width: 160px;
  height: 160px;
  background: rgba(78, 160, 255, 0.38);
}

.feature-light-right {
  right: -34px;
  bottom: 26px;
  width: 170px;
  height: 170px;
  background: rgba(255, 132, 67, 0.34);
}

.feature-media {
  position: relative;
  z-index: 1;
  min-height: 216px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(17, 28, 49, 0.68), rgba(4, 8, 15, 0.82));
}

.feature-media--tool {
  min-height: 250px;
}

.feature-logo {
  max-width: min(100%, 260px);
  max-height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 22px 34px rgba(0,0,0,0.34));
}

.feature-body {
  position: relative;
  z-index: 1;
  padding: 0 28px 28px;
}

.feature-body h2 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  letter-spacing: -0.03em;
}

.feature-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

.feature-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.meta-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9cb3da;
}

.meta-dot.blue { background: var(--blue-2); }
.meta-dot.green { background: var(--green); }
.meta-dot.neutral { background: #96a3be; }

.tool-grid-map {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 360px;
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.tool-hero-grid--compact {
  grid-template-columns: 1fr;
}

.tool-hero-grid--compact .tool-copy {
  max-width: 920px;
}

.tool-main {
  border-radius: 28px;
  padding: 22px;
}

.tool-main__header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.tool-title {
  margin: 8px 0 8px;
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.tool-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  max-width: 730px;
}

.tool-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.tool-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
  padding: 16px;
  border-radius: 22px;
}

.seed-field {
  display: grid;
  gap: 10px;
}

.seed-field > span {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.seed-field input {
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  outline: none;
  background: var(--field-bg);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.seed-field input::placeholder {
  color: rgba(221, 230, 245, 0.36);
}

.seed-field input:focus {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 0 4px rgba(45, 102, 255, 0.12);
}

.tool-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.icon-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.primary-button,
.secondary-button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #2d66ff, #58a8ff 60%, #7acbff);
  box-shadow: 0 16px 32px rgba(48, 108, 255, 0.28);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(48, 108, 255, 0.34);
}

.secondary-button,
.icon-button {
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.secondary-button:hover,
.icon-button:hover {
  background: rgba(255,255,255,0.09);
}

.icon-button {
  min-width: 52px;
  min-height: 52px;
  border-radius: 16px;
  font-size: 1.3rem;
}

.tool-alert {
  display: none;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 91, 99, 0.12);
  border: 1px solid rgba(255, 91, 99, 0.28);
  color: #ffd7da;
  line-height: 1.55;
}

.map-shell {
  margin-top: 18px;
}

.map-frame {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  border-radius: 26px;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

#mapCanvas {
  display: block;
  width: 100%;
  height: 680px;
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
}

#mapCanvas:active {
  cursor: grabbing;
}

.map-help {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 3;
  max-width: min(440px, calc(100% - 36px));
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(5, 10, 18, 0.84);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-side {
  display: grid;
  gap: 16px;
}


.side-card {
  border-radius: 24px;
  padding: 20px;
}

.side-card__value {
  margin-top: 10px;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.side-card__meta {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.side-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.legend-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: 0 0 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.legend-swatch--crimson { background: #7B1E3A; }
.legend-swatch--warped { background: #1F7A73; }
.legend-swatch--wastes { background: #5E5147; }
.legend-swatch--soul { background: #3F5E78; }
.legend-swatch--basalt { background: #45414A; }

.ws-popup[hidden]{display:none}

.ws-popup {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  min-width: 236px;
  max-width: min(290px, calc(100% - 20px));
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.ws-popup__card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(11, 14, 20, 0.94);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 18px 40px rgba(0,0,0,0.44);
  pointer-events: auto;
}

.ws-popup__title {
  font-size: 15px;
  font-weight: 700;
}

.ws-popup__coords {
  margin-top: 6px;
  font-size: 13px;
}

.ws-popup__meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.ws-popup__build {
  width: 100%;
  margin-top: 12px;
}

.ws-popup__build[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.ws-popup__arrow {
  width: 16px;
  height: 16px;
  margin: -8px auto 0;
  background: rgba(11, 14, 20, 0.94);
  border-right: 1px solid rgba(255,255,255,0.09);
  border-bottom: 1px solid rgba(255,255,255,0.09);
  transform: rotate(45deg);
}

.footer-bar {
  display: flex;
  justify-content: center;
  margin-top: 22px;
  padding: 18px 0 6px;
}

.footer-name {
  opacity: 0.92;
}

button[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

@media (max-width: 1120px) {
  .tool-hero-grid,
  .tool-grid-map {
    grid-template-columns: 1fr;
  }

  .tool-main__header {
    grid-template-columns: 1fr;
    display: grid;
  }

  .tool-pills {
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  .portal-shell {
    width: min(100% - 28px, 1262px);
    margin-top: 16px;
  }

  .topbar {
    min-height: auto;
    padding: 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav-links a,
  .nav-button {
    flex: 1 1 150px;
    text-align: center;
  }

  .tool-copy {
    padding-top: 10px;
  }

  .tool-toolbar {
    grid-template-columns: 1fr;
  }

  .tool-toolbar-actions {
    justify-content: stretch;
  }

  .primary-button,
  .secondary-button,
  .icon-button {
    flex: 1 1 140px;
  }

  .map-frame,
  #mapCanvas {
    min-height: 470px;
    height: 470px;
  }
}

@media (max-width: 640px) {
  .portal-shell {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .topbar {
    padding: 14px;
    gap: 10px;
    border-radius: 22px;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
  }

  .brand-name {
    font-size: 1.55rem;
  }

  .brand-subtitle {
    font-size: 0.8rem;
  }

  .tool-hero-grid {
    gap: 14px;
    margin-top: 14px;
  }

  .tool-copy {
    padding-top: 4px;
  }

  .tool-copy h1 {
    font-size: 1.62rem;
    line-height: 1.1;
    margin-bottom: 10px;
  }

  .tool-copy p {
    font-size: 0.94rem;
    line-height: 1.55;
    margin-bottom: 12px;
  }

  .hero-inline-meta {
    gap: 8px;
  }

  .feature-card--tool {
    min-height: auto;
  }

  .feature-art {
    min-height: 140px;
    padding: 14px;
  }

  .feature-media--tool {
    min-height: 140px;
  }

  .feature-body,
  .tool-main,
  .side-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tool-main {
    border-radius: 22px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .tool-main__header {
    gap: 12px;
  }

  .tool-title {
    font-size: 1.34rem;
    margin-top: 4px;
  }

  .tool-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .tool-pills {
    gap: 7px;
  }

  .pill {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.79rem;
  }

  .tool-toolbar {
    margin-top: 14px;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .seed-field input,
  .primary-button,
  .secondary-button,
  .icon-button {
    min-height: 48px;
    height: 48px;
  }

  .map-help {
    left: 10px;
    top: 10px;
    right: 10px;
    max-width: none;
    font-size: 0.8rem;
    padding: 9px 11px;
  }

  .map-frame,
  #mapCanvas {
    min-height: 340px;
    height: 340px;
    border-radius: 20px;
  }

  .ws-popup[hidden]{display:none}

.ws-popup {
    min-width: 214px;
    max-width: min(246px, calc(100% - 20px));
  }

  .tool-side {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .side-card {
    border-radius: 18px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .side-card--secondary {
    display: none;
  }

  .side-card__value {
    font-size: 1.02rem;
    margin-top: 8px;
  }

  .side-card__meta,
  .side-list,
  .legend-item {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .footer-bar {
    margin-top: 14px;
    padding-top: 8px;
  }
}


.feature-card--tool { display: none !important; }

.tool-side > .side-card:nth-child(2) { display: none; }


/* v20 responsive topbar refresh */
.brand-link {
  text-decoration: none;
  color: inherit;
}

.topbar {
  gap: 16px;
  flex-wrap: wrap;
  min-height: unset;
  padding-top: 14px;
  padding-bottom: 14px;
}

.topbar .brand,
.topbar .brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar .brand-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.38);
  border: 1px solid rgba(173, 197, 243, 0.12);
}

.nav-links a,
.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  white-space: nowrap;
}

.nav-links a {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-button:hover,
.nav-button:focus-visible {
  border-color: rgba(167, 192, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .topbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-links {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .nav-links a,
  .nav-button {
    flex: 1 1 calc(50% - 6px);
    min-width: calc(50% - 6px);
  }
}

@media (max-width: 560px) {
  .portal-shell,
  .auth-shell,
  .account-shell,
  .artifacts-shell,
  .confirm-shell,
  .pack-shell,
  .release-shell {
    width: calc(100% - 20px);
  }

  .topbar {
    gap: 12px;
    border-radius: 16px;
  }

  .brand-name {
    font-size: 18px;
  }

  .nav-links {
    gap: 8px;
    padding: 8px;
  }

  .nav-links a,
  .nav-button {
    flex-basis: 100%;
    min-width: 100%;
    width: 100%;
  }
}
