/* ============ EndBlue's World v20 ============ */
:root {
  --bg: #0b0716;
  --panel: rgba(18, 12, 34, .78);
  --panel-solid: #140e26;
  --line: rgba(201, 179, 255, .16);
  --line2: rgba(201, 179, 255, .34);
  --text: #f4effc;
  --muted: #bdb3d3;
  --dim: #978db0;
  --lav: #c9b3ff;
  --violet: #8f6bff;
  --pink: #ea9bff;
  --green: #6ee7a8;
  --joinme: #42caff;
  --grad: linear-gradient(120deg, #f3e9ff 0%, #c9b3ff 38%, #9d7bff 72%, #ea9bff 100%);
  --display: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;
  --body: 'Noto Sans TC', 'Space Grotesk', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 4vw, 40px);
  --r: 22px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0; color: var(--text); font-family: var(--body); font-size: 16px; line-height: 1.7;
  background: radial-gradient(ellipse at 70% 20%, #2a1650 0%, var(--bg) 60%) fixed, var(--bg);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--lav); outline-offset: 3px; border-radius: 10px; }
::selection { background: var(--violet); color: #fff; }
.spark { color: var(--lav); display: inline-block; }

/* ---------- 3D world layer ---------- */
.world { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.world-canvas, .world-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.world-fallback { position: absolute; right: 8%; top: 14%; width: min(30vw, 340px); opacity: .55; filter: drop-shadow(0 0 40px rgba(157, 123, 255, .8)); animation: float 7s ease-in-out infinite; }
html.webgl-ready .world-fallback { display: none; }
.site { position: relative; z-index: 1; }
/* backwards：動畫結束後不留 transform/filter，否則手機底部導覽列的 position:fixed 會失效 */
html.entered .site { animation: siteIn 1.1s var(--ease) backwards; }
html.intro .site { opacity: 0; pointer-events: none; visibility: hidden; }
html.intro body { overflow: hidden; }
html.intro .world { z-index: 50; pointer-events: auto; cursor: pointer; }

/* ---------- portal HUD ---------- */
.portal-hud, .portal-skip, .loading { display: none; }
html.intro .portal-hud { display: block; position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.hud-top { position: absolute; top: 20px; left: var(--gutter); right: var(--gutter); display: flex; align-items: center; justify-content: space-between; }
.hud-brand { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.03em; text-shadow: 0 0 20px rgba(143, 107, 255, .8); }
.hud-brand .spark { animation: spin 10s linear infinite; }
.hud-loc { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: rgba(11, 7, 22, .55); border: 1px solid var(--line2); font-family: var(--display); font-size: 13px; letter-spacing: .08em; color: var(--muted); backdrop-filter: blur(6px); }
.hud-loc i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.hud-prompt {
  position: absolute; left: 50%; bottom: max(8vh, 56px); translate: -50% 0; text-align: center; white-space: nowrap;
  font-size: clamp(17px, 2.2vw, 22px); font-weight: 700; text-shadow: 0 2px 20px rgba(0, 0, 0, .8);
  opacity: 0; transition: opacity .6s;
}
html.portal-ready .hud-prompt { opacity: 1; animation: bob 2.4s ease-in-out .6s infinite; }
.hud-status {
  position: absolute; left: 50%; bottom: max(8vh, 56px); translate: -50% 0; white-space: nowrap;
  padding: 8px 18px; border-radius: 99px; background: rgba(11, 7, 22, .6); border: 1px solid var(--line2);
  font-size: 14px; color: var(--muted); backdrop-filter: blur(6px); transition: opacity .4s;
}
.hud-status b { color: var(--text); font-family: var(--display); }
.hud-status .spark { animation: spin 1.6s linear infinite; }
html.portal-ready .hud-status, html.intro:not(.webgl-ready) .hud-status { opacity: 0; }
.hud-prompt .key { display: inline-block; margin-right: 10px; padding: 3px 12px; border-radius: 8px; background: var(--grad); color: #1a1030; font-size: .8em; vertical-align: 2px; }
.hud-prompt small { display: block; margin-top: 4px; font-family: var(--display); font-size: 11px; letter-spacing: .35em; color: var(--muted); font-weight: 500; }
.hud-reticle { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .75); box-shadow: 0 0 8px rgba(201, 179, 255, .9); }
html.entering .hud-prompt, html.entering .hud-top, html.entering .hud-reticle,
html.loading-on .hud-prompt, html.loading-on .hud-top, html.loading-on .hud-reticle { opacity: 0; transition: opacity .4s; }
.hud-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle, #fff 0%, #e6d8ff 30%, #8f6bff 70%, #2a1650 100%); }
html.warp-flash .hud-flash { animation: flashIn .5s ease-in both; }
html.intro .portal-skip {
  display: inline-flex; align-items: center; gap: 8px; position: fixed; right: var(--gutter); bottom: 24px; z-index: 70;
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line2); background: rgba(11, 7, 22, .6); color: var(--muted);
  font-size: 13px; backdrop-filter: blur(6px); animation: fadein .5s .4s both;
}
.portal-skip kbd { font-family: var(--display); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line2); }
.portal-skip:hover { color: var(--text); border-color: var(--lav); }
html.intro:not(.webgl-ready) .portal-hud::before {
  content: '✳'; position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 44px; color: var(--lav);
  text-shadow: 0 0 24px rgba(157, 123, 255, .9); animation: spin 2.4s linear infinite;
}
html.intro:not(.webgl-ready) .hud-prompt, html.intro:not(.webgl-ready) .hud-reticle { display: none; }

/* ---------- loading world ---------- */
html.loading-on .loading { display: grid; place-items: center; position: fixed; inset: 0; z-index: 80; animation: fadein .35s both; }
.loading-bg { position: absolute; inset: 0; background: linear-gradient(rgba(11, 7, 22, .7), rgba(11, 7, 22, .92)), url(assets/setup.jpg) center / cover; filter: blur(14px) saturate(1.2); transform: scale(1.1); }
.loading-panel { position: relative; width: min(520px, calc(100% - 32px)); padding: 34px 32px 28px; border-radius: 28px; background: rgba(18, 12, 34, .82); border: 1px solid var(--line2); box-shadow: 0 40px 120px -30px rgba(143, 107, 255, .8); text-align: center; }
.loading-kicker { margin: 0; font-family: var(--display); font-size: 12px; letter-spacing: .4em; color: var(--lav); }
.loading-title { margin: 8px 0 2px; font-family: var(--display); font-size: clamp(32px, 6vw, 46px); line-height: 1.1; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.loading-by { margin: 0 0 26px; color: var(--muted); }
.loading-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.loading-bar i { display: block; height: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; box-shadow: 0 0 16px var(--violet); }
.loading-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); }
.loading-pct { font-family: var(--display); color: var(--text); }
.loading-tip { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }

/* ---------- invite toast ---------- */
.invite {
  position: fixed; z-index: 90; right: var(--gutter); top: 86px; display: flex; align-items: center; gap: 12px;
  max-width: calc(100% - 32px); padding: 12px 14px; border-radius: 18px; cursor: pointer;
  background: rgba(20, 13, 38, .94); border: 1px solid var(--line2); box-shadow: 0 20px 60px -20px rgba(143, 107, 255, .9);
  font-size: 14px; line-height: 1.45; transform: translateX(calc(100% + 40px)); transition: transform .6s var(--ease);
}
.invite.show { transform: none; }
.invite img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--joinme); }
.invite span { color: var(--lav); font-size: 13px; }
.invite::before { content: 'INVITE'; position: absolute; top: -9px; left: 16px; padding: 0 8px; border-radius: 6px; background: var(--grad); color: #1a1030; font-family: var(--display); font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.invite-close { margin-left: 4px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted); }

/* ---------- quick menu header ---------- */
.qm {
  position: sticky; top: 12px; z-index: 30; margin: 12px auto 0; width: min(1200px, calc(100% - 2 * var(--gutter)));
  display: flex; align-items: center; gap: 16px; padding: 8px 10px 8px 20px; border-radius: 20px;
  background: rgba(16, 10, 30, .8); border: 1px solid var(--line2); box-shadow: 0 16px 50px -20px rgba(0, 0, 0, .8);
}
.qm-brand { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.03em; white-space: nowrap; }
.qm-brand .spark { animation: spin 12s linear infinite; text-shadow: 0 0 14px rgba(157, 123, 255, .9); }
.qm-tabs { display: flex; gap: 2px; margin: 0 auto; }
.qm-tabs a { display: flex; flex-direction: column; align-items: center; padding: 6px 14px; border-radius: 12px; line-height: 1.25; transition: background .2s; }
.qm-tabs b { font-size: 14px; font-weight: 700; }
.qm-tabs small { font-family: var(--display); font-size: 9.5px; letter-spacing: .16em; color: var(--dim); }
.qm-tabs a:hover { background: rgba(255, 255, 255, .06); }
.qm-tabs a.on { background: rgba(143, 107, 255, .22); box-shadow: inset 0 -2px 0 var(--lav); }
.qm-tabs a.on small { color: var(--lav); }
.qm-hud { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 12px; color: var(--muted); white-space: nowrap; }
.qm-inst { display: inline-flex; align-items: center; gap: 7px; }
.qm-inst i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.qm-clock { padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .06); color: var(--text); font-weight: 600; }

