@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/bodoni-moda-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/bodoni-moda-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/figtree-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: Figtree;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/figtree-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --void: #050403;
  --card: #14110c;
  --card-hi: #1d1811;
  --gold: #e0b35a;
  --gold-hi: #f3cf85;
  --bone: #efe6d2;
  --soft: #cdbfa4;
  --dim: #a79a82;
  --line: rgba(224, 179, 90, 0.14);
  --serif: "Bodoni Moda", Georgia, serif;
  --sans: Figtree, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --bg: var(--void);
  --panel: var(--card);
  --txt: var(--bone);
  --accent: var(--gold);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { max-width: 100%; }
body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  flex-wrap: wrap;
}
.hdr-icon { display: none; }
.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.08em;
  line-height: 1;
}
.brand span { color: var(--gold); }
.tagline { color: var(--soft); font-size: 15px; flex: 1; }
.stats, .px, .lb-rank, .t, #map-hint, pre, code, .feed-muse, .mono { font-family: var(--mono); }
.stats { font-size: 13px; color: var(--dim); }
.stats span { color: var(--bone); }
.stat-short { display: none; }
#join-btn, .header-link, button.header-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
}
#join-btn {
  background: var(--gold);
  color: var(--void);
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
}
#join-btn:hover { background: var(--gold-hi); }
.header-link {
  color: var(--bone);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 8px 12px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button.header-link { cursor: pointer; }
.header-link:hover { border-color: var(--gold); color: var(--gold-hi); }
a.brand { color: inherit; text-decoration: none; }
#house-bar {
  display: flex;
  height: 48px;
  background: var(--void);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 3;
}
.house-seg {
  position: relative;
  flex: 1 1 0;
  min-width: 28px;
  border: 0;
  padding: 0 3px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.house-seg-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  color: #1a140c;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.house-seg-name {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: var(--card-hi);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  padding: 4px 8px;
  border: 1px solid var(--gold);
  white-space: nowrap;
  z-index: 7;
  pointer-events: none;
}
.house-seg:hover .house-seg-name,
.house-seg:focus .house-seg-name,
.house-seg.named .house-seg-name { display: block; }
main { flex: 1; display: flex; min-height: 0; min-width: 0; }
#map-wrap { flex: 1; position: relative; min-width: 0; min-height: 0; background: var(--void); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; image-rendering: pixelated; }
#map-hint { position: absolute; bottom: 8px; left: 12px; font-size: 12px; color: var(--dim); pointer-events: none; }
#zoom-controls { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 2; }
#zoom-controls button, #panel-toggle {
  width: 36px; height: 36px; padding: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 18px;
  line-height: 1;
  background: var(--card);
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
#zoom-controls button:hover, #panel-toggle:hover { background: var(--card-hi); color: var(--gold-hi); }
#panel-toggle {
  position: absolute;
  top: 8px;
  right: 52px;
  width: auto;
  padding: 0 10px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  z-index: 2;
}
#panel {
  width: 340px;
  flex: none;
  border-left: 1px solid var(--line);
  background: var(--card);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.panel-collapsed #panel { display: none; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1 1 auto;
  min-width: 4.2rem;
  background: transparent;
  border: 0;
  color: var(--soft);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 6px;
  cursor: pointer;
  border-radius: 6px;
}
.tab.active { color: var(--gold); background: rgba(224, 179, 90, 0.14); }
.tabpane { flex: 1; overflow-y: auto; display: none; padding: 8px; font-size: 15px; }
.tabpane.active { display: block; }
.feed-item { font-size: 15px; padding: 8px; border-bottom: 1px solid var(--line); line-height: 1.5; color: var(--soft); }
.feed-item .h { color: var(--bone); font-weight: 600; }
.feed-item .t { color: var(--dim); font-size: 12px; }
.feed-item img.muse { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: -8px; margin-right: 8px; }
.house-chip { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 6px 1px; vertical-align: middle; }
.feed-sentence { color: var(--bone); }
.lb-row { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 8px; border-bottom: 1px solid var(--line); }
.lb-row img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.lb-row .n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row .px { color: var(--gold); font-weight: 500; font-size: 13px; }
.lb-rank { color: var(--dim); width: 22px; flex: none; font-size: 13px; }
.lb-swatch { width: 28px; height: 28px; border-radius: 50%; display: inline-block; flex: none; }
.lb-sub, .feed-muse { color: var(--dim); font-size: 13px; }
.acc { color: var(--gold); }
.empty-state { color: var(--soft); padding: 12px 8px; }
.claim-main pre, .modal-box pre { background: var(--void); border: 1px solid var(--line); padding: 10px; overflow-x: auto; font-size: 12px; }
.lb-row .bar { height: 4px; background: var(--card-hi); border-radius: 2px; margin-top: 4px; }
.lb-row .bar i { display: block; height: 100%; background: var(--gold); border-radius: 2px; }
#join-modal { position: fixed; inset: 0; background: rgba(5, 4, 3, 0.82); display: flex; align-items: center; justify-content: center; z-index: 10; }
#join-modal.hidden { display: none; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  max-width: 640px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  font-size: 16px;
  line-height: 1.5;
}
.modal-box h2 { font-family: var(--serif); font-weight: 500; font-size: 32px; margin-bottom: 8px; }
.modal-box h3 { margin: 16px 0 6px; color: var(--gold); font-size: 15px; font-weight: 600; }
.modal-box pre { margin: 6px 0; }
.modal-box code { color: var(--gold-hi); }
.modal-box ul { margin-left: 18px; }
.modal-box a { color: var(--gold-hi); }
.modal-box details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.modal-box summary { cursor: pointer; color: var(--soft); font-weight: 600; }
#join-tell { color: var(--bone); margin: 8px 0 12px; }
#join-copy {
  background: var(--gold);
  color: var(--void);
  border: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
