/* worlds.css — the /worlds/ registry pages' own parts (served at /worlds/assets/worlds.css; built by
   site-src/worlds/build-worlds.mjs), loaded after the site's one design (/assets/design.css: the header, footer, type,
   colours, page head and form controls; WO-SCRAP-20261027-243). The registry page (main.reg): its head with the live
   readout, the map (page/map.js: the islands' labels, the hint, the empty state), the kinds as filters, search, the list
   of worlds with their live status, paging, "Your character" and the register box. A world's page: its facts, its live
   check and its Play link. */
.inner { --ok: var(--leaf); --no: #f2876f; --off: var(--dim); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.registry-body { max-width: 1100px; }
.registry-body > h2 { position: relative; margin: 52px 0 14px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 800; text-transform: uppercase; font-size: clamp(21px, 2.2vw, 28px); line-height: 1.08; }
.registry-body > h2::before { content: ""; position: absolute; left: 0; top: -1px; width: 46px; height: 3px; background: var(--sig); }
.registry-body p { color: var(--dim); max-width: 74ch; }
.registry-body .page-foot { max-width: none; }
.registry-body a, .reg-card p a { color: var(--sig); text-underline-offset: 3px; } .registry-body a:hover, .reg-card p a:hover { color: var(--cream); }
.registry-body code, .reg-cols code { font-family: var(--mono); font-size: .86em; color: var(--cream); background: rgba(111,227,255,.07); border: 1px solid rgba(111,227,255,.14); padding: 1px 5px; overflow-wrap: anywhere; }
.sub { margin: 14px 0; color: var(--dim); font-family: var(--mono); font-size: 13px; letter-spacing: .02em; overflow-wrap: anywhere; }
.sub:not(:empty)::before { content: "> "; color: var(--sig); }
.err { color: var(--no); }
.page-head .meta { margin-top: 22px; }

/* ---------- the registry page: its head, with the live readout ---------- */
.reg .page-head { padding: clamp(26px, 3vw, 40px) 0 clamp(24px, 2.6vw, 34px); }
.reg .page-head .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); gap: 14px 56px; align-items: end; }
.reg .page-head .kicker { grid-column: 1; grid-row: 1; margin: 0; align-self: center; }
.reg .page-head h1 { grid-column: 1; grid-row: 2; margin: 0; font-size: clamp(44px, 5.6vw, 92px); max-width: none; }
.reg .page-head .lede { grid-column: 2; grid-row: 2; font-size: 17px; line-height: 1.5; color: var(--dim); max-width: none; }
.reg-readout { grid-column: 2; grid-row: 1; justify-self: end; display: flex; flex-wrap: wrap; gap: 1px; margin: 0; padding: 0; width: fit-content; max-width: 100%; background: var(--line); border: 1px solid var(--line); font-family: var(--mono); }
.reg-readout div { display: flex; align-items: baseline; gap: 12px; padding: 9px 16px; background: rgba(4,7,6,.94); }
.reg-readout dt { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); }
.reg-readout dd { margin: 0; font-size: 20px; color: var(--sig); }
.reg .page-body { padding-top: clamp(18px, 1.8vw, 26px); }