/* ---------- panels / buttons ---------- */
.panel { position: relative; background: var(--panel); border: 1px solid var(--line2); border-radius: 28px; box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9); }
@media (hover: hover) and (pointer: fine) {
  .panel, .qm { backdrop-filter: blur(14px) saturate(1.2); }
  .panel::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 50%), rgba(201, 179, 255, .1), transparent 60%); }
  .panel:hover::after { opacity: 1; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 22px; border-radius: 14px; font-weight: 700; font-size: 15px; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, background .25s; }
.btn svg { width: 22px; height: 20px; }
.btn.primary { background: var(--grad); color: #1a1030; box-shadow: 0 10px 40px -12px rgba(157, 123, 255, .9); }
.btn.primary::after { content: ''; position: absolute; inset: 0; transform: translateX(-120%); background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transition: transform .7s var(--ease); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.ghost { border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); }
.btn.ghost:hover { background: rgba(143, 107, 255, .2); }
.btn:hover { transform: translateY(-2px); }
.btn.wide { width: 100%; }
.label { margin: 0 0 10px; font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .25em; color: var(--dim); }

/* ---------- profile ---------- */
.profile-sec { width: min(1200px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: clamp(28px, 6vh, 64px) 0 0; min-height: calc(100svh - 80px); display: flex; align-items: center; }
.profile-card { width: 100%; overflow: hidden; }
.banner { position: relative; height: clamp(150px, 26vh, 260px); overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transform: scale(1.05); transition: transform 1.4s var(--ease); }
.profile-card:hover .banner img { transform: scale(1.1); }
.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(11, 7, 22, .1), rgba(18, 12, 34, .96)); }
.banner-tag { position: absolute; z-index: 1; top: 16px; right: 18px; padding: 4px 12px; border-radius: 99px; background: rgba(11, 7, 22, .6); border: 1px solid var(--line2); font-family: var(--display); font-size: 11px; letter-spacing: .2em; color: var(--lav); }
.profile-main { position: relative; display: flex; align-items: flex-end; gap: 22px; padding: 0 clamp(20px, 4vw, 40px); margin-top: -64px; flex-wrap: wrap; }
.avatar-wrap { position: relative; flex: none; }
.avatar { width: 128px; height: 128px; border-radius: 50%; border: 5px solid var(--panel-solid); outline: 3px solid var(--joinme); box-shadow: 0 0 40px rgba(66, 202, 255, .45); }
.status-dot { position: absolute; right: 8px; bottom: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--joinme); border: 4px solid var(--panel-solid); animation: ping 2.2s infinite; }
.nameplate { flex: 1; min-width: 240px; padding-bottom: 4px; }
h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(56px, 9vw, 120px); line-height: .95; letter-spacing: -.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(143, 107, 255, .4)); }
h1 .spark { -webkit-text-fill-color: var(--lav); font-size: .45em; vertical-align: .9em; margin-left: .05em; animation: spin 9s linear infinite; }
.rank-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.rank { padding: 3px 12px; border-radius: 8px; background: rgba(143, 107, 255, .25); border: 1px solid var(--violet); color: #dccfff; font-family: var(--display); font-size: 13px; font-weight: 600; }
.status-text { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.status-text i { width: 9px; height: 9px; border-radius: 50%; background: var(--joinme); box-shadow: 0 0 10px var(--joinme); }
.profile-actions { display: flex; gap: 10px; padding-bottom: 8px; }
.profile-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(20px, 3vw, 36px); padding: 28px clamp(20px, 4vw, 40px) clamp(24px, 4vw, 36px); }
.bio-text { margin: 0 0 18px; font-size: clamp(16px, 1.4vw, 18px); color: var(--muted); }
.bio-text strong { color: var(--text); font-size: 1.25em; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 13px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 13.5px; transition: background .2s, color .2s, transform .2s; }
.chips li:hover { background: var(--lav); color: #1a1030; transform: translateY(-2px); }
.biolinks { display: flex; flex-direction: column; gap: 8px; }
.biolinks a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-weight: 600; transition: background .2s, border-color .2s, transform .2s; }
.biolinks svg { width: 20px; height: 18px; color: var(--lav); }
.biolinks a span { margin-left: auto; color: var(--dim); transition: transform .25s var(--ease), color .2s; }
.biolinks a:hover { background: rgba(143, 107, 255, .18); border-color: var(--lav); transform: translateX(4px); }
.biolinks a:hover span { color: var(--lav); transform: translate(2px, -2px); }

/* ---------- sections ---------- */
.sec { width: min(1200px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding-top: clamp(90px, 12vw, 150px); }
.sec-head { margin-bottom: 28px; }
.kicker { margin: 0 0 10px; font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: .3em; color: var(--lav); display: flex; align-items: center; gap: 10px; }
.kicker::before { content: '✳'; color: var(--violet); letter-spacing: 0; }
h2 { margin: 0; font-size: clamp(36px, 5vw, 64px); font-weight: 900; line-height: 1.1; text-shadow: 0 4px 30px rgba(11, 7, 22, .9); }
h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.js .reveal { opacity: 0; transform: translateY(36px) scale(.98); }
html.js .reveal.in { opacity: 1; transform: none; transition: opacity .8s var(--ease), transform .9s var(--ease); }

/* ---------- instance ---------- */
.instance { display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch; overflow: hidden; }
/* 左欄：封面 + 在線人數 + 玩家，右欄：說明 + 按鈕；兩欄高度對齊 */
.inst-media { display: flex; flex-direction: column; gap: 14px; padding: clamp(14px, 2vw, 22px); }
.inst-info { justify-content: center; }
/* 封面維持 Steam 原本的 460×215 比例，不裁切 */
.inst-thumb { position: relative; display: block; aspect-ratio: 460 / 215; border-radius: 18px; overflow: hidden; border: 1px solid var(--line2); background: radial-gradient(circle at 50% 50%, #3a2380, #140e26 70%); }
.inst-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.instance:hover .inst-thumb img { transform: scale(1.04); }
.inst-thumb.noimg img { display: none; }
/* VRChat 圖示只在封面圖載不到時當替代 */
.inst-portal { display: none; position: absolute; z-index: 1; left: 50%; top: 50%; translate: -50% -50%; height: 80%; aspect-ratio: 1; place-items: center; }
.inst-thumb.noimg .inst-portal { display: grid; }
.inst-portal svg { width: 52%; height: 46%; color: #f1e8ff; filter: drop-shadow(0 0 18px rgba(201, 179, 255, .9)); transition: transform .5s var(--ease); }
.instance:hover .inst-portal svg { transform: scale(1.1); }
.ring { position: absolute; inset: 0; border-radius: 50%; }
.ring.r1 { border: 2px solid transparent; background: conic-gradient(from 0deg, transparent 0 55%, var(--lav) 80%, transparent) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0); animation: spin 5s linear infinite; }
.ring.r2 { inset: 12%; border: 1px dashed rgba(201, 179, 255, .5); animation: spin 20s linear infinite reverse; }
.inst-info { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 14px; }
.inst-type { display: flex; gap: 6px; }
.inst-type span { padding: 3px 11px; border-radius: 8px; font-family: var(--display); font-size: 12px; border: 1px solid var(--line); color: var(--dim); }
.inst-type .on { border-color: var(--pink); color: var(--pink); background: rgba(234, 155, 255, .1); }
.inst-info h3 { margin: 0; font-family: var(--display); font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -.02em; }
.inst-desc { margin: 0; color: var(--muted); }
.cap-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.cap-row b { color: var(--green); font-family: var(--display); }
.cap-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.cap-bar i { display: block; width: 8%; height: 100%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: capPulse 3s ease-in-out infinite; }
.inst-users { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.inst-users img { width: 32px; height: 32px; border-radius: 50%; outline: 2px solid var(--joinme); }
.inst-users span { display: flex; flex-direction: column; line-height: 1.3; font-weight: 700; font-size: 14px; }
.inst-users small { font-weight: 400; color: var(--dim); font-size: 12px; }
.fine { margin: 0; font-size: 12px; color: var(--dim); text-align: center; }
.gallery { margin-top: 40px; }
.gallery-track { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
.gallery-track figure { margin: 0; flex: 0 0 min(80vw, 380px); scroll-snap-align: start; border-radius: 18px; overflow: hidden; border: 1px solid var(--line2); background: var(--panel); }
.gallery-track img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery-track figcaption { padding: 8px 14px; font-size: 13px; color: var(--muted); }

/* ---------- world browser ---------- */
.filters { display: inline-flex; gap: 4px; padding: 5px; margin-bottom: 26px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line2); }
.filters button { border: 0; background: none; padding: 8px 18px; border-radius: 10px; font-weight: 700; color: var(--muted); transition: background .2s, color .2s; }
.filters button.on { background: var(--grad); color: #1a1030; }
.wrow { margin-bottom: 34px; }
.wrow-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wrow-head h3 { margin: 0; display: flex; align-items: baseline; gap: 12px; font-size: 19px; text-shadow: 0 2px 16px rgba(11, 7, 22, .9); }
.wrow-head h3 span { font-family: var(--display); font-size: 11px; letter-spacing: .22em; color: var(--lav); }
.wrow-head h3 em { font-style: normal; font-family: var(--display); font-size: 12px; color: var(--dim); padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); }
.wnav { display: flex; gap: 6px; }
.wnav button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); font-size: 20px; line-height: 1; transition: background .2s; }
.wnav button:hover { background: rgba(143, 107, 255, .3); }
.wtrack { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(240px, 26vw, 300px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; scrollbar-color: var(--violet) transparent; }
.wcard {
  scroll-snap-align: start; display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; position: relative;
  background: var(--panel-solid); border: 1px solid var(--line2); transition: transform .35s var(--ease), box-shadow .35s, border-color .35s;
}
.wcard:hover { transform: translateY(-6px); border-color: var(--lav); box-shadow: 0 24px 50px -20px rgba(143, 107, 255, .9); }
.wcover { position: relative; aspect-ratio: 460 / 215; overflow: hidden; background: linear-gradient(135deg, #2a1650, #120c24); }
.wcover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.wcard:hover .wcover img { transform: scale(1.07); }
.wcover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 14, 38, .85), transparent 55%); }
.wcover.fallback { display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, #6d4fd6, #2a1650 55%, #120c24); }
.fb-mark { position: absolute; right: 12px; top: 6px; font-size: 40px; color: rgba(255, 255, 255, .25); }
.fb-title { font-size: 22px; font-weight: 900; padding: 0 16px; text-align: center; text-shadow: 0 2px 20px rgba(0, 0, 0, .6); position: relative; z-index: 1; }
.winfo { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.winfo h4 { margin: 0; font-size: 16.5px; line-height: 1.4; }
.wen { margin: 0; color: var(--dim); font-size: 12.5px; }
.wnote { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.wmeta { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; }
.wtag { font-family: var(--display); font-size: 10px; letter-spacing: .14em; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--lav); }
.whot { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: rgba(234, 155, 255, .15); color: var(--pink); }
.wgo { margin-left: auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .06); transition: background .25s, color .25s, transform .3s var(--ease); }
.wcard:hover .wgo { background: var(--lav); color: #1a1030; transform: rotate(45deg); }
.wcard.main { border-color: var(--lav); box-shadow: 0 0 0 1px rgba(201, 179, 255, .3), 0 20px 60px -25px rgba(143, 107, 255, .9); }
.wcard.main h4 { font-family: var(--display); font-size: 24px; }
.wtrack:has(.main) { grid-auto-columns: clamp(300px, 46vw, 560px); }

/* ---------- inventory ---------- */
.inventory { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; align-items: stretch; }
.pedestal { overflow: hidden; min-height: 460px; }
.pedestal img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; transition: transform 1.2s var(--ease); }
.pedestal:hover img { transform: scale(1.05); }
.pedestal::before { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: linear-gradient(to top, rgba(11, 7, 22, .95), rgba(11, 7, 22, 0) 55%); }
.pedestal-cap { position: absolute; z-index: 2; left: 26px; right: 26px; bottom: 24px; }
.pedestal-cap small { font-family: var(--display); font-size: 11px; letter-spacing: .22em; color: var(--lav); }
.pedestal-cap strong { display: block; font-family: var(--display); font-size: clamp(36px, 4vw, 54px); line-height: 1.05; letter-spacing: -.03em; }
.pedestal-cap em { font-style: normal; color: var(--pink); }
.pedestal-cap span { color: var(--muted); }
.inv-panel { padding: 14px; display: flex; flex-direction: column; }
.inv-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.inv-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); line-height: 1.25; transition: background .2s, border-color .2s; }
.inv-tab b { font-size: 14px; }
.inv-tab small { font-family: var(--display); font-size: 9.5px; letter-spacing: .14em; color: var(--dim); }
.inv-tab[aria-selected="true"] { background: rgba(143, 107, 255, .24); border-color: var(--lav); }
.inv-tab[aria-selected="true"] small { color: var(--lav); }
.inv-list dl { margin: 0; }
.inv-list dl div { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 12px 10px; border-bottom: 1px solid var(--line); }
.inv-list dl div:last-child { border-bottom: 0; }
.inv-list.pop dl div { animation: slot .45s var(--ease) both; animation-delay: calc(var(--i) * .04s); }
.inv-list dt { color: var(--dim); font-size: 14px; }
.inv-list dd { margin: 0; font-size: 15px; }

/* ---------- friends ---------- */
.friends { padding: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px; }
.friends a { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); transition: background .2s, border-color .2s, transform .25s var(--ease); }
.friends a:hover { background: rgba(143, 107, 255, .16); border-color: var(--lav); transform: translateY(-3px); }
.f-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .06); border: 2px solid var(--line2); }
.f-ic svg { width: 20px; height: 20px; }
.f-ic.vrc { border-color: var(--joinme); }
.f-ic.vrc svg { width: 26px; height: 22px; }
.f-name { display: flex; flex-direction: column; line-height: 1.35; font-weight: 700; font-family: var(--display); font-size: 17px; }
.f-name small { display: inline-flex; align-items: center; gap: 6px; font-family: var(--body); font-weight: 400; font-size: 12.5px; color: var(--dim); }
.f-name i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.f-name i.on { background: var(--joinme); box-shadow: 0 0 8px var(--joinme); }
.f-btn { margin-left: auto; padding: 6px 14px; border-radius: 10px; background: rgba(255, 255, 255, .07); font-size: 13px; font-weight: 700; transition: background .2s, color .2s; }
.friends a:hover .f-btn { background: var(--grad); color: #1a1030; }

/* ---------- footer ---------- */
.footer { width: min(1200px, calc(100% - 2 * var(--gutter))); margin: 110px auto 0; padding: 26px 0 40px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; }
.footer p { margin: 0; color: var(--dim); font-size: 14px; }
.footer-actions { margin-left: auto; display: flex; gap: 10px; }
.footer-actions button, .footer-actions a { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); font-size: 13px; font-weight: 600; transition: background .2s; }
.footer-actions button:hover, .footer-actions a:hover { background: rgba(143, 107, 255, .25); }

