:root {
  --brand: #5EFF0D;
  --brand-hover: #0050FF;
  --brand-ink: #0A141E;
  --brand-bg: rgb(94 255 13 / 0.12);
  --brand-border: rgb(94 255 13 / 0.35);
  --radius-panel: 0;
  --radius-md: 0;
  --radius-sm: 0;
  --radius-xs: 0;
  --notch: none;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  overflow-x: hidden;
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-bar {
  width: 100%;
  max-width: calc(1200px + var(--host-rail-w, 0px));
  margin: 0 auto;
  padding-inline: var(--page-padding);
}

footer.app-bar {
  margin-top: auto;
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 480px;
  overflow: hidden;
  background: var(--bg-deep);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  padding: 0 24px;
  background: linear-gradient(to bottom, rgb(10 20 30 / 0.9), transparent);
}

.topbar-brand {
  display: flex;
  align-items: flex-end;
  text-decoration: none;
}

.topbar-brand img {
  height: 48px;
  width: auto;
  display: block;
  transition: transform 0.3s, filter 0.3s;
}

.topbar-brand:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08));
}

.topbar-title {
  padding-left: 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 20px;
  color: var(--text);
  transition: color 0.3s;
}

.topbar-brand:hover .topbar-title {
  color: var(--brand);
}

.topbar-links,
.topbar-actions {
  display: none;
}

.topbar-links {
  flex: 1;
  justify-content: center;
  gap: 40px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-transform: uppercase;
  filter: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06));
}

.topbar-links a,
.mobile-menu-links a {
  color: var(--text);
  text-decoration: none;
}

.topbar-links a:hover,
.mobile-menu-links a:hover {
  color: var(--secondary);
}

.topbar-actions {
  gap: 16px;
}

.topbar-button {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--brand);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
}

.topbar-button:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

.topbar-button-primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.topbar-button-primary:hover {
  background: var(--secondary);
  color: var(--brand-ink);
}

.topbar-menu-button,
.mobile-menu-close {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.topbar-menu-button svg,
.mobile-menu-close svg {
  width: 32px;
  height: 32px;
  display: block;
}

@media (min-width: 1360px) {
  .topbar-links,
  .topbar-actions {
    display: flex;
  }

  .topbar-menu-button {
    display: none;
  }
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.mobile-menu-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.75;
}

.mobile-menu-panel {
  position: relative;
  width: 80%;
  height: 100%;
  padding: 24px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  gap: 24px;
  text-align: center;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
}

.mobile-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1;
}

.site-header {
  height: auto;
  min-height: var(--header-h);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.page-title-link {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.page-tagline {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-muted);
}

.button-primary,
.button-primary-outline,
.small-button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid var(--brand);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out);
}

.button-primary,
.small-button-primary {
  background: var(--brand);
  color: var(--brand-ink);
}

.small-button-primary {
  padding: 6px 16px;
  border-width: 1px;
}

.button-primary:hover:not(:disabled),
.small-button-primary:hover:not(:disabled) {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--brand-ink);
}

.button-primary-outline {
  background: transparent;
  color: var(--brand);
}

.button-primary-outline:hover:not(:disabled) {
  border-color: var(--secondary);
  color: var(--secondary);
}

.button-primary:disabled,
.small-button-primary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .topbar {
    padding: 0 16px;
  }

  .site-header-inner {
    padding-block: 12px;
    flex-wrap: wrap;
  }

  .page-title-link {
    flex-wrap: wrap;
    row-gap: 4px;
  }
}

#map,
#markers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#map {
  touch-action: none;
  cursor: grab;
}

#map:active {
  cursor: grabbing;
}

#markers {
  pointer-events: none;
}

.map-panel {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  width: min(340px, calc(100vw - var(--sp-6)));
  max-height: calc(100% - var(--sp-6));
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
}

.map-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.map-panel__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 0;
}

#panel-toggle {
  display: none;
  height: 32px;
  padding: 0 var(--sp-3);
  font-size: 13px;
}

@media (max-width: 900px) {
  #panel-toggle {
    display: inline-flex;
  }

  .map-panel.is-collapsed {
    width: auto;
    padding: var(--sp-2) var(--sp-3);
  }

  .map-panel.is-collapsed .map-panel__body {
    display: none;
  }
}

.map-panel__seed {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-2);
}

.map-panel__seed label {
  grid-column: 1 / -1;
}

.map-panel__seed .field {
  min-width: 0;
  height: 44px;
  padding: 0 var(--sp-3);
  background: var(--bg-inset);
}

.map-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.map-panel__actions .button-primary-outline {
  flex: 1 1 auto;
  height: 36px;
  padding: 0 var(--sp-2);
  font-size: 13px;
}

#status {
  margin: 0;
  min-height: 1.5em;
}