/* ---------- the map ---------- */
.reg-map { position: relative; height: clamp(440px, calc(100vh - 372px), 780px); border: 1px solid var(--line); overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  background: radial-gradient(ellipse 70% 55% at 50% 100%, rgba(47,122,91,.42), transparent 70%), radial-gradient(ellipse 50% 40% at 50% 0%, rgba(111,227,255,.08), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 48px 48px, linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px, #071410; }
.reg-map:focus-visible { outline: 3px solid var(--sig); outline-offset: 3px; }
.reg-map[data-map="live"] { cursor: grab; } .reg-map.over-world { cursor: pointer; } .reg-map.dragging { cursor: grabbing; }
.reg-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.reg-map .corner { z-index: 1; } /* under the labels */
.map-still { position: absolute; left: 24px; right: 24px; top: 50%; transform: translateY(-50%); margin: 0; text-align: center; font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--dim); }
.map-still:empty { display: none; }
.map-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s; } .map-labels.on { opacity: 1; }
.map-labels a { position: absolute; left: 0; top: 0; min-height: 44px; display: inline-flex; align-items: center; gap: 0; pointer-events: auto; border: 1px solid var(--sig); background: rgba(4,7,6,.86); color: var(--cream); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 6px 10px; white-space: nowrap; text-decoration: none; transition: background .2s, color .2s; will-change: transform; }
.map-labels a.off { visibility: hidden; }
.map-labels a .n { color: var(--sig); margin-right: 6px; }
.map-labels a .dot { width: 7px; height: 7px; margin-right: 8px; background: var(--off); flex: none; }
.map-labels a[data-status="ok"] .dot { background: var(--ok); }
.map-labels a[data-status="unsupported"] .dot, .map-labels a[data-status="invalid"] .dot { background: var(--no); }
.map-labels a[data-status="offline"] { border-color: rgba(111,227,255,.4); color: var(--dim); }
.map-labels a:hover, .map-labels a.hot, .map-labels a:focus-visible { background: var(--sig); color: var(--void); z-index: 1; }
.map-labels a:hover .n, .map-labels a.hot .n, .map-labels a:focus-visible .n { color: var(--void); }
.map-labels a::after { content: ""; position: absolute; left: calc(50% + var(--lead, 0px)); top: 100%; width: 1px; height: var(--lead-h, 26px); background: var(--sig); }
.map-labels em { font-style: normal; margin-left: .2em; color: inherit; opacity: .8; }
.map-labels.many em { display: none; }
.map-hint { position: absolute; z-index: 3; left: 20px; bottom: 18px; margin: 0; display: inline-flex; align-items: center; gap: 10px; max-width: calc(100% - 40px); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sig); background: rgba(4,7,6,.82); padding: 8px 12px; pointer-events: none; }
.drag-icon { flex: none; width: 22px; height: 10px; position: relative; } .drag-icon::before, .drag-icon::after { content: ""; position: absolute; top: 1px; width: 7px; height: 7px; border: solid var(--sig); border-width: 0 0 1.5px 1.5px; } .drag-icon::before { left: 1px; transform: rotate(45deg); } .drag-icon::after { right: 1px; transform: rotate(-135deg); }
.map-page { position: absolute; z-index: 3; right: 20px; bottom: 18px; margin: 0; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--cream); background: rgba(4,7,6,.82); border: 1px solid var(--line); padding: 7px 12px; pointer-events: none; }
.map-none { position: absolute; z-index: 3; left: 50%; top: 22px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 40px); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--cream); background: rgba(4,7,6,.9); border: 1px solid var(--sig); padding: 10px 14px; text-align: center; }
/* with no world registered: the way in, over the waiting portal */
.map-empty { position: absolute; z-index: 4; left: 28px; bottom: 28px; width: min(560px, calc(100% - 56px)); padding: 26px 28px 28px; background: rgba(4,7,6,.9); border: 1px solid var(--sig); }
.map-empty::before { content: ""; position: absolute; left: -1px; top: -1px; width: 46px; height: 3px; background: var(--gold); }
.map-empty .kicker { margin-bottom: 12px; }
.map-empty-title { margin: 0 0 12px; font-weight: 800; text-transform: uppercase; font-size: clamp(28px, 3vw, 40px); line-height: .95; color: var(--cream); }
.map-empty p:not(.kicker):not(.map-empty-title) { margin: 0; color: var(--dim); max-width: 46ch; }
.map-empty .actions, .reg-card .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------- the kinds, as filters, and search ---------- */
.finder { margin: 14px 0 0; }
.kinds { margin: 0; padding: 0; border: 0; min-width: 0; }
.kinds legend { float: left; width: 100%; padding: 0; margin: 0 0 10px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--sig); }
.kind-grid { clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 176px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.kind { position: relative; display: grid; align-content: start; gap: 6px; padding: 14px 16px 16px; background: rgba(6,13,10,.96); cursor: pointer; transition: background .2s; }
.kind:hover { background: rgba(111,227,255,.06); }
.kind input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.kind:has(input:disabled) { cursor: default; } .kind:has(input:disabled):hover { background: rgba(6,13,10,.96); }
.kind:has(input:checked) { background: rgba(111,227,255,.11); box-shadow: inset 0 0 0 1px var(--sig); }
.kind:has(input:checked)::before { content: ""; position: absolute; left: 0; top: 0; width: 46px; height: 3px; background: var(--sig); }
.kind:has(input:disabled:checked) { background: rgba(6,13,10,.96); box-shadow: none; } .kind:has(input:disabled:checked)::before { content: none; }
.kind:has(input:focus-visible) { outline: 3px solid var(--sig); outline-offset: -3px; }
.k-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-family: var(--mono); }
.k-name { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--cream); }
.k-n { font-size: 18px; color: var(--sig); }
.k-line { font-size: 14px; line-height: 1.4; color: var(--dim); }
.kind.none .k-name, .kind.none .k-n { color: var(--dim); }
.finder-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.finder-row:has(.eng) { grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); }
.finder-row label { display: grid; gap: 8px; }
.finder-row label > span { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--sig); }