/* ---------- keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-14px) rotate(6deg); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(66, 202, 255, .6); } 70%, 100% { box-shadow: 0 0 0 12px rgba(66, 202, 255, 0); } }
@keyframes flashIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes siteIn { from { opacity: 0; transform: scale(.97) translateY(20px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes capPulse { 50% { opacity: .55; } }
@keyframes slot { from { opacity: 0; transform: translateX(14px); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) { .qm-inst { display: none; } }
@media (max-width: 900px) {
  .qm { padding: 8px 8px 8px 16px; }
  .qm-tabs { position: fixed; left: 50%; bottom: 12px; translate: -50% 0; margin: 0; padding: 6px; border-radius: 18px; background: rgba(16, 10, 30, .94); border: 1px solid var(--line2); box-shadow: 0 10px 40px rgba(0, 0, 0, .6); width: max-content; max-width: calc(100% - 24px); }
  .qm-tabs a { padding: 6px 10px; }
  .qm-tabs b { font-size: 13px; }
  .qm-hud { margin-left: auto; }
  .profile-body, .instance, .inventory { grid-template-columns: 1fr; }
  .pedestal { min-height: 320px; }
  .footer { padding-bottom: 100px; }
  .invite { top: auto; bottom: 86px; }
}
@media (max-width: 560px) {
  .qm-tabs small { display: none; }
  .qm-tabs a { padding: 8px 9px; }
  .profile-main { margin-top: -54px; gap: 14px; }
  .avatar { width: 100px; height: 100px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; }
  .inv-tabs { grid-template-columns: repeat(2, 1fr); }
  .inv-list dl div { grid-template-columns: 1fr; gap: 0; }
  .wtrack { grid-auto-columns: 78vw; }
  .wtrack:has(.main) { grid-auto-columns: 86vw; }
  .wnav { display: none; }
  .friends { grid-template-columns: 1fr; }
  .footer-actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; }
}
