:root {
  --bg: #1d150e;
  --panel: #2b2016;
  --panel-2: #3a2b1e;
  --line: #5e4730;
  --text: #f6ead0;
  --muted: #c4ad88;
  --pink: #c8463b;
  --teal: #3f9c94;
  --yellow: #e3b64c;
  --lime: #7fb35a;
  --orange: #d98a3d;
  --topbar-h: 60px;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.45 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ico {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: linear-gradient(#3a2b1e, #2b2016);
  border-bottom: 2px solid #8a6a3d;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  z-index: 40;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font-family: Cinzel, Georgia, serif; font-size: 19px; letter-spacing: .5px;
}
.logo b { color: var(--pink); font-weight: 400; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--pink), var(--orange));
  color: #1d150e; font-size: 18px;
}
.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.chip {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip .ico { width: 16px; height: 16px; color: var(--yellow); }
.chip:hover { color: var(--text); }
.btn-primary {
  height: 36px; padding: 0 16px;
  border: 0; border-radius: 10px;
  background: var(--pink); color: #1d150e;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; filter: none; }
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }

/* ---------- Main / city ---------- */
main { position: relative; flex: 1; min-height: 0; }
.city, .room { position: absolute; inset: 0; }
/* ---------- Room ---------- */
.room {
  --accent: var(--pink);
  overflow: clip; /* the wide floor must never become scrollable, even by scrollIntoView */
  background:
    radial-gradient(110% 70% at 50% 0%, color-mix(in srgb, var(--accent) 32%, #2a1e14) 0%, #2a1e14 58%, #1a120b 100%);
}
.room-floor {
  position: absolute; left: -50%; right: -50%; bottom: -8%; height: 55%;
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 60%, transparent) 2px, transparent 2px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, transparent) 2px, transparent 2px);
  background-size: 80px 80px;
  transform: perspective(500px) rotateX(62deg);
  transform-origin: 50% 100%;
  opacity: .35;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent);
          mask-image: linear-gradient(to top, #000 30%, transparent);
}
.back-btn {
  position: absolute; top: 18px; left: 20px; z-index: 2;
  display: flex; align-items: center; gap: 4px;
  height: 38px; padding: 0 14px 0 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(43, 31, 21, .8); color: var(--text);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.back-btn:hover { border-color: var(--accent); }
.room-inner {
  position: relative; height: 100%; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 64px 20px 110px; text-align: center;
}
.room-title {
  font-family: Cinzel, Georgia, serif; font-weight: 400;
  font-size: clamp(38px, 7vw, 80px); line-height: 1.1; letter-spacing: 3px;
  color: #fff; outline: none;
  text-shadow: 0 3px 0 #1d150e, 0 0 22px color-mix(in srgb, var(--accent) 45%, transparent);
}
.room-sub { color: var(--muted); }
/* One screen on a computer (the user, 2026-11-03): every room but the Marketplace and the Workshop fits a desktop
   window from 1280 × 720 up without scrolling the page. Rooms with fit (app.js ROOMS) get a smaller title and their
   content fills the rest down to the dock; each room lays out its content in its own CSS and long lists scroll inside
   their own panels. Phones and narrow windows keep the page that scrolls. */
@media (min-width: 1041px) and (min-height: 560px) {
  .room.fit .room-inner { box-sizing: border-box; gap: 0; padding: 10px 20px 92px; }
  .room.fit .room-title { font-size: clamp(34px, 5.4vh, 64px); line-height: 1; margin: 0; }
  .room.fit .room-sub { margin: 4px 0 0; }
}
@media (min-width: 1041px) and (min-height: 560px) and (max-height: 820px) {
  .room.fit .room-sub { font-size: 11px; }
}
/* One room header on a computer (design review, 5 Nov 2026): the Marketplace and the Workshop scroll, but their title is as compact
   as the one-screen rooms', so their content starts in the first screen. */
@media (min-width: 1041px) {
  .room:not(.fit) .room-inner { padding-top: 14px; }
  .room:not(.fit) .room-title { font-size: clamp(34px, 5.4vh, 60px); line-height: 1; margin: 0; }
  .room:not(.fit) .room-sub { margin: 4px 0 10px; }
}
.room-empty {
  flex: 1; width: min(860px, 100%); max-height: 380px; min-height: 160px;
  margin-top: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 20px;
  background: rgba(29, 21, 14, .55);
  backdrop-filter: blur(4px);
  color: var(--muted);
}
.room-empty .ico { width: 40px; height: 40px; color: var(--accent); margin-bottom: 4px; }
.room-empty strong { color: var(--text); font-size: 18px; }

/* Casino game tiles and embedded game */
.game-grid {
  width: min(860px, 100%); margin-top: 24px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px;
}
.game-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 20px 22px;
  border: 1px solid color-mix(in srgb, var(--game) 45%, var(--line)); border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--game) 18%, rgba(29, 21, 14, .7)), rgba(29, 21, 14, .78));
  backdrop-filter: blur(4px);
  color: var(--text); text-decoration: none; outline: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.game-card:hover, .game-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--game);
  box-shadow: 0 0 0 1px var(--game), 0 18px 40px -12px var(--game);
}
.game-card img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 6px; border-radius: 16px; }
.game-card strong { font-family: Cinzel, Georgia, serif; font-weight: 400; font-size: 26px; letter-spacing: 1px; }
.game-card span { color: var(--muted); font-size: 14px; }
.game-card em {
  margin-top: 12px; padding: 9px 28px; border-radius: 10px;
  background: var(--game); color: #fff;
  font-style: normal; font-weight: 700; font-size: 14px;
}
.game-view {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  padding-bottom: 88px; /* keep the game clear of the player dock */
  background: var(--bg);
}
.game-bar {
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 16px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.game-bar .back-btn { position: static; height: 34px; }
.game-bar strong { font-family: Cinzel, Georgia, serif; font-weight: 400; font-size: 16px; letter-spacing: 1px; }
.game-view iframe { flex: 1; width: 100%; border: 0; background: #000; }

/* Marketplace */
.market { width: min(1100px, 100%); margin-top: 20px; text-align: left; }
.market h3 { font-size: 16px; font-weight: 700; margin: 0; }
.market-tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 12px; background: rgba(29, 21, 14, .7);
}
.market-tabs button {
  padding: 8px 20px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
}
.market-tabs button[aria-selected="true"] { background: var(--accent); color: #1d150e; }
.market-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(29, 21, 14, .6); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.market select, .market input {
  height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
/* No offers at all (market.js firstSeller): what the player could list, one click from My shop. */
.market-first { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; border-radius: 16px;
  text-align: center; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .3); }
.market-first > b { font: 700 18px var(--head, Oswald), sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.market-first p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.market-first p b { color: var(--text); }
.market-meta { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.market-toolbar .chips + .chips { width: 100%; order: 2; }
.chip-btn.set[aria-pressed="true"] { border-color: var(--yellow); background: rgba(255, 210, 63, .14); }
.listing.from-player { border-color: rgba(34, 228, 217, .55); box-shadow: 0 0 0 1px rgba(34, 228, 217, .25); }
.seller small { color: var(--muted); }
.get-it { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; }
.get-it:hover { text-decoration: underline; }
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.collection { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(36, 27, 18, .85); display: flex; flex-direction: column; gap: 8px; }
.collection.complete { border-color: var(--yellow); box-shadow: 0 0 22px -8px var(--yellow); }
.collection header { display: flex; justify-content: space-between; align-items: baseline; }
.collection header span { color: var(--yellow); font-weight: 700; }
.collection-items { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.col-item { --r: var(--muted); aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; background: #21180f; border: 1px solid var(--line); filter: grayscale(1) brightness(.45); }
.col-item.have { filter: none; border-color: var(--r); box-shadow: inset 0 0 12px -4px var(--r); }
.col-item svg { width: 80%; height: 80%; }
.listing {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: rgba(36, 27, 18, .85);
}
.item-art {
  --r: var(--muted);
  display: grid; place-items: center; aspect-ratio: 16 / 10;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--r) 35%, transparent), transparent 70%), #21180f;
  color: var(--r);
}
.item-art .ico { width: 44px; height: 44px; stroke-width: 1.4; filter: drop-shadow(0 0 10px var(--r)); }
.item-art > svg:not(.ico) { width: 64px; height: 64px; filter: drop-shadow(0 0 10px var(--r)); }
.my-row .item-art > svg:not(.ico) { width: 36px; height: 36px; }
.r-uncommon { --r: #a8a8b8; } .r-common { --r: #4f9be6; } .r-rare { --r: #b07ae8; } .r-epic { --r: #f0569f; } .r-legendary { --r: #f2a33a; }
.listing-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 0; flex: 1; }
.rarity { color: var(--r); font-size: 12px; font-weight: 700; }
.listing-body strong { font-size: 15px; }
.seller { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.seller em, .via-badge {
  font-style: normal; font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.listing-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 14px; }
.listing-foot b { font-size: 16px; }
.btn-buy {
  height: 32px; padding: 0 16px; border: 0; border-radius: 9px;
  background: var(--accent); color: #1d150e; font-weight: 700; cursor: pointer;
}
.btn-buy:disabled { opacity: .45; cursor: not-allowed; }
.tag-mine { font-size: 12px; font-weight: 700; color: var(--accent); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(58, 43, 30, .6); color: var(--text);
  font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); }
.btn-ghost:disabled { color: var(--muted); cursor: not-allowed; }
.btn-ghost em {
  font-style: normal; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px; background: var(--bg); color: var(--muted);
}
.btn-link { margin-top: 18px; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.shop-locked, .shop, .list-form {
  border: 1px solid var(--line); border-radius: 18px; background: rgba(36, 27, 18, .85); padding: 22px;
}
.shop-locked-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.shop-locked-head p { color: var(--muted); margin-top: 4px; }
.shop-lock {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.unlocks { display: grid; gap: 10px; }
.unlock {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(29, 21, 14, .6);
}
.unlock strong { display: block; }
.unlock small { color: var(--muted); font-size: 13px; }
.unlock-n {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 14px;
}
.demo-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line);
  color: var(--muted); font-size: 13px;
}
.shop { display: flex; flex-direction: column; gap: 16px; }
.shop-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; }
.shop-name { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.shop-name input { width: 220px; font-weight: 700; }
.via-badge { align-self: center; }
.shop-stats { display: flex; gap: 16px; margin-left: auto; color: var(--muted); font-size: 13px; }
.shop-stats b { color: var(--text); font-size: 16px; }
.list-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 18px; background: rgba(29, 21, 14, .6); }
.list-form h3 { width: 100%; }
.list-form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.list-form label:first-of-type { flex: 1; min-width: 200px; }
.list-form input { width: 120px; }
.list-form .btn-primary { height: 38px; background: var(--accent); color: #1d150e; }
.my-list { display: grid; gap: 8px; }
.my-row {
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 14px;
  padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(29, 21, 14, .6);
}
.my-row .item-art { aspect-ratio: 1; border-radius: 9px; }
.my-row .item-art .ico { width: 26px; height: 26px; }
.my-row small { display: block; }

/* ---------- Dock ---------- */
.dock {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px;
  background: rgba(43, 31, 21, .9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 16px;
  z-index: 20;
}
/* In a room, what scrolls under the dock fades out behind it instead of being cut by its edge. */
body::after { content: ''; position: fixed; left: 0; right: 0; bottom: 0; height: 118px; pointer-events: none; z-index: 19;
  background: linear-gradient(180deg, transparent, rgba(14, 6, 28, .78) 55%, rgba(10, 4, 20, .94)); }
body:has(#room[hidden])::after { display: none; }
::selection { background: rgba(255, 62, 165, .45); color: #fff; }
.dock button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 84px; padding: 8px 10px;
  border: 0; border-radius: 11px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.dock button .ico { width: 22px; height: 22px; }
.dock button:hover { background: var(--panel-2); color: var(--text); }
.dock button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--pink); }

/* ---------- Drawer ---------- */
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(400px, 100%);
  display: flex; flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 48px rgba(0, 0, 0, .45);
  z-index: 30;
  animation: slide-in .22s ease;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 14px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 17px; font-weight: 700; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; }
.panel h3 {
  margin: 22px 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted);
}
.panel-meta { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.empty-line {
  padding: 14px; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--muted); font-size: 14px; text-align: center;
}

/* Character */
.who { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.who-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted);
}
.who strong { display: block; }
.who small { color: var(--muted); font-size: 13px; }
.equip { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; align-items: center; }
.equip-col { display: flex; flex-direction: column; gap: 10px; }
.slot {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed #6e5538; border-radius: 12px;
  background: rgba(58, 43, 30, .6);
  color: #a88d66; font-size: 11px; font-weight: 600;
}
.slot .ico { width: 24px; height: 24px; }
.mannequin { width: 100%; max-height: 330px; fill: #4a3826; stroke: #7a5d3d; stroke-width: 1.5; }

/* Backpack */
.bag-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bag-grid span {
  aspect-ratio: 1; border-radius: 10px;
  border: 1px dashed #5e4730; background: rgba(58, 43, 30, .5);
}

/* Chat */
.panel.chat { display: flex; flex-direction: column; height: 100%; }
.chat-log { flex: 1; min-height: 240px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding: 4px 2px 12px; }
.chat-log .empty-state { margin: auto; }
.chat-online { color: var(--lime); font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.msg { max-width: 92%; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--panel-2); }
.msg.mine { align-self: flex-end; border-radius: 12px 12px 4px 12px; background: rgba(255, 210, 63, .12); }
.msg b { font-size: 13px; }
.msg time { margin-left: 8px; color: var(--muted); font-size: 11px; }
.msg p { margin-top: 2px; font-size: 14px; overflow-wrap: anywhere; }
.dock button[data-badge] { position: relative; }
.dock button[data-badge]::after {
  content: attr(data-badge); position: absolute; top: 2px; right: 14px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--pink); color: #1d150e; font-size: 11px; font-weight: 800; line-height: 18px;
}
.who-name { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.who-name label { color: var(--muted); font-size: 12px; font-weight: 600; }
.who-name input {
  height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: 700 15px Inter, system-ui, sans-serif;
}
.who-name input:focus { outline: none; border-color: var(--yellow); }
.who-name small { color: var(--muted); font-size: 12px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.empty-state .ico { width: 34px; height: 34px; }
.chat-form { display: flex; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-form input {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit;
}
.chat-form input:disabled { opacity: .6; }
.chat-form .btn-primary { height: 40px; }

/* Ranking: your rank card, three numbers, the next rank's rewards, then tabs (Top players · Ranks · Achievements). */
.rk { --rc: var(--yellow); }
.rk-hero {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 16px; border-radius: 18px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--rc) 55%, var(--line));
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 60%), rgba(255, 255, 255, .04);
}
.rk-medal {
  position: relative; flex: none; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--rc) 45%, #fff), var(--rc) 55%, color-mix(in srgb, var(--rc) 60%, #000));
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .25), 0 0 22px -2px var(--rc); color: rgba(20, 8, 31, .85);
}
.rk-medal .ico { width: 30px; height: 30px; }
.rk-medal b {
  position: absolute; right: -4px; bottom: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: #14081f; color: var(--rc); border: 2px solid var(--rc); font-size: 12px; font-weight: 900;
}
.rk-me { flex: 1; min-width: 0; }
.rk-me small { display: block; color: var(--muted); font-size: 12px; }
.rk-me strong { display: block; font: 600 26px/1.1 var(--head, Inter), sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #fff; }
.rk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.rk-stats div { padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); text-align: center; }
.rk-stats b { display: block; font-size: 18px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.rk-stats small { color: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.rk-next { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--rc) 70%, transparent); background: color-mix(in srgb, var(--rc) 8%, transparent); }
.rk-next small { color: var(--muted); font-size: 12.5px; }
.rk-next b { color: var(--rc); }
.rk-next ul, .rk-step ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 5px; }
.rk-next li, .rk-step li { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.rk-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 14px 0 12px; padding: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.rk-tabs button { height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.rk-tabs button[aria-selected="true"] { background: var(--panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--yellow); }

/* Top players */
.rk-podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; align-items: end; gap: 6px; margin-bottom: 10px; }
.rk-place { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; text-align: center; }
.rk-place b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #fff; }
.rk-place em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.rk-crown { font-size: 22px; line-height: 1; }
.rk-block {
  width: 100%; margin-top: 6px; display: grid; place-items: center; border-radius: 10px 10px 4px 4px;
  font: 700 22px var(--head, Inter), sans-serif; color: rgba(255, 255, 255, .9);
  border: 1px solid color-mix(in srgb, var(--pc) 70%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 45%, transparent), rgba(255, 255, 255, .03));
}
.rk-place.p1 { --pc: #f2c14e; } .rk-place.p2 { --pc: #c9d1dc; } .rk-place.p3 { --pc: #d08a4e; }
.rk-place.p1 .rk-block { height: 78px; } .rk-place.p2 .rk-block { height: 58px; } .rk-place.p3 .rk-block { height: 44px; }
.rk-place.p1 .rk-crown { font-size: 28px; }
.rk-place.me .rk-block { box-shadow: 0 0 0 2px var(--yellow); }
.rk-chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 60%, transparent); background: color-mix(in srgb, var(--rc) 12%, transparent);
}
.ach-list, .leaderboard { list-style: none; padding: 0; display: grid; gap: 6px; }
.leaderboard li:not(.empty-line) {
  display: grid; grid-template-columns: 26px 1fr auto auto; gap: 0 10px; align-items: center;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
}
.leaderboard .pos { color: var(--muted); font-weight: 800; text-align: center; }
.leaderboard b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.leaderboard b small, .rk-place b small { color: var(--yellow); font-size: 10.5px; font-weight: 800; text-transform: uppercase; }
.leaderboard em { font-style: normal; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.leaderboard li.me { border-color: var(--yellow); background: rgba(255, 179, 71, .08); }
.leaderboard li.out { margin-top: 6px; border-style: dashed; }

/* Ranks ladder */
.rk-ladder { position: relative; display: grid; gap: 10px; }
.rk-ladder::before { content: ''; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.rk-step { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.rk-node {
  position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 900; font-size: 14px; color: #14081f; background: var(--rc); border: 3px solid #14081f;
}
.rk-step-body { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.rk-step-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rk-step-head b { font-size: 15px; color: #fff; }
.rk-step-head small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rk-step.done li, .rk-step.now li { border-color: color-mix(in srgb, var(--rc) 60%, transparent); }
.rk-step.now .rk-step-body { border-color: var(--rc); box-shadow: 0 0 18px -6px var(--rc); }
.rk-step.now .rk-node { box-shadow: 0 0 0 3px var(--rc); }
.rk-step.next .rk-step-head small { color: var(--rc); font-weight: 700; }
.rk-step.locked .rk-node { background: rgba(255, 255, 255, .12); color: var(--muted); }
.rk-step.locked .rk-step-body { opacity: .6; }
.rk-step .xp-bar { margin: 6px 0 2px; }
.rk-step.next .xp-bar span { background: var(--rc); }

/* Achievements */
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; margin-bottom: 14px; }
.badge-grid .badge { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.badge-grid .badge i {
  width: 100%; max-width: 60px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  border: 1px dashed var(--line); background: rgba(255, 255, 255, .04); color: var(--muted);
}
.badge-grid .badge.on i { border: 2px solid var(--yellow); font-size: 24px; background: radial-gradient(circle, rgba(255, 179, 71, .3), rgba(255, 255, 255, .03)); box-shadow: 0 0 16px -4px var(--yellow); }
.badge-grid .badge small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.badge-grid .badge.on small { color: #fff; }
.ach-list li:not(.empty-line) {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 0 10px; align-items: center;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
}
.ach-list li i { grid-row: 1 / span 2; font-style: normal; font-size: 20px; text-align: center; }
.ach-list li b { font-size: 14px; }
.ach-list li span { grid-column: 2; color: var(--muted); font-size: 12px; }
.ach-list li em { grid-row: 1 / span 2; grid-column: 3; font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.ach-list li:not(.done):not(.empty-line) { opacity: .6; }
.ach-list li.done { border-color: color-mix(in srgb, var(--lime) 45%, transparent); }
.ach-list li.done em { color: var(--lime); }
.xp-bar { height: 8px; margin: 8px 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.xp-bar span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--pink), var(--yellow)); transition: width .5s ease; }

/* Toasts (achievements) */
.toasts { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 60; display: grid; justify-items: center; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; min-width: 240px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--yellow); background: rgba(43, 31, 21, .96); color: var(--text);
  box-shadow: 0 12px 30px -10px var(--yellow); animation: toast-in .35s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.out { opacity: 0; transform: translateX(20px); transition: all .4s ease; }
.toast-icon { font-size: 30px; }
.toast small { display: block; color: var(--yellow); font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.toast b { display: block; font-size: 16px; }
.toast em { font-style: normal; color: var(--lime); font-weight: 700; font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px) scale(.9); } }

/* Tour */
.tour { position: fixed; inset: 0; z-index: 70; }
.tour-spot {
  position: fixed; border-radius: 14px; border: 2px solid var(--yellow);
  box-shadow: 0 0 0 9999px rgba(5, 2, 12, .72), 0 0 24px var(--yellow);
  transition: all .35s ease; pointer-events: none;
}
.tour.centered .tour-spot { border-color: transparent; box-shadow: 0 0 0 9999px rgba(5, 2, 12, .72); }
.tour-card {
  position: fixed; width: min(340px, calc(100% - 32px)); padding: 18px; border-radius: 16px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 40px -10px #000; transition: top .35s ease, left .35s ease;
}
.tour.centered .tour-card { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-card small { color: var(--yellow); font-weight: 700; font-size: 12px; }
.tour-card h3 { margin: 4px 0 6px; font-family: Cinzel, Georgia, serif; font-weight: 400; font-size: 20px; }
.tour-card p { color: var(--muted); font-size: 14px; }
.tour-start { list-style: none; margin: 12px 0 4px; padding: 0; display: grid; gap: 6px; text-align: left; }
.tour-start li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); font-size: 13.5px; }
.tour-start b { color: #ffd23f; font-variant-numeric: tabular-nums; }
.tour-start a { color: #ff6ec7; font-weight: 800; text-decoration: none; white-space: nowrap; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tour-actions .btn-link { margin: 0 auto 0 0; }
.tour-btn { font-weight: 800; font-size: 16px; border: 1px solid var(--line); }

/* ---------- Sign-in modal ---------- */
.modal {
  width: min(400px, calc(100% - 32px));
  margin: auto; padding: 28px 24px 24px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--panel); color: var(--text);
}
.modal::backdrop { background: rgba(5, 2, 12, .7); backdrop-filter: blur(3px); }
.modal-close-form { position: absolute; top: 10px; right: 10px; }
.modal h2 { font-size: 20px; margin-bottom: 6px; padding-right: 30px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.login-opt {
  width: 100%; height: 48px; margin-top: 10px; padding: 0 14px;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2); color: var(--text);
  font-weight: 600; text-align: left; cursor: pointer;
}
.login-opt:hover:not(:disabled) { border-color: var(--yellow); }
.login-opt:disabled { cursor: not-allowed; opacity: .75; }
.login-opt.slim { height: 42px; margin-top: 0; }
.login-google { margin-top: 10px; min-height: 44px; display: flex; justify-content: center; }
.login-google:empty { display: none; }
.login-msg { min-height: 18px; margin: 12px 0 0 !important; font-size: 13px !important; color: var(--muted); }
.login-msg.bad { color: #ef8a7c !important; }
.login-legal { margin: 10px 0 0 !important; font-size: 12px !important; color: var(--muted); }
.login-legal a { color: var(--yellow); }
.login-note { font-size: 12.5px !important; margin: 4px 0 14px !important; }
.account-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0 8px; font-size: 14px; }
.account-list dt { color: var(--muted); }
.account-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.account-list code { font-size: 12.5px; color: var(--yellow); }
.account-actions { display: grid; gap: 8px; margin-bottom: 16px; }
#signInBtn.signed { background: var(--panel-2); color: var(--text); border: 1px solid var(--yellow); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-opt em {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted);
}
.g-mark {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: #4285f4; font-weight: 800; font-size: 13px;
}
/* Wallet sign-in: the same pill as Google's button above it, with a Solana-coloured mark. */
.login-opt.login-wallet {
  width: min(340px, 100%); height: 44px; margin: 10px auto 0; padding: 0 18px 0 4px; gap: 10px;
  border-radius: 999px; border: 1px solid rgba(153, 69, 255, .55);
  background: linear-gradient(90deg, #1d1033, #2a1648);
  transition: border-color .15s, box-shadow .15s;
}
.login-opt.login-wallet:hover:not(:disabled) { border-color: #14f195; box-shadow: 0 0 14px rgba(153, 69, 255, .45); }
.w-mark {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #9945ff, #14f195); color: #fff;
}
.w-mark .ico { width: 18px; height: 18px; }
.w-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.w-text b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.w-text small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .topbar { padding: 0 16px; gap: 10px; }
  .logo { font-size: 16px; }
  .chip { padding: 0 10px; }
  .dock {
    left: 0; right: 0; bottom: 0; transform: none;
    border-radius: 0; border-width: 1px 0 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .dock button { flex: 1; min-width: 0; }
  .room-inner { padding: 72px 16px 96px; }
  .game-view { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .listing-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .unlock { grid-template-columns: auto 1fr; }
  .unlock .btn-ghost { grid-column: 2; justify-self: start; }
  .shop-stats { margin-left: 0; }
  .my-row { grid-template-columns: 48px 1fr auto; }
  .my-row .btn-ghost { grid-column: 2 / -1; justify-self: start; }
  .back-btn { left: 16px; }
}
@media (max-width: 380px) {
  .chip { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* City "Online now" list filled by social.js */
.iso-online li em { margin-left: auto; padding-left: 8px; font-style: normal; font-size: 11px; color: var(--muted); }
.iso-online li.more { color: var(--muted); font-size: 12px; }
.sound-btn { border: 1px solid var(--line); }
.modal-name { padding: 0 34px 16px 0; margin-bottom: 16px; border-bottom: 1px solid var(--line); }

/* Profile pictures (net.avatar): the uploaded picture, else the first letter on the player's colour */
.pfp {
  display: inline-grid; place-items: center; flex: none; width: var(--pfp); height: var(--pfp); margin-right: .4em; vertical-align: middle;
  border-radius: 50%; object-fit: cover; background: var(--pfc, #3a2c4e); box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
  color: #fff; font: 800 calc(var(--pfp) * .5) / 1 Inter, system-ui, sans-serif; text-transform: uppercase;
}
.rk-place > .pfp { margin: 2px 0 2px; box-shadow: 0 0 0 2px var(--pc); }
/* Crew pictures (net.crewPic): the uploaded picture, else the crew's tag on its colour */
.crewpic {
  display: inline-grid; place-items: center; flex: none; width: var(--cp); height: var(--cp); margin-left: .35em; vertical-align: middle;
  border-radius: calc(var(--cp) * .26); object-fit: cover; background: var(--cc, #2a1d3d); box-shadow: 0 0 0 1px rgba(255, 255, 255, .28);
  color: #14081f; font: 800 calc(var(--cp) * .34) / 1 Oswald, Inter, sans-serif; letter-spacing: 0; overflow: hidden; white-space: nowrap;
}
.pfp-edit { display: flex; align-items: center; gap: 14px; padding-right: 0; }
/* The picture as in games: a round photo with a ring and a camera badge; a click picks a new one. */
.pfp-edit-pic { position: relative; flex: none; display: block; padding: 3px; border-radius: 50%; cursor: pointer;
  background: conic-gradient(from 210deg, #ff3ea5, #ffd23f, #22e4d9, #ff3ea5); box-shadow: 0 0 18px rgba(255, 62, 165, .35); transition: transform .15s; }
.pfp-edit-pic:hover { transform: scale(1.04); }
.pfp-edit-pic.off { cursor: default; filter: grayscale(.6); }
.pfp-edit-pic.off:hover { transform: none; }
.pfp-edit-pic #pfpPic { display: block; border-radius: 50%; padding: 2px; background: var(--bg, #14081f); }
.pfp-edit-pic .pfp { display: grid; margin: 0; box-shadow: none; }
.pfp-edit-cam { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #ff3ea5; color: #fff; box-shadow: 0 0 0 3px var(--bg, #14081f); }
.pfp-edit-cam svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.pfp-edit-pic.off .pfp-edit-cam { display: none; }
.pfp-edit-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pfp-edit-body b { color: var(--muted); font-size: 12px; font-weight: 600; }
.pfp-edit-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pfp-edit-btns label { cursor: pointer; }
.pfp-edit small { color: var(--muted); font-size: 12px; }
.pfp-edit small.bad { color: #ff7a7a; }

/* ---------- MMO frames (top bar, buttons, action bar) ---------- */
.topbar {
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 9px),
    linear-gradient(#4d3725, #2e2116 70%, #261b12);
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 #d9b25c, inset 0 -3px 0 #6b4a2a, inset 0 1px 0 rgba(255, 233, 180, .12), 0 4px 14px rgba(0, 0, 0, .45);
}
.logo { text-shadow: 0 2px 0 #1d150e; }
.logo-mark {
  border-radius: 50%; border: 2px solid #6b4a14;
  background: radial-gradient(circle at 35% 30%, #fff0a0, #e3b64c 48%, #a8742a);
  color: #5a3a10; font-family: Cinzel, Georgia, serif; font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 0 0 1px #d9b25c, 0 2px 6px rgba(0, 0, 0, .5);
}
.chip { border-color: #8a6a3d; background: linear-gradient(#3a2b1e, #261b12); box-shadow: inset 0 1px 0 rgba(255, 233, 180, .12); }
.chip:hover { border-color: #d9b25c; }
.btn-primary {
  background: linear-gradient(#d8604a, #a83a28); color: #fff3e0;
  border: 1px solid #f3cf63; text-shadow: 0 1px 0 rgba(0, 0, 0, .4);
  box-shadow: inset 0 1px 0 rgba(255, 233, 180, .35), 0 0 0 1px #5a1f16, 0 3px 8px rgba(0, 0, 0, .4);
}
.dock {
  background: linear-gradient(rgba(58, 43, 30, .97), rgba(36, 26, 17, .97));
  border: 1px solid #d9b25c;
  box-shadow: 0 0 0 1px #3a2410, 0 0 0 3px #8a6a3d, inset 0 1px 0 rgba(255, 233, 180, .2), 0 12px 26px -10px rgba(0, 0, 0, .75);
}
.dock button {
  background: radial-gradient(circle at 50% 35%, #3f2f20, #221810);
  border: 1px solid #6b4a2a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .5), inset 0 3px 8px rgba(0, 0, 0, .45);
  color: #d8c29a;
}
.dock button .ico { color: #e3b64c; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .6)); }
.dock button:hover { background: radial-gradient(circle at 50% 35%, #4d3a27, #2a1e14); border-color: #d9b25c; color: #fff3d0; }
.dock button:hover .ico { color: #f3cf63; filter: drop-shadow(0 0 6px rgba(243, 207, 99, .6)); }
.dock button[aria-pressed="true"] { background: radial-gradient(circle at 50% 35%, #5a4228, #2e2116); border-color: #f3cf63; color: #fff3d0; box-shadow: inset 0 0 0 1px rgba(243, 207, 99, .35), inset 0 0 14px rgba(243, 207, 99, .25); }
.logo span, .btn-primary, .chip { white-space: nowrap; }

/* ---------- Wallet (wallet.js): balance in the top bar, deposit / withdraw window ---------- */
.wallet-pill { color: var(--text); }
.wallet-pill b { font-variant-numeric: tabular-nums; }
.wallet-pill span { color: var(--muted); font-size: 11px; }
.wallet-pill .pill-play { font-style: normal; font-size: 11px; font-weight: 700; color: #ffd23f; margin-left: 2px; white-space: nowrap; }
.wallet-modal { width: min(460px, calc(100% - 32px)); }
.wallet-balance { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; }
.wallet-balance b { font-family: Cinzel, Georgia, serif; font-size: 34px; color: var(--yellow); font-variant-numeric: tabular-nums; }
.wallet-balance span { color: var(--muted); font-weight: 700; }
.modal .wallet-note { font-size: 13px; margin: 6px 0 12px; }
.modal .wallet-note a { color: #ff6ec7; font-weight: 700; text-underline-offset: 3px; }
.wallet-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 10px; }
.wallet-money div { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); text-align: left; }
.wallet-money b { display: block; font: 700 14px Oswald, sans-serif; letter-spacing: .04em; color: #fff; }
.wallet-money small { display: block; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.wallet-money div:first-child { box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .5); }
.wallet-money div:first-child b { color: #ffd23f; }
@media (max-width: 420px) { .wallet-money { grid-template-columns: 1fr; } }
.wallet-signin { margin-top: 8px; }
.wallet-tabs { display: flex; gap: 4px; margin: 14px 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.wallet-tabs button {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: none;
  color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer;
}
.wallet-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--yellow); }
.wallet-address { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--yellow); border-radius: 12px; background: var(--bg); }
.wallet-address code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: var(--yellow); }
.wallet-form { display: grid; gap: 6px; margin-top: 14px; }
.wallet-form label { font-size: 12.5px; color: var(--muted); }
.wallet-form small { font-size: 12px; color: var(--muted); }
.wallet-form input {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 14px;
}
.wallet-form input:focus { outline: none; border-color: var(--yellow); }
.wallet-form .btn-primary { margin-top: 6px; height: 42px; }
.wallet-row { display: flex; gap: 8px; }
.wallet-history { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.wallet-history li {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "amt what link" "amt when link"; column-gap: 12px;
  align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.wallet-history b { grid-area: amt; font-variant-numeric: tabular-nums; }
.wallet-history li.in b { color: var(--lime); }
.wallet-history span { grid-area: what; font-size: 13px; }
.wallet-history small { grid-area: when; font-size: 11.5px; color: var(--muted); }
.wallet-history a { grid-area: link; font-size: 12px; color: var(--yellow); }
.wallet-history .wallet-cancel { grid-area: link; font: 600 12px Inter, sans-serif; color: var(--muted); background: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.wallet-history .wallet-cancel:hover { color: var(--text, #fff); border-color: currentColor; }
@media (max-width: 640px) {
  .wallet-pill span { display: none; }
}
#walletState:empty { display: none; }
@media (max-width: 380px) {
  .wallet-pill, .play-admin-btn:not([hidden]) { display: flex; }
}
/* The play admin window (players.js): find a player by name, send play credits. */
.play-admin-btn { color: #ffd23f; font-weight: 700; }
.pa-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.pa-list button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer;
}
.pa-list button[aria-pressed="true"] { border-color: var(--yellow); }
.pa-list small { margin-left: auto; color: var(--muted); font-size: 12px; }
.pa-list .pa-empty { color: var(--muted); font-size: 13px; }
.pa-to { margin: 0; font-size: 14px; }

/* ---------- Top bar in the GTA VI trailer mood: Vice City sunset, neon, palms ---------- */
.topbar {
  --sunset: linear-gradient(90deg, #ffb347, #ff6a5c 30%, #ff3ea5 55%, #b04dff 80%, #3ad7e6);
  position: relative; overflow: hidden; isolation: isolate;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cg fill='%2309031a'%3E%3Cpath d='M58 60c1-14 3-27 9-38l2 1c-5 11-7 23-8 37z'/%3E%3Cpath d='M68 22c-8-6-19-6-27 1 9-2 18-1 27 1zM68 22c-3-9-12-15-23-14 9 3 16 8 23 14zM68 22c4-9 13-13 23-11-9 1-17 5-23 11zM68 22c9-4 20-2 27 5-9-3-18-4-27-5zM68 22c2 7 0 15-6 20 3-7 4-13 6-20z'/%3E%3Cpath d='M22 60c0-10 1-19 5-27l2 1c-3 8-4 17-4 26z'/%3E%3Cpath d='M28 33c-6-4-13-4-19 1 7-1 13-1 19-1zM28 33c-1-7-7-11-15-11 6 2 11 6 15 11zM28 33c3-6 9-9 16-7-6 1-11 3-16 7zM28 33c6-2 13 0 18 5-6-2-12-4-18-5z'/%3E%3C/g%3E%3C/svg%3E") left -10px bottom -4px / 150px 75px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cg fill='%2309031a' transform='translate(120 0) scale(-1 1)'%3E%3Cpath d='M58 60c1-14 3-27 9-38l2 1c-5 11-7 23-8 37z'/%3E%3Cpath d='M68 22c-8-6-19-6-27 1 9-2 18-1 27 1zM68 22c-3-9-12-15-23-14 9 3 16 8 23 14zM68 22c4-9 13-13 23-11-9 1-17 5-23 11zM68 22c9-4 20-2 27 5-9-3-18-4-27-5zM68 22c2 7 0 15-6 20 3-7 4-13 6-20z'/%3E%3C/g%3E%3C/svg%3E") right -20px bottom -4px / 150px 75px no-repeat,
    radial-gradient(160px 90px at 40px 110%, rgba(255, 150, 80, .75), rgba(255, 62, 165, .25) 55%, transparent 80%),
    radial-gradient(160px 90px at calc(100% - 40px) 110%, rgba(255, 120, 90, .7), rgba(176, 77, 255, .25) 55%, transparent 80%),
    radial-gradient(60% 140% at 50% 130%, rgba(255, 94, 120, .55), rgba(255, 62, 165, .18) 45%, transparent 70%),
    linear-gradient(90deg, #12061f, #24093a 30%, #3a0f45 50%, #24093a 70%, #12061f);
  box-shadow: 0 6px 22px rgba(10, 2, 24, .6);
}
/* Sunset stripe along the bottom edge, like the trailer's title cards. */
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: -1;
  background: var(--sunset); box-shadow: 0 0 12px rgba(255, 62, 165, .7);
}
.topbar .logo { font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 1px; text-transform: uppercase; text-shadow: 0 2px 0 #12061f; }
.topbar .logo > span:last-child { transform: skewX(-8deg); color: #fff; }
.topbar .logo b {
  font-weight: 700; margin-left: 4px;
  background: var(--sunset); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 0 8px rgba(255, 62, 165, .45));
}
.topbar .logo-mark {
  /* dark ink on the gradient: white on its orange was 1.8:1 */
  border-radius: 10px; border: 0; color: #1b0b2e; font-family: Oswald, Inter, sans-serif; font-weight: 700; font-size: 20px;
  background: linear-gradient(160deg, #ffb347, #ff3ea5 55%, #7b3cff);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 0 14px rgba(255, 62, 165, .55);
}
.topbar .chip, .topbar .icon-btn {
  border: 1px solid rgba(255, 120, 200, .35); background: rgba(18, 6, 32, .6); color: #f3e6ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); backdrop-filter: blur(4px);
}
.topbar .chip { font-family: Oswald, Inter, sans-serif; font-weight: 500; font-size: 14px; letter-spacing: .6px; }
.topbar .chip .ico { color: #ffb347; }
.topbar .chip:hover, .topbar .icon-btn:hover { border-color: #ff3ea5; color: #fff; background: rgba(40, 10, 60, .75); box-shadow: 0 0 12px rgba(255, 62, 165, .45); }
.topbar .wallet-pill span { color: #ff9ad5; }
.topbar .btn-primary {
  border: 0; border-radius: 999px; padding: 0 20px; color: #fff;
  font-family: Oswald, Inter, sans-serif; font-weight: 600; font-size: 15px; letter-spacing: 1.2px; text-transform: uppercase;
  background: linear-gradient(90deg, #ff8a3d, #ff3ea5 55%, #9b4dff);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 0 16px rgba(255, 62, 165, .55);
}
.topbar .btn-primary:hover { filter: brightness(1.12) saturate(1.1); }
.topbar #signInBtn.signed { background: rgba(18, 6, 32, .6); border: 1px solid #ff3ea5; text-transform: none; letter-spacing: .4px; box-shadow: 0 0 10px rgba(255, 62, 165, .35); }
@media (max-width: 640px) { .topbar .logo { font-size: 18px; } .topbar { background-size: 110px 55px, 110px 55px, auto, auto, auto, auto; } }
/* Phones: the D mark stands for the name so the balance and the account button keep their room. */
@media (max-width: 520px) { .topbar .logo > span:last-child { display: none; } .topbar .btn-primary { padding: 0 14px; font-size: 14px; } }

/* A game is open: no player dock, the game gets the whole height */
body.in-game .dock { display: none; }
body.in-game .game-view { padding-bottom: 0; }
/* Signed in: the top bar's account button shows the profile picture next to the name (auth.js). */
#signInBtn.signed { display: inline-flex; align-items: center; gap: 8px; padding-left: 5px; }
#signInBtn.signed .pfp { margin: 0; box-shadow: 0 0 0 2px #ff3ea5; }
#signInBtn.signed span:not(.pfp) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-who { white-space: nowrap; }
/* Ping and frame rate (app.js) in the top right corner under the top bar, like Sun City's corner: small,
   right-aligned, coloured when slow. The city's Online now panel is in the top left (city/iso.css). */
.netstats { position: fixed; top: calc(var(--topbar-h) + 14px); right: 20px; z-index: 30; pointer-events: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; font-family: Oswald, Inter, sans-serif; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .8), 0 0 6px rgba(0, 0, 0, .5); }
.netstats b { font-size: 16px; font-weight: 600; color: var(--muted); }
.netstats small { font-size: 13px; color: var(--muted); }
.netstats [data-level="1"] { color: #ffcf5a; }
.netstats [data-level="2"] { color: #f26b5c; }
/* On a phone the minimap sits top right (city/iso.css): the ping goes to the left corner so it never covers it. */
@media (max-width: 520px) { .netstats { right: auto; left: 14px; align-items: flex-start; } .netstats small { display: none; } }
/* Only when it matters: a calm ping and frame rate are noise for players; slow (yellow, red) shows. */
.netstats:not(:has([data-level="1"], [data-level="2"])) { opacity: 0; }
body.in-game .netstats { display: none; } /* it sat on the game's own top-right buttons (Gambling's chat) */

/* A game's store page in Games (Six City), as in the Eleventake hub: the picture with thumbnails, the game beside it. */
.game-grid.has-store { width: min(1180px, 100%); grid-template-columns: 1fr; }
.game-store { --game: #ff4fa3; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 16px;
  border: 1px solid color-mix(in srgb, var(--game) 45%, transparent); border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--game) 16%, rgba(24, 8, 40, .82)), rgba(16, 5, 28, .9)); backdrop-filter: blur(4px); }
.gs-shot { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--game) 70%, transparent); }
.gs-shot img { width: 100%; height: 100%; object-fit: cover; display: block; animation: gs-in .4s ease; }
@keyframes gs-in { from { opacity: .35; } }
.gs-arrow { position: absolute; top: 50%; translate: 0 -50%; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(10, 2, 24, .55); color: #fff; font: 700 26px/1 Inter, system-ui, sans-serif; cursor: pointer; opacity: 0; transition: opacity .2s; }
.gs-arrow.prev { left: 12px; } .gs-arrow.next { right: 12px; }
.gs-shot:hover .gs-arrow, .gs-arrow:focus-visible { opacity: 1; }
.gs-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gs-thumbs button { flex: 0 0 auto; width: 128px; aspect-ratio: 16 / 9; padding: 0; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: #000; cursor: pointer; opacity: .6; transition: opacity .2s, border-color .2s; }
.gs-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-thumbs button.on, .gs-thumbs button:hover { opacity: 1; border-color: var(--game); }
.gs-side { display: flex; flex-direction: column; gap: 10px; align-self: start; }
.gs-logo { width: 84px; height: 84px; object-fit: contain; }
.gs-side strong { font: 600 30px/1 var(--head, Oswald, sans-serif); letter-spacing: 2px; text-transform: uppercase; color: #fff; }
.gs-sub { color: #ffd23f; font-size: 14px; font-weight: 600; }
.gs-side p { margin: 0; color: #e6dcf5; font-size: 15px; line-height: 1.5; }
.gs-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.gs-tags span { font-size: 12px; padding: 4px 9px; border-radius: 6px; background: color-mix(in srgb, var(--game) 16%, transparent); color: color-mix(in srgb, var(--game) 55%, #fff); }
.gs-play { margin-top: 6px; padding: 13px; border-radius: 12px; text-align: center; text-decoration: none; color: #fff; background: var(--sunset-btn, var(--game));
  font: 600 18px var(--head, Oswald, sans-serif); letter-spacing: 2px; text-transform: uppercase; box-shadow: 0 0 18px color-mix(in srgb, var(--game) 60%, transparent); transition: transform .15s, box-shadow .15s; }
.gs-play:hover { transform: translateY(-2px); box-shadow: 0 0 26px color-mix(in srgb, var(--game) 85%, transparent); }
@media (max-width: 860px) { .game-store { grid-template-columns: 1fr; } .gs-thumbs button { width: calc((100% - 16px) / 3); } }

/* One bar for DaCity Pack (app.js gameBar): the game's arrow, menu, level and profile in the middle of the hub's top bar. */
.game-topnav { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; margin: 0 14px; }
.game-topnav[hidden] { display: none; }
.gtn-back { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .22); background: rgba(10, 2, 24, .45); color: #fff; font: 700 22px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.gtn-back:hover { border-color: #ff3ea5; box-shadow: 0 0 12px rgba(255, 62, 165, .5); }
.gtn-brand { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font: 700 17px/1 var(--head, Oswald, sans-serif); letter-spacing: 1px; text-transform: uppercase; }
.gtn-brand img { width: 30px; height: 30px; }
.gtn-brand b { color: #ff9bd0; font-weight: 700; }
.gtn-groups { flex: 1 1 auto; min-width: 0; display: flex; justify-content: safe center; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.gtn-groups > a, .gtn-groups > button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  color: #d9c9ea; font: 600 14px Inter, system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.gtn-groups > a:hover, .gtn-groups > button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.gtn-groups > .on { color: #fff; background: rgba(255, 62, 165, .18); border-color: rgba(255, 62, 165, .45); }
.gtn-groups i { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.gtn-groups svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.gtn-level { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; font-size: 11px; color: #c9b8dc; line-height: 1.15; }
.gtn-level b { color: #fff; font-size: 13px; }
.gtn-profile { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(10, 2, 24, .45); color: #fff; font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
.gtn-profile img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.game-topnav-menu { position: fixed; z-index: 120; width: 280px; padding: 6px; border-radius: 14px; background: rgba(20, 6, 34, .97); border: 1px solid rgba(255, 62, 165, .35); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); }
.game-topnav-menu[hidden] { display: none; }
.game-topnav-menu a { display: block; padding: 9px 12px; border-radius: 10px; color: #fff; text-decoration: none; font: 600 14px Inter, system-ui, sans-serif; }
.game-topnav-menu a small { display: block; margin-top: 2px; color: #b8a6cc; font-weight: 400; font-size: 12px; }
.game-topnav-menu a:hover, .game-topnav-menu a.on { background: rgba(255, 62, 165, .16); }
/* Up to 1280 px the level and the names give way, or Open · Play · Collection got squeezed to a cut-off "Ope" (1024 px). */
@media (max-width: 1280px) { .gtn-level, .gtn-brand span, .gtn-profile span { display: none; } .game-topnav { margin: 0 8px; gap: 6px; }
  body.has-game-topnav .topbar .logo > span:not(.logo-mark) { display: none; } .gtn-groups > a, .gtn-groups > button { padding: 7px 10px; } }

/* Marketplace filters as on the Eleventake hub's market (market.js renderBrowse): a panel beside the listings with the
   type (slot), the collection and the rarities. */
.market-browse { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
/* On a phone the filters fold into one Filters button (as on Eleventake), so the offers start under the tabs (market.js). */
.mf-toggle { display: none; }
@media (max-width: 640px) {
  .mf-toggle { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; margin: 2px 0 10px; border-radius: 999px;
    border: 1px solid var(--line); background: rgba(28, 10, 46, .85); color: var(--text); font-weight: 700; font-size: 14px; }
  .mf-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
  .mf-toggle i { width: 8px; height: 8px; border-radius: 50%; background: #ff3ea5; }
  .mfilters:not(.open) { display: none; }
}
.mfilters { position: sticky; top: 12px; display: grid; gap: 16px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(18, 6, 31, .6); }
.mfilters fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.mfilters legend, .mfilters-field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; text-transform: uppercase; letter-spacing: .06em; }
.mfilters-field { display: grid; }
.mfilters-field select { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(10, 2, 24, .7); color: var(--text); font: 600 14px Inter, system-ui, sans-serif; }
.mfilters-types { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.mfilters-types label { position: relative; cursor: pointer; padding: 5px 0; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; width: fit-content; }
.mfilters-types label.on, .mfilters-types label:hover { color: var(--text); }
.mfilters-types label.on { border-bottom-color: #ff3ea5; }
.mfilters-types input { position: absolute; opacity: 0; pointer-events: none; }
.mfilters-rarities { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.mfilters-rarities label { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.mfilters-rarities input { appearance: none; width: 13px; height: 13px; margin: 0; border-radius: 3px; border: 2px solid var(--r); background: transparent; cursor: pointer; flex: none; }
.mfilters-rarities input:checked { background: var(--r); }
.mfilters-clear { justify-self: start; }
.market-results .market-toolbar { justify-content: flex-end; }
@media (max-width: 820px) { .market-browse { grid-template-columns: 1fr; } .mfilters { position: static; } }