/* ---------- the list, "Your character" and the register box ---------- */
.reg-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "list you" "list reg" "list ." "pager ."; grid-template-rows: auto auto 1fr auto; gap: 14px 28px; align-items: start; }
.reg-cols > .worlds { grid-area: list; } .reg-cols > .pager { grid-area: pager; } .reg-cols > .you { grid-area: you; } .reg-cols > .reg-card { grid-area: reg; }
.reg-cols.empty { grid-template-columns: minmax(0, 760px); grid-template-areas: "reg"; grid-template-rows: auto; }
.reg-cols.empty > .worlds { display: none; }
.worlds { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.world { position: relative; display: grid; grid-template-columns: 168px minmax(0, 1fr) 236px; gap: 18px; padding: 14px; background: var(--panel); border: 1px solid var(--line); transition: border-color .2s; }
.world:hover, .world:focus-within { border-color: rgba(111,227,255,.45); }
.world[hidden] { display: none; }
.thumb { width: 168px; aspect-ratio: 16 / 9; height: auto; display: grid; place-items: center; overflow: hidden; background: #0b1712; border: 1px solid var(--line); color: var(--dim); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.w-main { min-width: 0; }
.w-n { margin: 0 0 4px; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--sig); }
.world .name { margin: 0; font-weight: 800; text-transform: uppercase; font-size: clamp(22px, 2vw, 27px); line-height: 1; overflow-wrap: anywhere; }
.world .name a { color: var(--cream); text-decoration: none; } .world .name a:hover { color: var(--sig); }
.meta { margin: 8px 0 0; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); overflow-wrap: anywhere; }
.why, .desc { margin: 6px 0 0; color: var(--dim); font-size: 15px; overflow-wrap: anywhere; }
.desc { color: var(--cream); line-height: 1.45; }
.w-check { min-width: 0; display: grid; align-content: start; justify-items: start; }
.w-check .why { font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; } /* the whole reason: its title, and the world's own page */
.status { margin: 10px 0 0; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--off); }
.w-check .status { margin-top: 2px; }
.status::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: currentColor; vertical-align: 1px; }
.status[data-status="ok"] { color: var(--ok); }
.status[data-status="unsupported"], .status[data-status="invalid"], .status[data-status="error"] { color: var(--no); }
a.play { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; padding: 0 20px; background: var(--sig); color: var(--void); font: 700 13px var(--mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
a.play::after { content: "\2197"; margin-left: 8px; }
a.play:hover { background: var(--cream); color: var(--void); }
a.play[hidden] { display: none; }
.pager { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
.inner .pager button.pg { min-height: 44px; padding: 0 18px; background: transparent; color: var(--sig); box-shadow: inset 0 0 0 1px var(--sig); clip-path: none; }
.inner .pager button.pg:hover { background: rgba(111,227,255,.14); }
.inner .pager button.pg:disabled { opacity: .35; cursor: default; background: transparent; }
.reg-card { position: relative; padding: 22px; background: var(--panel); border: 1px solid var(--line); }
.reg-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 46px; height: 3px; background: var(--gold); }
.reg-card h2 { margin: 0 0 8px; font-weight: 800; text-transform: uppercase; font-size: 22px; line-height: 1.05; }
.reg-card p { margin: 0; color: var(--dim); font-size: 15px; }
.reg-card .machine { margin-top: 18px; }
.reg-cols:not(.empty) .reg-card .actions .btn { flex: 1 1 100%; }

/* a world's facts */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0 0 28px; border: 1px solid var(--line); background: var(--panel); }
.facts dt, .facts dd { padding: 12px 16px; border-top: 1px solid var(--line); }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.facts dt { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sig); padding-top: 15px; }
.facts dd { margin: 0; color: var(--cream); overflow-wrap: anywhere; }
.machine { margin-top: 32px; font-family: var(--mono); font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }

