/* Mono — Liquid Glass: grayscale UI + one accent colour (games and avatar items are full colour).
   Palette lives in these variables — swap --accent* to re-theme the whole site. */
:root {
  --accent: #4c8dff;          /* soft electric blue */
  --accent-hi: #74a6ff;
  --accent-lo: #3a78ea;
  --accent-ink: #ffffff;      /* text/icons on an accent fill */
  --accent-text: #8db6ff;     /* accent used as text on dark glass (AA on #070707) */
  --accent-soft: rgba(76, 141, 255, 0.16);
  --accent-ring: rgba(76, 141, 255, 0.6);
  --accent-glow: rgba(76, 141, 255, 0.35);
  --accent-grad: linear-gradient(180deg, var(--accent-hi), var(--accent-lo));
  --online: var(--accent);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', Inter, 'Helvetica Neue', Arial, sans-serif;
  --bg: #070707;
  --fg: #f5f5f7;
  --fg-2: rgba(245, 245, 247, 0.68);
  --fg-3: rgba(245, 245, 247, 0.45);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(28, 28, 30, 0.42);
  --stroke: rgba(255, 255, 255, 0.16);
  --stroke-hi: rgba(255, 255, 255, 0.55);
  --blur: 18px; /* was 28px — big blur radii are the most expensive part of backdrop-filter */
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  min-height: 100vh;
}
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
em { font-style: normal; }
::selection { background: #fff; color: #000; }

/* ---------- Animated background ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(1200px 800px at 50% -10%, #1d1d1f 0%, #070707 60%);
}
.backdrop { contain: strict; }
/* No filter: blur() — the radial gradients already fade to transparent, so the blobs stay soft without a full-screen blur pass. */
.blob { position: absolute; border-radius: 50%; opacity: .9; will-change: transform; }
.b1 { width: 46vw; height: 46vw; left: -8vw; top: -6vw; background: radial-gradient(circle, rgba(232,232,232,.9) 0%, rgba(138,138,138,.45) 38%, transparent 68%); animation: float1 40s ease-in-out infinite alternate; opacity: .5; }
.b2 { width: 38vw; height: 38vw; right: -6vw; top: 18vh; background: radial-gradient(circle, rgba(189,189,189,.85) 0%, rgba(74,74,74,.5) 42%, transparent 70%); animation: float2 48s ease-in-out infinite alternate; opacity: .55; }
.b3 { width: 52vw; height: 52vw; left: 20vw; top: 60vh; background: radial-gradient(circle, rgba(154,154,154,.8) 0%, rgba(46,46,46,.5) 45%, transparent 70%); animation: float3 56s ease-in-out infinite alternate; }
@keyframes float1 { to { transform: translate(22vw, 30vh) scale(1.15); } }
@keyframes float2 { to { transform: translate(-28vw, 32vh) scale(.85); } }
@keyframes float3 { to { transform: translate(-18vw, -42vh) scale(1.1); } }
.grain {
  position: absolute; inset: -50%; opacity: .06; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* pause decorative motion while the mini-game runs (saves GPU for the canvas) */
body.gaming .blob, body.gaming .orb, body.gaming .orb-art, body.gaming .float-chip, body.gaming .dot.live { animation-play-state: paused; }
/* while the full-screen game runs, nothing behind it needs painting */
body.gaming .backdrop, body.gaming main, body.gaming .nav-wrap, body.gaming .footer, body.gaming .tabbar { visibility: hidden; }
body.gaming .game-layer .dot.live { animation-play-state: running; }

/* ---------- Liquid Glass primitive ---------- */
.glass {
  position: relative;
  background:
    linear-gradient(135deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.04) 40%, rgba(255,255,255,.02) 60%, rgba(255,255,255,.08) 100%),
    var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%) brightness(1.05);
  backdrop-filter: blur(var(--blur)) saturate(160%) brightness(1.05);
  border: 1px solid var(--stroke);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.35),
    inset 0 -1px 0 rgba(255,255,255,.06),
    inset 0 0 24px rgba(255,255,255,.04),
    0 10px 40px rgba(0,0,0,.45),
    0 2px 6px rgba(0,0,0,.25);
  isolation: isolate;
}
/* refraction-like specular rim: gradient border via mask */
.glass::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255,255,255,.75), rgba(255,255,255,.08) 28%, rgba(255,255,255,0) 50%, rgba(255,255,255,.12) 72%, rgba(255,255,255,.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  z-index: 1;
}
/* soft top sheen */
.glass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 60% at 20% 0%, rgba(255,255,255,.14), transparent 55%);
  z-index: -1;
}
.glass-strong { background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.03) 50%, rgba(255,255,255,.07)), var(--glass-strong); --blur: 24px; }
.glass-inset {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35), inset 0 -1px 0 rgba(255,255,255,.06);
}

