:root {
  --bg: #16141d;
  --bg2: #1d1a26;
  --card: #242030;
  --card2: #2e2940;
  --line: #3a3450;
  --text: #f4f1ec;
  --muted: #9d96b0;
  --accent: #b89cff;
  --accent-dark: #8f6ff0;
  --mint: #7ee0c3;
  --pink: #ff8fb1;
  --danger: #ff6b7a;
  --online: #5fe08e;
  --ink: #17141f;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Nunito, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  background-image:
    radial-gradient(circle at 10% 12%, #8f6ff02e, transparent 38%),
    radial-gradient(circle at 92% 88%, #ff8fb11c, transparent 34%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { display: block; }

/* Layout */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  /* Its own width, wider than the page (it holds a lot) but centered: the same margin on both sides. */
  padding: 14px max(20px, calc((100vw - 1500px) / 2));
  background: #16141dd9; backdrop-filter: blur(14px);
  border-bottom: 1px solid #ffffff0d;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 26px; letter-spacing: -0.5px; }
.brand img { width: 38px; height: 38px; }
.nav-links { display: flex; gap: 4px; margin-left: 10px; }
.nav-links a { padding: 9px 14px; border-radius: 12px; color: var(--muted); font-weight: 800; }
.nav-links a.on, .nav-links a:hover { color: var(--text); background: var(--card2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang, select { background: var(--bg2); color: var(--text); border: 2px solid var(--line); border-radius: 12px; padding: 7px 10px;
  font: inherit; font-weight: 800; font-size: 15px; outline: none; max-width: 160px; }
select { max-width: none; padding: 12px 14px; }
.lang:focus, select:focus { border-color: var(--accent); }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--card); }
.me-chip span { font-weight: 800; }
main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 70px; }
footer { color: var(--muted); text-align: center; padding: 30px 20px 50px; font-size: 14px; }
footer a { color: var(--accent); }

/* Components */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 16px; padding: 14px 22px;
  background: var(--accent); color: var(--ink); font-weight: 800; font-size: 17px;
  transition: transform .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card2); color: var(--text); }
