@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("/fonts/ChakraPetch-600.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("/fonts/ChakraPetch-700.woff2") format("woff2"); }
:root {
  --bg: #090b0a; --s1: #0f100d; --s2: #171914; --s3: #23271e; --line: #2b3025;
  --text: #f0f3ea; --dim: #a5ab9c; --faint: #7d8375;
  --lime: #c3ff5c; --lime-ink: #142000; --lav: #b9a7ff; --coral: #ff8a70;
  --display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --r: 12px; --top-h: 56px; --bar-h: 64px;
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); overflow: hidden;
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "main" "nav";
}
a { color: var(--lime); }
svg { width: 20px; height: 20px; flex: none; }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
img, canvas.art { image-rendering: pixelated; image-rendering: crisp-edges; }
canvas.art { image-rendering: pixelated; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .01em; margin: 0; line-height: 1.1; }

/* ---------- top bar ---------- */
.top {
  grid-area: top; display: flex; align-items: center; gap: 8px; z-index: 5;
  padding: calc(6px + var(--st)) calc(10px + var(--sr)) 6px calc(10px + var(--sl));
  min-height: calc(var(--top-h) + var(--st)); border-bottom: 1px solid #14160f; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 7px; text-decoration: none; color: var(--text); min-height: 44px; flex: none; }
.logo { width: 26px; height: 26px; }
.name { font: 700 21px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.top-title { flex: 1; min-width: 0; text-align: center; font: 600 13px/1 var(--display); color: var(--dim); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.holder-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px 0 10px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; font-weight: 650;
  transition: transform .15s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.holder-btn:active { transform: scale(.96); }
.holder-btn canvas { width: 30px; height: 30px; image-rendering: pixelated; border-radius: 999px; background: #000; box-shadow: 0 0 0 2px var(--lime); }
.holder-btn.is-holder { border-color: #4f6a1e; background: #10160a; color: var(--lime); padding-left: 5px; }

/* ---------- nav: bottom tab bar on phones ---------- */
.nav {
  grid-area: nav; display: flex; z-index: 5; background: #0b0c0a; border-top: 1px solid #1b1e17;
  padding: 4px calc(4px + var(--sr)) calc(4px + var(--sb)) calc(4px + var(--sl));
}
.nav a {
  flex: 1 1 0; min-width: 0; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); text-decoration: none; font-size: 12px; font-weight: 600; border-radius: 10px;
  transition: color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease);
}
.nav a svg { width: 22px; height: 22px; }
.nav a:active { transform: scale(.94); }
.nav a[aria-current="page"] { color: var(--lime); }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nav .wide-only { display: none; }

main { grid-area: main; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; outline: none; }
.view { padding: 14px calc(var(--pad) + var(--sr)) 28px calc(var(--pad) + var(--sl)); max-width: 1500px; margin: 0 auto; animation: in .22s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- shared pieces ---------- */
.kicker { font: 600 12px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--lime); margin: 0 0 6px; }
.kicker.lav { color: var(--lav); }
.kicker.coral { color: var(--coral); }
.h1 { font-size: 30px; }
.lede { color: var(--dim); margin: 6px 0 0; max-width: 60ch; font-size: 14px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.sec-head .meta { color: var(--dim); font-size: 12px; text-align: right; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--s1); color: var(--text); font-weight: 650; font-size: 14px; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
}
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--lime); color: var(--lime-ink); border-color: var(--lime); }
.btn.ghost { background: transparent; }
.btn.icon { width: 44px; padding: 0; }
.btn.wide { width: 100%; }
.btn svg { width: 18px; height: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); background: var(--s1); color: var(--dim); font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 700; }
.chip[aria-pressed="true"] { background: #16200a; border-color: #4f6a1e; color: var(--lime); }
.chip[aria-pressed="true"] b { color: var(--lime); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px; margin: 0 calc(-1 * var(--pad)); padding-left: var(--pad); padding-right: var(--pad); }
.chips::-webkit-scrollbar { display: none; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font: 700 12px/1.4 var(--display); letter-spacing: .04em; }
.pill.lime { background: #1b2a08; color: var(--lime); }
.pill.lav { background: #221d3a; color: var(--lav); }
.pill.coral { background: #3a1c15; color: var(--coral); }
.pill.dim { background: var(--s2); color: var(--dim); }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--lav); display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.empty {
  border: 1px dashed var(--line); border-radius: var(--r); padding: 26px 18px; text-align: center; color: var(--dim);
  display: flex; flex-direction: column; align-items: center; gap: 10px; background: linear-gradient(180deg, #0d0e0b, transparent);
}
.empty h3 { color: var(--text); font-size: 20px; }
.empty p { margin: 0; max-width: 44ch; font-size: 14px; }
.empty .glyph { width: 64px; height: 64px; color: var(--lav); }
.error { color: var(--coral); }
.skel { background: linear-gradient(90deg, var(--s1) 0%, var(--s2) 50%, var(--s1) 100%); background-size: 200% 100%; animation: sk 1.3s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- tiles ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tile {
  position: relative; display: block; text-decoration: none; color: var(--text); border-radius: 10px; overflow: hidden;
  background: var(--s1); border: 1px solid #1a1d16; transition: transform .15s var(--ease), border-color .15s var(--ease);
  content-visibility: auto; contain-intrinsic-size: 120px 140px;
}
.tile:active { transform: scale(.97); }
.tile .art { display: block; width: 100%; aspect-ratio: 1; background: #050605; object-fit: cover; }
.tile .cap { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 5px 7px; font: 600 12px/1.2 var(--display); color: var(--dim); }
.tile .cap b { color: var(--text); font-weight: 700; }
.tile .badges { position: absolute; top: 5px; left: 5px; right: 5px; display: flex; justify-content: space-between; pointer-events: none; }
.tile .mine { position: absolute; inset: 0; border: 2px solid var(--lime); border-radius: 10px; pointer-events: none; }
.tile.is-new { animation: newin .6s var(--ease); }
@keyframes newin { from { opacity: 0; transform: scale(.94); } }
.sentinel { height: 1px; }
.more-note { color: var(--faint); text-align: center; font-size: 12px; padding: 16px 0 0; }

/* ---------- lobby ---------- */
.spot { display: grid; gap: 14px; background: radial-gradient(120% 90% at 50% 0%, #141a0c 0%, var(--bg) 70%); border: 1px solid #1b1f15; border-radius: 18px; padding: 14px; }
.spot-art { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #050605; }
.spot-art canvas, .spot-art img { width: 100%; height: 100%; display: block; }
.spot-info { display: flex; flex-direction: column; gap: 8px; }
.spot-info h2 { font-size: 30px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; }
.facts .pill { font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.stat { background: var(--s1); border: 1px solid #1a1d16; border-radius: var(--r); padding: 10px 12px; }
.stat b { display: block; font: 700 22px/1.1 var(--display); }
.stat span { font-size: 12px; color: var(--dim); }
.wings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wing {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; min-height: 104px; border-radius: var(--r); text-decoration: none; color: var(--text);
  background: var(--s1); border: 1px solid #1a1d16; transition: transform .15s var(--ease), border-color .15s var(--ease);
}
.wing:active { transform: scale(.97); }
.wing svg { width: 24px; height: 24px; color: var(--lime); }
.wing.lav svg { color: var(--lav); }
.wing.coral svg { color: var(--coral); }
.wing b { font: 700 16px/1.15 var(--display); }
.wing span { font-size: 12px; color: var(--dim); }
.exhibit-card { display: grid; gap: 10px; padding: 14px; border-radius: 16px; text-decoration: none; color: var(--text); background: linear-gradient(160deg, #17132a, #0d0e0b 70%); border: 1px solid #2a2346; margin: 14px 0; }
.exhibit-card .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.exhibit-card img { width: 100%; aspect-ratio: 1; border-radius: 8px; background: #050605; display: block; }
.exhibit-card h3 { font-size: 22px; }
.exhibit-card p { margin: 0; color: var(--dim); font-size: 13px; }
.lobby-block { margin-top: 18px; }
.footer { color: var(--faint); font-size: 12px; text-align: center; padding: 26px 0 4px; }
.footer a { color: var(--dim); }

/* ---------- version strips ---------- */
.strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding: 2px 0 6px; overscroll-behavior-x: contain; }
.strip .fr { flex: none; width: 56px; display: flex; flex-direction: column; gap: 3px; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; color: var(--faint); font: 600 12px/1 var(--display); }
.strip .fr canvas { width: 56px; height: 56px; border-radius: 6px; border: 1px solid #1e221a; display: block; image-rendering: pixelated; }
.strip .fr.sel canvas { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.strip .fr.sel { color: var(--lime); }
.strip .gap { flex: none; width: 2px; align-self: stretch; background: var(--lav); border-radius: 2px; margin: 0 4px 16px; opacity: .7; }
.strip .sk { flex: none; width: 56px; height: 56px; }

/* hundred */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: grid; grid-template-columns: 34px 64px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px; border-radius: var(--r); background: var(--s1); border: 1px solid #1a1d16; content-visibility: auto; contain-intrinsic-size: 300px 150px; }
.rank .no { font: 700 20px/1 var(--display); color: var(--faint); text-align: center; }
.rank li:nth-child(-n+3) .no { color: var(--lime); }
.rank .thumb { width: 64px; height: 64px; border-radius: 8px; display: block; background: #050605; }
.rank .who { min-width: 0; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 3px; }
.rank .who b { font: 700 16px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .who span { font-size: 12px; color: var(--dim); }
.rank .strip { grid-column: 1 / -1; }

/* latest */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.work { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--s1); border: 1px solid #1a1d16; border-radius: var(--r); overflow: hidden; transition: transform .15s var(--ease); }
.work:active { transform: scale(.97); }
.work canvas, .work .ph { width: 100%; aspect-ratio: 1; display: block; background: #050605; }
.work .body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 3px; }
.work b { font: 700 15px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work span { font-size: 12px; color: var(--dim); }
.work.is-new { animation: newin .6s var(--ease); box-shadow: 0 0 0 1px var(--lime); }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.live-tag .dot { background: var(--lime); }

/* reborn chapters */
.reborn-list { display: grid; gap: 12px; }
.reborn-card { padding: 12px; border-radius: 16px; background: linear-gradient(170deg, #161228, var(--s1) 60%); border: 1px solid #2a2346; display: grid; gap: 10px; }
.reborn-card .head { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); }
.reborn-card .head img { width: 56px; height: 56px; border-radius: 8px; background: #050605; }
.reborn-card .head b { font: 700 18px/1.1 var(--display); display: block; }
.reborn-card .head span { color: var(--dim); font-size: 12px; }
.chapter { display: grid; gap: 4px; }
.chapter h4 { margin: 0; font: 700 12px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--lav); }

/* museum */
.exhibit-hero { padding: 18px 16px; border-radius: 18px; background: linear-gradient(160deg, #1a1530, #0c0d0b 75%); border: 1px solid #2a2346; margin-bottom: 14px; }
.exhibit-hero h1 { font-size: 32px; margin: 2px 0 6px; }
.exhibit-hero p { margin: 0; color: var(--dim); font-size: 14px; max-width: 62ch; }
.exhibit-hero .by { margin-top: 10px; font-size: 12px; color: var(--faint); }
.wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.piece { text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.piece .frame { padding: 8px; background: #11120e; border: 1px solid #262a20; border-radius: 6px; box-shadow: 0 10px 30px #0008; }
.piece img { width: 100%; aspect-ratio: 1; display: block; background: #050605; }
.piece .placard { font-size: 12px; color: var(--dim); }
.piece .placard b { display: block; font: 700 14px/1.2 var(--display); color: var(--text); }
.others { display: grid; gap: 8px; margin-top: 22px; }
.others button { text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: var(--r); background: var(--s1); border: 1px solid #1a1d16; cursor: pointer; }
.others button b { font: 700 15px/1.2 var(--display); display: block; }
.others button span { color: var(--dim); font-size: 12px; }
.others button[aria-pressed="true"] { border-color: #4a3f80; background: #17132a; }

/* rooms */
.room-form { display: flex; gap: 8px; margin: 12px 0 6px; }
.room-form input { flex: 1; min-width: 0; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--s1); padding: 0 16px; font-size: 16px; }
.room-head { padding: 16px; border-radius: 16px; background: linear-gradient(160deg, #10180a, var(--s1) 70%); border: 1px solid #263418; margin: 12px 0 14px; }
.room-head h2 { font-size: 24px; word-break: break-all; }
.room-head p { margin: 6px 0 0; color: var(--dim); font-size: 13px; }
.room-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* lounge */
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.agent { display: flex; flex-direction: column; text-decoration: none; color: var(--text); border-radius: var(--r); overflow: hidden; background: var(--s1); border: 1px solid #2a2346; }
.agent img { width: 100%; aspect-ratio: 1; display: block; background: #050605; }
.agent .body { padding: 8px 10px 10px; display: grid; gap: 4px; }
.agent b { font: 700 15px/1.15 var(--display); }
.agent span { font-size: 12px; color: var(--dim); }

/* ---------- biography: full sheet on phones ---------- */
.bio-wrap { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.bio-scrim { position: absolute; inset: 0; background: #000a; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.bio {
  position: relative; width: 100%; height: 100%; background: var(--bg); display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  animation: up .24s var(--ease); outline: none;
}
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.bio-head { display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--st)) calc(8px + var(--sr)) 6px calc(8px + var(--sl)); border-bottom: 1px solid #14160f; }
.bio-head h2 { flex: 1; min-width: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.bio-body { overflow-y: auto; overscroll-behavior: contain; padding: 12px calc(var(--pad) + var(--sr)) 20px calc(var(--pad) + var(--sl)); }
.bio-foot { display: flex; gap: 8px; padding: 8px calc(var(--pad) + var(--sr)) calc(8px + var(--sb)) calc(var(--pad) + var(--sl)); border-top: 1px solid #14160f; background: #0b0c0a; }
.bio-foot .btn { flex: 1; }
.bio-foot .btn.primary { flex: 1.4; }
.stage { position: relative; width: 100%; max-width: 440px; margin: 0 auto; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #050605; }
.stage canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; transition: opacity .18s var(--ease); }
.stage .ver { position: absolute; left: 8px; bottom: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.stage-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 10px 0 2px; }
.stage-nav .label { min-width: 0; flex: 1; text-align: center; font-size: 12px; color: var(--dim); }
.stage-nav .label b { display: block; color: var(--text); font: 700 14px/1.2 var(--display); }
.bio-sec { margin-top: 18px; }
.bio-sec h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kv div { background: var(--s1); border: 1px solid #1a1d16; border-radius: 10px; padding: 8px 10px; min-width: 0; }
.kv b { display: block; font: 700 17px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv span { font-size: 12px; color: var(--dim); }
.kv .kvlink { display: block; background: var(--s1); border: 1px solid #263418; border-radius: 10px; padding: 8px 10px; min-width: 0; color: var(--text); text-decoration: none; }
.traits { display: flex; flex-wrap: wrap; gap: 6px; }
.traits span { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--s2); color: var(--dim); }
.traits span b { color: var(--text); font-weight: 650; }
.note { color: var(--faint); font-size: 12px; margin: 6px 0 0; }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.log a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; font-size: 13px; padding: 6px 10px; border-radius: 10px; background: var(--s1); color: var(--dim); text-decoration: none; }
.log a b { color: var(--text); }

/* ---------- dialog, toast ---------- */
.dlg {
  width: min(440px, calc(100vw - 24px)); max-height: min(560px, calc(100dvh - 24px)); overflow: auto; padding: 16px; border-radius: 16px;
  background: var(--s1); color: var(--text); border: 1px solid var(--line);
}
.dlg::backdrop { background: #000b; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { font-size: 20px; }
.dlg-note { color: var(--dim); font-size: 13px; margin: 6px 0 12px; }
.dlg-status { color: var(--dim); font-size: 13px; min-height: 1.4em; margin: 10px 0 4px; }
.wallets { display: grid; gap: 8px; }
.wbtn { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border-radius: 12px; background: var(--s2); border: 1px solid var(--line); cursor: pointer; text-align: left; }
.wbtn .wico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--s3); flex: none; }
.wbtn .wname { flex: 1; font-weight: 650; }
.wbtn .wsub { font-size: 12px; color: var(--dim); }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 16px + var(--sb)); transform: translateX(-50%); z-index: 80; max-width: calc(100vw - 32px);
  background: #10160a; color: var(--lime); border: 1px solid #4f6a1e; border-radius: 999px; padding: 10px 16px; font-size: 13px; font-weight: 650;
  animation: toast .22s var(--ease); text-align: center;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }
.noscript { padding: 24px; }

/* ---------- 380+ ---------- */
@media (min-width: 380px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
/* ---------- phone landscape and short screens: slimmer chrome ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --top-h: 46px; }
  .nav a { min-height: 44px; flex-direction: row; gap: 6px; }
  .spot { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); align-items: center; }
  .stage { max-width: 260px; }
  .works { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wall { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .toast { bottom: calc(56px + var(--sb)); }
}

/* ---------- tablet and desktop: a side rail, the biography as a drawer ---------- */
@media (min-width: 768px) {
  :root { --pad: 22px; }
  body { grid-template-columns: 216px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "top top" "nav main"; }
  .nav { flex-direction: column; gap: 2px; border-top: 0; border-right: 1px solid #1b1e17; padding: 12px 10px calc(12px + var(--sb)) calc(10px + var(--sl)); overflow-y: auto; }
  .nav .wide-only { display: flex; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; font-size: 14px; color: var(--dim); }
  .nav a:hover { background: var(--s1); color: var(--text); }
  .nav a[aria-current="page"] { background: #131b09; color: var(--lime); }
  .nav p.keys { display: block; margin: auto 6px 6px; padding-top: 14px; font-size: 12px; color: var(--faint); line-height: 1.5; }
  .nav p.sig { display: block; margin: 0 6px; font-size: 12px; color: var(--faint); }
  .top-title { text-align: left; padding-left: 70px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
  .spot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; padding: 20px; gap: 24px; }
  .spot-info h2 { font-size: 40px; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .works { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .wall { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }
  .rank li { grid-template-columns: 44px 80px minmax(0, 220px) minmax(0, 1fr); }
  .rank .thumb { width: 80px; height: 80px; }
  .rank .strip { grid-column: auto; }
  .h1 { font-size: 38px; }
  .bio-wrap { justify-content: flex-end; }
  .bio { width: min(560px, 58vw); border-left: 1px solid var(--line); animation: side .24s var(--ease); }
  @keyframes side { from { transform: translateX(28px); opacity: 0; } }
  .toast { bottom: 24px; }
  .exhibit-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; }
}
@media (min-width: 1280px) {
  body { grid-template-columns: 240px minmax(0, 1fr); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .agents { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
@media (hover: hover) {
  .tile:hover, .work:hover, .wing:hover, .agent:hover { border-color: #3d4a2a; }
  .btn:hover { border-color: #4a5240; }
  .btn.primary:hover { filter: brightness(1.05); }
}
@media (display-mode: standalone) {
  .top { padding-top: calc(8px + var(--st)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .view, .bio, .toast, .tile.is-new, .work.is-new { animation: fade .2s linear !important; }
}