progress {
  width: 100%;
  height: 6px;
  accent-color: var(--info);
}

.map-panel__layers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.map-panel__layers-head .button-primary-outline {
  height: 28px;
  padding: 0 var(--sp-2);
  font-size: 12px;
}

#layers {
  min-height: 0;
  margin: 0 calc(-1 * var(--sp-2));
  overflow-y: auto;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.layer-row:hover {
  background: var(--bg-elevated);
}

.layer-row--type {
  min-height: 34px;
  padding-left: var(--sp-8);
  color: var(--text-muted);
}

.layer-row .ctl-check {
  width: 20px;
  height: 20px;
}

.layer-row .ctl-check:checked::after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
}

.layer-row .ctl-check:indeterminate {
  background: var(--info);
  border-color: var(--info);
}

.layer-row .ctl-check:indeterminate::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 8px;
  height: 2px;
  background: var(--bg);
}

.layer-swatch {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
}

.layer-name {
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-weight: 600;
}

.layer-row--type .layer-name {
  font-family: var(--font-sans);
  font-weight: 400;
}

.layer-count {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.layer-expand {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out);
}

.layer-expand:hover {
  background: var(--bg-surface);
  color: var(--text);
}

.layer-expand[aria-expanded='true'] {
  transform: rotate(90deg);
}

.layer-expand:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.map-host {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 248px;
}

.map-host .host-card-body {
  padding: var(--sp-3);
}

.map-host .host-card-text {
  font-size: 12.5px;
  line-height: 1.5;
}

.map-host .host-card {
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--border);
}

.map-host .host-card-art {
  flex: none;
  width: 100%;
}

@media (max-width: 900px) {
  .map-host {
    display: none;
  }
}

#readout {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
}

#readout:empty {
  display: none;
}

.map-about {
  position: absolute;
  left: 50%;
  bottom: var(--sp-3);
  transform: translateX(-50%);
  width: 320px;
  max-height: 50vh;
  overflow-y: auto;
  padding: var(--sp-2) var(--sp-3);
  font-size: 13px;
  line-height: 1.5;
}

.map-about summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
}

.map-about h2,
.map-about h3 {
  margin: var(--sp-3) 0 var(--sp-1);
  font-size: 14px;
}

.map-about p {
  margin: 0 0 var(--sp-2);
  color: var(--text-muted);
}

.map-about a {
  color: var(--info);
}

@media (max-width: 900px) {
  .map-about {
    display: none;
  }
}

.footer-links,
.host-card-title,
.mono-label {
  font-family: var(--font-display);
}

.footer-links {
  margin-bottom: var(--footer-pad-y);
}

.ribbon {
  background: var(--secondary);
}

.bottom-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 32px 16px;
}

.ribbon h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 40px;
  color: var(--text);
}

.ribbon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button-secondary,
.button-secondary-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border: 2px solid var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.2s ease-out;
}

.button-secondary {
  background: var(--text);
  color: var(--secondary);
}

.button-secondary-outline {
  background: transparent;
  color: var(--text);
}

.button-secondary:hover {
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
}

.button-secondary-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

.org-footer {
  background: var(--bg-surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
}

.org-footer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 32px;
}

.org-footer-grid .topbar-brand {
  grid-column: 1 / -1;
  justify-self: start;
}

.org-footer h3 {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  color: var(--text);
}

.org-footer ul {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.org-footer li a {
  color: var(--text-muted);
  text-decoration: none;
}

.org-footer li a:hover,
.org-footer-discord:hover {
  color: var(--secondary);
}

.org-footer-more summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  list-style: none;
}

.org-footer-more summary::-webkit-details-marker {
  display: none;
}

.org-footer-more summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.org-footer-more[open] summary svg {
  transform: rotate(180deg);
}

.org-footer-more-open,
.org-footer-more[open] .org-footer-more-closed {
  display: none;
}

.org-footer-more[open] .org-footer-more-open {
  display: inline;
}

.org-footer-discord {
  display: inline-block;
  margin-top: 8px;
  color: var(--brand);
}

.org-footer-discord svg {
  display: block;
  width: 40px;
  height: 40px;
}

.org-footer-copy {
  margin: 48px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--text-muted);
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .bottom-inner {
    padding-inline: 24px;
  }
}

@media (min-width: 768px) {
  .org-footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .bottom-inner {
    padding: 48px 32px;
  }

  .ribbon .bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 56px;
  }

  .ribbon-actions {
    flex-shrink: 0;
    margin-top: 0;
  }
}

@media (min-width: 1280px) {
  .org-footer-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .org-footer-grid .topbar-brand {
    grid-column: auto;
    align-self: start;
  }

  .org-footer-copy {
    text-align: center;
  }
}