.btn.mint { background: var(--mint); }
.btn.danger { background: var(--danger); }
.btn.small { padding: 9px 14px; font-size: 15px; border-radius: 12px; }
.btn.big { padding: 17px 30px; font-size: 20px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; }
.muted { color: var(--muted); }
h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 900; letter-spacing: -1px; line-height: 1.05; margin: 0 0 14px; }
h2 { font-size: 26px; font-weight: 900; margin: 34px 0 14px; }
h3 { margin: 0 0 6px; font-size: 21px; font-weight: 900; }
p { line-height: 1.55; }
.row { display: flex; align-items: center; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.on { background: var(--online); }
.dot.play { background: var(--mint); }
.bust { width: 52px; height: 52px; border-radius: 50%; background: var(--card2); object-fit: cover; flex: none; }
.bust.big { width: 190px; height: 190px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--bg2); font-size: 14px; }
input {
  width: 100%; border: 2px solid var(--line); background: var(--bg2); color: var(--text);
  border-radius: 14px; padding: 14px 16px; font: inherit; font-size: 17px; outline: none;
}
input:focus { border-color: var(--accent); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { border: 0; background: var(--card2); color: var(--text); padding: 10px 16px; border-radius: 14px; font-weight: 800; }
.tabs button.on { background: var(--accent); color: var(--ink); }
.error { color: var(--danger); min-height: 1.2em; }
.empty { background: #24203099; border-radius: 20px; padding: 26px; text-align: center; color: var(--muted); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 34px; align-items: center; margin-top: 26px; }
.hero p { color: var(--muted); font-size: 19px; }
.cover { width: 100%; border-radius: 24px; box-shadow: 0 24px 70px #0009; aspect-ratio: 16 / 9; object-fit: cover; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.features .card b { display: block; font-size: 20px; font-weight: 900; margin-bottom: 6px; }
.features .card span { color: var(--muted); }

/* Place card */
.place { display: grid; grid-template-columns: 420px 1fr; gap: 26px; align-items: center; }
.place img { width: 100%; border-radius: 20px; aspect-ratio: 16 / 9; object-fit: cover; }
.tag { color: var(--accent); font-weight: 900; font-size: 13px; letter-spacing: 1px; }
.server { display: flex; align-items: center; gap: 16px; }
.meter { width: 150px; height: 10px; background: var(--bg2); border-radius: 5px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.friend-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.friend-strip .card { min-width: 250px; padding: 14px; }

/* Profile */
.profile { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; }
.stats { display: flex; gap: 12px; margin: 14px 0; }
.stats div { background: var(--bg2); border-radius: 16px; padding: 12px 16px; }
.stats b { display: block; font-size: 22px; font-weight: 900; }

/* Places */
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.place-card { padding: 12px; transition: transform .15s; }
.place-card:hover { transform: translateY(-3px); }
.place-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; margin-bottom: 10px; }
.bust.small { width: 30px; height: 30px; }

/* Badges */
.badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 8px; font-size: 11px; font-weight: 900;
  letter-spacing: .5px; color: var(--ink); vertical-align: middle; }
.badge.owner { background: #ffd166; }
.badge.admin { background: var(--mint); }
.badge.banned { background: var(--danger); margin-left: 0; }

/* Admin */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile b { display: block; font-size: 30px; font-weight: 900; margin-top: 4px; }
label.muted { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.admin-user { flex-wrap: wrap; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(460px, 100%); }
.toast {
  position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 80;
  background: var(--card2); border-left: 4px solid var(--accent); padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 10px 30px #0008; animation: pop .2s;
}
.toast.error { border-color: var(--danger); }
.toast.ok { border-color: var(--mint); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -8px); } }

/* Download buttons */
.dl-grid { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.btn.dl { flex-direction: column; gap: 2px; align-items: flex-start; }
.btn.dl small { font-size: 12px; font-weight: 700; opacity: .7; }
.btn.dl.big { min-width: 260px; }

/* Nav counters */
.nav-links a { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--pink); color: var(--ink); font-size: 12px; font-weight: 900; line-height: 1; }
.count[hidden] { display: none; }
.ic { flex: none; }

/* Bottom tab bar (phones) */
.tabbar { display: none; }

/* Friends carousel */
.section-head { margin: 34px 0 14px; gap: 12px; align-items: baseline; }
.section-head h2 { margin: 0; }
.search { max-width: 300px; padding: 11px 14px; font-size: 16px; align-self: center; }
.carousel { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.carousel.wrap { flex-wrap: wrap; overflow: visible; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 92px; flex: none; scroll-snap-align: start;
  background: none; border: 0; color: var(--text); padding: 0; text-align: center; }
.chip b { font-size: 14px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip small { color: var(--mint); font-weight: 900; font-size: 13px; margin-top: -4px; }
.ring { padding: 3px; border-radius: 50%; border: 3px solid transparent; transition: transform .15s; }
.ring.on { border-color: var(--online); }
.ring.play { border-color: var(--mint); }
.ring .bust { width: 70px; height: 70px; }
.chip:hover .ring { transform: translateY(-2px); }
.chip:not(:has(.ring.on, .ring.play)) .bust { opacity: .55; }

/* Place page */
.place img.square { width: 76px; height: 76px; aspect-ratio: 1; border-radius: 18px; object-fit: cover; flex: none; }

/* Profile */
.stage { width: 240px; height: 320px; display: grid; place-items: center; border-radius: 22px;
  background: radial-gradient(circle at 50% 70%, #8f6ff033, transparent 65%); }
.stage.live { cursor: grab; touch-action: pan-y; }
.stage.live:active { cursor: grabbing; }
.stage canvas { display: block; }
.more { gap: 18px; margin-top: 12px; }
.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 800; font-size: 15px; }
.link:hover { color: var(--text); }
.link.danger:hover { color: var(--danger); }
label.radio { flex-direction: row; align-items: center; gap: 10px; display: flex; font-size: 16px; color: var(--text); cursor: pointer; }
label.radio input { width: auto; accent-color: var(--accent); }

/* Settings */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { display: none; }
.switch i { width: 46px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: left .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { left: 23px; }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; }
.face { aspect-ratio: 1; border: 3px solid transparent; border-radius: 18px; background: #f5f1ec; padding: 8px; }
.face img { width: 100%; height: 100%; object-fit: contain; }
.face.on { border-color: var(--accent); box-shadow: 0 0 0 3px #b89cff55; }
.tg { justify-content: center; }
.tg h3 { display: flex; align-items: center; gap: 10px; color: var(--accent); }
input[type="date"] { color-scheme: dark; }

/* Messages */
.dm { display: grid; grid-template-columns: 320px 1fr; gap: 18px; height: calc(100vh - 250px); min-height: 460px; }
.dm-side { min-height: 0; }
.dm-list { overflow-y: auto; min-height: 0; flex: 1; padding-right: 4px; }
.conv { width: 100%; padding: 12px; border: 0; color: var(--text); text-align: left; gap: 12px; border-radius: 18px; }
.conv .bust { width: 46px; height: 46px; }
.conv.on, .conv:hover { background: var(--card2); }
.conv .grow { display: flex; flex-direction: column; gap: 2px; }
.preview { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-pane { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 18px; }
.dm-empty { margin: auto; background: none; }
.dm-empty .ic { opacity: .5; }
.dm-head { gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.dm-head .bust { width: 44px; height: 44px; }
.dm-head .pill { margin-top: 4px; font-size: 12px; padding: 3px 10px; }
.dm-head .back { display: none; }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; min-height: 0; }
.bubble { max-width: 75%; align-self: flex-start; background: var(--card2); padding: 10px 14px; border-radius: 18px 18px 18px 6px;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--ink); border-radius: 18px 18px 6px 18px; }
.note { color: var(--muted); text-align: center; font-size: 15px; padding: 4px 8px; }
#send input { flex: 1; }
#send .btn { padding: 14px 16px; }

@media (max-width: 860px) {
  .hero, .place, .profile, .grid2, .features { grid-template-columns: 1fr; }
  .profile { justify-items: center; text-align: center; }
  .profile .row, .profile .stats { justify-content: center; }
  .server { flex-wrap: wrap; }
  .meter { width: 100px; }
  .dm { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .dm .dm-pane { display: none; }
  .dm.chat-open .dm-side { display: none; }
  .dm.chat-open .dm-pane { display: flex; }
  .dm-head .back { display: inline-flex; }
}

/* Phones: slim top bar, app-style tab bar at the bottom. */
@media (max-width: 760px) {
  .nav { gap: 10px; padding: 10px 14px; }
  .brand { font-size: 22px; }
  .brand img { width: 32px; height: 32px; }
  .nav-links { display: none; }
  .me-chip { padding: 3px; }
  .me-chip span { display: none; }
  .lang { max-width: 118px; padding: 6px 8px; font-size: 14px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #1d1a26f2; backdrop-filter: blur(14px); border-top: 1px solid #ffffff12;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 14px;
    color: var(--muted); font-size: 11px; font-weight: 800; position: relative; min-width: 0; }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .count { position: absolute; top: 0; left: 50%; margin-left: 6px; height: 18px; min-width: 18px; font-size: 11px; }
  body { padding-bottom: 72px; }
  main { padding: 18px 14px 40px; }
  h2 { font-size: 22px; }
  .section-head { flex-wrap: wrap; }
  .search { max-width: none; flex-basis: 100%; }
  .btn.big { padding: 15px 22px; font-size: 18px; }
  .btn.dl.big { min-width: 0; width: 100%; }
  .dl-grid .btn { flex: 1 1 140px; }
  .card { padding: 16px; }
  .stage { width: 220px; height: 290px; }
  .dm { height: calc(100dvh - 150px); min-height: 380px; }
  .toast { width: calc(100vw - 28px); text-align: center; }
}

/* Loading */
.loader { display: grid; place-items: center; min-height: 160px; }
.loader i { width: 42px; height: 42px; border-radius: 50%; border: 4px solid #b89cff2e; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { display: block; height: 14px; border-radius: 8px; background: var(--card2); animation: pulse 1.4s ease-in-out infinite; }
.skel-card { display: flex; flex-direction: column; gap: 10px; }
@keyframes pulse { 50% { opacity: .45; } }
input.busy { background-image: radial-gradient(circle, var(--accent) 35%, transparent 40%); background-repeat: no-repeat;
  background-size: 14px 14px; background-position: right 14px center; animation: pulse 0.8s ease-in-out infinite; }

/* Friends + chats switch */
.social-head { flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.segment { display: flex; background: var(--bg2); border-radius: 16px; padding: 4px; gap: 4px; }
.segment a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; color: var(--muted); font-weight: 800; }
.segment a.on { background: var(--accent); color: var(--ink); }
.segment a.on .count { background: var(--ink); color: var(--accent); }
@media (max-width: 760px) { .segment { width: 100%; } .segment a { flex: 1; justify-content: center; } }

/* Studio: comments, owner stats, my places and images, docs */
.comment { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; }
.comment p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.bars i { flex: 1; min-width: 2px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.studio-row { padding: 12px 16px; flex-wrap: wrap; }
.studio-row img { width: 128px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; display: block; }
.studio-row select { width: auto; }
/* The name and stats keep a readable width; the controls wrap under them when space runs out. */
.studio-row .grow { flex: 1 1 200px; min-width: 160px; }
.studio-row h3 { overflow-wrap: anywhere; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.asset { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.asset img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: var(--bg2); }
.asset b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote { margin: 0; padding: 8px 14px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
.docs aside { position: sticky; top: 90px; padding: 14px; gap: 2px; }
.docs aside a { padding: 9px 12px; border-radius: 12px; color: var(--muted); }
.docs aside a.on, .docs aside a:hover { background: var(--card2); color: var(--text); }
.md { line-height: 1.6; min-width: 0; }
.md h1 { margin-top: 0; }
.md h2 { margin-top: 36px; }
.md h3 { margin-top: 26px; }
.md a { color: var(--accent); }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--card2); padding: 2px 6px; border-radius: 6px; }
.md pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; overflow-x: auto; }
.md pre code { background: none; padding: 0; font-size: 14px; }
.md table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; margin: 12px 0; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.md th { color: var(--muted); font-weight: 800; }
.md blockquote { margin: 12px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; }
  .docs aside { position: static; flex-direction: row; flex-wrap: wrap; }
}
.card .card { background: var(--card2); }
.assets .empty { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile b { font-size: 24px; }
  .studio-row img { width: 96px; }
  .studio-row .grow { flex-basis: calc(100% - 110px); min-width: 0; }
}
@media (max-width: 760px) { .user-row { flex-wrap: wrap; } }
/* Chats never grow the page: the grid row and both columns scroll inside. */
.dm { grid-template-rows: minmax(0, 1fr); }
.dm > * { min-height: 0; min-width: 0; }
.conv .grow { min-width: 0; }
.dm-pane .msgs { flex: 1; min-height: 0; overflow-y: auto; overflow-wrap: anywhere; }
.place-card h3 { overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.owner-panel textarea { width: 100%; resize: vertical; }
.tr-row { gap: 8px; flex-wrap: wrap; }
.lang-tag { min-width: 110px; font-size: 14px; color: var(--muted); }
.cover-pick { display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.cover-pick img { border-radius: 14px; object-fit: cover; background: var(--bg2); border: 2px dashed var(--line); }
.cover-pick:hover img { border-color: var(--accent); }
.cover-pick.wide img { width: 256px; aspect-ratio: 16 / 9; }
.cover-pick.square img { width: 144px; aspect-ratio: 1; }
.cover-pick span { font-size: 14px; color: var(--muted); font-weight: 800; }
textarea { border: 2px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 14px; padding: 14px 16px; font: inherit; font-size: 17px; outline: none; }
textarea:focus { border-color: var(--accent); }
.tr-row input { width: auto; min-width: 160px; }

/* --- economy -------------------------------------------------------------- */
.cur { vertical-align: -4px; flex: none; }
.wallet-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--card2); color: var(--text); text-decoration: none; font-size: 15px; margin-right: 8px; }
.wallet-chip b { margin-right: 6px; }
.balances { margin: 10px 0 22px; }
.balance { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--text); }
.balance div { display: flex; flex-direction: column; gap: 2px; }
.balance b { font-size: 30px; }
.balance small { font-size: 13px; }
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pack { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pack .big { font-size: 34px; }
.mintpill { background: #7ee0c333; color: var(--mint); }
.small-note { font-size: 14px; margin-top: 14px; }
.plus { color: var(--online); } .minus { color: var(--pink); }
.quest { display: flex; gap: 16px; align-items: center; }
.quest .meter { width: auto; }
.shop { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
.shop-preview { position: sticky; top: 80px; }
.shop-preview .viewer { height: 360px; display: flex; align-items: center; justify-content: center; }
.shop-preview .viewer .bust { width: 160px; height: 160px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.shop-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 2px solid transparent; }
.shop-item.on { border-color: var(--accent); }
.shop-item .pic { height: 70px; display: flex; align-items: center; justify-content: center; background: var(--bg2); border-radius: 14px; }
.shop-item .pic img { height: 60px; }
.shop-item .acc-slot { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.shop-item .price { gap: 4px; min-height: 22px; }
.shop-item .row { gap: 6px; flex-wrap: wrap; }
.wrap-row { flex-wrap: wrap; gap: 8px; }
.passes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.pass { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pass img, .pass .pass-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--bg2); display: flex; align-items: center; justify-content: center; }
.legal { max-width: 860px; margin: 0 auto; line-height: 1.55; }
.legal h2 { font-size: 20px; margin-top: 26px; }
.reply { background: var(--bg2); border-radius: 14px; padding: 12px 14px; white-space: pre-line; border-left: 3px solid var(--mint); }
textarea { width: 100%; border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); padding: 12px 14px; font: inherit; resize: vertical; }
footer a { color: var(--muted); }
@media (max-width: 760px) {
  .shop { grid-template-columns: 1fr; }
  .shop-preview { position: static; }
  .shop-preview .viewer { height: 260px; }
  .wallet-chip { padding: 6px 10px; font-size: 14px; }
  .nav-right .wallet-chip b { margin-right: 2px; }
}

.shop-item .pic { height: 110px; }
.shop-item .pic img[data-thumb] { height: 100px; width: 100px; }
@media (max-width: 760px) {
  .quest { flex-wrap: wrap; }
  .quest > .grow { flex: 1 1 60%; }
  .quest > .btn, .quest > .pill { width: 100%; justify-content: center; }
  .balances { grid-template-columns: 1fr 1fr; gap: 10px; }
  .balance { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; }
  .balance small { display: none; }
  .balance b { font-size: 24px; }
}

/* Narrow phones: the wallet chip needs the room the wordmark took. */
html { overflow-x: clip; }
.nav-right { min-width: 0; }
@media (max-width: 520px) {
  .brand span { display: none; }
  .nav-right { gap: 6px; }
  .lang { max-width: 104px; }
  .wallet-chip { margin-right: 0; gap: 4px; padding: 6px 9px; }
}
.shop-item .buy-row { display: flex; gap: 6px; }
.shop-item .buy-row .btn { flex: 1; justify-content: center; gap: 4px; padding-left: 8px; padding-right: 8px; }
.shop-item .buy-row .btn svg { flex: none; }
.shop-item > .pill { align-self: flex-start; }
/* Laptops: eight links, the language, the wallet and you have to share one row. */
@media (min-width: 761px) and (max-width: 1440px) {
  .nav { gap: 10px; }
  .nav-links { margin-left: 0; gap: 0; }
  .nav-links a { padding: 9px 9px; font-size: 15px; }
  .me-chip { padding: 3px; }
  .me-chip span { display: none; }
  .wallet-chip { margin-right: 0; }
}
@media (min-width: 761px) and (max-width: 1180px) {
  .brand span { display: none; }
  .lang { max-width: 110px; }
}
@media (min-width: 761px) and (max-width: 1040px) {
  .nav { flex-wrap: wrap; row-gap: 6px; }
  .nav-links { order: 3; width: 100%; justify-content: space-between; }
}
/* Long words (script names in hints, links) wrap instead of pushing the page wider. */
body { overflow-wrap: break-word; }
.card, .stack > * { min-width: 0; }
.shop-item .pic img.face-tile { height: 84px; width: 84px; border-radius: 16px; padding: 6px; object-fit: contain; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge-wrap { display: flex; flex-direction: column; gap: 4px; }
.badge-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px; text-align: center; }
.badge-tile img, .badge-tile .badge-ph { width: 96px; height: 96px; border-radius: 18px; object-fit: cover; }
.badge-tile .badge-ph { display: flex; align-items: center; justify-content: center; font-size: 56px; color: var(--accent); background: var(--bg2); }
.badge-tile.dim { opacity: .45; }
.badge-tile a { font-size: 13px; }

/* Communities */
.emblem { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 30%; color: #1d1a26; font-weight: 900; }
.cm-row { padding: 14px 16px; margin-bottom: 10px; }
.cm-head { gap: 16px; }
button.pill { border: 0; color: var(--text); cursor: pointer; font: inherit; font-weight: 700; }
button.pill.on { background: var(--accent); color: #1d1a26; }
.cm-msgs { height: min(52vh, 480px); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.cm-msg { display: flex; gap: 10px; align-items: flex-start; }
.cm-msg .bust { width: 38px; height: 38px; }
.cm-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); color: var(--text); text-decoration: none; margin: 0 8px 8px 0; }
.accent { color: var(--accent); }
b.danger { color: var(--danger); }
b.mint { color: var(--mint); }