/* "Your character" (your-avatar.js) */
.you { position: relative; margin: 0 0 8px; padding: 20px 22px; background: var(--panel); border: 1px solid var(--line); }
.reg-cols > .you { margin: 0; }
.you::before { content: ""; position: absolute; left: -1px; top: -1px; width: 46px; height: 3px; background: var(--sig); }
.you[hidden], .avatar-shown[hidden], .you img[hidden], .forget[hidden] { display: none; }
.inner .you h2 { margin: 0 0 6px; font-weight: 800; text-transform: uppercase; font-size: 22px; line-height: 1.1; }
.inner .you .hint { margin: 0 0 14px; color: var(--dim); font-size: 15px; }
.avatar-form label { display: block; margin-bottom: 8px; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--sig); }
.avatar-row { display: flex; flex-wrap: wrap; gap: 10px; }
.inner .avatar-row input { flex: 1 1 220px; width: auto; }
.reg-cols .avatar-row button { flex: 1 1 auto; }
.avatar-shown { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.avatar-shown img { width: 56px; height: 56px; object-fit: cover; background: #0b1712; border: 1px solid var(--line); image-rendering: pixelated; }
.inner .avatar-name { margin: 0; font-weight: 800; font-size: 19px; text-transform: uppercase; color: var(--cream); overflow-wrap: anywhere; }
.inner .you button.forget { min-height: 44px; padding: 0; background: none; color: var(--sig); clip-path: none; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; text-decoration: underline; text-underline-offset: 3px; }
.inner .you button.forget:hover { background: none; color: var(--cream); }
.you .sub { margin: 10px 0 0; }
body[data-avatar="refused"] .you .sub { color: var(--no); }

@media (max-width: 1100px) {
  .reg .page-head .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .reg .page-head .kicker { margin-bottom: 16px; }
  .reg .page-head h1 { grid-row: 2; margin-bottom: 16px; }
  .reg .page-head .lede { grid-column: 1; grid-row: 3; }
  .reg-readout { grid-column: 1; grid-row: 4; justify-self: start; margin-top: 20px; }
  .world { grid-template-columns: 168px minmax(0, 1fr); }
  .w-check { grid-column: 2; }
}
@media (max-width: 900px) {
  .reg-cols { grid-template-columns: minmax(0, 1fr); grid-template-areas: "you" "list" "pager" "reg"; grid-template-rows: none; }
  .reg-cols.empty { grid-template-areas: "reg"; }
}
@media (max-width: 700px) {
  .reg-map { height: auto; aspect-ratio: 4 / 5; max-height: 72vh; min-height: 380px; }
  .map-labels em { display: none; }
  .map-labels a { font-size: 10.5px; padding: 6px 8px; }
  .map-hint { left: 12px; bottom: 12px; font-size: 10px; max-width: calc(100% - 24px); }
  .map-page { right: 12px; top: 12px; bottom: auto; }
  .map-empty { left: 14px; right: 14px; bottom: 14px; width: auto; padding: 20px; }
  /* with no world: the scene above, the way in below it, inside the same frame */
  .reg-map.empty { height: auto; aspect-ratio: auto; max-height: none; min-height: 0; padding: 250px 14px 14px; }
  .reg-map.empty .map-empty { position: relative; left: auto; right: auto; bottom: auto; }
  .reg-readout { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .kind-grid { grid-template-columns: 1fr 1fr; }
  .finder-row:has(.eng) { grid-template-columns: minmax(0, 1fr); }
  .world { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .w-check { grid-column: 1; }
  .thumb { width: 100%; }
}
@media (max-width: 560px) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { border-top: 0; padding-top: 0; }
  .facts dt:first-of-type + dd { padding-top: 0; }
  .you, .reg-card { padding: 16px; }
  .k-line { font-size: 13px; }
  .kind { padding: 12px; }
}
/* with scripts off: the map's frame is only a note; every world is in the list */
@media (scripting: none) {
  .reg-map:not(.empty) { height: 140px; aspect-ratio: auto; min-height: 0; }
}