/* ---------- Nav ---------- */
.nav-wrap { position: fixed; top: 16px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.nav {
  pointer-events: auto; width: min(1180px, 100%); height: 60px; border-radius: 999px;
  display: flex; align-items: center; gap: 20px; padding: 0 10px 0 20px;
  animation: drop .8s var(--ease) both;
}
@keyframes drop { from { transform: translateY(-20px); opacity: 0; } }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
/* Mono logo: the rounded Shard (logo.svg). The glyph is a mask, so its colour follows --logo (foreground on dark/light). */
.brand-mark {
  --logo: linear-gradient(160deg, #ffffff 30%, #c9cbd2);
  width: 26px; height: 26px; display: inline-block; position: relative; flex: none;
  background: var(--logo);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3Cmask id='bm' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='32'%3E%3Crect width='32' height='32' fill='%23fff'/%3E%3Cpath d='M8.4 12.6h15.2M12.6 12.6l1.3-5.6M19.4 12.6l-1.3-5.6' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3C/defs%3E%3Cg fill='%23000' stroke='%23000' mask='url(%23bm)'%3E%3Cpath d='M11 5.4h10l5.1 7.1L16 26.6 5.9 12.5z' stroke-width='3.6' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cdefs%3E%3Cmask id='bm' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='32'%3E%3Crect width='32' height='32' fill='%23fff'/%3E%3Cpath d='M8.4 12.6h15.2M12.6 12.6l1.3-5.6M19.4 12.6l-1.3-5.6' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/mask%3E%3C/defs%3E%3Cg fill='%23000' stroke='%23000' mask='url(%23bm)'%3E%3Cpath d='M11 5.4h10l5.1 7.1L16 26.6 5.9 12.5z' stroke-width='3.6' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: block; padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--fg-2); transition: background .25s var(--ease), color .25s; }
.nav-links a:hover, .nav-links a.active { color: var(--fg); background: rgba(255,255,255,.1); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; color: var(--fg-3); transition: box-shadow .25s; }
.search:focus-within { box-shadow: inset 0 1px 2px rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.18); }
.search input { background: none; border: 0; outline: 0; color: var(--fg); font: inherit; font-size: 14px; width: 170px; }
.search input::placeholder { color: var(--fg-3); }
.search input::-webkit-search-cancel-button { filter: invert(1) grayscale(1); }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); padding: 3px; cursor: pointer; transition: transform .3s var(--spring); }
.avatar-btn:hover { transform: scale(1.08); }
.avatar-mini { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #f2f2f2 0 22%, transparent 23%), radial-gradient(ellipse at 50% 100%, #bdbdbd 0 45%, transparent 46%), linear-gradient(#3a3a3a, #111); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; border: 0; cursor: pointer; letter-spacing: -.01em;
  transition: transform .35s var(--spring), box-shadow .3s var(--ease), background .3s;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: linear-gradient(180deg, #ffffff, #dcdcdc); color: #0a0a0a; box-shadow: inset 0 1px 0 #fff, inset 0 -2px 4px rgba(0,0,0,.12), 0 8px 24px rgba(255,255,255,.15), 0 2px 6px rgba(0,0,0,.4); }
.btn-primary:hover { transform: translateY(-1px) scale(1.02); box-shadow: inset 0 1px 0 #fff, 0 12px 34px rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.4); }
.btn-glass { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); color: var(--fg); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.btn-glass:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.btn-glass:disabled { opacity: .55; cursor: default; transform: none; }
.btn-lg { height: 54px; padding: 0 34px; font-size: 17px; flex: 1; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); cursor: pointer; transition: transform .3s var(--spring), background .2s; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.icon-btn:hover { background: rgba(255,255,255,.2); transform: scale(1.08); }
.icon-btn.lg { width: 54px; height: 54px; flex: none; }
.icon-btn.on { background: #fff; color: #000; }
.icon-btn.on path { fill: currentColor; }

/* ---------- Hero ---------- */
main { width: min(1180px, 100% - 32px); margin: 0 auto; }
.hero { padding: 120px 0 40px; display: grid; grid-template-columns: 1.25fr .75fr; gap: 32px; align-items: center; min-height: 640px; }
.hero-card { border-radius: var(--r-xl); padding: 48px; animation: rise .9s var(--ease) .1s both; }
@keyframes rise { from { transform: translateY(24px) scale(.98); opacity: 0; } }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--fg-2); }
.demo-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.12); color: var(--fg-2); font-weight: 600; vertical-align: middle; }
.hero h1 { font-size: clamp(40px, 5vw, 64px); line-height: 1.04; letter-spacing: -.045em; margin: 22px 0 18px; font-weight: 700; }
.hero h1 span { display: block; -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .04em; }
.hero h1 .lite { background-image: linear-gradient(180deg, #ffffff 35%, #b4b4b4); }
.hero h1 .dim { background-image: linear-gradient(180deg, #9a9a9a, #555); }
.lede { font-size: 18px; line-height: 1.5; color: var(--fg-2); max-width: 520px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; margin: 36px 0 0; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.1); }
.hero-stats dt { font-size: 12px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; }
.hero-stats dd { margin: 4px 0 0; font-size: 28px; font-weight: 650; letter-spacing: -.03em; }
.demo-note { font-size: 11px; color: var(--fg-3); margin: 10px 0 0; }

.hero-visual { position: relative; height: 480px; animation: rise 1s var(--ease) .25s backwards; transition: transform .6s var(--ease); }
.orb { position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: min(100%, 390px); aspect-ratio: 1; border-radius: 44% 56% 52% 48% / 50% 44% 56% 50%; overflow: hidden; animation: morph 16s ease-in-out infinite alternate; background: linear-gradient(140deg, rgba(255,255,255,.22), rgba(255,255,255,.04) 45%, rgba(255,255,255,.12)); border: 1px solid rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 30px 80px rgba(0,0,0,.55); }
.orb-art { position: absolute; inset: 14px; border-radius: inherit; overflow: hidden;
  background: radial-gradient(circle at 70% 26%, #fff 0 7%, transparent 8%), linear-gradient(180deg, transparent 64%, #0b0b0b 64%), repeating-linear-gradient(90deg, transparent 0 30px, rgba(255,255,255,.05) 30px 31px), linear-gradient(170deg, #b5b5b5, #2b2b2b 72%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.6);
}
.orb-art { animation: drift 16s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1); } to { transform: scale(1.08) translate(-2%, 1%); } }
@keyframes morph { to { border-radius: 56% 44% 46% 54% / 44% 58% 42% 56%; transform: rotate(4deg); } }
.float-chip { position: absolute; background: rgba(30,30,32,.82); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 30px rgba(0,0,0,.45); padding: 10px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.float-chip em { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .06em; }
.c1 { left: -10px; bottom: 70px; animation: bob 6s ease-in-out infinite; }
.c2 { right: -6px; top: 40px; animation: bob 7s ease-in-out -2s infinite; }
@keyframes bob { 50% { transform: translateY(-12px); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; display: inline-block; }
.dot.live { box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

/* ---------- Discover ---------- */
.section { padding: 48px 0; scroll-margin-top: 80px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.section h2 { font-size: 40px; letter-spacing: -.035em; margin: 0; font-weight: 700; }
.sub { color: var(--fg-2); margin: 6px 0 0; font-size: 16px; }
.segmented { display: flex; padding: 4px; border-radius: 999px; gap: 2px; position: relative; }
.seg { position: relative; z-index: 2; border: 0; background: none; padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--fg-2); cursor: pointer; transition: color .3s; }
.seg.active { color: #0a0a0a; font-weight: 600; }
.seg-indicator { position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: linear-gradient(180deg, #fff, #dedede); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(0,0,0,.35); transition: transform .5s var(--spring), width .5s var(--spring); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card.glass, .earn-row.glass, .feature.glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.03) 50%, rgba(255,255,255,.06)), rgba(22,22,24,.72); }
.card {
  border-radius: var(--r-lg); padding: 10px; cursor: pointer; text-align: left; border: 1px solid var(--stroke);
  transition: transform .5s var(--spring), box-shadow .4s var(--ease);
  animation: rise .7s var(--ease) both; animation-delay: calc(var(--i) * 50ms);
}
.card:hover { transform: translateY(-6px) scale(1.015); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 24px 60px rgba(0,0,0,.55); }
.card:focus-visible { outline: 3px solid rgba(255,255,255,.6); outline-offset: 3px; }
.card-art { position: relative; aspect-ratio: 4/3; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.card-art .art { position: absolute; inset: 0; transition: transform .8s var(--ease); }
.card:hover .card-art .art { transform: scale(1.06); }
.card-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 35%, rgba(0,0,0,.35)); pointer-events: none; }
.badge { position: absolute; z-index: 2; top: 10px; left: 10px; font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 999px; }
.badge.playable { background: #fff; color: #000; border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.badge.playable::before, .badge.playable::after { display: none; }
.card-body { padding: 12px 6px 6px; }
.card-title { font-size: 16px; font-weight: 650; margin: 0; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; color: var(--fg-3); gap: 8px; }
.card-meta .players { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.card-meta .players em { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.1); color: var(--fg-3); }
.card-meta .dot { width: 6px; height: 6px; }
.empty { text-align: center; color: var(--fg-3); padding: 40px; }

.create { border-radius: var(--r-xl); padding: 40px 48px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.create h2 { font-size: 32px; }

/* ---------- Footer ---------- */
.footer { width: min(1180px, 100% - 32px); margin: 40px auto 24px; }
.footer-inner { border-radius: var(--r-lg); padding: 24px 28px; display: grid; grid-template-columns: auto 1fr; gap: 12px 28px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; }
.footer-brand .brand-mark { width: 22px; height: 22px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; color: var(--fg-2); }
.footer-links a:hover { color: var(--fg); }
.fine { grid-column: 1 / -1; margin: 0; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: var(--fg-3); }

/* ---------- Overlays / modal ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.overlay[hidden] { display: none; }
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .35s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(880px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--r-xl); display: grid; grid-template-columns: 1fr 1fr; animation: pop .55s var(--spring) both; }
@keyframes pop { from { transform: translateY(20px) scale(.94); opacity: 0; } }
.modal .close { position: absolute; top: 16px; right: 16px; z-index: 5; }
.modal-art { margin: 12px; border-radius: 22px; min-height: 380px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), inset 0 0 80px rgba(0,0,0,.5); }
.modal-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.15), transparent 40%); }
.modal-body { padding: 36px 32px 28px 20px; display: flex; flex-direction: column; }
.modal-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); color: var(--fg-2); }
.tag.solid { background: #fff; color: #000; border-color: #fff; }
.modal h3 { font-size: 34px; letter-spacing: -.035em; margin: 14px 0 4px; line-height: 1.1; padding-right: 30px; }
.by { margin: 0; color: var(--fg-3); font-size: 14px; }
.desc { color: var(--fg-2); line-height: 1.55; font-size: 15px; margin: 16px 0 20px; }
.modal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.modal-stats > div { padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.modal-stats span { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.modal-stats small { font-size: 11px; color: var(--fg-3); }
.modal-stats small em { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.modal-actions { display: flex; gap: 10px; margin-top: auto; }
.hint { font-size: 12px; color: var(--fg-3); margin: 12px 0 0; min-height: 1em; }

/* ---------- Shards ---------- */
.shard-ic { width: 18px; height: 18px; flex: none; filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.shard-ic.sm { width: 14px; height: 14px; }
.shard-ic.md { width: 24px; height: 24px; }
.shard-ic.lg { width: 30px; height: 30px; }
.shard-ic.xl { width: 52px; height: 52px; filter: drop-shadow(0 6px 18px rgba(255,255,255,.25)); animation: bob 5s ease-in-out infinite; }
.inline-shard { display: inline-flex; align-items: center; gap: 3px; color: var(--fg); font-weight: 600; vertical-align: -2px; }
.shards-pill { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 6px 0 12px; border-radius: 999px; cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums; transition: transform .35s var(--spring), background .2s; }
.shards-pill:hover { background: rgba(255,255,255,.12); }
.shards-pill .plus { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; font-weight: 700; font-size: 16px; line-height: 1; }
.shards-pill { max-width: 44vw; }
.shards-pill #shardBal { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shards-pill.bump { animation: bump .5s var(--spring); }
@keyframes bump { 40% { transform: scale(1.12); } }

.shards-modal { position: relative; width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: var(--r-xl); padding: 28px; animation: pop .55s var(--spring) both; }
.shards-modal .close { position: absolute; top: 16px; right: 16px; z-index: 5; }
.s-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.s-head h3 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.s-head .sub b { color: var(--fg); font-variant-numeric: tabular-nums; }
.bundles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bundle { border-radius: 22px; padding: 18px 10px 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--fg); animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 60ms); transition: transform .4s var(--spring); }
.bundle:hover { transform: translateY(-4px); }
.b-gems { position: relative; height: 44px; display: flex; align-items: flex-end; justify-content: center; margin-bottom: 6px; }
.b-gems .b2 { margin-left: -8px; transform: rotate(14deg); }
.b-gems .b3 { margin-left: -4px; transform: rotate(-10deg); }
.b-amt { font-size: 22px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.b-name { font-size: 13px; color: var(--fg-2); }
.b-price { margin-top: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 5px 10px; border-radius: 999px; background: #fff; color: #000; }
.b-bonus { position: absolute; top: 8px; right: 8px; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.14); color: var(--fg-2); z-index: 2; }
.fine-note { margin: 18px 0 0; font-size: 12px; line-height: 1.5; color: var(--fg-3); }
.fine-note b { color: var(--fg-2); }

.toast.clickable { pointer-events: auto; }
.toast a.u, a.u { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.5); font-weight: 650; }
.toast { position: fixed; z-index: 200; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(30px); opacity: 0; padding: 12px 20px; border-radius: 999px; display: flex; align-items: center; gap: 8px; font-size: 14px; pointer-events: none; transition: transform .5s var(--spring), opacity .3s var(--ease); white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


/* ---------- Account chip (nav) ---------- */
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 3px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--fg); transition: transform .3s var(--spring), background .2s; max-width: 200px; }
.user-chip:hover { background: rgba(255,255,255,.12); transform: scale(1.03); }
.user-chip .avatar-mini { width: 32px; height: 32px; flex: none; border: 1px solid rgba(255,255,255,.25); }
.nav-user { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-mini.lg { width: 52px; height: 52px; flex: none; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.avatar-mini.sm { width: 30px; height: 30px; flex: none; border: 1px solid rgba(255,255,255,.18); }
.brand-mark.lg { width: 52px; height: 52px; flex: none; }

/* ---------- Auth + username modals ---------- */
/* ---------- Full-screen auth gate ---------- */
/* Nothing of the site renders until a signed-in user with a profile exists (body.authed). */
body.gated .nav-wrap, body.gated main, body.gated .footer, body.gated .tabbar, body.gated .overlay, body.gated .game-layer { display: none !important; }
body.gated { overflow: hidden; }
.gate { position: fixed; inset: 0; z-index: 150; overflow-y: auto; overscroll-behavior: contain; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.gate-loading { display: inline-flex; align-items: center; gap: 14px; padding: 14px 22px 14px 14px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--fg-2); animation: fade .4s var(--ease) both; }
.brand-mark.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.9); opacity: .65; } }
.gate-page { width: min(1080px, 100%); display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 56px; align-items: center; }
.gate-page.single { grid-template-columns: minmax(0, 460px); justify-content: center; }
.gate-brand { animation: rise .9s var(--ease) both; }
.gate-logo { font-size: 26px; gap: 12px; }
.gate-logo.small { font-size: 18px; gap: 10px; margin-bottom: 18px; }
.gate-brand h1 { font-size: clamp(40px, 5.2vw, 68px); line-height: 1.03; letter-spacing: -.045em; margin: 34px 0 18px; font-weight: 700; }
.gate-brand h1 span { display: block; -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .04em; }
.gate-brand h1 .lite { background-image: linear-gradient(180deg, #ffffff 35%, #b4b4b4); }
.gate-brand h1 .dim { background-image: linear-gradient(180deg, #9a9a9a, #555); }
.gate-chips { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gate-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg-2); }
.auth-card { position: relative; width: 100%; border-radius: var(--r-xl); padding: 30px; animation: pop .6s var(--spring) .05s both; }
.a-head h2 { margin: 0; font-size: 28px; letter-spacing: -.03em; }
.a-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.a-head h3 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.a-head .sub { font-size: 14px; line-height: 1.4; }
.auth-seg { margin-bottom: 18px; }
.auth-seg .seg { flex: 1; }
.btn-block { width: 100%; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--fg-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.12); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fg-2); font-weight: 600; }
.field em { font-weight: 500; color: var(--fg-3); }
.field input, .dn-form input { height: 46px; border-radius: 14px; padding: 0 14px; font: inherit; font-size: 15px; font-weight: 500; color: var(--fg); outline: 0; transition: box-shadow .25s, border-color .25s; width: 100%; }
.field input::placeholder, .dn-form input::placeholder { color: var(--fg-3); }
.field input:focus, .dn-form input:focus, .input-at:focus-within { border-color: rgba(255,255,255,.4); box-shadow: inset 0 1px 2px rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.14); }
.input-at { display: flex; align-items: center; height: 46px; border-radius: 14px; padding-left: 14px; transition: box-shadow .25s, border-color .25s; }
.input-at i { font-style: normal; color: var(--fg-3); font-size: 15px; }
.input-at input { border: 0 !important; background: none !important; box-shadow: none !important; padding-left: 4px; height: 100%; }
.field-hint { font-weight: 500; font-size: 12px; color: var(--fg-3); min-height: 1.2em; }
.field-hint.good { color: #fff; }
.field-hint.good::before { content: "✓ "; }
.field-hint.bad { color: #bdbdbd; }
.field-hint.bad::before { content: "✕ "; }
.form-msg { margin: 0; font-size: 13px; line-height: 1.45; color: var(--fg-2); min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.err { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); color: #e6e6e6; }
.form-msg.err::before { content: "! "; font-weight: 800; }
.form-msg.ok { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.btn.loading { opacity: .75; cursor: progress; }
.btn:disabled { cursor: default; }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 22px; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--fg-2); font-size: 13px; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(255,255,255,.25); text-underline-offset: 3px; }
.link-btn:hover { color: var(--fg); text-decoration-color: rgba(255,255,255,.7); }
.link-btn.strong { color: var(--fg); font-weight: 650; font-size: 15px; }
.muted { color: var(--fg-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fine-note.center { text-align: center; }

/* ---------- Discover: coming soon ---------- */
.card.soon { grid-column: span 3; cursor: default; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 24px; padding: 24px 28px; border-style: dashed; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.025); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.card.soon:hover { transform: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.soon-art { display: flex; gap: 10px; }
.soon-art span { width: 64px; aspect-ratio: 3/4; border-radius: 14px; border: 1px dashed rgba(255,255,255,.22); background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.01)); animation: bob 6s ease-in-out infinite; }
.soon-art span:nth-child(2) { animation-delay: -2s; opacity: .7; }
.soon-art span:nth-child(3) { animation-delay: -4s; opacity: .45; }
.soon-body h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.soon-body p { margin: 0; color: var(--fg-2); font-size: 14px; line-height: 1.5; max-width: 520px; }

/* ---------- Get Shards: ways to earn ---------- */
.earn { display: grid; gap: 10px; }
.earn-row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 22px; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.earn-row .b-gems { margin: 0; height: 40px; }
.e-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.e-text b { font-size: 18px; letter-spacing: -.02em; }
.e-text span { font-size: 13px; color: var(--fg-2); line-height: 1.4; }
.e-btn { height: 38px; padding: 0 16px; font-size: 14px; white-space: nowrap; }
.e-state { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-2); padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.08); white-space: nowrap; }

/* ---------- Profile panel additions ---------- */
.p-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.p-actions .btn { height: 38px; padding: 0 14px; font-size: 13px; flex: 1; }
.p-meta { margin: 4px 0 0; font-size: 12px; color: var(--fg-3); }
.dn-form { display: flex; gap: 8px; margin-top: 12px; }
.dn-form input { height: 40px; }
.dn-form .btn { height: 40px; padding: 0 16px; font-size: 14px; }

@media (max-width: 1080px) { .card.soon { grid-column: span 2; } }
@media (max-width: 640px) {
  .card.soon { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .soon-art span { width: 44px; }
  .user-chip { padding-right: 10px; max-width: 132px; font-size: 13px; }
  .user-chip .avatar-mini { width: 30px; height: 30px; }
  .auth-card { padding: 22px; border-radius: 28px; }
  .a-head h2 { font-size: 23px; }
  .earn-row { grid-template-columns: 48px 1fr; }
  .earn-row .e-btn, .earn-row .e-state { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
}
@media (max-width: 400px) { .user-chip:not(.guest) .nav-user { display: none; } .user-chip:not(.guest) { padding-right: 3px; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .search input { width: 120px; }
}
@media (max-width: 900px) {
  .gate { place-items: start center; }
  .gate-page { grid-template-columns: minmax(0, 460px); justify-content: center; gap: 22px; }
  .gate-brand { text-align: center; }
  .gate-brand .gate-logo { justify-content: center; }
  .gate-brand h1 { font-size: clamp(30px, 8vw, 44px); margin: 18px 0 0; }
  .gate-brand .lede, .gate-brand .gate-chips { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 100px; }
  .hero-visual { height: 300px; order: -1; }
  .orb { width: 270px; }
  .modal { grid-template-columns: 1fr; }
  .modal-art { min-height: 220px; }
  .modal-body { padding: 8px 22px 22px; }
}
@media (max-width: 640px) {
  .nav { height: 56px; gap: 10px; padding: 0 8px 0 16px; }
  .search { width: 40px; padding: 0; justify-content: center; }
  .search input { display: none; }
  .search.expanded { width: auto; padding: 0 12px; }
  .search.expanded input { display: block; width: 140px; }
  .hero { padding-top: 88px; gap: 16px; }
  .hero-visual { height: 230px; }
  .orb { width: 220px; }
  .c1 { left: 0; bottom: 18px; }
  .c2 { right: 0; top: 8px; }
  .hero-card { padding: 28px 22px; border-radius: 28px; }
  .lede { font-size: 16px; }
  .hero-cta .btn { flex: 1 1 auto; white-space: nowrap; }
  .hero-stats { gap: 18px; justify-content: space-between; }
  .hero-stats dd { font-size: 22px; }
  .section { padding: 32px 0; }
  .section h2 { font-size: 30px; }
  .segmented { width: 100%; }
  .seg { flex: 1; padding: 8px 6px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .bundles { grid-template-columns: repeat(2, 1fr); }
  .shards-modal { padding: 22px; }
  .shards-pill { padding: 0 4px 0 10px; gap: 5px; }
  .shards-pill .plus { display: none; }
  .shards-pill { padding-right: 12px; }
  .brand-name { font-size: 17px; }
  .card { padding: 7px; border-radius: 20px; }
  .card-art { border-radius: 14px; }
  .card-body { padding: 10px 4px 4px; }
  .card-title { font-size: 14px; }
  .card-meta { font-size: 12px; flex-direction: column; align-items: flex-start; gap: 2px; }
  .create { padding: 28px 22px; }
  .create h2 { font-size: 26px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; gap: 14px; }
  .modal h3 { font-size: 28px; }
  .overlay { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   v3 — pages, device classes, full-screen game, shop, avatar editor
   ===================================================================== */

/* ---------- Device classes (set in <head> before first paint) ---------- */
html.is-desktop .only-touch, html.is-touch .only-desktop { display: none !important; }
.touch-ui { display: none; }
html.is-touch .touch-ui { display: block; }

/* ---------- Pages (hash router) ---------- */
.page { min-height: calc(100vh - 220px); animation: pageIn .35s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.page-head { padding: 112px 0 24px; }
.page-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-title { font-size: clamp(36px, 4.4vw, 54px); letter-spacing: -.045em; line-height: 1.05; margin: 14px 0 0; font-weight: 700; }
.page-head .page-title:first-child, .page-head > div > .page-title:first-child { margin-top: 0; }

/* ---------- Touch tab bar (touch-primary devices only) ---------- */
.tabbar { display: none; }
html.nav-tabs .tabbar { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); height: 64px; border-radius: 26px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px; }
.tabbar a { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 20px; font-size: 11px; font-weight: 650; color: var(--fg-3); transition: background .25s, color .25s; }
.tabbar a.active { color: #0a0a0a; background: linear-gradient(180deg, #fff, #dcdcdc); box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(0,0,0,.35); }
html.nav-tabs body { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
html.nav-tabs .nav-links { display: none; }
html.is-touch .card:hover, html.is-touch .item:hover, html.is-touch .tile:hover { transform: none; }

/* ---------- Chips (shop categories, editor tabs) ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 0 16px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--fg-2); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.chip em { font-size: 11px; opacity: .6; margin-left: 3px; font-variant-numeric: tabular-nums; }
.chip:hover { background: rgba(255,255,255,.12); color: var(--fg); }
.chip.active { background: linear-gradient(180deg, #fff, #dcdcdc); color: #0a0a0a; border-color: #fff; }
.chip.active em { opacity: .55; }

/* ---------- Avatar Shop (buy only) ---------- */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.shop-search { margin: 0 0 16px; max-width: 420px; }
.shop-search input { width: 100%; flex: 1; }
.shop-search .shop-search-x { border: 0; background: rgba(255,255,255,.14); color: var(--fg-2); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1; display: grid; place-items: center; padding: 0; }
.shop-search .shop-search-x:hover { background: rgba(255,255,255,.24); color: var(--fg); }
.shop-none { grid-column: 1 / -1; }
.item {
  border-radius: var(--r-lg); padding: 10px 10px 12px; display: flex; flex-direction: column; min-width: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.03) 50%, rgba(255,255,255,.06)), rgba(22,22,24,.74);
  border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 10px 30px rgba(0,0,0,.35);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 30ms); transition: transform .4s var(--spring);
}
.item:hover { transform: translateY(-4px); }
.item.is-owned { border-color: rgba(255,255,255,.32); }
.item-art, .tile-art { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: radial-gradient(circle at 50% 115%, rgba(255,255,255,.22), transparent 62%), rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.thumb { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; opacity: 0; transition: opacity .35s var(--ease); }
.thumb.ready { opacity: 1; }
.own-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 999px; background: #fff; color: #000; }
.item-body { padding: 10px 4px; }
.item h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price { margin: 4px 0 0; display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--fg-2); }
.slot-tag { margin-right: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 650; }
.item-btn { height: 36px; padding: 0 10px; font-size: 13px; margin-top: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-btn:disabled { opacity: .6; }
.item-btn.pulse-hint { background: #fff; color: #000; border-color: #fff; animation: bump .6s var(--spring); }

/* ---------- Profile: avatar editor ---------- */
.profile-layout { padding-top: 104px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.studio { border-radius: var(--r-xl); padding: 14px; position: sticky; top: 92px; }
.studio-stage { position: relative; height: min(60vh, 560px); min-height: 340px; border-radius: 24px; overflow: hidden; touch-action: pan-y;
  background: radial-gradient(60% 45% at 50% 88%, rgba(255,255,255,.2), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.01)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.studio-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.studio-canvas:active { cursor: grabbing; }
.studio-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--fg-2); font-size: 14px; }
.studio-tip { text-align: center; margin: 8px 0 0; font-size: 12px; color: var(--fg-3); }
.studio-id { padding: 4px 8px 0; }
.p-name { margin: 8px 0 2px; font-size: 26px; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.p-sub { margin: 0; color: var(--fg-3); font-size: 13px; }
.p-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 2px; }
.p-stats div { text-align: center; padding: 10px 4px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.p-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.p-stats small { font-size: 11px; color: var(--fg-3); }
.editor-col { display: grid; gap: 18px; min-width: 0; }
.editor, .account { border-radius: var(--r-xl); padding: 22px; min-width: 0; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.editor-head h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 20px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); cursor: pointer; color: var(--fg); text-align: center; font: inherit; transition: transform .3s var(--spring), border-color .2s, background .2s; }
.tile:hover { transform: translateY(-3px); background: rgba(255,255,255,.09); }
.tile.on { border-color: #fff; background: rgba(255,255,255,.16); box-shadow: 0 0 0 3px rgba(255,255,255,.16); }
.tile.on .tile-name::before { content: "✓ "; }
.tile.more { border-style: dashed; }
.tile-art { border-radius: 14px; display: grid; place-items: center; }
.none-ic { font-size: 34px; color: var(--fg-3); line-height: 1; }
.tone-dot { position: absolute; right: 8px; bottom: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); border: 2px solid rgba(255,255,255,.75); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.tile-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-wearing { margin: 16px 0 0; font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.edit-wearing b { color: var(--fg); }
#editTabs { flex-wrap: wrap; }
.account h3 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 650; }

/* ---------- Create page ---------- */
.create-hero { border-radius: var(--r-xl); padding: 40px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.create-hero h2 { font-size: 34px; margin: 0 0 6px; letter-spacing: -.035em; }
.create-hero .sub { line-height: 1.55; }
.create-hero .hero-cta { margin-top: 24px; }
.create-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 10px; }
.create-art span { aspect-ratio: 1; border-radius: 16px; background: linear-gradient(150deg, #ececec, #6a6a6a); box-shadow: inset 0 1px 0 #fff, 0 14px 30px rgba(0,0,0,.45); }
.create-art span:nth-child(2n) { background: linear-gradient(150deg, #3a3a3a, #101010); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 14px 30px rgba(0,0,0,.45); }
.create-art span:nth-child(2), .create-art span:nth-child(5) { transform: translateY(-16px); }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.feature { border-radius: var(--r-lg); padding: 20px; }
.feature b { font-size: 17px; letter-spacing: -.02em; }
.feature p { color: var(--fg-2); font-size: 14px; line-height: 1.5; margin: 6px 0 0; }

/* ---------- Full-screen game layer ---------- */
.game-layer {
  position: fixed; inset: 0; z-index: 120; width: 100vw; height: 100vh; height: var(--app-h, 100vh); height: 100dvh;
  background: #101010; touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.game-layer:fullscreen { width: 100vw; height: 100vh; }
.game-layer .canvas-wrap { position: absolute; inset: 0; overflow: hidden; background: #161616; }
canvas#game { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
canvas#game.dragging { cursor: grabbing; }
.canvas-wrap.pointer-locked canvas#game { cursor: none; }
.ghud { position: absolute; z-index: 5; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; }
.ghud-left, .ghud-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ghud-left { flex-wrap: wrap; }
.ghud-right { flex-wrap: wrap; justify-content: flex-end; }
/* HUD glass: translucent fills + specular rim, no backdrop-filter over the live canvas */
.ghud-btn, .ghud-title, .hud-pill, .game-intro, .lock-hint, .pause-badge, .game-toast {
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 55%, rgba(255,255,255,.06)), rgba(18,18,20,.6);
  border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px rgba(0,0,0,.3);
}
.ghud-btn { pointer-events: auto; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform .25s var(--spring), background .2s; }
.ghud-btn:hover { transform: scale(1.06); }
.ghud-btn:active { transform: scale(.94); }
.ghud-btn .brand-mark { width: 22px; height: 22px; }
.ghud-title { height: 34px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; white-space: nowrap; }
.hud-pill { height: 34px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-pill b { color: var(--fg); }
.hud-pill svg { opacity: .8; }
/* Creator-defined HUD (Studio → Game UI). When a world defines its own elements the built-in
   pills are hidden; when it defines none, the classic pills (.hud-time/.hud-best/#hudGoal) show. */
#gameOverlay:not(.ui-default) .hud-time,
#gameOverlay:not(.ui-default) #hudGoal,
#gameOverlay:not(.ui-default) .hud-best { display: none !important; }
.cui-wrap { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 24px); }
.cui { pointer-events: none;
  height: 34px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; white-space: nowrap;
  color: var(--fg-2); font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 55%, rgba(255,255,255,.06)), rgba(18,18,20,.6);
  border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px rgba(0,0,0,.3); }
.cui b { color: var(--fg); }
.cui.sz-sm { height: 28px; font-size: 12px; padding: 0 11px; }
.cui.sz-lg { height: 42px; font-size: 16px; padding: 0 18px; }
/* Voice controls, top-right of the game HUD. Only shown when friends-only voice is active in this server. */
.gvoice { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 4px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.02) 55%, rgba(255,255,255,.06)), rgba(18,18,20,.6);
  border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 18px rgba(0,0,0,.3); }
.gv-btn { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255,255,255,.14); color: #fff; transition: background .18s, transform .18s var(--spring); }
.gv-btn:hover { transform: scale(1.08); }
.gv-btn:active { transform: scale(.92); }
.gv-btn .gv-slash { position: absolute; left: 50%; top: 50%; width: 22px; height: 2.5px; border-radius: 2px; background: #ff5a5a; box-shadow: 0 0 0 1.5px rgba(18,18,20,.9); transform: translate(-50%, -50%) rotate(-45deg) scaleX(0); transform-origin: center; transition: transform .16s var(--spring); }
.gv-btn[aria-pressed="true"] { background: rgba(255,90,90,.34); box-shadow: 0 0 0 1.5px rgba(255,90,90,.6); }
.gv-btn[aria-pressed="true"] .gv-slash { transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); }
.gv-state { font-size: 11px; font-weight: 650; letter-spacing: .01em; color: var(--fg-2); padding: 0 4px 0 2px; white-space: nowrap; }
.gv-state[data-kind="mic"] { color: #ff9a9a; }
.gv-state[data-kind="deaf"] { color: #ff9a9a; }
.gv-state[data-kind="both"] { color: #ff9a9a; }
.gvoice { position: relative; }
.game-intro { position: absolute; z-index: 4; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 58px); transform: translateX(-50%); padding: 12px 20px; border-radius: 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; pointer-events: none; transition: opacity .4s var(--ease), transform .4s var(--ease); max-width: calc(100% - 32px); }
.game-intro b { font-size: 15px; }
.game-intro span { font-size: 12px; color: var(--fg-2); }
.game-intro.fade { opacity: 0; transform: translateX(-50%) translateY(-10px); }
.lock-hint { position: absolute; z-index: 4; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--fg-2); pointer-events: none; transition: opacity .5s; white-space: nowrap; }
.lock-hint.fade, .game-layer.locked .lock-hint, .game-layer.menu-open .lock-hint { opacity: 0; }
.game-toast { position: absolute; z-index: 4; left: 50%; bottom: 70px; transform: translateX(-50%) translateY(20px); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; white-space: nowrap; }
.game-toast.show { animation: toastIn 2.2s var(--ease) both; }
@keyframes toastIn { 0% { opacity: 0; transform: translateX(-50%) translateY(20px) scale(.9); } 12%, 80% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
.game-vignette { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.55) 100%); }
.game-hit { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .12s linear; background: radial-gradient(ellipse at center, rgba(255,40,40,.12) 20%, rgba(220,20,20,.55) 100%); }
.invite-banner { position: fixed; z-index: 205; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: min(440px, calc(100vw - 24px)); padding: 12px 12px 12px 18px; border-radius: 18px; display: flex; align-items: center; gap: 10px; font-size: 14px; animation: pop .4s var(--spring) both; }
.invite-banner .gt-go { flex: none; padding: 8px 16px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.invite-banner .gt-x { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: inherit; cursor: pointer; font-size: 15px; line-height: 1; }
.pause-badge { position: absolute; z-index: 4; right: max(12px, env(safe-area-inset-right)); top: calc(max(12px, env(safe-area-inset-top)) + 46px); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.game-layer.menu-open .pause-badge { display: none; }
.win-panel { position: absolute; z-index: 10; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100% - 32px)); padding: 26px 26px 22px; border-radius: 28px; text-align: center; animation: winPop .6s var(--spring) both;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.03) 50%, rgba(255,255,255,.07)), rgba(18,18,18,.7); }
@keyframes winPop { from { transform: translate(-50%, -44%) scale(.9); opacity: 0; } }
.win-panel h3 { font-size: 40px; letter-spacing: -.04em; margin: 12px 0 2px; }
.win-time { font-size: 30px; font-weight: 650; margin: 0; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.win-sub { margin: 4px 0 16px; font-size: 13px; color: var(--fg-2); }
.win-reward { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; font-size: 17px; margin-bottom: 18px; }
.win-actions { display: flex; gap: 10px; }
.win-actions .btn { flex: 1; }
.game-menu { position: absolute; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.55); animation: fade .25s var(--ease) both; }
.gm-card { width: min(360px, 100%); border-radius: 28px; padding: 22px; display: grid; gap: 10px; animation: pop .45s var(--spring) both; }
.gm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.gm-head b { display: block; font-size: 18px; letter-spacing: -.02em; }
.gm-head small { color: var(--fg-3); font-size: 12px; }
.gm-help { margin: 6px 0 0; font-size: 12px; color: var(--fg-3); text-align: center; line-height: 1.5; }
.game-fallback { position: absolute; z-index: 30; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 30px; text-align: center; color: var(--fg-2); font-size: 14px; background: #111; }
.game-fallback b { color: var(--fg); font-size: 18px; }
/* touch controls (is-touch only) */
.joy { position: absolute; z-index: 6; left: max(22px, env(safe-area-inset-left)); bottom: max(22px, env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; touch-action: none;
  background: rgba(10,10,10,.35); border: 1px solid rgba(255,255,255,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 24px rgba(0,0,0,.3); }
.joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: linear-gradient(180deg, #fff, #cfcfcf); box-shadow: 0 4px 14px rgba(0,0,0,.45), inset 0 1px 0 #fff; transition: transform .08s; }
.jump-btn { position: absolute; z-index: 6; right: max(22px, env(safe-area-inset-right)); bottom: max(30px, env(safe-area-inset-bottom)); width: 90px; height: 90px; border-radius: 50%; font-weight: 700; font-size: 15px; color: var(--fg); touch-action: none; cursor: pointer;
  background: rgba(10,10,10,.38); border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 24px rgba(0,0,0,.3); }
.jump-btn:active { transform: scale(.92); background: rgba(255,255,255,.2); }
html.is-touch .game-toast { bottom: 170px; }
html.is-touch .ghud-btn { width: 48px; height: 48px; }

/* ---------- Responsive (layout by width; controls by device class) ---------- */
@media (max-width: 1080px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
  .studio { position: relative; top: 0; }
  .studio-stage { height: 46vh; min-height: 300px; }
  .create-hero { grid-template-columns: 1fr; padding: 28px; }
  .create-art { max-width: 320px; }
  /* narrow desktop window: keep the top nav links (wrapped onto a second row) — no touch tab bar */
  html.nav-side .nav { height: auto; flex-wrap: wrap; border-radius: 28px; padding: 8px 8px 8px 16px; row-gap: 4px; }
  html.nav-side .nav-links { order: 3; width: 100%; justify-content: space-between; overflow-x: auto; scrollbar-width: none; }
  html.nav-side .nav-links a { padding: 7px 12px; font-size: 13px; white-space: nowrap; }
  html.nav-side .hero { padding-top: 150px; }
  html.nav-side .page-head, html.nav-side .profile-layout { padding-top: 150px; }
}
@media (max-width: 640px) {
  .page-head { padding-top: 92px; }
  .profile-layout { padding-top: 84px; gap: 16px; }
  html.nav-side .page-head, html.nav-side .profile-layout { padding-top: 140px; }
  html.nav-side .hero { padding-top: 140px; }
  .shop-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .edit-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #editTabs { flex-wrap: nowrap; }
  .tile { padding: 6px; border-radius: 16px; gap: 6px; }
  .tile-name { font-size: 12px; }
  .editor, .account { padding: 16px; border-radius: 26px; }
  .editor-head h2 { font-size: 22px; }
  .feature-grid { grid-template-columns: 1fr; }
  .ghud-title, .hud-best { display: none; }
  .hud-pill { height: 32px; padding: 0 10px; font-size: 12px; }
  .ghud-right { gap: 6px; }
  .win-panel h3 { font-size: 32px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .joy { width: 106px; height: 106px; }
  .jump-btn { width: 78px; height: 78px; }
  .game-intro { top: calc(max(8px, env(safe-area-inset-top)) + 52px); padding: 8px 14px; } .game-intro b { font-size: 13px; }
  html.is-touch .game-toast { bottom: 24px; }
}

/* keep touch controls clear of third-party bottom overlays (var set by app.js; 0 when none) */
html.nav-tabs .tabbar { bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--ext-bottom, 0px)); }
html.nav-tabs body { padding-bottom: calc(84px + env(safe-area-inset-bottom) + var(--ext-bottom, 0px)); }
.game-layer:not(.fs-native) .jump-btn { bottom: calc(max(30px, env(safe-area-inset-bottom)) + var(--ext-bottom, 0px)); }
.game-layer:not(.fs-native) .joy { bottom: calc(max(22px, env(safe-area-inset-bottom)) + var(--ext-bottom, 0px)); }

/* =====================================================================
   v4 — home rows, game page, friends, chat, settings, studio, light theme
   ===================================================================== */
html.nav-tabs .tabbar { grid-template-columns: repeat(5, 1fr); }
.page > .page-head:first-child { padding-top: 112px; }
.sub.sm, p.sub.sm { font-size: 13px; margin: 6px 2px; color: var(--fg-3); }
.btn.xs { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-danger { background: linear-gradient(180deg, #2a2a2a, #121212); color: #fff; border: 1px solid rgba(255,255,255,.28); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.35); }
.btn-danger:hover { background: #000; transform: translateY(-1px); }
.beta { display: inline-block; vertical-align: middle; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: #fff; color: #000; margin-left: 4px; }
.admin-badge { display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #000; color: #fff; border: 1px solid #fff; }
.admin-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255,255,255,.22); }
.link-more { font-size: 14px; color: var(--fg-2); font-weight: 600; }
.link-more:hover { color: var(--fg); }

/* ---------- avatar heads ---------- */
.head-img { width: 40px; height: 40px; border-radius: 50%; display: block; object-fit: cover; flex: none; background: radial-gradient(circle at 50% 115%, rgba(255,255,255,.28), transparent 62%), linear-gradient(180deg, #2a2a2c, #141416); border: 1px solid rgba(255,255,255,.22); opacity: .35; transition: opacity .3s; }
.head-img.ready { opacity: 1; }
.head-img:not([src]) { content: none; }
.user-chip .head-img { width: 32px; height: 32px; }
.head-img.xl { width: 64px; height: 64px; }
.home-hello { padding-top: 112px; display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.home-hello .page-title { margin: 0; font-size: clamp(30px, 3.6vw, 44px); }

/* ---------- rows ---------- */
.row-block { margin: 26px 0 8px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 2px 12px; }
.row-head h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.row-head h2 em { font-size: 14px; color: var(--fg-3); font-weight: 600; margin-left: 4px; }
.game-row { display: grid; grid-auto-flow: column; grid-auto-columns: max(200px, calc((100% - 64px) / 5)); gap: 16px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 14px; scroll-snap-type: x proximity; }
.game-row::-webkit-scrollbar { display: none; }
.game-row > .card { scroll-snap-align: start; }
.game-row.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, max(200px, calc((100% - 64px) / 5))); justify-content: start; overflow: visible; } /* fixed card width = Home rows; never stretches a lone card */
.row-empty { border-radius: 18px; padding: 18px 20px; color: var(--fg-2); font-size: 14px; }
.card-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-empty { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(160deg, #3a3a3c, #121214); }
.badge.live-badge, .badge.feat, .card-art .badge { background: rgba(10,10,10,.72); color: #fff; border: 1px solid rgba(255,255,255,.25); display: inline-flex; align-items: center; gap: 6px; }
.badge.feat { left: auto; right: 10px; background: #fff; color: #000; }
.badge .dot { width: 6px; height: 6px; }

/* ---------- friends row (home) ---------- */
.friend-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 10px; }
.friend-row::-webkit-scrollbar { display: none; }
.friend { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.fhead-wrap { position: relative; display: block; border-radius: 50%; }
.friend .head-img, .fhead { width: 80px; height: 80px; }
.fhead.add-ic { display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.4); font-size: 34px; font-weight: 300; color: var(--fg-2); background: rgba(255,255,255,.05); transition: background .2s, transform .3s var(--spring); }
.friend.add:hover .add-ic { background: rgba(255,255,255,.12); transform: scale(1.05); }
.fname { font-size: 13px; font-weight: 650; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fstat { font-size: 11px; color: var(--fg-3); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend .btn.xs { height: 26px; padding: 0 12px; margin-top: 2px; }
.odot { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; background: #555; border: 3px solid #0b0b0c; display: none; }
.odot.on, .odot.ingame { display: block; background: #fff; }
.odot.ingame { background: #fff; box-shadow: 0 0 0 2px #fff inset; }
.odot.ingame::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: #0b0b0c; }
.fhead-wrap.sm .odot { width: 12px; height: 12px; border-width: 2px; right: 0; bottom: 0; }

/* ---------- game page ---------- */
.gp { padding-top: 104px; }
.gp-hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.gp-art { border-radius: var(--r-xl); padding: 10px; }
.gp-art .art { position: relative; aspect-ratio: 16/9; border-radius: 24px; overflow: hidden; background-size: cover; background-position: center; height: 100%; min-height: 320px; }
.gp-art .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gp-info { border-radius: var(--r-xl); padding: 26px; display: flex; flex-direction: column; gap: 4px; }
.gp-title { font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.04em; line-height: 1.05; margin: 14px 0 6px; }
.creator { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-2); font-size: 15px; width: fit-content; padding: 4px 12px 4px 4px; border-radius: 999px; transition: background .2s; }
.creator:hover { background: rgba(255,255,255,.08); color: var(--fg); }
.creator b { color: var(--fg); }
.creator .head-img { width: 34px; height: 34px; }
.gp-cta { display: flex; gap: 10px; margin: 18px 0 16px; }
.gp-cta .gp-play { flex: 2; }
.gp-cta .fav-btn { flex: 1; padding: 0 18px; }
.fav-btn.on { background: #fff; color: #000; }
.gp-stats { margin-bottom: 4px; }
.gp-cols { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.gp-about, .gp-servers { border-radius: var(--r-lg); padding: 22px; }
.gp-about h2, .gp-servers h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.gp-about .desc { margin: 0; white-space: pre-wrap; }
.servers { display: grid; gap: 8px; }
.server { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.server > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.server small { color: var(--fg-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server .cap { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--fg-2); font-size: 13px; }
.gp-missing, .up-loading { margin-top: 120px; border-radius: var(--r-xl); padding: 36px; display: grid; gap: 14px; justify-items: start; }
.up-loading { display: flex; align-items: center; gap: 12px; color: var(--fg-2); }

/* ---------- create page ---------- */
.create-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.create-card { border-radius: var(--r-xl); padding: 22px; display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; }
.create-card h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.create-card .sub { font-size: 14px; line-height: 1.5; }
.create-card .hero-cta { margin-top: 16px; }
.cc-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cc-art span { aspect-ratio: 1; border-radius: 10px; background: linear-gradient(150deg, #ececec, #6a6a6a); box-shadow: inset 0 1px 0 #fff, 0 8px 20px rgba(0,0,0,.4); }
.cc-art span:nth-child(2n) { background: linear-gradient(150deg, #3a3a3a, #101010); box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 20px rgba(0,0,0,.4); }
.cc-art span:nth-child(2), .cc-art span:nth-child(5) { transform: translateY(-8px); }
.item-art-deco { grid-template-columns: repeat(2, 1fr); width: 110px; }
.create-blocked { border-radius: var(--r-xl); padding: 28px; display: flex; gap: 20px; align-items: center; }
.create-blocked h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.03em; }
.create-blocked .sub { font-size: 14px; line-height: 1.55; }
.cb-ic { flex: none; width: 70px; height: 70px; border-radius: 22px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.create-blocked.flash { animation: bump .7s var(--spring); }
.mini-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mini-item { position: relative; border-radius: 16px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mini-item .thumb { position: relative; inset: auto; width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; background: rgba(255,255,255,.04); }
.mini-item span { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.mini-item small { font-size: 11px; color: var(--fg-3); }
.ugc-badge { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 3px 7px; border-radius: 999px; background: rgba(10,10,10,.75); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.item-body .by { display: block; font-size: 12px; color: var(--fg-3); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .adm-del { margin-top: 6px; }

/* ---------- profile ---------- */
.p-stats { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
.p-stats b { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 16px; }
.creations { border-radius: var(--r-xl); padding: 22px; min-width: 0; }
.creations .row-head h2 { font-size: 22px; }
.creations .game-row { grid-auto-columns: max(180px, calc((100% - 32px) / 3)); }
.fh { margin: 18px 2px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); font-weight: 700; }
.fh-tabs { display: flex; gap: 8px; margin: 18px 2px 12px; }
.fh-tabs .chip { height: 32px; padding: 0 14px; font-size: 13px; }
.fh em { color: var(--fg-2); }
.up { padding-top: 104px; }
.up-hero { border-radius: var(--r-xl); padding: 22px; display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: center; }
.up-avatar { border-radius: 24px; aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(60% 45% at 50% 88%, rgba(255,255,255,.2), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.01)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); overflow: hidden; }
.up-avatar .head-img.full { width: 100%; height: 100%; border-radius: 0; border: 0; background: none; object-fit: contain; }
.up-info .page-title { margin: 0; font-size: clamp(30px, 3.6vw, 44px); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.up-info .p-actions .btn { flex: 0 1 auto; }

/* ---------- friends page ---------- */
.friends-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.fcard { border-radius: var(--r-xl); padding: 22px; min-width: 0; }
.fcard > .fh:first-child { margin-top: 0; }
.search-wide { display: flex; align-items: center; gap: 10px; height: 48px; border-radius: 16px; padding: 0 14px; color: var(--fg-3); }
.search-wide input { flex: 1; background: none; border: 0; outline: 0; font: inherit; font-size: 15px; color: var(--fg); min-width: 0; }
.people { display: grid; gap: 8px; margin-top: 10px; }
.person { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 16px; min-width: 0; }
.person .head-img { width: 44px; height: 44px; }
.pmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pmeta b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pmeta small { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-pill { position: relative; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-2); transition: background .2s, color .2s; }
.icon-pill:hover, .icon-pill.active { color: var(--fg); background: rgba(255,255,255,.12); }
.nbadge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #fff; color: #000; font-size: 11px; font-weight: 800; font-style: normal; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.4); }

/* ---------- avatar menu ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 232px; border-radius: 18px; padding: 7px; display: grid; gap: 1px; z-index: 70; animation: pop .3s var(--spring) both; }
.menu a, .menu button { display: flex; align-items: center; gap: 11px; text-align: left; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; background: none; border: 0; cursor: pointer; color: var(--fg); position: relative; z-index: 2; }
.menu a > svg, .menu button > svg { flex: none; opacity: .72; }
.menu a > span, .menu button > span { flex: 1; }
.menu a:hover, .menu button:hover { background: rgba(255,255,255,.1); }
.menu-head { display: flex; align-items: center; gap: 11px; padding: 9px 11px 10px; position: relative; z-index: 2; }
.menu-head .head-img { width: 34px; height: 34px; border-radius: 11px; flex: none; }
.menu-id { display: grid; min-width: 0; }
.menu-id b { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-id small { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-sep { height: 1px; margin: 4px 8px; background: rgba(255,255,255,.09); position: relative; z-index: 2; }
.menu .menu-danger { color: #ff6b6b; }
.menu .menu-danger > svg { opacity: 1; }
html.theme-light .menu-sep { background: rgba(0,0,0,.08); }

/* ---------- chat drawer ---------- */
.chat-fab { position: fixed; z-index: 80; right: 20px; bottom: 20px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; cursor: pointer; border: 1px solid var(--stroke); }
.chat-fab > * { position: relative; z-index: 2; }
.chat-fab .nbadge { top: -4px; right: -4px; position: absolute; }
body.gated .chat-fab, body.gated .chat, body.gaming .chat-fab, body.tooling .chat-fab { display: none !important; }
.chat { position: fixed; z-index: 90; right: 20px; bottom: 80px; width: 360px; height: min(540px, calc(100vh - 140px)); border-radius: 26px; display: flex; flex-direction: column; overflow: hidden; animation: pop .35s var(--spring) both; }
.chat > * { position: relative; z-index: 2; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.chat-head b { flex: 1; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .icon-btn { width: 32px; height: 32px; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px; display: grid; align-content: start; gap: 2px; }
.conv { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 14px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--fg); }
.conv:hover { background: rgba(255,255,255,.08); }
.conv .head-img { width: 40px; height: 40px; }
.cmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cmeta b { font-size: 14px; }
.cmeta small { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv time { font-size: 11px; color: var(--fg-3); }
.conv.unread b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-left: 6px; vertical-align: 2px; }
.chat-empty { padding: 30px 16px; text-align: center; color: var(--fg-2); display: grid; gap: 10px; justify-items: center; }
.chat-thread { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.msg { position: relative; align-self: flex-start; max-width: 80%; padding: 8px 12px; border-radius: 16px 16px 16px 6px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: #fff; color: #000; border-color: #fff; border-radius: 16px 16px 6px 16px; }
.msg.pending { opacity: .6; }
.msg time { display: block; font-size: 10px; opacity: .55; margin-top: 2px; }
.mdel, .gdel { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #000; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: none; }
.msg:hover .mdel { display: block; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.chat-form input { flex: 1; min-width: 0; height: 40px; border-radius: 999px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--fg); outline: 0; }
.chat-head a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.3); }

/* ---------- in-game chat ---------- */
.gchat { position: absolute; z-index: 6; left: max(12px, env(safe-area-inset-left)); top: calc(max(12px, env(safe-area-inset-top)) + 58px); width: min(340px, 46vw); display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
/* hover backing plate: a faint frosted panel behind the whole chat area so messages stay readable over the world */
.gchat::before { content: ''; position: absolute; inset: -10px -12px; border-radius: 18px; z-index: -1; background: rgba(8,8,12,.42); border: 1px solid rgba(255,255,255,.12); -webkit-backdrop-filter: blur(10px) saturate(1.15); backdrop-filter: blur(10px) saturate(1.15); opacity: 0; transition: opacity .22s var(--ease, ease); pointer-events: none; }
.gchat.open::before, .gchat.typing::before, .gchat.pointer::before, .gchat:hover::before { opacity: 1; }
html.theme-light .gchat::before { background: rgba(250,250,252,.5); border-color: rgba(0,0,0,.1); }
.gchat-log { max-height: 190px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; scrollbar-width: none; opacity: .55; transition: opacity .3s; }
.gchat.active .gchat-log, .gchat.typing .gchat-log, .gchat.pointer .gchat-log, .gchat:hover .gchat-log { opacity: 1; }
.gmsg { position: relative; align-self: flex-start; max-width: 100%; padding: 5px 10px; border-radius: 12px; background: rgba(10,10,10,.6); border: 1px solid rgba(255,255,255,.14); font-size: 13px; line-height: 1.35; color: #f2f2f2; overflow-wrap: anywhere; pointer-events: auto; }
.gmsg b { color: #fff; margin-right: 2px; }
.gmsg.mine { background: rgba(255,255,255,.22); }
.gmsg:hover .gdel { display: block; }
.gchat-form input { pointer-events: auto; width: 100%; height: 34px; border-radius: 999px; padding: 0 12px; font: inherit; font-size: 13px; color: #fff; outline: 0; background: rgba(10,10,10,.55); border: 1px solid rgba(255,255,255,.22); }
.gchat-form input::placeholder { color: rgba(255,255,255,.55); }
.gchat-form input:focus { border-color: #fff; background: rgba(10,10,10,.75); }
html.is-touch .gchat-form { display: none; }
html.is-touch .gchat.open .gchat-form { display: block; }
.gchat-toggle { position: absolute; z-index: 6; right: max(22px, env(safe-area-inset-right)); bottom: calc(max(30px, env(safe-area-inset-bottom)) + 104px + var(--ext-bottom, 0px)); width: 48px; height: 48px; border-radius: 50%; background: rgba(10,10,10,.38); border: 1px solid rgba(255,255,255,.28); color: #fff; display: grid; place-items: center; }
html.is-desktop .gchat-toggle { display: none; }
.test-badge { position: absolute; z-index: 5; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: #fff; color: #000; }
.gm-players { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--fg-2); }
.gm-players b { width: 100%; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); }
.gm-players span { padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.set-card { border-radius: var(--r-xl); padding: 22px; display: grid; gap: 12px; min-width: 0; }
.set-card > * { position: relative; z-index: 2; }
.set-card h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 0; cursor: default; }
.set-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-row b { font-size: 14px; }
.set-row small { font-size: 12px; color: var(--fg-3); line-height: 1.4; }
.set-row input[type=range] { width: 160px; accent-color: #fff; }
.set-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.set-form .field { flex: 1 1 180px; }
.set-form .btn { height: 46px; }
.seg3 { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); gap: 2px; flex: none; flex-wrap: wrap; }
.seg3 button { border: 0; background: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--fg-2); cursor: pointer; transition: background .2s, color .2s; }
.seg3 button.active { background: linear-gradient(180deg, #fff, #dcdcdc); color: #0a0a0a; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 48px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); position: relative; cursor: pointer; transition: background .25s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .3s var(--spring); }
.switch:checked { background: #fff; }
.switch:checked::after { transform: translateX(20px); background: #0a0a0a; }
.switch:focus-visible, .seg3 button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- confirm / publish cards ---------- */
.pub-card { position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 28px; padding: 24px; display: grid; gap: 12px; animation: pop .45s var(--spring) both; }
.pub-card > * { position: relative; z-index: 2; }
.pub-card h3 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.pub-thumb { width: 100%; aspect-ratio: 16/9; border-radius: 16px; object-fit: cover; background: #111; border: 1px solid rgba(255,255,255,.12); }
.pub-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field textarea, .field select { border-radius: 14px; padding: 10px 14px; font: inherit; font-size: 15px; font-weight: 500; color: var(--fg); outline: 0; width: 100%; resize: vertical; }
.field select { height: 46px; padding: 0 12px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: #1a1a1c; color: #f2f2f2; }

/* ---------- Studio + item creator (full-screen tool layers) ---------- */
.tool-layer { position: fixed; inset: 0; z-index: 110; background: #0d0d0f; overflow: hidden; }
.tool-layer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
body.tooling .nav-wrap, body.tooling main, body.tooling .footer, body.tooling .tabbar, body.tooling .backdrop { visibility: hidden; }
.st-top { position: absolute; z-index: 3; left: 12px; right: 12px; top: 12px; height: 56px; border-radius: 20px; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.st-top > * { position: relative; z-index: 2; }
.st-name { font-size: 15px; white-space: nowrap; }
.st-note { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.st-state { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.st-state.dirty { color: var(--accent-text); }
.st-state.err { color: #ff8a8a; }
.st-sp { flex: 1; }
.st-tools { position: absolute; z-index: 3; left: 12px; top: 80px; width: 92px; border-radius: 20px; padding: 6px; display: grid; gap: 4px; max-height: calc(100% - 140px); overflow-y: auto; }
.st-tool { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; border: 0; background: none; cursor: pointer; color: var(--fg-2); font-size: 11px; font-weight: 650; }
.st-tool:hover { background: rgba(255,255,255,.08); color: var(--fg); }
.st-tool.active { background: linear-gradient(180deg, #fff, #dcdcdc); color: #0a0a0a; }
.st-props { position: absolute; z-index: 3; right: 12px; top: 80px; width: 290px; max-height: calc(100% - 140px); overflow-y: auto; border-radius: 20px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.st-props > * { position: relative; z-index: 2; }
.st-props h4 { margin: 2px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-2); }
.st-props h4 small { color: var(--fg-3); font-weight: 600; }
.st-props .field input, .st-props .field select { height: 40px; font-size: 14px; }
.st-props .pub-row { gap: 8px; }
.vec { display: grid; grid-template-columns: 58px repeat(3, 1fr); gap: 6px; align-items: center; font-size: 12px; color: var(--fg-3); font-weight: 650; }
.vec input, .field.inline input[type=number] { width: 100%; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--fg); font: inherit; font-size: 13px; padding: 0 6px; outline: 0; }
.vec input:focus { border-color: #fff; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.field.inline input[type=number] { width: 90px; }
.field.inline input[type=range] { flex: 1; accent-color: #fff; }
.nudge { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.nudge button { height: 30px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: var(--fg-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.nudge button:hover { background: rgba(255,255,255,.14); color: var(--fg); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; background: var(--c); border: 1px solid rgba(255,255,255,.3); cursor: pointer; padding: 0; }
.sw.on { outline: 2px solid #fff; outline-offset: 2px; }
.st-count, .st-status, .st-help { margin: 0; font-size: 12px; color: var(--fg-3); line-height: 1.45; }
.st-status { color: var(--fg-2); }
.st-props .p-actions .btn { height: 34px; font-size: 13px; }
.st-hint { position: absolute; z-index: 3; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 14px; border-radius: 999px; font-size: 12px; color: var(--fg-2); background: rgba(14,14,16,.75); border: 1px solid rgba(255,255,255,.14); white-space: nowrap; pointer-events: none; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.ic-panel { top: 80px; }
.ic-sec { display: grid; gap: 6px; }
.ic-sec .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); font-weight: 700; }
.ic-sec .seg3 { width: 100%; }
.ic-sec .seg3 button { flex: 1; padding: 7px 6px; }
.set-row.tight { padding: 0; }
.game-layer { z-index: 130; }
#pubModal { z-index: 115; }

/* ---------- responsive (v4) ---------- */
@media (max-width: 1080px) { .gp-hero, .gp-cols { grid-template-columns: 1fr; } .create-cards { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .friends-layout, .settings { grid-template-columns: 1fr; }
  .up-hero { grid-template-columns: 1fr; }
  .up-avatar { max-width: 260px; justify-self: center; width: 100%; }
  html.nav-side .home-hello, html.nav-side .gp, html.nav-side .up { padding-top: 150px; }
}
@media (max-width: 640px) {
  .home-hello { padding-top: 88px; gap: 12px; }
  .home-hello .head-img.xl { width: 52px; height: 52px; }
  .home-hello .sub { font-size: 14px; }
  .gp, .up { padding-top: 84px; }
  .page > .page-head:first-child { padding-top: 92px; }
  .game-row { grid-auto-columns: 168px !important; gap: 10px; }
  .game-row.wrap { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .friend { width: 74px; }
  .friend .head-img, .fhead { width: 66px; height: 66px; }
  .gp-art .art { min-height: 0; }
  .gp-info { padding: 20px; }
  .create-card { grid-template-columns: 1fr; }
  .cc-art { max-width: 160px; }
  .create-blocked { flex-direction: column; align-items: flex-start; padding: 22px; }
  .chat { left: 0; right: 0; top: 0; bottom: 0; width: auto; height: auto; border-radius: 0; z-index: 140; }
  .chat-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .chat-form { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .set-row { flex-wrap: wrap; }
  .pub-row { grid-template-columns: 1fr; }
  .gchat { width: min(280px, 60vw); }
  .person { flex-wrap: wrap; }
  .pact { width: 100%; justify-content: flex-start; padding-left: 56px; }
}
html.nav-tabs .chat-fab { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px + var(--ext-bottom, 0px)); right: 14px; height: 44px; width: 44px; padding: 0; justify-content: center; }
html.nav-tabs .chat-fab > span { display: none; }
html.nav-tabs .chat { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 128px + var(--ext-bottom, 0px)); }
html.is-touch .msg .mdel { display: block; }
@media (max-width: 900px) { html.nav-side .chat-fab { bottom: 16px; } }

/* ---------- reduce motion (setting) ---------- */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
html.reduce-motion .blob { animation: none !important; }

/* =====================================================================
   Light theme — the same liquid glass, frosted white over pale gray
   ===================================================================== */
html.theme-light {
  --bg: #e9e9ec; --fg: #0b0b0c; --fg-2: rgba(11,11,12,.68); --fg-3: rgba(11,11,12,.48);
  --glass: rgba(255,255,255,.55); --glass-strong: rgba(255,255,255,.7);
  --stroke: rgba(0,0,0,.1); --stroke-hi: rgba(0,0,0,.3);
  color-scheme: light;
}
html.theme-light ::selection { background: #000; color: #fff; }
html.theme-light .backdrop { background: radial-gradient(1200px 800px at 50% -10%, #ffffff 0%, #e4e4e7 60%); }
html.theme-light .b1 { background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(200,200,205,.5) 38%, transparent 68%); opacity: .9; }
html.theme-light .b2 { background: radial-gradient(circle, rgba(170,170,175,.55) 0%, rgba(210,210,215,.4) 42%, transparent 70%); }
html.theme-light .b3 { background: radial-gradient(circle, rgba(190,190,196,.6) 0%, rgba(235,235,238,.4) 45%, transparent 70%); }
html.theme-light .grain { opacity: .03; }
html.theme-light .glass { background: linear-gradient(135deg, rgba(255,255,255,.85) 0%, rgba(255,255,255,.45) 45%, rgba(255,255,255,.35) 60%, rgba(255,255,255,.7) 100%), var(--glass);
  box-shadow: inset 0 1px 0 rgba(255,255,255,1), inset 0 -1px 0 rgba(0,0,0,.04), 0 10px 34px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05); }
html.theme-light .glass::before { background: linear-gradient(140deg, rgba(255,255,255,1), rgba(255,255,255,.3) 28%, rgba(0,0,0,.04) 50%, rgba(255,255,255,.4) 72%, rgba(255,255,255,.95)); }
html.theme-light .glass::after { background: radial-gradient(120% 60% at 20% 0%, rgba(255,255,255,.7), transparent 55%); }
html.theme-light .glass-strong { background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.6) 50%, rgba(255,255,255,.8)), var(--glass-strong); }
html.theme-light .glass-inset { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.08); box-shadow: inset 0 1px 2px rgba(0,0,0,.08), inset 0 -1px 0 rgba(255,255,255,.7); }
html.theme-light .card.glass, html.theme-light .earn-row.glass, html.theme-light .item { background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.7) 50%, rgba(255,255,255,.85)); border-color: rgba(0,0,0,.08); box-shadow: inset 0 1px 0 #fff, 0 10px 28px rgba(0,0,0,.08); }
html.theme-light .card:hover { box-shadow: inset 0 1px 0 #fff, 0 24px 50px rgba(0,0,0,.14); }
html.theme-light .btn-primary { background: linear-gradient(180deg, #2a2a2c, #0a0a0a); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 8px 22px rgba(0,0,0,.2); }
html.theme-light .btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 12px 30px rgba(0,0,0,.28); }
html.theme-light .btn-glass, html.theme-light .icon-btn { background: rgba(255,255,255,.7); border-color: rgba(0,0,0,.12); box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0,0,0,.06); }
html.theme-light .btn-glass:hover, html.theme-light .icon-btn:hover { background: #fff; }
html.theme-light .btn-danger { background: linear-gradient(180deg, #2a2a2c, #000); border-color: #000; }
html.theme-light .nav-links a:hover, html.theme-light .nav-links a.active, html.theme-light .icon-pill:hover, html.theme-light .icon-pill.active, html.theme-light .user-chip:hover, html.theme-light .shards-pill:hover { background: rgba(0,0,0,.07); }
html.theme-light .chip, html.theme-light .seg3 { background: rgba(255,255,255,.6); border-color: rgba(0,0,0,.1); }
html.theme-light .chip:hover { background: #fff; }
html.theme-light .chip.active, html.theme-light .seg3 button.active, html.theme-light .tabbar a.active, html.theme-light .st-tool.active, html.theme-light .seg-indicator { background: linear-gradient(180deg, #2a2a2c, #0a0a0a); color: #fff; border-color: #000; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
html.theme-light .seg.active { color: #fff; }
html.theme-light .tag { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); }
html.theme-light .tag.solid, html.theme-light .beta, html.theme-light .own-badge, html.theme-light .badge.feat, html.theme-light .nbadge, html.theme-light .shards-pill .plus { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
html.theme-light .admin-badge { background: #fff; color: #000; border-color: #000; }
html.theme-light .modal-stats > div, html.theme-light .p-stats div { background: rgba(255,255,255,.6); border-color: rgba(0,0,0,.07); }
html.theme-light .item-art, html.theme-light .tile-art, html.theme-light .studio-stage, html.theme-light .up-avatar { background: radial-gradient(circle at 50% 115%, rgba(0,0,0,.14), transparent 62%), linear-gradient(180deg, #f6f6f8, #dcdcdf); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
html.theme-light .tile { background: rgba(255,255,255,.6); border-color: rgba(0,0,0,.1); }
html.theme-light .tile.on { border-color: #000; background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,.1); }
html.theme-light .head-img { background: radial-gradient(circle at 50% 115%, rgba(0,0,0,.12), transparent 62%), linear-gradient(180deg, #f4f4f6, #d6d6da); border-color: rgba(0,0,0,.12); }
html.theme-light .up-avatar .head-img.full { background: none; }
html.theme-light .odot { border-color: #ececee; }
html.theme-light .odot.on, html.theme-light .odot.ingame { background: #0a0a0a; box-shadow: none; }
html.theme-light .odot.ingame::after { background: #fff; }
html.theme-light .fhead.add-ic { border-color: rgba(0,0,0,.3); background: rgba(255,255,255,.6); }
html.theme-light .msg { background: rgba(255,255,255,.85); border-color: rgba(0,0,0,.08); }
html.theme-light .msg.mine { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
html.theme-light .conv:hover, html.theme-light .menu a:hover, html.theme-light .menu button:hover, html.theme-light .st-tool:hover { background: rgba(0,0,0,.06); }
html.theme-light .chat-head, html.theme-light .chat-form { border-color: rgba(0,0,0,.08); }
html.theme-light .conv.unread b::after { background: #000; }
html.theme-light .switch { background: rgba(0,0,0,.1); border-color: rgba(0,0,0,.15); }
html.theme-light .switch:checked { background: #0a0a0a; }
html.theme-light .switch:checked::after { background: #fff; }
html.theme-light .set-row input[type=range], html.theme-light .field.inline input[type=range] { accent-color: #000; }
html.theme-light .form-msg.err { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.15); color: #111; }
html.theme-light .form-msg.ok { background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.2); color: #000; }
html.theme-light .field-hint.good { color: #000; }
html.theme-light .field-hint.bad { color: #555; }
html.theme-light .field input:focus, html.theme-light .input-at:focus-within { border-color: rgba(0,0,0,.4); box-shadow: inset 0 1px 2px rgba(0,0,0,.08), 0 0 0 3px rgba(0,0,0,.08); }
html.theme-light .field select option { background: #fff; color: #000; }
html.theme-light .fine, html.theme-light .or::before, html.theme-light .or::after, html.theme-light .admin-row { border-color: rgba(0,0,0,.1); }
html.theme-light .or::before, html.theme-light .or::after { background: rgba(0,0,0,.12); }
html.theme-light .toast a.u, html.theme-light a.u, html.theme-light .link-btn, html.theme-light .chat-head a { text-decoration-color: rgba(0,0,0,.35); }
html.theme-light .scrim { background: rgba(240,240,242,.55); }
html.theme-light .search input::-webkit-search-cancel-button { filter: grayscale(1); }
html.theme-light .cb-ic { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); }
html.theme-light .brand-mark { --logo: linear-gradient(160deg, #0b0b0c 40%, #3a3b40); filter: none; }
html.theme-light .gate-brand h1 .lite, html.theme-light .hero h1 .lite { background-image: linear-gradient(180deg, #0a0a0a 35%, #444); }
html.theme-light .gate-brand h1 .dim, html.theme-light .hero h1 .dim { background-image: linear-gradient(180deg, #777, #aaa); }
html.theme-light .cc-art span { box-shadow: inset 0 1px 0 #fff, 0 8px 18px rgba(0,0,0,.15); }
html.theme-light .badge.live-badge, html.theme-light .card-art .badge:not(.feat) { background: rgba(255,255,255,.88); color: #000; border-color: rgba(0,0,0,.12); }
html.theme-light .row-empty { color: var(--fg-2); }
/* game, studio and in-game HUD stay dark (3D scenes are designed for it) */
html.theme-light .game-layer, html.theme-light .tool-layer { --fg: #f5f5f7; --fg-2: rgba(245,245,247,.68); --fg-3: rgba(245,245,247,.45); color: var(--fg); color-scheme: dark; }
html.theme-light .game-layer .glass, html.theme-light .tool-layer .glass { background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.03) 50%, rgba(255,255,255,.07)), rgba(28,28,30,.6); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 10px 30px rgba(0,0,0,.45); }
html.theme-light .game-layer .glass::before, html.theme-light .tool-layer .glass::before { background: linear-gradient(140deg, rgba(255,255,255,.6), rgba(255,255,255,.06) 28%, transparent 50%, rgba(255,255,255,.1) 72%, rgba(255,255,255,.45)); }
html.theme-light .game-layer .glass::after, html.theme-light .tool-layer .glass::after { background: radial-gradient(120% 60% at 20% 0%, rgba(255,255,255,.12), transparent 55%); }
html.theme-light .game-layer .btn-glass, html.theme-light .tool-layer .btn-glass { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); color: var(--fg); }
html.theme-light .game-layer .btn-primary, html.theme-light .tool-layer .btn-primary { background: linear-gradient(180deg, #fff, #dcdcdc); color: #0a0a0a; }
html.theme-light .game-layer .glass-inset, html.theme-light .tool-layer .glass-inset { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
html.theme-light .game-layer .tag.solid, html.theme-light .tool-layer .beta { background: #fff; color: #000; }
html.theme-light .tool-layer .st-tool.active, html.theme-light .tool-layer .seg3 button.active { background: linear-gradient(180deg, #fff, #dcdcdc); color: #0a0a0a; }
html.theme-light .tool-layer .seg3 { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); }
html.theme-light .tool-layer .switch:checked { background: #fff; }
html.theme-light .tool-layer .switch:checked::after { background: #0a0a0a; }
html.theme-light .tool-layer .field select option { background: #1a1a1c; color: #f2f2f2; }
html.theme-light .tool-layer .form-msg.err { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); color: #e6e6e6; }
.game-row:has(> .row-empty), .mini-items:has(> .row-empty) { display: block; }

/* =====================================================================
   Scrollbars — thin glass thumbs, transparent tracks, no arrow buttons.
   Page scrollbar always visible (thin); inner scroll areas show the thumb only on hover.
   ===================================================================== */
/* Chromium + Safari (Chromium ignores these if scrollbar-width/color are set, so those are Firefox-only below) */
::-webkit-scrollbar { width: 6px; height: 6px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.24); border-radius: 999px; border: 0; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.overlay ::-webkit-scrollbar-thumb, .chat ::-webkit-scrollbar-thumb, .menu::-webkit-scrollbar-thumb, .st-props::-webkit-scrollbar-thumb, .st-tools::-webkit-scrollbar-thumb, .gate::-webkit-scrollbar-thumb, .msgs::-webkit-scrollbar-thumb, .chat-list::-webkit-scrollbar-thumb, .gchat-log::-webkit-scrollbar-thumb, .edit-grid::-webkit-scrollbar-thumb, .people::-webkit-scrollbar-thumb, .pub-card::-webkit-scrollbar-thumb, .shards-modal::-webkit-scrollbar-thumb, .gm-card::-webkit-scrollbar-thumb { background: transparent; }
.overlay :hover::-webkit-scrollbar-thumb, .chat :hover::-webkit-scrollbar-thumb, .menu:hover::-webkit-scrollbar-thumb, .st-props:hover::-webkit-scrollbar-thumb, .st-tools:hover::-webkit-scrollbar-thumb, .gate:hover::-webkit-scrollbar-thumb, .msgs:hover::-webkit-scrollbar-thumb, .chat-list:hover::-webkit-scrollbar-thumb, .gchat-log:hover::-webkit-scrollbar-thumb, .edit-grid:hover::-webkit-scrollbar-thumb, .people:hover::-webkit-scrollbar-thumb, .pub-card:hover::-webkit-scrollbar-thumb, .shards-modal:hover::-webkit-scrollbar-thumb, .gm-card:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); }
html.theme-light ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.22); }
html.theme-light ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.38); }
html.theme-light .overlay ::-webkit-scrollbar-thumb, html.theme-light .chat ::-webkit-scrollbar-thumb, html.theme-light .menu::-webkit-scrollbar-thumb, html.theme-light .st-props::-webkit-scrollbar-thumb, html.theme-light .st-tools::-webkit-scrollbar-thumb, html.theme-light .gate::-webkit-scrollbar-thumb, html.theme-light .msgs::-webkit-scrollbar-thumb, html.theme-light .chat-list::-webkit-scrollbar-thumb, html.theme-light .gchat-log::-webkit-scrollbar-thumb, html.theme-light .edit-grid::-webkit-scrollbar-thumb, html.theme-light .people::-webkit-scrollbar-thumb, html.theme-light .pub-card::-webkit-scrollbar-thumb, html.theme-light .shards-modal::-webkit-scrollbar-thumb, html.theme-light .gm-card::-webkit-scrollbar-thumb { background: transparent; }
html.theme-light .overlay :hover::-webkit-scrollbar-thumb, html.theme-light .chat :hover::-webkit-scrollbar-thumb, html.theme-light .menu:hover::-webkit-scrollbar-thumb, html.theme-light .st-props:hover::-webkit-scrollbar-thumb, html.theme-light .st-tools:hover::-webkit-scrollbar-thumb, html.theme-light .gate:hover::-webkit-scrollbar-thumb, html.theme-light .msgs:hover::-webkit-scrollbar-thumb, html.theme-light .chat-list:hover::-webkit-scrollbar-thumb, html.theme-light .gchat-log:hover::-webkit-scrollbar-thumb, html.theme-light .edit-grid:hover::-webkit-scrollbar-thumb, html.theme-light .people:hover::-webkit-scrollbar-thumb, html.theme-light .pub-card:hover::-webkit-scrollbar-thumb, html.theme-light .shards-modal:hover::-webkit-scrollbar-thumb, html.theme-light .gm-card:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,.26); }
html.theme-light .tool-layer ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.26); }
/* Firefox */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.24) transparent; }
  .overlay *, .chat *, .menu, .st-props, .st-tools, .gate, .msgs, .chat-list, .gchat-log, .edit-grid, .people, .pub-card, .shards-modal, .gm-card { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  .overlay *:hover, .chat *:hover, .menu:hover, .st-props:hover, .st-tools:hover, .gate:hover, .msgs:hover, .chat-list:hover, .gchat-log:hover, .edit-grid:hover, .people:hover, .pub-card:hover, .shards-modal:hover, .gm-card:hover { scrollbar-color: rgba(255,255,255,.28) transparent; }
  html.theme-light { scrollbar-color: rgba(0,0,0,.24) transparent; }
  html.theme-light .overlay *:hover, html.theme-light .chat *:hover, html.theme-light .menu:hover, html.theme-light .st-props:hover, html.theme-light .st-tools:hover, html.theme-light .gate:hover, html.theme-light .msgs:hover, html.theme-light .chat-list:hover, html.theme-light .gchat-log:hover, html.theme-light .edit-grid:hover, html.theme-light .people:hover, html.theme-light .pub-card:hover, html.theme-light .shards-modal:hover, html.theme-light .gm-card:hover { scrollbar-color: rgba(0,0,0,.26) transparent; }
  html.theme-light .tool-layer, html.theme-light .tool-layer * { scrollbar-color: rgba(255,255,255,.26) transparent; }
}
/* horizontal overflow: never inside modals, panels, drawers */
.chat-list, .msgs, .st-props, .menu, .gchat-log { overflow-x: hidden; }
/* non-scrolling panels: clip (hidden would turn them into vertical scroll containers) */
.chat, .gm-card, .auth-card, .set-card, .gp-info, .earn-row .e-text { overflow-x: clip; }
/* modals size to their content (never their own scroll box — subpixel heights made Chromium show a bar for 1px);
   only on very short screens does the full-screen overlay scroll, with the thin glass bar */
.overlay { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.overlay > * { margin: auto; }
/* the scrim stays pinned to the viewport while the dialog scrolls (an absolute scrim scrolled away with the card) */
.overlay > .scrim { position: fixed; }
.shards-modal, .pub-card { max-height: none !important; overflow: visible !important; }
.earn-row > *, .set-row > *, .person > *, .server > *, .conv > *, .gp-info > *, .create-card > * { min-width: 0; }
.shards-modal { padding: 24px; }
.shards-modal .s-head { margin-bottom: 16px; }
.shards-modal .shard-ic.xl { width: 44px; height: 44px; }
.earn { gap: 8px; }
.earn-row { padding: 12px 14px; }
.b-gems { overflow: visible; width: 64px; }
@media (max-height: 760px) { .shards-modal { padding: 20px; } .earn-row { padding: 10px 12px; } .fine-note { margin-top: 12px; } }
.ic-panel .swatches { gap: 5px; flex-wrap: nowrap; }

/* =====================================================================
   Accent (one colour, driven by the --accent* variables above)
   ===================================================================== */
html.theme-light {
  --accent: #2f6feb; --accent-hi: #4c8dff; --accent-lo: #2560d6; --accent-ink: #ffffff; --accent-text: #2160d8;
  --accent-soft: rgba(47, 111, 235, 0.12); --accent-ring: rgba(47, 111, 235, 0.55); --accent-glow: rgba(47, 111, 235, 0.28);
}
::selection, html.theme-light ::selection { background: var(--accent); color: var(--accent-ink); }
.btn-primary, html.theme-light .btn-primary { background: var(--accent-grad); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -2px 4px rgba(0,0,0,.14), 0 8px 24px var(--accent-glow); }
.btn-primary:hover, html.theme-light .btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 34px var(--accent-glow), 0 2px 6px rgba(0,0,0,.3); }
.nav-links a.active, html.theme-light .nav-links a.active, .icon-pill.active, html.theme-light .icon-pill.active { color: var(--accent-text); background: var(--accent-soft); }
.tabbar a.active, html.theme-light .tabbar a.active { color: var(--accent-ink); background: var(--accent-grad); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 2px 10px var(--accent-glow); }
a.u, .toast a.u, .link-btn, .chat-head a, html.theme-light a.u, html.theme-light .link-btn { color: var(--accent-text); text-decoration-color: var(--accent-ring); }
.link-btn:hover { color: var(--accent-hi); }
:focus-visible { outline-color: var(--accent-ring); }
.card:focus-visible, .switch:focus-visible, .seg3 button:focus-visible, .sw.on, .btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.dot { background: var(--online); } .dot.live { box-shadow: 0 0 0 0 var(--accent-ring); }
.odot.on, html.theme-light .odot.on { background: var(--online); box-shadow: none; }
.odot.ingame, html.theme-light .odot.ingame { background: var(--online); box-shadow: none; }
.odot.ingame::after, html.theme-light .odot.ingame::after { inset: 3px; background: var(--accent-ink); }
.nbadge, html.theme-light .nbadge, .beta, html.theme-light .beta, .tool-layer .beta, html.theme-light .tool-layer .beta, .badge.feat, html.theme-light .badge.feat, .shards-pill .plus, html.theme-light .shards-pill .plus { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.admin-badge, html.theme-light .admin-badge { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-ring); }
.shard-ic.xl { filter: drop-shadow(0 6px 18px var(--accent-glow)); }

/* =====================================================================
   Sidebar (desktop rail, collapsible) · drawer on touch devices
   ===================================================================== */
:root { --sb-w: 228px; }
html.sb-collapsed { --sb-w: 76px; }
@media (max-width: 1200px) { html.nav-side:not(.sb-expanded) { --sb-w: 76px; } html.nav-side .sb-collapse { display: none; } }
.sidebar { position: fixed; z-index: 60; top: 16px; bottom: 16px; left: 16px; width: var(--sb-w); border-radius: 28px; padding: 14px 10px; display: flex; flex-direction: column; gap: 6px;
  overflow: hidden auto; transition: width .3s var(--ease), transform .35s var(--ease); }
.sb-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 10px; min-height: 44px; }
.sb-brand { gap: 10px; font-size: 19px; }
.sb-close { display: none; }
.sb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sb-list a, .sb-list button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 0; background: none;
  color: var(--fg-2); font: inherit; font-size: 14.5px; font-weight: 550; cursor: pointer; text-align: left; white-space: nowrap; transition: background .2s, color .2s; }
.sb-list svg { flex: none; }
.sb-list a:hover, .sb-list button:hover { background: rgba(255,255,255,.08); color: var(--fg); }
.sb-list a.active { background: var(--accent-soft); color: var(--accent-text); }
.sb-list a.active::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 3px; background: var(--accent); }
.sb-admin { display: none; } body.admin-mode .sb-admin { display: block; }
.sb-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.sb-new { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-style: normal; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sb-collapse { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 14px; border: 0; border-radius: 14px; background: none; color: var(--fg-3); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sb-collapse:hover { color: var(--fg); background: rgba(255,255,255,.06); }
.sb-collapse svg { transition: transform .3s var(--ease); flex: none; }
/* icon-only rail */
html.sb-collapsed .sidebar .sb-label, html.sb-collapsed .sb-new { display: none; }
@media (max-width: 1200px) { html.nav-side .sidebar .sb-label, html.nav-side .sb-new { display: none; } }
html.sb-collapsed .sb-collapse svg { transform: rotate(180deg); }
html.sb-collapsed .sb-list a, html.sb-collapsed .sb-list button, html.sb-collapsed .sb-collapse { justify-content: center; padding: 0; }
@media (max-width: 1200px) { html.nav-side .sb-list a, html.nav-side .sb-list button { justify-content: center; padding: 0; } }
html.sb-collapsed .sb-head { justify-content: center; padding: 4px 0 10px; }
@media (max-width: 1200px) { html.nav-side .sb-head { justify-content: center; padding: 4px 0 10px; } }
html.sb-collapsed .sb-badge, html.nav-side .sidebar .sb-badge:only-child { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; }
@media (max-width: 1200px) { html.nav-side .sb-badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; font-size: 9.5px; padding: 0 4px; } html.nav-side .sb-new:not([hidden]) { display: block; position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; padding: 0; font-size: 0; } }
html.sb-collapsed .sb-new:not([hidden]) { display: block; position: absolute; top: 8px; right: 12px; width: 8px; height: 8px; padding: 0; font-size: 0; }
/* desktop layout: content + slim top bar sit to the right of the rail */
html.nav-side body.authed { --sb-space: calc(var(--sb-w) + 32px); }
html.nav-side body.authed .nav-wrap { padding-left: var(--sb-space); }
html.nav-side body.authed .nav { width: min(1180px, 100%); }
html.nav-side body.authed .nav .brand, html.nav-side body.authed .nav-links { display: none; }
html.nav-side body.authed main, html.nav-side body.authed .footer { width: auto; max-width: 1180px; margin-left: calc(var(--sb-space) + max(0px, (100% - var(--sb-space) - 16px - 1180px) / 2)); margin-right: 16px; }
html.nav-side body.authed .nav .search { margin-right: auto; }
html.nav-side body.authed .nav .nav-actions { width: 100%; }
html.nav-side body.authed .search input { width: 240px; }
.sb-burger { display: none; }
body.gated .sidebar, body.gated .sb-burger, body.gaming .sidebar, body.tooling .sidebar { display: none !important; }
/* touch devices: slide-out drawer + hamburger (bottom tab bar stays) */
html.nav-tabs .sb-burger { display: grid; flex: none; }
html.nav-tabs .sidebar { top: 0; bottom: 0; left: 0; width: min(300px, 84vw); border-radius: 0 28px 28px 0; padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-105%); z-index: 120; visibility: hidden; transition: transform .35s var(--ease), visibility 0s .35s; }
html.nav-tabs .sidebar.open { transform: none; visibility: visible; transition: transform .35s var(--ease); }
html.nav-tabs .sidebar .sb-label { display: inline; }
html.nav-tabs .sb-close { display: grid; }
html.nav-tabs .sb-collapse { display: none; }
.sb-scrim { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fadeIn .25s both; }
@keyframes fadeIn { from { opacity: 0; } }
body.drawer-open { overflow: hidden; }
html.theme-light .sb-list a:hover, html.theme-light .sb-list button:hover, html.theme-light .sb-collapse:hover { background: rgba(0,0,0,.05); }
html.theme-light .sb-scrim { background: rgba(0,0,0,.2); }

/* =====================================================================
   Forums · thread · update log · admin · legal
   ===================================================================== */
.f-compose { border-radius: var(--r-lg); padding: 20px; display: grid; gap: 12px; margin-bottom: 18px; }
.f-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.f-row .grow, .grow { flex: 1; min-width: 200px; }
.f-compose input, .f-compose textarea, .f-compose select, .t-reply textarea, .t-edit input, .t-edit textarea, .admin-grid input, .t-status select { width: 100%; padding: 11px 14px; border-radius: 14px; font: inherit; font-size: 14px; color: var(--fg); border: 0; resize: vertical; }
.f-compose select, .t-status select { appearance: none; padding-right: 30px; cursor: pointer; }
.field em { font-style: normal; color: var(--fg-3); font-weight: 500; }
.f-bug { display: grid; gap: 12px; }
.f-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; }
.f-bar .sub { margin: 0; }
.f-sort { width: 260px; }
.f-list { display: grid; gap: 10px; padding-bottom: 40px; }
.f-thread { display: grid; grid-template-columns: 64px minmax(0, 1fr) 128px; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 20px; transition: transform .25s var(--ease), background .2s; }
.f-thread:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); }
.f-score { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg-2); }
.f-score svg { color: var(--accent); }
.f-main { display: grid; gap: 4px; min-width: 0; }
.f-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-meta, .f-last { color: var(--fg-3); font-size: 12.5px; }
.f-side { display: grid; justify-items: end; text-align: right; gap: 1px; min-width: 0; }
.f-side b { font-size: 18px; font-variant-numeric: tabular-nums; } .f-side small { color: var(--fg-3); font-size: 12px; } .f-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.f-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ftag { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid var(--stroke); color: var(--fg-2); }
.ftag.pin { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.ftag.lock { color: var(--fg-3); }
.ftag.st-open { border-color: var(--stroke-hi); color: var(--fg); }
.ftag.st-investigating { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-ring); }
.ftag.st-fixed { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.ftag.st-wontfix { color: var(--fg-3); text-decoration: line-through; }
.f-skel { height: 76px; border-radius: 20px; opacity: .5; animation: pulse 1.4s ease-in-out infinite; }
.f-skel.tall { height: 260px; }
#page-thread { padding-top: 104px; }
.back-link { display: inline-block; color: var(--fg-2); font-size: 14px; margin-bottom: 14px; }
.back-link:hover { color: var(--fg); }
.t-post { border-radius: var(--r-xl); padding: 26px 28px; display: grid; gap: 14px; }
.t-title { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.02em; line-height: 1.15; overflow-wrap: anywhere; }
.t-author { display: flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: 13px; }
.t-author .head-img { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); }
.u-link { color: var(--fg); font-weight: 650; } .u-link:hover { color: var(--accent-text); }
.t-text { font-size: 15.5px; line-height: 1.6; color: var(--fg); overflow-wrap: anywhere; }
.t-bug { margin: 0; padding: 14px 16px; border-radius: 16px; display: grid; gap: 4px; font-size: 14px; }
.t-bug dt { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); margin-top: 6px; } .t-bug dt:first-child { margin-top: 0; }
.t-bug dd { margin: 0; overflow-wrap: anywhere; }
.t-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.vote.on { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-ring); }
.vote svg { color: var(--accent); }
.danger-text { color: #ff8a8a !important; } html.theme-light .danger-text { color: #c62828 !important; }
.t-admin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--stroke); }
.t-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); } .t-status select { width: auto; padding: 8px 30px 8px 12px; }
.t-count { margin: 26px 4px 12px; font-size: 16px; color: var(--fg-2); }
.t-replies { display: grid; gap: 10px; }
.t-rep { border-radius: 20px; padding: 16px 18px; display: grid; gap: 10px; }
.t-rep .t-text { font-size: 14.5px; }
.link-btn.like.on { color: var(--accent-text); text-decoration: none; }
.t-reply { border-radius: 20px; padding: 14px; display: grid; gap: 10px; margin: 16px 0 50px; }
.t-reply-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.t-locked { border-radius: 18px; padding: 16px; margin: 16px 0 50px; color: var(--fg-2); text-align: center; }
.t-edit { display: grid; gap: 10px; }
.timeline { list-style: none; margin: 0; padding: 0 0 50px 26px; position: relative; display: grid; gap: 16px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 50px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent-ring), var(--stroke) 30%, transparent); }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -26px; top: 22px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--stroke-hi); }
.tl-dot.now { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-card { border-radius: var(--r-lg); padding: 20px 24px; }
.tl-card header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-ver { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.tl-latest { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.tl-card time { color: var(--fg-3); font-size: 13px; margin-left: auto; }
.tl-del { margin-left: 8px; }
.tl-card h3 { margin: 6px 0 8px; font-size: 16px; color: var(--fg-2); font-weight: 600; }
.tl-card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--fg); font-size: 14.5px; line-height: 1.5; }
.tl-card li::marker { color: var(--accent); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 50px; }
.admin-grid .set-card { display: grid; gap: 10px; align-content: start; }
.admin-grid h3 { margin: 0; }
.op-list { display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.op-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); font-weight: 600; font-size: 14px; }
.op-item small { color: var(--fg-3); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-item:hover { background: rgba(255,255,255,.1); }
.op-links { display: flex; gap: 10px; flex-wrap: wrap; }
.legal-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 26px 0 40px; color: var(--fg-3); font-size: 12.5px; }
.legal-row a { color: var(--fg-3); } .legal-row a:hover { color: var(--fg-2); text-decoration: underline; }
.legal .page-head { padding-bottom: 60px; max-width: 820px; }
.legal-card { border-radius: var(--r-lg); padding: 26px 30px; margin-top: 14px; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.legal-card h2 { font-size: 17px; color: var(--fg); margin: 22px 0 6px; } .legal-card h2:first-child { margin-top: 0; }
.legal-card b { color: var(--fg); } .legal-card ul { padding-left: 20px; display: grid; gap: 4px; }
.legal-nav { margin-top: 16px; color: var(--fg-3); font-size: 14px; }
@media (max-width: 760px) {
  .f-thread { grid-template-columns: 44px minmax(0, 1fr); } .f-side { grid-column: 2; justify-items: start; text-align: left; display: flex; gap: 6px; align-items: baseline; } .f-side b { font-size: 14px; }
  .admin-grid { grid-template-columns: 1fr; } .t-post { padding: 20px; } .f-sort { width: 100%; } .tl-card time { margin-left: 0; width: 100%; }
}
html.theme-light .f-thread:hover { background: rgba(255,255,255,.7); }
html.theme-light .ftag { background: rgba(0,0,0,.04); }
html.theme-light .op-item { background: rgba(0,0,0,.04); } html.theme-light .op-item:hover { background: rgba(0,0,0,.08); }

/* profile stat tiles: one row, number stacked above its label */
.p-stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.p-stats div { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 12px 6px 10px; min-width: 0; }
.p-stats b { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 18px; line-height: 1.1; white-space: nowrap; }
.p-stats small { display: block; font-size: 11px; line-height: 1.25; letter-spacing: .01em; color: var(--fg-3); text-wrap: balance; }

/* ---------- presence dots (green online · blue in a game · gray offline), censor dots, profile v4 ---------- */
.odot, html.theme-light .odot { display: block; background: #6b6d74; box-shadow: none; }
.odot::after, html.theme-light .odot::after { content: none; }
.odot.on, html.theme-light .odot.on { background: #34c759; }
.odot.ingame, html.theme-light .odot.ingame { background: var(--accent); }
.fhead-wrap.xs { position: relative; display: inline-flex; flex: none; }
.fhead-wrap.xs .odot { width: 10px; height: 10px; border-width: 2px; right: -2px; bottom: -2px; }
.odot.xl { width: 26px; height: 26px; border-width: 4px; right: 14px; bottom: 14px; }
.up-avatar { position: relative; }
.pres-line[data-state="on"] { color: #34c759; }
.pres-line[data-state="ingame"] { color: var(--accent-text); }
.pres-line[data-state="off"] { color: var(--fg-3); }
.censor { color: var(--fg-2); opacity: .9; letter-spacing: .04em; }
/* on a "mine" bubble (white in dark mode / near-white in light) the muted gray was invisible — force a readable dark gray */
.msg.mine .censor, .gmsg.mine .censor { color: rgba(0,0,0,.5); opacity: 1; }
html.theme-light .msg .censor, html.theme-light .gmsg .censor { color: rgba(0,0,0,.45); }
.up-handle { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.up-bio { margin: 10px 0 0; color: var(--fg-2); font-size: 15px; line-height: 1.45; max-width: 60ch; overflow-wrap: anywhere; }
.up-bio.muted { color: var(--fg-3); font-style: italic; }
.up .p-stats.up-stats { grid-auto-flow: row; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); margin: 16px 0 6px; }
@media (max-width: 760px) { .up .p-stats.up-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.chat-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.chat-who .head-img { width: 28px; height: 28px; border-radius: 9px; }
.chat-who > span:last-child { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.chat-who .pres-line { font-size: 11px; font-weight: 500; }
.creator .fhead-wrap.xs .head-img { margin: 0; }
.mrep, .grep { opacity: 0; }
.msg:hover .mrep, .gmsg:hover .grep, .mrep:focus-visible, .grep:focus-visible { opacity: .8; }
html.is-touch .mrep, html.is-touch .grep { opacity: .55; }
.t-rep-btn { margin-left: auto; background: none; border: 0; color: var(--fg-3); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.t-rep-btn:hover { color: var(--fg-1); background: rgba(127,127,127,.12); }
.av-title { margin: 0; font-size: 30px; }
.av-actions { margin-top: 10px; }
#cSelect { width: 100%; padding: 10px 12px; border-radius: 12px; color: inherit; font: inherit; }

/* ---------- Limited items ---------- */
.lim-badge { position: absolute; left: 10px; top: 10px; z-index: 2; font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 3px 8px; border-radius: 6px; color: #fff;
  background: linear-gradient(135deg, var(--accent-hi), var(--accent-lo)); box-shadow: 0 4px 14px var(--accent-glow); }
.op-item .lim-badge, .lim-badge.inline { position: static; display: inline-block; margin-left: 4px; font-size: 9px; padding: 2px 6px; vertical-align: middle; }
.lim-badge.lg { font-size: 12px; padding: 5px 10px; left: 14px; top: 14px; }
.tile.lim .lim-badge { left: 6px; top: 6px; font-size: 9px; padding: 2px 6px; letter-spacing: .04em; }
.item.lim .item-art { position: relative; display: block; }
.lim-bar { height: 6px; border-radius: 99px; background: rgba(127,127,127,.18); overflow: hidden; margin-top: 8px; }
.lim-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-hi), var(--accent)); }
.lim-bar.lg { height: 8px; margin: 12px 0 4px; max-width: 520px; }
.lim-page { padding-top: 104px; }
.lim-hero { border-radius: var(--r-xl); padding: 22px; display: grid; grid-template-columns: 280px 1fr; gap: 26px; align-items: center; }
.lim-art { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 1; background: radial-gradient(60% 45% at 50% 88%, rgba(255,255,255,.18), transparent 70%), rgba(255,255,255,.04); }
.lim-art .thumb { width: 100%; height: 100%; object-fit: contain; }
.lim-info .page-title { margin: 6px 0 4px; }
.lim-stats { margin: 14px 0 4px; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)) !important; grid-auto-flow: row !important; max-width: 640px; }
.lim-own { margin-top: 10px; }
.lim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.lim-list { display: grid; gap: 6px; margin: 10px 0; }
.lim-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; font-size: 14px; }
.lim-row > span { color: var(--fg-2); }
.lim-row .lim-p { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--fg-1); font-weight: 650; font-variant-numeric: tabular-nums; }
.lim-sell { margin-left: auto; display: flex; gap: 6px; }
.lim-sell input { width: 110px; padding: 6px 10px; border-radius: 10px; color: inherit; font: inherit; }
.lim-spark { width: 100%; height: 80px; display: block; margin: 8px 0 4px; }
@media (max-width: 860px) { .lim-hero, .lim-grid { grid-template-columns: 1fr; } .lim-art { max-width: 280px; justify-self: center; width: 100%; } .lim-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } .lim-page { padding-top: 84px; } }

/* ---------- Admin hub ---------- */
.op-wide { grid-column: 1 / -1; }
.op-user { margin-top: 12px; padding: 14px; border-radius: 16px; display: grid; gap: 12px; }
.op-uhead { display: flex; gap: 12px; align-items: center; }
.op-uhead .head-img { width: 48px; height: 48px; border-radius: 14px; }
.op-uhead small { display: block; color: var(--fg-3); font-size: 11px; margin-top: 2px; }
.op-stats { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; grid-auto-flow: row !important; margin: 0; }
@media (max-width: 760px) { .op-stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; } }
.op-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.op-actions .f-row { display: flex; gap: 8px; align-items: center; }
.op-actions input, .op-actions select, .op-form input, .op-form select { padding: 9px 12px; border-radius: 12px; color: inherit; font: inherit; min-width: 0; }
@media (max-width: 760px) { .op-actions { grid-template-columns: 1fr; } }
.op-form { display: grid; gap: 10px; margin: 10px 0; }
.op-form .f-row { display: flex; gap: 10px; flex-wrap: wrap; }
.op-form .grow { flex: 1 1 120px; }
.op-form input[type=color] { width: 54px; height: 40px; padding: 3px; border: 0; border-radius: 10px; background: none; }
.op-rep { padding: 12px; border-radius: 14px; display: grid; gap: 6px; }
.op-rep-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.op-rep-top small { color: var(--fg-3); margin-left: auto; }
.op-rep-ex { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.op-rep-act { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.sm .chip { padding: 5px 12px; font-size: 12px; }

/* ---------- first-person camera + script HUD ---------- */
.canvas-wrap .crosshair { display: none; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(0,0,0,.55); pointer-events: none; z-index: 4; }
.canvas-wrap.fp .crosshair { display: block; }
.script-hud { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); padding: 7px 16px; border-radius: 999px; background: rgba(10,10,12,.62); color: #fff; font-weight: 600; font-size: 14px; pointer-events: none; z-index: 4; backdrop-filter: blur(8px); max-width: 80vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.script-console { position: absolute; right: 12px; bottom: 12px; width: min(420px, 60vw); max-height: 150px; overflow: auto; padding: 8px 10px; border-radius: 10px; background: rgba(8,8,10,.78); color: #d8d8d8; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; z-index: 5; }
.script-console .sc-warn { color: #ffd479; } .script-console .sc-error { color: #ff7b7b; }

/* ---------- Studio Advanced mode (desktop) ---------- */
.tool-layer:not(.adv) .adv-only { display: none !important; }
#stAdvToggle[aria-pressed="true"] { background: var(--accent); border-color: transparent; color: #fff; }
.tool-layer.adv .st-props { width: 310px; }
.st-advbar { position: absolute; z-index: 3; left: 364px; right: 334px; top: 80px; min-height: 44px; border-radius: 16px; padding: 5px 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
/* per-panel collapse: each side panel has its own header button; collapsing one leaves the others alone */
.st-phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin: -2px 0 2px; padding: 2px 2px; border: 0; background: none; color: var(--fg-2); font: 700 11px/1 inherit; letter-spacing: .07em; text-transform: uppercase; cursor: pointer; }
.st-phead:hover { color: var(--fg); }
.st-phead .st-pchev { transition: transform .2s var(--spring); opacity: .75; }
.panel-min > .st-phead .st-pchev { transform: rotate(-90deg); }
.panel-min > :not(.st-phead):not(.ex-head) { display: none !important; }
.panel-min .ex-min { transform: rotate(-90deg); }
.panel-min.st-tools { width: auto; padding: 6px 10px; }
.panel-min.st-props, .panel-min.st-explorer { max-height: none; }
.st-panels-btn { white-space: nowrap; }
.st-advbar > * { position: relative; z-index: 2; }
.st-advbar button, .st-advbar select { height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06); color: var(--fg); font: 600 12px/1 inherit; cursor: pointer; }
.st-advbar button.on { background: var(--accent); border-color: transparent; color: #fff; }
.st-advbar button:disabled { opacity: .4; cursor: default; }
.st-advbar .sep { width: 1px; height: 22px; background: rgba(255,255,255,.14); margin: 0 3px; }
.st-advbar label { font-size: 11px; color: var(--fg-3); display: flex; align-items: center; gap: 4px; }
.st-explorer { position: absolute; z-index: 3; left: 112px; top: 80px; width: 240px; max-height: calc(100% - 140px); border-radius: 20px; padding: 10px 6px; display: flex; flex-direction: column; }
.st-explorer > * { position: relative; z-index: 2; }
.ex-head { display: flex; align-items: center; gap: 4px; padding: 0 6px 8px; }
.ex-head b { flex: 1; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-2); }
.ex-head button { height: 26px; padding: 0 7px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06); color: var(--fg); font-size: 11px; cursor: pointer; }
.ex-search { height: 28px; margin: 0 6px 8px; padding: 0 9px; border-radius: 9px; font-size: 12px; color: var(--fg); }
.ex-none { padding: 8px; }
.ex-tree { overflow-y: auto; min-height: 60px; flex: 1; padding-bottom: 20px; }
.st-ctx { position: fixed; z-index: 90; min-width: 150px; padding: 5px; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; }
.st-ctx button { text-align: left; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); font-size: 12.5px; cursor: pointer; }
.st-ctx button:hover { background: rgba(255,255,255,.1); }
.sc-tpl { padding: 6px 8px 0; }
.sc-tpl select { width: 100%; height: 30px; font-size: 12px; }
.ex-row { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 calc(6px + var(--d, 0) * 14px); border-radius: 7px; font-size: 12.5px; color: var(--fg-2); cursor: pointer; user-select: none; white-space: nowrap; }
.ex-row:hover { background: rgba(255,255,255,.07); color: var(--fg); }
.ex-row.sel { background: color-mix(in srgb, var(--accent) 38%, transparent); color: #fff; }
.ex-row.drop { outline: 1.5px dashed var(--accent); }
.ex-row .ic { width: 14px; text-align: center; opacity: .75; flex: none; }
.ex-row .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.ex-row .lk { opacity: .7; font-size: 11px; }
.ex-row .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.ex-row input { width: 100%; height: 22px; font-size: 12px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--accent); background: #111; color: #fff; }
.ex-row.root-drop { opacity: .6; font-style: italic; }
.st-props .chk { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.st-props .chk label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg-2); cursor: pointer; }
.st-props .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-props input[type=range] { width: 100%; accent-color: var(--accent); }
.st-props input[type=color] { width: 40px; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; }
.st-props .hexrow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-3); }
.st-props .attr { display: grid; grid-template-columns: 1fr 1fr 28px; gap: 5px; }
.st-props .attr input { height: 30px; font-size: 12px; padding: 0 7px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: var(--fg); min-width: 0; }
.st-props .attr button, .st-props .mini { height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: var(--fg); cursor: pointer; font-size: 12px; }
.st-props .lbl { font-size: 12px; color: var(--fg-3); display: flex; justify-content: space-between; }
.st-ui { position: absolute; z-index: 5; left: 364px; right: 334px; bottom: 12px; max-height: min(60%, 520px); overflow-y: auto; border-radius: 20px; padding: 12px; display: grid; gap: 10px; align-content: start; }
.st-ui > * { position: relative; z-index: 2; }
.st-ui-head { display: flex; align-items: center; gap: 8px; }
.st-ui-head b { flex: 1; font-size: 14px; }
.st-ui .ui-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.04); }
.st-ui .ui-row small { display: block; color: var(--fg-3); font-size: 11px; }
.st-ui .ui-tok { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; background: rgba(255,255,255,.08); font: 600 12px/1 inherit; }
.st-ui .ui-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.st-ui .ui-hint { font-size: 11.5px; color: var(--fg-3); }
.st-ui .ui-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-scripts { position: absolute; z-index: 4; left: 364px; right: 334px; bottom: 12px; height: min(46%, 420px); border-radius: 20px; padding: 10px; display: grid; grid-template-columns: 170px 1fr; grid-template-rows: auto 1fr auto; gap: 8px; }
.st-scripts > * { position: relative; z-index: 2; min-width: 0; min-height: 0; }
.st-scripts .sc-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; }
.st-scripts .sc-head b { flex: 1; font-size: 13px; }
.st-scripts .sc-head button, .sc-list button { height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: var(--fg); font-size: 12px; cursor: pointer; }
.sc-list { overflow-y: auto; display: grid; align-content: start; gap: 3px; grid-row: 2 / 4; }
.sc-list .sc-item { text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; height: auto !important; padding: 5px 9px !important; }
.sc-list .sc-item small { color: var(--fg-3); font-size: 10.5px; }
.sc-list .sc-item.on { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.st-scripts textarea { width: 100%; height: 100%; resize: none; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: #0a0a0c; color: #e8e8e8; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 10px 12px; tab-size: 2; white-space: pre; }
.st-scripts .sc-foot { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--fg-3); }
.st-scripts .sc-foot .ok { color: #6fdc8c; } .st-scripts .sc-foot .bad { color: #ff7b7b; }
.st-scripts details { font-size: 11.5px; color: var(--fg-2); }
.st-scripts details pre { white-space: pre-wrap; margin: 6px 0 0; font: 11px/1.5 ui-monospace, Menlo, monospace; max-height: 160px; overflow: auto; background: rgba(255,255,255,.04); padding: 8px; border-radius: 8px; }
.edit-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.edit-colors .ec-lbl { font-size: 12px; font-weight: 600; color: var(--fg-3); margin-right: 4px; }
.edit-colors .ec-sw { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(127,127,127,.35); }
.edit-colors .ec-sw.on { box-shadow: 0 0 0 2px var(--bg, #000), 0 0 0 4px var(--accent); }
.edit-colors .ec-sw.def { background: var(--glass-2, rgba(127,127,127,.15)); color: var(--fg-2); font-size: 13px; }
.edit-colors .ec-custom input { width: 28px; height: 26px; border: 0; padding: 0; background: none; cursor: pointer; }

/* ---------- chat launcher + panel (v4 layout) ---------- */
.chat-fab { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); height: 40px; padding: 0 14px 0 12px; gap: 7px; font-size: 13px; z-index: 85;
  box-shadow: 0 6px 22px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.25); }
.chat-fab svg { width: 18px; height: 18px; }
.chat-fab .nbadge { top: -6px; right: -6px; }
.chat-fab[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }
.chat { right: max(16px, env(safe-area-inset-right)); bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px); width: min(360px, calc(100vw - 32px)); height: min(520px, 80vh, calc(100vh - 100px)); border-radius: 22px; z-index: 86;
  box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.chat-head { padding: 12px 10px 12px 16px; min-height: 54px; border-bottom: 1px solid var(--stroke, rgba(127,127,127,.18)); }
.chat-head b { font-size: 15px; font-weight: 700; }
/* page content never ends under the launcher */
html.nav-side .footer { margin-bottom: 76px; }
html.nav-side main { padding-bottom: 24px; }
/* never during full-screen games, the Studio or the item creator (the game has its own chat) */
body.gaming .chat, body.tooling .chat, body.gated .chat { display: none !important; }
/* touch: chat lives in the tab bar / sidebar instead of a floating button */
html.nav-tabs .chat-fab { display: none !important; }
html.nav-tabs .tabbar { grid-template-columns: repeat(6, 1fr); }
html.nav-tabs .tabbar a .nbadge { top: 4px; right: calc(50% - 20px); }
html.nav-tabs .chat { left: 8px; right: 8px; width: auto; top: max(8px, env(safe-area-inset-top)); height: auto; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px + var(--ext-bottom, 0px)); }
body.chat-open .tabbar #tabChat { color: var(--accent); }

/* ---------- Studio: Basic / Advanced segmented toggle + first-run chooser ---------- */
.st-mode-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); }
.st-mode-seg button { height: 30px; padding: 0 14px; border-radius: 999px; border: 0; background: none; color: var(--fg-2); font: 650 13px/1 inherit; cursor: pointer; transition: background .2s, color .2s; }
.st-mode-seg button:hover { color: var(--fg); }
.st-mode-seg button[aria-checked="true"] { background: var(--accent); color: #fff; box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.st-mode-modal { z-index: 20; }
.st-mode-modal .scrim { background: rgba(4, 5, 8, .86); backdrop-filter: blur(2px); }
.mode-card { position: relative; width: min(720px, calc(100vw - 40px)); border-radius: 28px; padding: 32px; display: grid; gap: 22px; animation: pop .35s var(--spring) both;
  background: #16181d; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 30px 80px rgba(0,0,0,.6); color: #fff; }
.mode-card h3 { margin: 0; font-size: 26px; font-weight: 750; text-align: center; letter-spacing: -.01em; color: #fff; }
.mode-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; padding: 26px; border-radius: 22px; border: 2px solid rgba(255,255,255,.14);
  background: #20232a; color: #fff; cursor: pointer; font: inherit; transition: border-color .18s, transform .18s, box-shadow .18s, background .18s; }
.mode-choice:hover, .mode-choice:focus-visible { border-color: var(--accent); background: #232833; transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,.45), 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); outline: none; }
.mode-choice:active { transform: translateY(-1px); }
.mode-choice .mc-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.mode-choice b { font-size: 20px; font-weight: 750; display: flex; align-items: center; gap: 8px; color: #fff; }
.mode-choice > span:not(.mc-ic):not(.mc-go) { font-size: 14.5px; line-height: 1.5; color: #d3d6dc; }
.mode-choice small { font-size: 13px; font-weight: 650; color: #b4b9c2; }
.mode-choice .mc-go { margin-top: auto; align-self: stretch; text-align: center; padding: 11px 16px; border-radius: 12px; background: #2F6FEB; color: #fff; font-size: 14.5px; font-weight: 700; }
.mode-choice:hover .mc-go, .mode-choice:focus-visible .mc-go { background: #255fd1; }
.mode-note { margin: 0; text-align: center; font-size: 13.5px; color: #b4b9c2; }
html.theme-light .st-mode-modal .scrim { background: rgba(20, 22, 28, .62); }
html.theme-light .mode-card { background: #fbfbfc; border-color: rgba(0,0,0,.1); color: #0b0c0e; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
html.theme-light .mode-card h3, html.theme-light .mode-choice b { color: #0b0c0e; }
html.theme-light .mode-choice { background: #fff; border-color: rgba(0,0,0,.14); color: #0b0c0e; }
html.theme-light .mode-choice:hover, html.theme-light .mode-choice:focus-visible { background: #f4f7ff; border-color: #2F6FEB; }
html.theme-light .mode-choice > span:not(.mc-ic):not(.mc-go) { color: #3b3f47; }
html.theme-light .mode-choice small, html.theme-light .mode-note { color: #4d525c; }
html.theme-light .mode-choice .mc-ic { color: #2F6FEB; background: rgba(47,111,235,.12); }
html.theme-light .mode-choice .beta { background: #0b0c0e; color: #fff; }
@media (max-width: 640px) { .mode-choices { grid-template-columns: 1fr; } }

/* ---------- Creator dashboard (beta) ---------- */
.sb-beta { margin-left: auto; padding: 2px 6px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); font-size: 9.5px; font-style: normal; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
html.sb-collapsed .sb-beta { display: none; }
@media (max-width: 1200px) { html.nav-side .sb-beta { display: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 28px; }
.cr-stat { position: relative; border-radius: 20px; padding: 18px 18px 16px; display: grid; gap: 4px; }
.cr-stat > * { position: relative; z-index: 2; }
.cr-stat b { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.cr-stat .cr-sh { font-style: normal; font-size: 13px; font-weight: 650; color: var(--accent); }
.cr-stat span { font-size: 13px; font-weight: 650; color: var(--fg-2); }
.cr-stat small { font-size: 11.5px; color: var(--fg-3); line-height: 1.35; }
.cr-stat:first-child { border-top: 2px solid var(--accent); }
.cr-table { position: relative; border-radius: 20px; padding: 6px; display: grid; }
.cr-table > * { position: relative; z-index: 2; }
.cr-tr { display: grid; grid-template-columns: minmax(0, 1fr) 64px 80px 88px 92px minmax(0, max-content); align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; font-size: 14px; }
.cr-tr:not(.cr-th) + .cr-tr { border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.cr-tr:not(.cr-th):hover { background: rgba(255,255,255,.04); }
.cr-th { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); padding-block: 8px; }
.cr-game { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cr-game > span:last-child { display: grid; gap: 4px; min-width: 0; }
.cr-game b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-game small { color: var(--fg-3); font-size: 12px; display: flex; gap: 6px; align-items: center; }
.cr-art { position: relative; flex: none; width: 96px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111; }
.cr-art .art { position: absolute; inset: 0; }
.cr-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-act { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 0; }
.cr-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 12px; }
.cr-item { position: relative; border-radius: 18px; padding: 12px; display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.cr-item > * { position: relative; z-index: 2; }
.cr-item .thumb { width: 64px; height: 64px; border-radius: 12px; background: rgba(255,255,255,.06); object-fit: contain; }
.cr-item small { display: block; color: var(--fg-3); font-size: 12px; margin-top: 3px; }
.cr-item-n { display: grid; gap: 2px; text-align: right; font-size: 12px; color: var(--fg-2); }
.cr-item-n b { color: var(--fg); font-size: 14px; }
.cr-card { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.cr-thumb-row { display: grid; grid-template-columns: 200px 1fr; gap: 14px; align-items: center; }
.cr-thumb { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.cr-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-thumb-actions { display: grid; gap: 8px; justify-items: start; }
.cr-thumb-actions small { font-size: 11.5px; line-height: 1.4; }
.cr-thumb-actions label.btn { cursor: pointer; }
/* creator dashboard: the game's extra pictures (a small gallery under the cover) */
.cr-gal-block { display: grid; gap: 8px; }
.cr-gal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.cr-gal-head span { font-weight: 650; font-size: 13px; }
.cr-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cr-gal-item { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #111; border: 1px solid rgba(255,255,255,.12); }
.cr-gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-gal-item button { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(10,10,12,.72); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.cr-gal-add { justify-self: start; cursor: pointer; }
/* game page picture gallery + lightbox */
.gp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.gp-gallery button { padding: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9; background: #111; cursor: pointer; }
.gp-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s var(--ease); }
.gp-gallery button:hover img { transform: scale(1.06); }
.gal-box { position: relative; width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 40px); display: grid; place-items: center; }
.gal-img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 16px; display: block; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.gal-close { position: absolute; top: -14px; right: -6px; z-index: 3; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: rgba(10,10,12,.55); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; z-index: 3; }
.gal-nav.prev { left: 8px; } .gal-nav.next { right: 8px; }
.gal-dots { position: absolute; bottom: -26px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.gal-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.gal-dots i.on { background: #fff; }
@media (max-width: 760px) {
  .cr-th { display: none; }
  .cr-tr { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
  .cr-game, .cr-act { grid-column: 1 / -1; }
  .cr-act { justify-content: stretch; } .cr-act .btn { flex: 1; }
  .cr-tr [data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 2px; }
  .cr-thumb-row { grid-template-columns: 1fr; }
  .cr-stats { grid-template-columns: repeat(2, 1fr); }
}
.cr-game .tag { padding: 2px 7px; font-size: 10px; }
.cr-item > div { min-width: 0; } .cr-item b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-stat { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) { .cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cr-stat b { font-size: 22px; } }
@media (max-width: 760px) { .cr-tr { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cr-game { min-width: 0; } }
.cr-game > span:last-child { grid-template-columns: minmax(0, 1fr); flex: 1; } .cr-game small { flex-wrap: wrap; }
.st-props .wchk { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 13px; color: var(--fg-2); cursor: pointer; }
.st-props .wchk input { width: 16px; height: 16px; accent-color: var(--accent); }
.cr-pct { color: var(--fg-3); font-size: 12px; }
@media (max-width: 760px) { .cr-tr { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* likes / dislikes */
.gp-vote { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; flex-wrap: wrap; }
.vote-btn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: var(--fg); font: 650 14px/1 inherit; cursor: pointer; transition: background .18s, border-color .18s, transform .12s; }
.vote-btn:hover { border-color: rgba(255,255,255,.32); }
.vote-btn:active { transform: scale(.96); }
.vote-btn.on[data-vote="1"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote-btn.on[data-vote="-1"] { background: #fff; border-color: #fff; color: #000; }
.vote-btn:disabled { opacity: .6; cursor: wait; }
.vote-meter { flex: 1; min-width: 140px; display: grid; gap: 5px; }
.vote-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.vote-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.vote-meter small { font-size: 12.5px; color: var(--fg-2); }
.fav-btn .fav-n { font-style: normal; font-size: 13px; opacity: .7; margin-left: 2px; }
.like-pct { color: var(--accent); font-weight: 700; }
html.theme-light .vote-btn { border-color: rgba(0,0,0,.14); background: rgba(0,0,0,.04); }
html.theme-light .vote-btn.on[data-vote="-1"] { background: #0b0c0e; border-color: #0b0c0e; color: #fff; }
html.theme-light .vote-bar { background: rgba(0,0,0,.1); }
/* Studio shortcuts panel */
.st-keys-btn { width: 34px; padding: 0; font-weight: 800; }
.st-keys { position: absolute; z-index: 15; top: 70px; right: 16px; width: min(380px, calc(100vw - 32px)); border-radius: 20px; padding: 16px 18px; }
.st-keys > * { position: relative; z-index: 2; }
.st-keys-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.st-keys h4 { margin: 0; font-size: 15px; }
.st-keys dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13px; align-items: center; }
.st-keys dt { white-space: nowrap; }
.st-keys dd { margin: 0; color: var(--fg-2); }
.st-keys kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); font: 600 11.5px/1.4 inherit; text-align: center; }
.st-keys-note { margin: 12px 0 0; font-size: 12px; color: var(--fg-3); }
.tool-layer:not(.adv) .st-keys .adv-only { display: none; }
/* game loading screen */
.g-loading { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: #050506; transition: opacity .45s ease; }
.g-loading.fade { opacity: 0; pointer-events: none; }
.gl-back { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2) brightness(.55); transform: scale(1.08); }
.gl-card { position: relative; width: min(440px, calc(100vw - 40px)); padding: 18px 18px 20px; border-radius: 26px; background: rgba(18,19,23,.72); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 30px 80px rgba(0,0,0,.55); text-align: center; color: #fff; animation: pop .4s var(--spring) both; }
.gl-art { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #111; margin-bottom: 14px; }
.gl-art .art { position: absolute; inset: 0; }
.gl-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gl-card h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.gl-by { margin: 4px 0 14px; font-size: 13.5px; color: #c4c8cf; }
.gl-progress { height: 5px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.gl-progress i { display: block; height: 100%; width: 35%; border-radius: inherit; background: var(--accent); animation: glbar 1.2s ease-in-out infinite; }
.g-loading.done .gl-progress i { width: 100%; animation: none; transition: width .3s; }
@keyframes glbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.gl-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 13px; color: #e6e8ec; font-weight: 600; }
.gl-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; }
.g-loading.done .gl-spin { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.gl-tip { margin: 10px 0 0; min-height: 2.6em; font-size: 13px; line-height: 1.4; color: #b8bdc6; transition: opacity .22s; }
.gl-tip.swap { opacity: 0; }
@media (max-height: 480px) and (orientation: landscape) { .gl-card { width: min(560px, calc(100vw - 40px)); display: grid; grid-template-columns: 200px 1fr; gap: 0 16px; text-align: left; align-items: center; } .gl-art { grid-row: span 5; margin: 0; } .gl-status { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .gl-progress i, .gl-spin { animation: none; } }

/* =====================================================================
   v4.1 bug fixes
   ===================================================================== */
/* 1 · game page: the art keeps its 16:9 box inside its column (it used to grow sideways under the info card) and the
   info card's buttons wrap instead of being clipped */
.gp-hero, .gp-cols { min-width: 0; }
.gp-art { min-width: 0; }
.gp-art .art { width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 9; }
/* wide screens: one grid for the page — art (always 16:9, never cropped to fit a tall card) with About under it on the
   left; the info card and Servers on the right */
@media (min-width: 1081px) {
  .gp:has(.gp-hero) { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 20px; row-gap: 20px; align-items: start; }
  .gp .gp-hero, .gp .gp-cols { display: contents; }
  .gp .gp-art { grid-column: 1; grid-row: 1; }
  .gp .gp-info { grid-column: 2; grid-row: 1 / span 2; }
  .gp .gp-about { grid-column: 1; grid-row: 2; }
  .gp .gp-servers { grid-column: 2; grid-row: 3; }
  /* the store/badges block and the "More by" row span the full width and start AFTER the About/Servers row.
     They used to share grid-row 3 with Servers, so a long badges list overlapped the servers panel. */
  .gp > .gp5 { grid-column: 1 / -1; grid-row: 4; margin-top: 0; }
  .gp > .row-block { grid-column: 1 / -1; grid-row: 5; }
}
.gp-info { min-width: 0; }
.gp-title { overflow-wrap: anywhere; }
.gp-cta { flex-wrap: wrap; }
.gp-cta > .btn { min-width: 0; white-space: nowrap; }
.gp-cta .gp-play { flex: 2 1 150px; }
.gp-cta .fav-btn, .gp-cta #shareBtn { flex: 1 1 auto; padding: 0 16px; }
.gp-stats > div { min-width: 0; }
.gp-servers .server small { overflow-wrap: anywhere; }
@media (max-width: 1280px) and (min-width: 1081px) { .gp:has(.gp-hero) { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } .gp-info { padding: 22px; } }

/* 3 · game cards: rows leave room for the hover lift + shadow (overflow-x:auto also clips y), the lift is a plain
   transition (the entry animation no longer holds the transform), and while hovered a strip under the card keeps
   the pointer "on" it, so the bottom edge can't flicker in and out of hover */
.game-row { padding: 12px 8px 26px; margin: -8px -8px -12px; scroll-padding-inline: 8px; }
.card { animation-fill-mode: backwards; transition: transform .28s var(--ease), box-shadow .28s var(--ease); }
.card:hover { transform: translateY(-4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 14px 32px rgba(0,0,0,.45); }
html.theme-light .card:hover { box-shadow: inset 0 1px 0 #fff, 0 14px 30px rgba(0,0,0,.12); }
.card.glass { background: radial-gradient(120% 60% at 20% 0%, rgba(255,255,255,.1), transparent 55%), linear-gradient(135deg, rgba(255,255,255,.1), rgba(255,255,255,.03) 50%, rgba(255,255,255,.06)), rgba(22,22,24,.72); }
html.theme-light .card.glass { background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.7) 50%, rgba(255,255,255,.85)); }
.card.glass::after { display: none; }
.card.glass:hover::after { display: block; inset: auto 0 -10px 0; height: 10px; background: none; border-radius: 0; pointer-events: auto; }
.card:hover .card-art .art { transform: scale(1.04); }
html.is-touch .card.glass:hover::after { display: none; }

/* 4 · forums: category chips are links — centre their text; thread titles wrap to two lines instead of being cut */
.chip { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1.2; text-decoration: none; }
.f-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.f-meta { overflow-wrap: anywhere; }
.f-tags .tag { white-space: nowrap; }
.f-sort { max-width: 100%; }
.f-bar .sub { min-width: 0; flex: 1 1 240px; }
.f-thread:hover { transform: none; }

/* 5 · footer legal links + policies for signed-out visitors */
.footer-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 12.5px; color: var(--fg-3); }
.footer-legal a { color: var(--fg-3); } .footer-legal a:hover { color: var(--fg); text-decoration: underline; }
.gate-legal-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin: 14px 0 0; font-size: 12px; color: var(--fg-3); }
.gate-legal-links a { color: var(--fg-3); } .gate-legal-links a:hover { color: var(--fg); text-decoration: underline; }
body.gated.gate-legal main { display: block !important; width: min(860px, 100% - 32px); margin: 0 auto; }
body.gate-legal .gate { display: none !important; }
body.gate-legal .legal .page-head { padding-top: 40px; }

/* 6 · sidebar: one panel. The panel itself never scrolls (a scrolling glass panel dragged its rim/sheen along with the
   content, drawing a rounded edge across the list); only the list scrolls, with no visible scrollbar, and Collapse is
   pinned to the bottom. Short laptop screens get tighter rows so everything fits without scrolling. */
.sidebar { overflow: hidden; }
.sb-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; }
.sb-list::-webkit-scrollbar { display: none; width: 0; }
.sb-list > li { flex: none; }
.sb-head, .sb-collapse { flex: none; }
@media (max-height: 820px) {
  html.nav-side .sb-list a, html.nav-side .sb-list button { height: 40px; }
  html.nav-side .sb-head { min-height: 40px; padding-bottom: 6px; }
}
@media (max-height: 700px) {
  html.nav-side .sidebar { padding: 10px 8px; gap: 4px; }
  html.nav-side .sb-list { gap: 1px; }
  html.nav-side .sb-list a, html.nav-side .sb-list button { height: 36px; font-size: 14px; }
  html.nav-side .sb-head { min-height: 36px; padding: 2px 8px 4px; }
  html.nav-side .sb-collapse { height: 34px; }
}
.gp-info { container-type: inline-size; }
@container (max-width: 470px) { .gp-cta .gp-play { flex-basis: 100%; } .gp-cta .fav-btn, .gp-cta #shareBtn { flex: 1 1 0; } }
.gp-cta .btn svg { flex: none; }
/* v4.1.1 admin: section headings inside the player card */
.op-actions .op-sec { grid-column: 1 / -1; margin: 6px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--fg-2, rgba(255,255,255,.7)); display: flex; align-items: baseline; gap: 8px; }
.op-actions .op-sec small { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--accent-text, #4C8DFF); }
.op-actions .op-sec:first-child { margin-top: 0; }
.op-find-label { margin: 4px 0 -2px; }
@media (max-width: 720px) { .op-actions { grid-template-columns: 1fr; } }

/* =====================================================================================================
   v5 — badges · gamepasses · private servers · groups · events · notifications · pause menu · emotes · voice
   ===================================================================================================== */
.ico { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; font-size: 22px; line-height: 1; object-fit: cover; }
.ico.lg { width: 46px; height: 46px; font-size: 28px; border-radius: 12px; }
.ico.xl { width: 64px; height: 64px; font-size: 40px; border-radius: 16px; }
.ico.xxl { width: 104px; height: 104px; font-size: 64px; border-radius: 24px; }
img.ico { background: rgba(255,255,255,.06); }
.gp5 { display: grid; gap: 16px; margin-top: 16px; }
.gp5 > .glass { border-radius: var(--r-lg); padding: 20px 22px; }
.gp5 h2 { margin: 0 0 12px; font-size: 18px; } .gp5 h2 em { font-style: normal; color: var(--fg-3); font-weight: 500; }
.pass-list, .badge-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pass, .badge5 { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; min-width: 0; }
.pass-txt, .badge5 > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pass small, .badge5 small { color: var(--fg-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.badge5:not(.earned) .ico { filter: grayscale(1); opacity: .55; }
.badge5 .ok { color: var(--accent-text); font-weight: 650; }
html.theme-light .badge5 .ok { color: var(--accent-lo); }
.priv, .priv-invite { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-top: 10px; flex-wrap: wrap; }
.priv > div:first-child, .priv-invite { flex: 1; min-width: 0; }
.priv > div:first-child { display: flex; flex-direction: column; } .priv small, .priv-invite small { color: var(--fg-3); font-size: 12px; }
.priv-invite { border: 1px solid var(--accent-ring); background: var(--accent-soft); flex-direction: row; }
.priv-invite b { flex: 1; }
.priv-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.priv-code { display: flex; gap: 6px; } .priv-code input { width: 140px; padding: 8px 12px; border-radius: 999px; border: 0; font: inherit; font-size: 13px; color: var(--fg); }
.priv-off { margin: 10px 0 0; }
.badge-row, .group-row { display: flex; gap: 10px; overflow-x: auto; padding: 8px 2px 10px; scrollbar-width: thin; }
.badge-chip { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 16px; flex: none; max-width: 240px; color: inherit; text-decoration: none; }
.badge-chip span { display: flex; flex-direction: column; min-width: 0; } .badge-chip b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-chip small { color: var(--fg-3); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group-card { flex: none; width: 168px; padding: 16px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: inherit; text-decoration: none; transition: transform .25s var(--spring); }
.group-card:hover { transform: translateY(-3px); }
.group-card b { font-size: 14px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .group-card small { color: var(--fg-3); font-size: 12px; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; padding-top: 4px; } .group-grid .group-card { width: auto; }
.grp-search { display: flex; max-width: 420px; margin: 0 0 18px; }
.grp-hero { display: flex; gap: 22px; align-items: flex-start; padding: 24px; border-radius: var(--r-xl); margin-bottom: 18px; }
.grp-info { flex: 1; min-width: 0; } .grp-info .page-title { margin: 0 0 4px; } .grp-info .up-bio { margin: 10px 0 14px; color: var(--fg-2); }
.grp-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.grp-wall, .grp-members { border-radius: var(--r-lg); padding: 20px; display: grid; gap: 12px; align-content: start; }
.grp-wall h2, .grp-members h2 { margin: 0; font-size: 18px; } .grp-members h2 em { font-style: normal; color: var(--fg-3); }
.wall-list { display: grid; gap: 4px; }
.wall-post { display: flex; gap: 10px; padding: 10px 4px; border-top: 1px solid rgba(255,255,255,.07); }
html.theme-light .wall-post { border-top-color: rgba(0,0,0,.07); }
.wall-post:first-child { border-top: 0; }
.wp-body { flex: 1; min-width: 0; } .wp-body a { color: inherit; text-decoration: none; } .wp-body small { color: var(--fg-3); font-size: 12px; }
.wp-body p { margin: 3px 0 0; font-size: 14px; color: var(--fg-2); overflow-wrap: anywhere; }
.wp-act { display: flex; gap: 8px; align-items: flex-start; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--fg-3); cursor: pointer; } .link-btn:hover { color: var(--fg); text-decoration: underline; }
.mem-list { display: grid; gap: 6px; max-height: 520px; overflow: auto; }
.mem { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.mem-n { flex: 1; min-width: 0; color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.xs { padding: 5px 10px; font-size: 12px; min-height: 0; }
/* events */
.ev-row, .ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ev-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ev-card { border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.ev-ban { aspect-ratio: 3 / 1; background: linear-gradient(135deg, rgba(76,141,255,.35), rgba(255,255,255,.04)); display: grid; place-items: center; overflow: hidden; }
.ev-ban img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-ph { font-size: 44px; font-weight: 800; color: rgba(255,255,255,.5); }
.ev-body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.ev-body h3 { margin: 0; font-size: 17px; } .ev-desc { margin: 0; color: var(--fg-2); font-size: 14px; white-space: pre-line; }
.ev-top { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.live-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.live-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse5 1.4s ease-in-out infinite; }
@keyframes pulse5 { 50% { opacity: .3; } }
.ev-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--fg-2); }
.ev-act { display: flex; gap: 8px; margin-top: 4px; } .ev-act:empty { display: none; }
.ev-ended { opacity: .7; }
.ev-form .f-row { flex-wrap: wrap; } .ef-banprev img { height: 48px; border-radius: 8px; display: block; }
.ev-ai { display: flex; align-items: center; gap: 8px; } .ev-ai span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* sidebar count uses .sb-badge */ .sb-badge5 { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
/* creator panel */
.cr5 { display: grid; gap: 10px; margin-top: 8px; }
.cr5-list { display: grid; gap: 6px; } .cr5-row { display: flex; align-items: center; gap: 10px; }
.cr5-row span { flex: 1; min-width: 0; display: flex; flex-direction: column; } .cr5-row small { color: var(--fg-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.cr5-add { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); }
.cr5 input:not([type=checkbox]), .cr5 select, .m5-card input, .m5-card textarea, .ev-form input, .ev-form select, .ev-form textarea { width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; font: inherit; font-size: 14px; color: var(--fg); }
.cr5 .f-row input[type=number] { width: 110px; flex: none; }
.cr5 code { font-size: 11px; }
.icon-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ip-emo { display: flex; flex-wrap: wrap; gap: 2px; flex: 1; min-width: 200px; }
.ip-emo button { border: 0; background: none; font-size: 18px; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; }
.ip-emo button:hover { background: rgba(255,255,255,.12); }
/* v5 modal */
.m5 { position: fixed; inset: 0; z-index: 160; display: grid; place-items: center; padding: 20px; }
.m5 .scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.m5-card { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 40px); overflow: auto; border-radius: 26px; padding: 24px; display: grid; gap: 12px; }
.m5-card h3 { margin: 0; } .m5-card .field { display: grid; gap: 6px; } .m5-card .field > span { font-size: 13px; color: var(--fg-2); font-weight: 600; }
/* pause menu */
.gm-card { width: min(600px, 100%); max-height: calc(100dvh - 40px); overflow: hidden; display: flex; flex-direction: column; }
.gm-head { position: relative; } .gm-head > div { flex: 1; }
.gm-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: var(--fg); font-size: 20px; cursor: pointer; }
.gm-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.07); }
.gm-tabs button { flex: 1; border: 0; background: none; color: var(--fg-2); font: inherit; font-size: 13px; font-weight: 600; padding: 8px 6px; border-radius: 999px; cursor: pointer; }
.gm-tabs button[aria-selected="true"] { background: linear-gradient(180deg, #fff, #dcdcdc); color: #0a0a0a; }
.gm-panes { overflow: auto; min-height: 120px; max-height: min(58dvh, 500px); padding: 2px; }
.gm-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gm-players { display: grid; gap: 4px; }
.gm-ph { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); } .gm-ph em { font-style: normal; }
.gm-pl { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; }
.gm-pl:hover { background: rgba(255,255,255,.05); }
.gm-players .gm-pl span { background: none; padding: 0; border-radius: 0; }
.gm-players .gm-pl .fhead-wrap { border-radius: 50%; }
.gm-pn { flex: 1; min-width: 0; display: flex; flex-direction: column; } .gm-pn b { width: auto; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--fg); }
.gm-pn small { color: var(--fg-3); font-size: 11px; } .gm-pn .spk { color: var(--accent-text); font-style: normal; } .gm-pn .mic-off { color: #ff9a9a; font-style: normal; }
.gm-pa { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.gm-report { display: grid; gap: 8px; padding: 12px; border-radius: 14px; margin: 2px 0 8px; }
.gm-report select, .gm-report textarea { width: 100%; padding: 9px 12px; border-radius: 12px; border: 0; font: inherit; font-size: 13px; color: var(--fg); background: rgba(255,255,255,.07); }
.gm-invite { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-ring); margin-bottom: 10px; }
.gm-invite > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .gm-invite small { font-size: 12px; color: var(--fg-2); }
.gm-invite .gm-inv-list { display: grid; gap: 2px; margin-top: 8px; }
.gm-inv-f { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; }
.gm-inv-f .fhead-wrap { flex: none; } .gm-inv-f .gm-inv-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* collapsible invite panel: a compact one-line row that expands to a scrollable friend list */
.gm-invite { display: block; }
.gm-invite .gm-inv-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; padding: 0; text-align: left; }
.gm-invite .gm-inv-toggle b { font-weight: 650; }
.gm-invite .gm-inv-toggle small { font-size: 12px; color: var(--fg-2); font-weight: 400; }
.gm-invite .gm-inv-chev { flex: none; margin-left: auto; transition: transform .25s var(--ease); color: var(--fg-3); }
.gm-invite.open .gm-inv-chev { transform: rotate(180deg); }
.gm-invite .gm-inv-body { margin-top: 8px; display: grid; gap: 6px; }
.gm-invite .gm-inv-list { max-height: 168px; overflow-y: auto; padding-right: 2px; margin-top: 2px; }
.gm-invite .gm-inv-back { justify-self: start; }
/* long Shard counts must not burst the pill: cap the number's width and shrink it */
.shards-pill { max-width: min(46vw, 220px); }
.shards-pill b { max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
@media (max-width: 520px) { .shards-pill b { max-width: 84px; } }
.gm-set-group { display: grid; gap: 6px; margin-bottom: 14px; } .gm-set-group h4 { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); }
.gm-set { display: flex; align-items: center; gap: 12px; font-size: 14px; min-height: 36px; }
.gm-set > span { flex: 1; color: var(--fg-2); } .gm-set em { width: 46px; text-align: right; font-style: normal; font-variant-numeric: tabular-nums; color: var(--fg-3); font-size: 12px; }
.gm-set input[type=range] { width: min(200px, 45vw); accent-color: var(--accent); }
.seg3.sm button { padding: 5px 10px; font-size: 12px; }
.gm-emotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.gm-emo-more { grid-column: 1 / -1; margin: 4px 0 0; }
.ew-b { position: relative; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: var(--fg); border-radius: 18px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit; transition: background .2s, transform .2s var(--spring); }
.ew-b:hover, .ew-b:focus-visible { background: rgba(76,141,255,.25); transform: scale(1.05); outline: none; }
.ew-b span { font-size: 26px; line-height: 1; } .ew-b b { font-size: 12px; font-weight: 600; }
.ew-b kbd { position: absolute; top: 4px; right: 6px; font: 600 10px var(--font); color: var(--fg-3); }
/* emote wheel */
.emote-wheel { position: absolute; inset: 0; z-index: 22; display: grid; place-items: center; background: rgba(0,0,0,.35); animation: fade .2s var(--ease) both; }
.ew-ring { position: relative; width: min(360px, 86vw); aspect-ratio: 1; border-radius: 50%; background: rgba(20,20,22,.55); border: 1px solid rgba(255,255,255,.14); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.ew-ring .ew-b { position: absolute; left: 50%; top: 50%; width: 76px; margin: -38px 0 0 -38px; transform: rotate(var(--a)) translate(calc(min(360px, 86vw) * .36)) rotate(calc(-1 * var(--a))); }
.ew-ring .ew-b:hover, .ew-ring .ew-b:focus-visible { transform: rotate(var(--a)) translate(calc(min(360px, 86vw) * .36)) rotate(calc(-1 * var(--a))) scale(1.08); }
.ew-center { position: absolute; width: 84px; height: 84px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: var(--fg); font: 600 13px var(--font); cursor: pointer; }
.emote-btn { position: absolute; right: 118px; bottom: 34px; width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.12); color: #fff; font-size: 24px; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
/* voice */

.fps-meter { position: absolute; top: 60px; right: 14px; z-index: 6; padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.45); color: #fff; font: 600 11px ui-monospace, Menlo, monospace; pointer-events: none; }
/* notifications — simple rows, one accent dot for unread */
.bell-wrap { position: relative; }
.bell-n { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; pointer-events: none; }
.bell-pop { position: absolute; right: 0; top: calc(100% + 10px); width: min(340px, calc(100vw - 24px)); border-radius: 20px; padding: 8px; z-index: 60; display: grid; gap: 4px; animation: pop .3s var(--spring) both; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 9px; margin-bottom: 3px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.bell-head b { font-size: 14px; }
.bell-foot { display: flex; justify-content: flex-end; padding: 8px 10px 4px; font-size: 13px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 2px; }
html.theme-light .bell-head { border-bottom-color: rgba(0,0,0,.08); }
html.theme-light .bell-foot { border-top-color: rgba(0,0,0,.08); }
.bell-list { display: grid; gap: 1px; max-height: 380px; overflow: auto; } .bell-empty { padding: 18px 10px; margin: 0; text-align: center; }
.nt-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 22px; border-radius: 12px; cursor: pointer; font-size: 13px; }
.nt-row:hover, .nt-row:focus-visible { background: rgba(255,255,255,.07); outline: none; }
html.theme-light .nt-row:hover { background: rgba(0,0,0,.05); }
.nt-dot { position: absolute; left: 9px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); opacity: 0; }
.nt-row.unread .nt-dot { opacity: 1; }
.nt-ic { font-size: 17px; width: 24px; text-align: center; flex: none; }
.nt-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; } .nt-tx span { overflow-wrap: anywhere; } .nt-tx small { color: var(--fg-3); font-size: 11px; }
.nt-page { border-radius: var(--r-lg); padding: 8px; display: grid; gap: 1px; }
.notif-toggles { display: grid; }
/* tour */
.tour5 { position: fixed; inset: 0; z-index: 120; }
.t5-spot { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0,0,0,.6), 0 0 0 2px var(--accent); transition: all .35s var(--ease); pointer-events: none; }
.t5-card { position: fixed; padding: 18px; border-radius: 22px; display: grid; gap: 6px; transition: left .35s var(--ease), top .35s var(--ease); }
.t5-card h3 { margin: 0; } .t5-card p { margin: 0; color: var(--fg-2); font-size: 14px; } .t5-n { color: var(--fg-3); font-size: 12px; }
.t5-act { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; } .t5-act [data-t5="skip"] { margin-right: auto; }
@media (max-width: 860px) {
  .grp-cols { grid-template-columns: 1fr; }
  .grp-hero { flex-direction: column; align-items: center; text-align: center; } .grp-hero .p-actions { justify-content: center; }
}
@media (max-width: 640px) {
  .gm-card { padding: 16px; border-radius: 22px; } .gm-actions { grid-template-columns: 1fr 1fr; } .gm-actions #gResume { grid-column: 1 / -1; }
  .gm-tabs button { font-size: 12px; padding: 7px 4px; }
  .pass-list, .badge-list, .ev-grid, .ev-row { grid-template-columns: 1fr; }
  .gm-pa .btn.xs { padding: 5px 8px; }
  .priv-code input { width: 110px; }
}

/* v5: the run timer + Best pill (and the finish time) only show when the world turns on "Show timer & best time" */
.game-layer:not(.show-timer) .hud-time, .game-layer:not(.show-timer) .hud-best, .game-layer:not(.show-timer) .win-time,
.game-layer:not(.show-timer) .win-best, .game-layer:not(.show-timer) .win-sep { display: none !important; }

/* v5: shop motion items + Avatar animation packs */
.motion-art { display: grid; place-items: center; background: radial-gradient(80% 80% at 50% 30%, rgba(76,141,255,.22), rgba(255,255,255,.03)); }
.motion-art > span:first-child { font-size: 64px; line-height: 1; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.item-btn.is-static { cursor: default; }
.av5 { margin-top: 16px; display: grid; gap: 12px; } .av5 h2 { margin: 0; font-size: 18px; }
.av5-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.av5-b { position: relative; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: var(--fg); border-radius: 18px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit; }
html.theme-light .av5-b { border-color: rgba(0,0,0,.1); background: rgba(0,0,0,.03); }
.av5-b span { font-size: 30px; line-height: 1; } .av5-b b { font-size: 12px; } .av5-b small { font-size: 11px; color: var(--fg-3); display: inline-flex; gap: 3px; align-items: center; }
.av5-b.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); }
.av5-b.locked span { filter: grayscale(1); opacity: .6; }
.av5-h { margin: 4px 0 0; font-size: 15px; } .av5-h small { color: var(--fg-3); font-weight: 500; font-size: 12px; }
.av5-emo { display: flex; flex-wrap: wrap; gap: 6px; } .av5-emo .chip.locked { opacity: .55; }

/* v5 trading */
.tr-card { width: min(760px, 100%); }
.tr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tr-side { display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
html.theme-light .tr-side { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.08); }
.tr-side h4 { margin: 0; display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; } .tr-tot { color: var(--fg-3); font-weight: 500; font-size: 12px; }
.tr-inv { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; max-height: 300px; overflow: auto; }
.tr-it { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); color: var(--fg); border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 3px; align-items: stretch; text-align: left; cursor: pointer; font: inherit; }
html.theme-light .tr-it { border-color: rgba(0,0,0,.1); }
.tr-it .art, .tr-it img { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
.tr-it b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .tr-it small { font-size: 11px; color: var(--fg-3); display: inline-flex; gap: 3px; align-items: center; }
.tr-it.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); } .tr-it:disabled { opacity: .4; cursor: not-allowed; }
.tr-sh { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); } .tr-sh input { width: 120px; padding: 8px 10px; border-radius: 10px; border: 0; font: inherit; color: var(--fg); }
.tr-shv { margin: 0; display: flex; gap: 6px; align-items: center; font-weight: 650; }
.tr-rules { margin: 0; } .btn.counting { background: var(--accent); color: var(--accent-ink); }
.tr-list { display: grid; gap: 8px; }
.tr-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; cursor: pointer; }
.tr-row:hover { background: rgba(255,255,255,.07); } .tr-dir { font-size: 20px; color: var(--accent-text); } .tr-rt { flex: 1; min-width: 0; display: flex; flex-direction: column; } .tr-rt small { color: var(--fg-3); font-size: 12px; }
.up5-acts { display: flex; gap: 8px; margin: 4px 0 8px; }
@media (max-width: 640px) { .tr-cols { grid-template-columns: 1fr; } .tr-inv { max-height: 220px; } }

/* v5 Studio templates */
.st-tpl { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0,0,0,.45); backdrop-filter: blur(6px); padding: 16px; }
.st-tpl[hidden] { display: none; }
.st-tpl-box { width: min(760px, 100%); max-height: calc(100% - 32px); overflow: auto; padding: 20px; border-radius: 20px; }
.st-tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-tpl-head h2 { margin: 0; font-size: 1.25rem; }
.st-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.st-tpl-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: inherit; font: inherit; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.st-tpl-card:hover, .st-tpl-card:focus-visible { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); transform: translateY(-1px); outline: none; }
.st-tpl-ic { font-size: 1.6rem; line-height: 1; }
.st-tpl-card small { opacity: .7; font-size: .8rem; line-height: 1.35; }

/* v5 Avatar Shop: in-place updates + full-screen item viewer */
.no-anim, .no-anim * { animation: none !important; }
#shopGrid .item[data-view] .item-art { cursor: zoom-in; }
#shopGrid .item-art[role=button]:focus-visible { outline: 2px solid var(--accent, #fff); outline-offset: 2px; }
.iv-layer { padding: 16px; }
.iv-box { position: relative; z-index: 1; width: min(1180px, 100%); height: min(780px, calc(100dvh - 32px)); border-radius: 28px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); overflow: hidden; animation: rise .4s var(--ease) both; }
.iv-close { position: absolute; top: 14px; right: 14px; z-index: 6; }
.iv-stage { position: relative; min-height: 0; background: radial-gradient(circle at 50% 95%, rgba(255,255,255,.16), transparent 60%), rgba(255,255,255,.03); touch-action: none; user-select: none; }
.iv-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.iv-canvas:active { cursor: grabbing; }
.iv-fallback { position: absolute; inset: 12%; display: grid; place-items: center; }
.iv-fallback[hidden] { display: none; }
.iv-fallback .thumb { position: static; width: 100%; height: 100%; }
.iv-emoji { font-size: clamp(80px, 14vw, 160px); line-height: 1; }
.iv-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: rgba(10,10,12,.55); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.iv-nav:hover { background: rgba(255,255,255,.18); }
.iv-nav[hidden] { display: none; }
.iv-nav.prev { left: 14px; } .iv-nav.next { right: 14px; }
.iv-ctl { position: absolute; left: 14px; bottom: 14px; z-index: 3; display: flex; gap: 6px; }
.iv-ctl button { width: 36px; height: 36px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(10,10,12,.55); color: #fff; font-size: 18px; cursor: pointer; }
.iv-try { position: absolute; right: 14px; bottom: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(10,10,12,.6); border: 1px solid rgba(255,255,255,.2); font-size: 13px; font-weight: 600; cursor: pointer; color: #fff; }
.iv-try[hidden] { display: none; }
.iv-try input { width: 16px; height: 16px; accent-color: #fff; }
.iv-hint { position: absolute; left: 0; right: 0; top: 14px; margin: 0; text-align: center; font-size: 12px; color: rgba(255,255,255,.55); pointer-events: none; }
.iv-info { padding: 34px 28px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.iv-info h2 { margin: 0; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.03em; }
.iv-info .sub { margin: 0; }
.iv-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding-right: 40px; }
.iv-kicker .lim-badge, .iv-kicker .ugc-badge, .iv-kicker .own-badge { position: static; }
.iv-kicker .slot-tag { margin-right: 4px; }
.iv-price { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 22px; }
.iv-price small { font-size: 12px; color: var(--fg-3); font-weight: 500; }
.iv-desc { margin: 0; color: var(--fg-2); line-height: 1.5; }
.iv-lim { padding: 14px; border-radius: 16px; display: grid; gap: 10px; }
.iv-lim h4 { margin: 4px 0 0; font-size: 13px; }
.iv-lim .lim-spark { width: 100%; height: 70px; }
.iv-lim-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.iv-lim-stats span { display: grid; gap: 2px; } .iv-lim-stats small { font-size: 11px; color: var(--fg-3); }
.iv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }
.iv-acts .btn { flex: 1 1 auto; }
.iv-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; }
.iv-links [data-iva=report] { margin-left: auto; }
@media (max-width: 760px) {
  .iv-layer { padding: 0; }
  .iv-box { width: 100%; height: 100dvh; border-radius: 0; grid-template-columns: 1fr; grid-template-rows: minmax(260px, 48dvh) minmax(0, 1fr); }
  .iv-info { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
  .iv-nav { width: 38px; height: 38px; font-size: 22px; }
}
html.theme-light .iv-stage { background: radial-gradient(circle at 50% 95%, rgba(0,0,0,.08), transparent 60%), rgba(0,0,0,.03); }

/* v5: item creator side panel fits laptops (1366×768, 1280×720) — scrolls inside, nothing off-screen */
.tool-layer .ic-panel { grid-template-columns: minmax(0, 1fr); width: clamp(260px, 25vw, 330px); top: 80px; bottom: auto; max-height: calc(100% - 80px - 56px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent; scrollbar-gutter: stable; }
.ic-panel > *, .ic-panel .ic-sec > * { min-width: 0; max-width: 100%; }
.ic-panel .seg3 { display: flex; flex-wrap: wrap; }
.ic-panel .seg3 button { flex: 1 1 0; min-width: max-content; }
.ic-panel .swatches { flex-wrap: wrap; gap: 5px; }
.ic-panel .field input, .ic-panel .field select { width: 100%; min-width: 0; box-sizing: border-box; }
.ic-panel .btn-block { width: 100%; white-space: normal; height: auto; min-height: 44px; }
.ic-panel::-webkit-scrollbar { width: 8px; }
.ic-panel::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
.ic-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
.ic-panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.4); background-clip: padding-box; }
@media (max-height: 800px) { .tool-layer .ic-panel { padding: 12px 14px; gap: 8px; } .ic-panel .st-help { font-size: 12px; margin: 0; } .ic-panel .field input { height: 36px; } }
@media (max-width: 700px) { .tool-layer .ic-panel { left: 12px; right: 12px; width: auto; top: auto; bottom: 52px; max-height: 44%; } }
html.theme-light .ic-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); background-clip: padding-box; }
/* scrolling glass panels: the glass rim/sheen pseudo-elements would scroll with the content, so use a plain rim instead */
.tool-layer .st-props::before, .tool-layer .st-props::after { display: none; }
.tool-layer .st-props { border: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 32px rgba(0,0,0,.35); }
.tr-it { position: relative; min-width: 0; }
.tr-it img.thumb { position: static; inset: auto; height: auto; display: block; }
/* v5 item creator: 2D clothing template */
.ic-texwrap { border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.35); padding: 6px; display: grid; place-items: center; }
.ic-tex { display: block; width: 100% !important; max-width: 100%; height: auto !important; max-height: none !important; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.tool-layer canvas.ic-tex { position: static; inset: auto; }
.ic-texlab { float: right; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--fg-2); }
.ic-texkey { font-size: 11px; color: var(--fg-3); line-height: 1.4; }
.ic-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ic-row select { flex: 1 1 140px; min-width: 0; height: 34px; border-radius: 10px; color: var(--fg); padding: 0 8px; font: inherit; font-size: 13px; }
.ic-col { width: 26px; height: 26px; padding: 0; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; background: none; cursor: pointer; }
.ic-fee { margin: 0; } .ic-fee.err { color: #ff8a8a; }
body.tooling #confirmModal { z-index: 130; } /* dialogs opened from Studio / the item creator sit above the tool layer */
/* v5: full-screen trade window */
.overlay.tr-full { padding: 0; place-items: stretch; }
.overlay.tr-full .scrim { background: rgba(6,6,8,.92); }
.tr-full .m5-card.tr-card { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; padding: 18px clamp(14px, 3vw, 40px) calc(14px + env(safe-area-inset-bottom)); grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; overflow: hidden; }
.tr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-head h3 { font-size: clamp(20px, 2.2vw, 28px); letter-spacing: -.02em; }
.tr-full .tr-cols { min-height: 0; gap: clamp(10px, 1.6vw, 22px); }
.tr-full .tr-side { min-height: 0; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: 14px; }
.tr-full .tr-inv { max-height: none; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); align-content: start; padding: 2px; }
.tr-tools { display: flex; gap: 8px; }
.tr-tools .tr-q { flex: 1 1 auto; min-width: 0; height: 38px; }
.tr-tools .tr-sort { flex: 0 0 auto; width: auto; height: 38px; padding: 0 10px; }
.tr-foot { display: grid; gap: 6px; }
.tr-foot .win-actions { justify-content: flex-end; }
.tr-sum { margin: 0; font-size: 13px; color: var(--fg-2); }
@media (max-width: 760px) { .tr-full .m5-card.tr-card { overflow-y: auto; grid-template-rows: none; } .tr-full .tr-cols { grid-template-columns: 1fr; } .tr-full .tr-inv { max-height: 46dvh; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } }
/* v5: the item viewer fills the whole viewport */
.iv-layer { padding: 0 !important; place-items: stretch; }
.iv-layer .scrim { background: #0b0b0d; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.theme-light .iv-layer .scrim { background: #f2f2f4; }
.iv-box { width: 100vw; height: 100dvh; border-radius: 0; grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 440px); }
.iv-info { padding: clamp(28px, 4vh, 56px) clamp(20px, 2.4vw, 36px) 24px; border-left: 1px solid rgba(255,255,255,.08); }
@media (max-width: 760px) { .iv-box { grid-template-columns: 1fr; grid-template-rows: minmax(280px, 52dvh) minmax(0, 1fr); } .iv-info { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); } }
.ic-desc { width: 100%; min-height: 56px; resize: vertical; border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--fg); border: 0; box-sizing: border-box; }
.ic-dn { float: right; color: var(--fg-3); font-weight: 500; }
.cr-idesc { margin: 4px 0 6px; font-size: 12px; color: var(--fg-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* =====================================================================
   v5 — phone navigation: bottom tab bar (Home · Discover · Create · Shop · Chat · Profile · More); the sidebar is only ever a
   slide-out drawer opened from "More" on phones / touch / narrow windows, never a permanent rail squeezing the content.
   ===================================================================== */
html.nav-tabs .tabbar { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; padding: 6px 5px; left: 8px; right: 8px; }
.tabbar button { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 20px; border: 0; background: none;
  font: inherit; font-size: 11px; font-weight: 650; color: var(--fg-3); cursor: pointer; transition: background .25s, color .25s; }
.tabbar a, .tabbar button { min-width: 0; padding: 0 1px; }
.tabbar a span, .tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: clamp(9.5px, 2.75vw, 11px); letter-spacing: -.01em; }
.tabbar button.active, .tabbar button[aria-expanded="true"] { color: var(--accent-text); background: var(--accent-soft); }
.tabbar .tab-more-dot { position: absolute; top: 7px; right: calc(50% - 15px); width: 8px; height: 8px; min-width: 0; padding: 0; border-radius: 50%; background: var(--accent); }
html.nav-tabs .sb-burger { display: none !important; } /* "More" in the tab bar opens the drawer */
html.nav-side .tabbar { display: none !important; }
html.nav-tabs .sidebar .sb-list a, html.nav-tabs .sidebar .sb-list button { justify-content: flex-start; padding: 0 14px; }
html.nav-tabs .sidebar .sb-label { display: inline !important; }
html.nav-tabs .sidebar .sb-new { display: inline-block; position: static; width: auto; height: auto; padding: 2px 8px; font-size: 10px; }
html.nav-tabs .sidebar .sb-badge { position: static; margin-left: auto; }
/* the drawer sits above the tab bar's z-index */
html.nav-tabs .sidebar { z-index: 120; }
/* v5 — "⋯" card menus (Report etc.) */
.item { position: relative; }
.kebab { position: absolute; z-index: 3; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); display: grid; place-items: center; padding: 0;
  background: rgba(12,12,14,.62); color: #fff; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background .2s, transform .2s var(--spring), opacity .2s; }
.kebab:hover, .kebab[aria-expanded="true"] { background: rgba(12,12,14,.85); transform: scale(1.06); }
.kebab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item > .kebab { top: 10px; right: 10px; }
.item:has(.ugc-badge) > .kebab { top: 10px; right: 10px; } .item .ugc-badge { right: 48px; top: 13px; }
html.is-desktop .item > .kebab { opacity: 0; } html.is-desktop .item:hover > .kebab, html.is-desktop .item:focus-within > .kebab, .item > .kebab[aria-expanded="true"] { opacity: 1; }
.gc-w { position: relative; flex: none; display: flex; min-width: 0; } .gc-w > .group-card { flex: 1; }
.group-grid .gc-w { flex: initial; } .group-grid .gc-w > .group-card { width: auto; min-width: 0; }
.gc-w > .kebab { top: 8px; right: 8px; width: 30px; height: 30px; }
html.is-desktop .gc-w > .kebab { opacity: 0; } html.is-desktop .gc-w:hover > .kebab, html.is-desktop .gc-w:focus-within > .kebab, .gc-w > .kebab[aria-expanded="true"] { opacity: 1; }
.kmenu { position: fixed; z-index: 140; min-width: 186px; max-width: calc(100vw - 16px); padding: 7px; border-radius: 15px; display: grid; gap: 1px; animation: pop .22s var(--spring) both; }
.kmenu > button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--fg); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.kmenu > button > svg { flex: none; opacity: .72; }
.kmenu > button > span { flex: 1; }
.kmenu > button:hover, .kmenu > button:focus-visible { background: rgba(255,255,255,.1); outline: none; }
.kmenu .danger-text { color: #ff6b6b; }
.kmenu .danger-text > svg { opacity: 1; }
.kmenu-head { display: grid; padding: 8px 12px 9px; position: relative; z-index: 2; }
.kmenu-head b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kmenu-head small { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .05em; }
.kmenu-head + button, .kmenu-head + .kmenu-head { margin-top: 2px; }
html.theme-light .kmenu > button:hover { background: rgba(0,0,0,.06); }

/* =====================================================================
   v5 — mobile text-overflow sweep fixes (360 / 390 / 412 portrait, 844×390 landscape)
   ===================================================================== */
/* top bar on phones: the tab bar + More drawer hold the pages, so the bar keeps only search · bell · Shards · account */
@media (max-width: 640px) {
  html.nav-tabs .nav { gap: 8px; padding: 0 6px 0 14px; }
  html.nav-tabs .nav-actions { gap: 6px; min-width: 0; flex: 1 1 auto; justify-content: flex-end; }
  html.nav-tabs #friendsBtn { display: none; }               /* Friends lives in More */
  html.nav-tabs .brand { flex: none; min-width: 0; }
  html.nav-tabs .search, html.nav-tabs .icon-pill { width: 38px; height: 38px; flex: none; }
  html.nav-tabs .shards-pill { height: 38px; padding: 0 5px 0 10px; gap: 5px; font-size: 13px; min-width: 0; flex: 0 1 auto; }
  html.nav-tabs .shards-pill .plus { width: 22px; height: 22px; font-size: 14px; }
  html.nav-tabs .user-chip { height: 38px; flex: none; }
  html.nav-tabs .search.expanded { position: absolute; left: 8px; right: 8px; top: 9px; z-index: 5; width: auto; }
}
@media (max-width: 440px) {
  html.nav-tabs .brand-name, html.nav-tabs .admin-badge { display: none; }
  html.nav-tabs .user-chip:not(.guest) .nav-user { display: none; }
  html.nav-tabs .user-chip:not(.guest) { padding-right: 6px; gap: 4px; }
}
@media (max-width: 370px) { html.nav-tabs .shards-pill .plus { display: none; } html.nav-tabs .shards-pill { padding-right: 10px; } }
/* forms + grids never force a card wider than the screen */
.f-row .grow, .grow { min-width: min(200px, 100%); }
.admin-grid > *, .lim-grid > *, .settings > *, .friends-layout > *, .gp > *, .up > * { min-width: 0; }
.f-row > * { min-width: 0; max-width: 100%; }
@media (max-width: 640px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.item-body, .item-body h3 { min-width: 0; overflow-wrap: anywhere; }
.item-body h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ev-ai { flex-wrap: wrap; } .ev-ai span { flex: 1 1 180px; } .ev-ai span b, .ev-ai span small { overflow-wrap: anywhere; }
.op-uhead > div { min-width: 0; } .op-uhead small { overflow-wrap: anywhere; }
.priv > div:first-child { flex: 1 1 200px; }
.grp-info { min-width: 0; } .grp-info .page-title { overflow-wrap: anywhere; }
.page-title, .row-head h2, .set-card h3, .tl-card h3, .t-post h1, .t-title { overflow-wrap: anywhere; }
.seg3, .seg { max-width: 100%; } .seg3 button, .seg button { min-width: 0; }
@media (max-width: 420px) {
  .page-title { font-size: clamp(26px, 8vw, 34px); }
  .set-row { flex-wrap: wrap; row-gap: 8px; } .set-row > :first-child { min-width: 0; flex: 1 1 160px; }
}
/* pause menu in short landscape: the tab panes shrink and scroll inside the card */
.gm-panes { flex: 1 1 auto; min-height: 0; }
@media (max-height: 520px) {
  .game-menu { padding: 8px; }
  .gm-card { max-height: calc(100dvh - 16px); padding: 12px 14px; gap: 8px; }
  .gm-head .brand-mark { display: none; }
  .gm-tabs button { padding: 6px 4px; }
  .gm-actions, .gm-actions #gResume { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; grid-column: auto !important; }
  .gm-actions .btn { padding: 8px 10px; font-size: 13px; }
}
.item-body h3 { white-space: normal; line-height: 1.25; }
/* notifications popover on phones: pinned under the top bar, full width (it used to hang off the left edge) */
@media (max-width: 640px) {
  html.nav-tabs .nav { position: relative; } html.nav-tabs .bell-wrap { position: static; }
  html.nav-tabs .bell-pop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); width: auto; max-height: calc(100dvh - 190px); overflow-y: auto; }
}
@media (max-height: 520px) { html.nav-tabs .bell-pop { max-height: calc(100dvh - 90px); } }
/* group page has no .page-head, so give it the same clearance under the top bar */
#groupPage { padding-top: 112px; }
@media (max-width: 640px) { #groupPage { padding-top: 88px; } }
.grp-hero .p-actions { flex-wrap: wrap; } .grp-hero .p-actions .btn { white-space: nowrap; }
.grp-wall .f-row input { flex: 1 1 160px; min-width: 0; padding: 11px 14px; border-radius: 14px; border: 0; font: inherit; font-size: 14px; color: var(--fg); }
@media (max-width: 420px) { .op-stats b, .op-stats > div > b { font-size: 15px; white-space: normal; overflow-wrap: anywhere; } }
/* dropdowns + popovers (notifications, account menu, ⋯ card menus): strong blur + ~93% solid fill in both themes, so the page
   behind never shows through their text (a popover inside the blurred top bar can't blur on its own, so the fill does the work) */
.bell-pop, .menu, .kmenu { background: rgba(22,22,26,.93) !important; backdrop-filter: blur(28px) saturate(1.5) !important; -webkit-backdrop-filter: blur(28px) saturate(1.5) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08) !important; }
html.theme-light .bell-pop, html.theme-light .menu, html.theme-light .kmenu { background: rgba(252,252,254,.94) !important; box-shadow: 0 18px 50px rgba(0,0,0,.18), inset 0 1px 0 #fff !important; }
.bell-pop::before, .bell-pop::after, .menu::before, .menu::after, .kmenu::before, .kmenu::after { opacity: .35; }
.st-tpl-auto { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--fg-2); cursor: pointer; } .st-tpl-auto input { accent-color: var(--accent); width: 16px; height: 16px; }
/* v5 — item favorites + likes, recommended items */
.iv-social { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.iv-social .iv-fav { height: 38px; padding: 0 14px; gap: 7px; font-size: 14px; }
.iv-social .iv-fav .if-n { font-variant-numeric: tabular-nums; opacity: .8; }
.iv-social .iv-fav.on svg path { fill: currentColor; }
.iv-social .vote-meter { flex: 1 1 140px; min-width: 0; }
.iv-rec { margin-top: 18px; display: grid; gap: 10px; } .iv-rec h3 { margin: 0; font-size: 16px; }
.iv-rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.rec-it { display: grid; gap: 4px; padding: 8px; border-radius: 16px; border: 0; text-align: left; color: var(--fg); font: inherit; cursor: pointer; min-width: 0; transition: transform .2s var(--spring), background .2s; }
.rec-it:hover { transform: translateY(-2px); } .rec-it:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rec-art { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.05); }
.rec-art img.thumb { position: static; width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-art .lim-badge { left: 6px; top: 6px; font-size: 8.5px; padding: 2px 5px; letter-spacing: .04em; }
.rec-art > .mo-art { position: absolute; inset: 0; border-radius: 12px; background: radial-gradient(80% 80% at 50% 30%, rgba(76,141,255,.18), rgba(255,255,255,.02)); }
.rec-art > .mo-art .mo-ic { font-size: 38px; }
.rec-emo { display: grid; place-items: center; height: 100%; font-size: 40px; }
.rec-it b { font-size: 13px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.rec-it small { display: flex; align-items: center; gap: 3px; color: var(--fg-3); font-size: 12px; }
.rec-sk { display: block; aspect-ratio: .78; border-radius: 16px; background: rgba(255,255,255,.06); animation: pulse 1.4s ease-in-out infinite; }
html.theme-light .rec-art, html.theme-light .rec-sk { background: rgba(0,0,0,.05); }
.lim-rec { margin-top: 16px; }
/* v5 — saved outfits on the Avatar page */
.av-outfits { display: grid; gap: 12px; margin-top: 16px; }
.of-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.of-head > div { min-width: 0; flex: 1 1 180px; } .of-head h2 { margin: 0; font-size: 18px; } .of-head h2 em { font-style: normal; color: var(--fg-3); font-weight: 600; font-size: 14px; } .of-head .sub { margin: 2px 0 0; }
.of-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.of-card { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: 16px; min-width: 0; transition: box-shadow .2s; }
.of-card.on { box-shadow: 0 0 0 2px var(--accent); }
.of-wear { position: relative; display: block; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.05); cursor: pointer; aspect-ratio: 4 / 5; transition: transform .2s var(--spring); }
.of-wear:hover { transform: translateY(-2px); } .of-wear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.of-wear .own-badge { top: 6px; left: 6px; font-size: 9px; padding: 3px 6px; }
.of-img { width: 100%; height: 100%; object-fit: contain; display: block; opacity: 0; transition: opacity .3s; } .of-img.ready { opacity: 1; }
.of-meta { min-width: 0; } .of-meta b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .of-meta small { display: block; font-size: 11px; line-height: 1.3; }
.of-acts { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; } .of-acts .link-btn { font-size: 12px; }
html.theme-light .of-wear { background: rgba(0,0,0,.04); }

/* v5 — in-game player menu (tap / click a player's avatar or nametag) */
.kmenu.pmenu { z-index: 420; min-width: 200px; }
.kmenu > button:disabled { opacity: .55; cursor: default; background: none; }
.pm-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 8px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px; min-width: 0; }
.pm-head > span:last-child { min-width: 0; display: grid; } .pm-head b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pm-head small { font-size: 11px; color: var(--fg-3); }
.kmenu.pmenu.rep { width: min(320px, calc(100vw - 16px)); padding: 0; }
.kmenu.pmenu .gm-report { margin: 0; border-radius: 16px; background: none; }
.gm-report .gm-rl { display: grid; gap: 4px; } .gm-report .gm-rnote { margin: 0; font-size: 11px; }
html.theme-light .pm-head { border-color: rgba(0,0,0,.08); }
.op-rep-chat { margin-top: 6px; } .op-rep-chat summary { cursor: pointer; font-size: 12px; color: var(--fg-2); }
.op-rep-chat pre { margin: 6px 0 0; padding: 8px 10px; max-height: 180px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; line-height: 1.45; border-radius: 10px; background: rgba(0,0,0,.25); }
html.theme-light .op-rep-chat pre { background: rgba(0,0,0,.05); }
.op-rep-ctx code { font-size: 11px; }

/* v5 — card badges stack (LIMITED + Owned #serial) instead of overlapping at top-left */
.art-badges { position: absolute; top: 10px; left: 10px; right: 52px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.art-badges > .lim-badge, .art-badges > .own-badge { position: static; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-badges > .own-badge { font-size: 9px; padding: 3px 7px; letter-spacing: .04em; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
/* v5 — group page: members pill + sheet, owner gear/settings, connected games */
.grp-hero { position: relative; }
/* v6: pinned group shout + custom member rank tags */
.grp-shout { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-lg); margin: 0 0 16px; }
.grp-shout .gs-ic { font-size: 18px; line-height: 1; flex: 0 0 auto; }
.grp-shout p { margin: 0; flex: 1; min-width: 0; color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.grp-shout .btn { flex: 0 0 auto; }
.tag.rank { text-transform: none; letter-spacing: 0; background: rgba(255,255,255,.06); border-style: dashed; }
/* v6: shared outfit on a profile */
.up-look { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: var(--r-lg); flex-wrap: wrap; }
.up-look .look-img { width: 84px; height: 105px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.05); flex: 0 0 auto; }
.up-look .look-txt { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 3px; }
.up-look .look-txt small { color: var(--fg-3); }
.up-look .look-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.grp-gear { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 0; background: rgba(255,255,255,.08); color: var(--fg); cursor: pointer; transition: transform .25s var(--spring), background .2s; }
.grp-gear:hover { background: rgba(255,255,255,.16); transform: rotate(40deg); } .grp-gear:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.theme-light .grp-gear { background: rgba(0,0,0,.06); } html.theme-light .grp-gear:hover { background: rgba(0,0,0,.1); }
.grp-hero:has(.grp-gear) .grp-info { padding-right: 44px; }
.grp-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.mem-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 0; border-radius: 999px; font: inherit; font-size: 13px; color: var(--fg); cursor: pointer; transition: transform .2s var(--spring), background .2s; }
.mem-pill:hover { transform: translateY(-1px); background: rgba(255,255,255,.12); } .mem-pill b { font-weight: 800; margin-left: 2px; }
.mem-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mp-faces { display: inline-flex; } .mp-faces:empty { display: none; }
.mp-face { width: 24px; height: 24px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: #2a2a30; box-shadow: 0 0 0 2px rgba(22,22,26,.95); margin-left: -7px; }
.mp-face:first-child { margin-left: 0; } .mp-face img { width: 100%; height: 100%; object-fit: cover; }
html.theme-light .mp-face { background: #e6e6ea; box-shadow: 0 0 0 2px #fff; }
.m5-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; } .m5-head h3 { margin: 0; } .m5-head h3 em { font-style: normal; color: var(--fg-3); font-weight: 600; }
.m5-head .icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: var(--fg); cursor: pointer; font-size: 14px; }
.mem-sheet { max-height: min(60vh, 520px); overflow: auto; } .mem-sheet.sm { max-height: 240px; }
.mem-sheet .mem .btn { flex: none; }
.overlay.m5.sheet .m5-card, .overlay.m5.grp-settings .m5-card { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto; }
.gs-sec { display: grid; gap: 8px; padding-top: 14px; margin-top: 4px; border-top: 1px solid rgba(255,255,255,.08); } .gs-sec h4 { margin: 0; font-size: 14px; } .gs-sec h4 em { font-style: normal; color: var(--fg-3); }
.gs-danger { border-color: rgba(255,90,90,.25); } .gs-danger h4 { color: #ff6b6b; } .gs-danger .btn { justify-self: start; }
html.theme-light .gs-sec { border-color: rgba(0,0,0,.08); }
.grp-games { margin-bottom: 16px; } .grp-games .row-head h2 em { font-style: normal; color: var(--fg-3); font-weight: 600; }
.grp-game-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.grp-game { display: grid; gap: 4px; padding: 8px 8px 12px; border-radius: var(--r-lg); color: inherit; text-decoration: none; min-width: 0; transition: transform .25s var(--spring); }
.grp-game:hover { transform: translateY(-3px); } .grp-game b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; } .grp-game small { font-size: 12px; color: var(--fg-3); padding: 0 4px; }
.gg-art { display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #2a2a35, #15151b); } .gg-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gg-ph { display: grid; place-items: center; height: 100%; font-size: 28px; font-weight: 800; color: rgba(255,255,255,.6); }
.gp-group { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 5px 12px 5px 5px; border-radius: 999px; color: inherit; text-decoration: none; font-size: 13px; max-width: 100%; }
.gp-group .gicon { flex: none; } .gp-group span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .gp-group small { color: var(--fg-3); }
.gp-group:hover { background: rgba(255,255,255,.12); }
@media (max-width: 760px) { .grp-gear { top: 10px; right: 10px; } .grp-hero:has(.grp-gear) .grp-info { padding-right: 0; } .grp-meta { justify-content: center; } }
.cr-group select { min-width: 0; max-width: 55%; padding: 8px 12px; border-radius: 12px; border: 0; font: inherit; font-size: 13px; color: var(--fg); }
/* v5 — minimal footer on phones (logo · Privacy · Terms · Guidelines · one-line disclaimer), clear of the tab bar */
.fl-s, .fine-s { display: none; }
html.nav-tabs .footer { width: calc(100% - 24px); margin: 28px auto calc(16px + env(safe-area-inset-bottom)); }
html.nav-tabs .footer-inner { grid-template-columns: auto 1fr; gap: 8px 12px; padding: 14px 16px; border-radius: 20px; }
html.nav-tabs .footer-brand { font-size: 14px; gap: 7px; } html.nav-tabs .footer-brand .brand-mark { width: 18px; height: 18px; }
html.nav-tabs .footer-links, html.nav-tabs .fl-x, html.nav-tabs .fine-x { display: none; }
html.nav-tabs .fl-s { display: inline; }
html.nav-tabs .footer-legal { grid-column: auto; justify-content: flex-end; flex-wrap: nowrap; gap: 0; font-size: 12.5px; white-space: nowrap; }
html.nav-tabs .footer-legal a + a::before { content: '·'; padding: 0 7px; color: var(--fg-3); display: inline-block; text-decoration: none; }
html.nav-tabs .fine-s { display: block; padding-top: 8px; font-size: 11px; line-height: 1.4; text-align: center; }
html.nav-tabs body { padding-bottom: calc(96px + env(safe-area-inset-bottom) + var(--ext-bottom, 0px)); }
@media (max-width: 340px) { html.nav-tabs .footer-inner { grid-template-columns: 1fr; justify-items: center; } html.nav-tabs .footer-legal { justify-content: center; } }
.op-lim-row { display: flex; align-items: center; gap: 8px; } .op-lim-row .op-item { flex: 1; min-width: 0; } .op-lim-row .btn { flex: none; }
.ic-lim { display: grid; gap: 8px; padding: 10px 12px; border-radius: 14px; margin: 4px 0; }
.ic-lim .set-row small { display: block; }
/* confirmations opened from a v5 dialog (kick / delete in group settings, etc.) sit above it */
#confirmModal { z-index: 170; }
.m5-card input.switch { width: 48px; height: 28px; padding: 0; border-radius: 999px; flex: none; }
.m5-card input.switch, html.theme-light .m5-card input.switch { border: 1px solid rgba(127,127,127,.35); }
.m5-card input[type=file] { width: auto; }
/* the in-game player menu always uses the dark game palette (it sits over the 3D view in either theme) */
.kmenu.pmenu, html.theme-light .kmenu.pmenu { background: rgba(22,22,26,.94) !important; box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08) !important; color: #fff; --fg: #fff; --fg-2: rgba(255,255,255,.78); --fg-3: rgba(255,255,255,.58); }
.kmenu.pmenu > button:hover, .kmenu.pmenu > button:focus-visible, html.theme-light .kmenu.pmenu > button:hover { background: rgba(255,255,255,.1); }
.kmenu.pmenu .pm-head, html.theme-light .kmenu.pmenu .pm-head { border-color: rgba(255,255,255,.1); }
.kmenu.pmenu .gm-report select, .kmenu.pmenu .gm-report textarea { background: rgba(255,255,255,.08); color: #fff; }
.m5-card input.switch:not(:checked) { background: rgba(127,127,127,.22); }
.gs-danger .btn-danger, html.theme-light .gs-danger .btn-danger { background: linear-gradient(180deg, #ff5a5f, #d92f36); border-color: rgba(255,255,255,.2); color: #fff; box-shadow: 0 6px 18px rgba(217,47,54,.35); } .gs-danger .btn-danger:hover { background: #c4262d; }
/* v5: the sidebar gained Groups + Events, so rows scale with the window height to keep every item visible without scrolling */
@media (max-height: 860px) {
  html.nav-side .sb-list { gap: 1px; }
  html.nav-side .sb-list a, html.nav-side .sb-list button { height: clamp(28px, calc((100dvh - 168px) / 15 - 1px), 42px); font-size: 14px; }
  html.nav-side .sb-list a.active::before { top: 8px; bottom: 8px; }
}
@media (max-height: 600px) { html.nav-side .sb-list a, html.nav-side .sb-list button { font-size: 13px; } html.nav-side .sb-list svg { width: 18px; height: 18px; } }
.gmsg .gname { cursor: pointer; border-radius: 4px; } .gmsg .gname:hover, .gmsg .gname:focus-visible { text-decoration: underline; outline: none; } #gChatLog { pointer-events: auto; }

/* v5.1: emote equip grid (Avatar page) */
.av5-eh { margin-top: 18px; } .av5-cnt { font-size: 13px; font-weight: 600; color: var(--fg-3); margin-left: 6px; }
.av5-grid.av5-emo { display: grid; }

/* v5.2: motion tiles (my avatar doing the emote / pack; one shared live canvas on hover / hold) + Avatar Animations / Emotes tabs */
.mo-art { position: relative; display: grid; place-items: center; overflow: hidden; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.mo-art > .mo-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; pointer-events: none; }
.mo-art > .mo-shot.ready { opacity: 1; } .mo-art > .mo-shot.ready + .mo-ic { opacity: 0; }
.mo-art > .mo-ic { line-height: 1; transition: opacity .2s; }
.mo-art > .mo-live { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.mo-art.mo-playing > .mo-shot { opacity: 0; }
.motion-art > .mo-art { position: absolute; inset: 0; } .motion-art .mo-ic { font-size: 64px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.av5-b > .mo-art { width: 100%; aspect-ratio: 1; border-radius: 12px; background: radial-gradient(80% 80% at 50% 30%, rgba(76,141,255,.16), rgba(255,255,255,.02)); }
.av5-b > .mo-art .mo-ic { font-size: 34px; } .av5-b.locked > .mo-art { filter: grayscale(1); opacity: .55; }
.edit-motion .av5-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.em-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; } .em-head .sub { margin: 0; }
.em-head .av5-cnt { color: var(--fg); margin: 0 2px; }
.ew-b > .mo-art { width: 52px; height: 52px; border-radius: 12px; } .ew-b > .mo-art .mo-ic { font-size: 26px; }
@media (max-width: 560px) { .em-head { flex-direction: column; align-items: flex-start; } .edit-motion .av5-grid { grid-template-columns: repeat(3, 1fr); } }

/* =====================================================================
   v6.2 — mobile polish pass
   Touch-first sizing and rhythm for phones (tab-bar layout). Keeps desktop
   untouched: every rule is scoped to html.nav-tabs or a phone media query.
   ===================================================================== */
@media (max-width: 640px) {
  /* page rhythm: tighter, even vertical spacing between the top bar and rows */
  .page-head { padding-top: 96px; padding-bottom: 18px; }
  .page-head.row { align-items: flex-start; }
  .row-block { margin: 22px 0 6px; }
  .row-head { align-items: center; margin-bottom: 10px; }
  .row-head h2 { font-size: 20px; }
}
/* buttons, pills and fields reach a comfortable 44px tap height on touch screens */
html.is-touch .btn { height: 48px; }
html.is-touch .btn.sm { height: 42px; }
html.is-touch .btn.xs { height: 36px; }
html.is-touch .icon-pill { width: 42px; height: 42px; }
html.is-touch .chip { height: 42px; }
html.is-touch .fh-tabs .chip { height: 38px; }
html.is-touch .icon-btn { width: 40px; height: 40px; }
html.is-touch .brand { min-height: 44px; }
html.is-touch .search { min-height: 44px; }
html.is-touch .seg button, html.is-touch .seg3 button { padding: 10px 16px; }
html.is-touch .link-btn { padding: 6px 0; }
/* "See all" / section links become a proper tap row without looking like a button */
html.nav-tabs .link-more { display: inline-flex; align-items: center; min-height: 40px; margin: -10px -6px -10px 0; padding: 0 6px; }
html.nav-tabs .row-head { align-items: center; }
/* tab bar: taller labels, a touch more height, a clear active pill */
html.nav-tabs .tabbar { height: 66px; border-radius: 24px; }
html.nav-tabs .tabbar a, html.nav-tabs .tabbar button { gap: 4px; border-radius: 18px; }
html.nav-tabs .tabbar a span, html.nav-tabs .tabbar button span { font-size: clamp(10px, 2.9vw, 11.5px); font-weight: 700; }
/* card kebabs get a real target and sit clear of the LIMITED/owned badges */
html.nav-tabs .kebab { width: 40px; height: 40px; }
html.nav-tabs .item > .kebab, html.nav-tabs .item:has(.ugc-badge) > .kebab { top: 8px; right: 8px; }
html.nav-tabs .item .ugc-badge { right: 54px; }
html.nav-tabs .gc-w > .kebab { top: 6px; right: 6px; width: 38px; height: 38px; }
/* the card menu itself: roomier rows for thumbs */
html.nav-tabs .kmenu > button { padding: 13px 14px; font-size: 15px; }
html.nav-tabs .kmenu-head { padding: 10px 14px 11px; }
html.nav-tabs .menu a, html.nav-tabs .menu button { padding: 12px 13px; }
/* notifications popover rows line up with the bigger targets */
html.nav-tabs .nt-row { padding: 12px 10px 12px 22px; }
html.nav-tabs .bell-foot .link-btn { padding: 8px 0; }
/* footer legal links get a comfortable tap height without changing the layout */
html.nav-tabs .footer-legal a { display: inline-flex; align-items: center; min-height: 40px; }
html.nav-tabs .footer-legal a + a::before { padding: 0 7px; }
/* top-bar controls reach 44px and the bar grows to match (phone layout only) */
@media (max-width: 640px) {
  html.nav-tabs .nav { height: 60px; }
  html.nav-tabs .search, html.nav-tabs .icon-pill { width: 44px; height: 44px; }
  html.nav-tabs .user-chip { height: 44px; }
  html.nav-tabs .shards-pill { height: 44px; }
  html.nav-tabs .nav-wrap { top: max(10px, env(safe-area-inset-top)); }
}
/* auth gate: full-width segmented control, comfortable links and fields */
@media (max-width: 640px) {
  .auth-card { padding: 24px 20px; }
  .auth-seg { width: 100%; }
  .auth-seg .seg { padding: 10px 8px; font-size: 14px; }
  .gate-legal-links { gap: 2px 10px; }
  .gate-legal-links a { padding: 4px 2px; }
  .link-btn.strong { padding: 8px 0; }
}
/* light theme: keep the new chrome legible */
html.theme-light.nav-tabs .tabbar { box-shadow: 0 8px 28px rgba(0,0,0,.16), inset 0 1px 0 rgba(255,255,255,.7); }
html.theme-light .chip { border-color: rgba(0,0,0,.12); }

/* landscape phones: the vertical budget is tiny, so rows tighten up and the
   tab bar/footer shrink instead of eating the viewport */
@media (max-height: 500px) and (orientation: landscape) {
  .page-head, .page > .page-head:first-child { padding-top: 74px; padding-bottom: 10px; }
  html.nav-tabs .page-head .sub, html.nav-tabs .row-head h2 em { display: none; }
  .row-block { margin: 14px 0 4px; }
  .row-head { margin-bottom: 8px; }
  html.nav-tabs .tabbar { height: 54px; border-radius: 20px; padding: 4px 5px; }
  html.nav-tabs .tabbar a span, html.nav-tabs .tabbar button span { font-size: 10px; }
  html.nav-tabs body { padding-bottom: calc(74px + env(safe-area-inset-bottom) + var(--ext-bottom, 0px)); }
  html.nav-tabs .footer { margin-top: 16px; }
  html.nav-tabs .footer-inner { padding: 10px 14px; }
  html.is-touch .card:hover, html.is-touch .item:hover, html.is-touch .tile:hover { transform: none; }
}
/* small phones (360 and under): trim the top-bar gap and label sizes a hair */
@media (max-width: 380px) {
  .page-head { padding-top: 92px; }
  html.nav-tabs .nav { padding-left: 12px; gap: 6px; }
  html.nav-tabs .shards-pill { font-size: 12px; }
}
/* very small phones (330 and under): let the top bar wrap instead of squeezing */
@media (max-width: 330px) {
  html.nav-tabs .nav-wrap { padding: 0 10px; }
  html.nav-tabs .nav { padding: 0 8px; }
  html.nav-tabs .shards-pill { display: none; }
  html.nav-tabs .tabbar a span, html.nav-tabs .tabbar button span { font-size: 9.5px; }
}