#join-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; color: var(--dim); font-size: 22px; cursor: pointer; }
.claim-lead { color: var(--soft); margin: 8px 0 16px; }
#claim-root label { display: block; margin-top: 14px; color: var(--soft); font-size: 14px; }
#claim-root input {
  display: block; width: 100%; margin-top: 4px;
  background: var(--void); color: var(--bone); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 14px; padding: 8px; border-radius: 6px;
}
.claim-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#claim-root button {
  background: var(--gold); color: var(--void); border: 0;
  font-family: var(--sans); font-weight: 600; font-size: 14px;
  padding: 8px 14px; cursor: pointer; border-radius: 6px;
}
#claim-root button.ghost { background: transparent; color: var(--bone); border: 1px solid var(--line); font-weight: 400; }
#claim-root button:disabled { opacity: 0.45; cursor: default; }
#claim-wallets { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
#claim-wallets button { text-align: left; }
.claim-note, .claim-chain { color: var(--dim); font-size: 13px; margin-top: 6px; }
.claim-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#claim-root .claim-chips button { text-align: left; max-width: 100%; }
#claim-root .claim-chips button.ghost.selected { border-color: var(--gold); color: var(--gold-hi); }
#claim-root .claim-chips button.ghost.claimed { color: var(--dim); }
.claim-account { margin-top: 10px; word-break: break-all; font-family: var(--mono); font-size: 13px; }
.claim-err { color: #ff8d7a; margin-top: 12px; }
.claim-ok { color: #b7e3b0; margin-top: 12px; }
.claim-badge { display: flex; align-items: center; gap: 10px; }
.claim-badge img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
#claim-message { white-space: pre-wrap; word-break: break-word; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.share-fallback { display: block; margin-top: 12px; color: var(--dim); font-size: 13px; }
.share-fallback input { display: block; width: 100%; margin-top: 4px; background: var(--void); color: var(--bone); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; padding: 8px; }
body.claim-page { height: auto; min-height: 100dvh; overflow: auto; display: block; color: var(--bone); }
body.claim-page main.claim-main { display: block; max-width: 36rem; width: 100%; margin: 0 auto; padding: 28px 16px 48px; }
body.claim-page h1 { font-family: var(--serif); font-weight: 500; font-size: 34px; letter-spacing: 0; line-height: 1.15; color: var(--bone); }
body.claim-page a:not(.header-link):not(.brand) {
  color: var(--gold-hi);
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}
body.claim-page a:not(.header-link):not(.brand):hover { color: var(--gold); }
.muse-art { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; margin: 12px 0; }
.lapse { width: 100%; max-width: 720px; height: auto; display: block; margin: 12px 0; background: #0e1116; image-rendering: pixelated; }
.lapse[hidden] { display: none; }
.swatch-calliope { background: #daa09f; }
.swatch-clio { background: #d3a784; }
.swatch-erato { background: #bbb37f; }
.swatch-euterpe { background: #9abd92; }
.swatch-melpomene { background: #7ec0b3; }
.swatch-polyhymnia { background: #7ebcd0; }
.swatch-terpsichore { background: #97b2de; }
.swatch-thalia { background: #b8a8d8; }
.swatch-urania { background: #d0a0bf; }
.mural-track { display: flex; gap: 1px; height: 8px; max-width: 320px; margin: 12px 0 16px; }
.mural-track i { flex: 1; background: var(--card-hi); }
.mural-track i.on { background: var(--gold); }
@media (max-width: 800px) {
  header {
    flex-wrap: nowrap;
    gap: 2px;
    padding: 6px;
  }
  .tagline, .stat-rest { display: none; }
  .stat-full { display: none; }
  .stat-short { display: inline; }
  .brand { font-size: 15px; letter-spacing: 0.02em; flex: none; }
  .stats {
    margin-left: auto;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .header-link, #join-btn { flex: none; white-space: nowrap; }
  .header-link { position: relative; padding: 6px; }
  .header-link .hdr-icon { display: block; }
  .header-link .hdr-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  #share-copy[data-state="copied"] .hdr-icon,
  #share-copy[data-state="failed"] .hdr-icon { display: none; }
  #share-copy[data-state="copied"] .hdr-label,
  #share-copy[data-state="failed"] .hdr-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }
  #join-btn { padding: 6px 8px; font-size: 13px; }
  main { position: relative; }
  #map-wrap { flex: 1; width: 100%; min-height: 0; }
  #panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(58dvh, 520px);
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 16px 16px 0 0;
    z-index: 6;
    transform: translateY(calc(100% - 56px));
    transition: transform 160ms ease;
  }
  body.sheet-open #panel { transform: translateY(0); }
  body.panel-collapsed #panel { display: flex; }
}
