/* Robis website — styled after the 2019 era of a certain brick-building platform. */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700;900&display=swap');

:root {
  --blue: #00a2ff;
  --blue-dark: #0074bd;
  --blue-hover: #32b5ff;
  --green: #02b757;
  --green-hover: #3fc679;
  --gray-bg: #f2f4f5;
  --panel: #ffffff;
  --text: #393b3d;
  --text-light: #757575;
  --border: #e3e3e3;
  --red: #d86868;
  --gold: #f6b702;
  --header-h: 40px;
  --nav-w: 175px;
  --radius: 3px;
  --shadow: 0 1px 4px rgba(25, 25, 25, 0.15);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Source Sans Pro', 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--gray-bg);
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; margin: 0 0 12px; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
img { max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }
.muted { color: var(--text-light); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ header */
.rbx-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 100;
  background: var(--blue); color: #fff; display: flex; align-items: center; padding: 0 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.rbx-header .menu-btn { display: none; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; margin-right: 6px; }
.rbx-header .logo { display: flex; align-items: center; height: 100%; margin-right: 18px; }
.rbx-header .logo img { height: 26px; }
.rbx-header .logo .logo-small { display: none; height: 30px; }
.rbx-header nav.main { display: flex; height: 100%; }
.rbx-header nav.main a {
  color: #fff; font-weight: 600; display: flex; align-items: center; padding: 0 14px; height: 100%; font-size: 16px;
}
.rbx-header nav.main a:hover, .rbx-header nav.main a.active { background: rgba(255, 255, 255, .15); text-decoration: none; }
.rbx-header .search { flex: 1; max-width: 460px; margin: 0 16px; position: relative; }
.rbx-header .search input {
  width: 100%; height: 28px; border: 0; border-radius: var(--radius); padding: 0 34px 0 10px; font-size: 15px; color: var(--text);
}
.rbx-header .search button { position: absolute; right: 2px; top: 2px; height: 24px; width: 28px; border: 0; background: none; cursor: pointer; color: #999; }
.rbx-header .right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.rbx-header .right a, .rbx-header .right button.icon-btn {
  color: #fff; display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: var(--radius); font-weight: 600;
  background: none; border: 0; cursor: pointer; font-size: 15px; position: relative;
}
.rbx-header .right a:hover, .rbx-header .right button.icon-btn:hover { background: rgba(255, 255, 255, .15); text-decoration: none; }
.rbx-header .right .login-btn { border: 1px solid #fff; }
.robits-icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }
.robits-icon svg { width: 100%; height: 100%; }
.badge-count {
  position: absolute; top: -2px; right: -2px; background: #e2231a; color: #fff; font-size: 11px; border-radius: 8px; padding: 0 5px; line-height: 15px;
}
.dropdown {
  position: absolute; top: calc(var(--header-h) - 2px); right: 8px; background: #fff; color: var(--text); border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25); min-width: 180px; padding: 6px 0; z-index: 200;
}
.dropdown a, .dropdown button { display: block; padding: 8px 16px; color: var(--text); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--gray-bg); text-decoration: none; }

/* ------------------------------------------------------------ left nav */
.rbx-leftnav {
  position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--nav-w); background: var(--panel);
  border-right: 1px solid var(--border); padding: 12px 0; overflow-y: auto; z-index: 90;
}
.rbx-leftnav .user { padding: 6px 16px 14px; font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.rbx-leftnav .user .headshot { width: 32px; height: 32px; border-radius: 50%; background: #d4d4d4; overflow: hidden; flex: none; }
.rbx-leftnav .user .headshot img { width: 100%; height: 100%; }
.rbx-leftnav a { display: flex; align-items: center; gap: 12px; padding: 9px 16px; color: var(--text); font-weight: 600; font-size: 15px; position: relative; }
.rbx-leftnav a:hover { background: var(--gray-bg); text-decoration: none; }
.rbx-leftnav a.active { background: var(--gray-bg); }
.rbx-leftnav a.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--blue); }
.rbx-leftnav a svg { width: 22px; height: 22px; flex: none; opacity: .8; }
.rbx-leftnav .count { margin-left: auto; background: var(--gray-bg); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.rbx-leftnav .upgrade {
  display: block; margin: 16px 14px 8px; text-align: center; background: var(--green); color: #fff !important; border-radius: var(--radius); padding: 8px; justify-content: center;
}
.rbx-leftnav .upgrade:hover { background: var(--green-hover); }
.rbx-leftnav .section-label { font-size: 12px; text-transform: uppercase; color: var(--text-light); padding: 12px 16px 4px; font-weight: 700; }

/* ------------------------------------------------------------ content */
.rbx-content { margin-top: var(--header-h); margin-left: var(--nav-w); padding: 24px 32px 60px; max-width: 1180px; display: flex; flex-direction: column; }
.rbx-content > * { flex: none; min-width: 0; }
.rbx-content > .footer { order: 99; }
.rbx-content.no-nav { margin-left: 0; margin-right: auto; margin-left: auto; }
.section { margin-bottom: 28px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-header h2 { margin: 0; font-size: 22px; }
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.panel + .panel { margin-top: 16px; }
.tabs { display: flex; background: var(--panel); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); overflow-x: auto; }
.tabs button {
  flex: 1; border: 0; background: none; padding: 12px 18px; font-weight: 600; color: var(--text-light); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--blue); }
.tabs + .panel { border-radius: 0 0 var(--radius) var(--radius); }

/* ------------------------------------------------------------ buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: var(--radius);
  padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 15px; line-height: 1.2; text-decoration: none !important; transition: background .1s;
  background: #fff; color: var(--text); border-color: #b8b8b8;
}
.btn:hover { background: #f5f5f5; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-hover); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: var(--green-hover); }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-large { padding: 12px 24px; font-size: 20px; }
.btn-block { display: flex; width: 100%; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid #b8b8b8; border-radius: var(--radius); padding: 8px 10px; background: #fff; color: var(--text);
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0, 162, 255, .2); }
label.field { display: block; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
label.field .input { margin-top: 4px; font-weight: 400; }
.error-text { color: #d0021b; font-size: 14px; min-height: 18px; }

/* ------------------------------------------------------------ game cards */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.game-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.game-row .game-card { flex: 0 0 158px; scroll-snap-align: start; }
.game-card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; color: var(--text);
  display: block; transition: box-shadow .15s, transform .15s; position: relative;
}
.game-card:hover { text-decoration: none; box-shadow: 0 3px 12px rgba(0, 0, 0, .25); transform: translateY(-1px); }
.game-card .thumb { aspect-ratio: 1; background: #d4d4d4 center/cover; position: relative; overflow: hidden; }
.game-card .thumb img, .game-card .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card .info { padding: 8px 10px 10px; }
.game-card .name { font-weight: 700; font-size: 15px; line-height: 1.25; height: 38px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.game-card .stats { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-light); margin-top: 6px; }
.game-card .stats span { display: flex; align-items: center; gap: 3px; }
.game-card .stats svg { width: 14px; height: 14px; }
.game-card .by { font-size: 12px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card .featured-tag { position: absolute; top: 6px; left: 6px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; border-radius: 2px; padding: 1px 6px; }

/* ------------------------------------------------------------ avatars & friends */
.avatar-card { text-align: center; width: 100px; flex: none; color: var(--text); }
.avatar-card:hover { text-decoration: none; }
.avatar-card .headshot { width: 90px; height: 90px; border-radius: 50%; background: #d4d4d4; margin: 0 auto 6px; overflow: hidden; position: relative; }
.avatar-card .headshot img { width: 100%; height: 100%; }
.avatar-card .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-card .presence { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.presence-dot { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; }
.presence-dot.online { background: var(--blue); }
.presence-dot.ingame { background: var(--green); }
.presence-dot.studio { background: #f68802; }
.friends-row { display: flex; gap: 12px; overflow-x: auto; padding: 16px; }

/* ------------------------------------------------------------ item cards */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.item-card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); display: block; overflow: hidden; position: relative; cursor: pointer; border: 2px solid transparent; }
.item-card:hover { text-decoration: none; box-shadow: 0 3px 12px rgba(0, 0, 0, .25); }
.item-card.selected { border-color: var(--green); }
.item-card .thumb { aspect-ratio: 1; background: linear-gradient(#f7f7f7, #e4e4e4); }
.item-card .thumb img { width: 100%; height: 100%; display: block; }
.item-card .info { padding: 6px 8px 8px; }
.item-card .name { font-weight: 600; font-size: 14px; height: 36px; overflow: hidden; line-height: 18px; }
.item-card .price { font-size: 14px; color: #02b757; font-weight: 700; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.item-card .price.free { color: var(--text); }
.item-card .limited-tag { position: absolute; left: 6px; top: 6px; background: #02b757; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 2px; }
.item-card .owned-tag { position: absolute; right: 6px; top: 6px; background: #393b3d; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 2px; }
.item-card .check { position: absolute; right: 6px; top: 6px; background: var(--green); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ------------------------------------------------------------ misc */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal { background: #fff; border-radius: 4px; width: 100%; max-width: 440px; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); overflow: hidden; animation: pop .15s ease-out; }
.modal-head { padding: 14px 18px; font-size: 20px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.modal-head button { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text-light); }
.modal-body { padding: 18px; }
.modal-foot { padding: 12px 18px 18px; display: flex; gap: 10px; justify-content: center; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #393b3d; color: #fff; padding: 10px 20px; border-radius: 4px; z-index: 2000; box-shadow: var(--shadow); animation: pop .2s; }
.toast.success { background: var(--green); }
.toast.error { background: #d0021b; }
.loading-spinner { width: 36px; height: 36px; margin: 30px auto; position: relative; animation: spin 1s linear infinite; }
.loading-spinner::before { content: ''; position: absolute; inset: 6px; background: var(--blue); transform: rotate(15deg); border-radius: 3px; }
.loading-spinner::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; background: var(--gray-bg); }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--text-light); padding: 30px; }
.stat-row { display: flex; gap: 0; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.stat-row > div { flex: 1; text-align: center; }
.stat-row .label { font-size: 13px; color: var(--text-light); }
.stat-row .value { font-size: 18px; font-weight: 700; }
.pill { display: inline-block; background: var(--gray-bg); border-radius: 12px; padding: 2px 10px; font-size: 13px; }
table.list { width: 100%; border-collapse: collapse; }
table.list td, table.list th { padding: 8px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; }
.footer { text-align: center; color: var(--text-light); font-size: 13px; padding: 30px 0 10px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer a { color: var(--text-light); margin: 0 8px; font-weight: 600; }
.footer .links { margin-bottom: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }

/* ------------------------------------------------------------ launch dialog */
.launch-dialog { text-align: center; padding: 30px 20px; }
.launch-dialog .spin-logo { width: 80px; height: 80px; margin: 0 auto 18px; animation: spin 1.6s linear infinite; }
.launch-dialog h3 { font-size: 22px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .rbx-leftnav { transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 12px rgba(0, 0, 0, .2); }
  body.nav-open .rbx-leftnav { transform: none; }
  .rbx-content { margin-left: 0; padding: 20px 16px 60px; }
  .rbx-header .menu-btn { display: block; }
}
@media (max-width: 720px) {
  .rbx-header nav.main { display: none; }
  .rbx-header .search { margin: 0 8px; }
  .rbx-header .logo img.logo-full { display: none; }
  .rbx-header .logo .logo-small { display: block; }
  .rbx-header .right .hide-mobile { display: none; }
}

/* ------------------------------------------------------------ phones */
.tabbar { display: none; }
.mobile-only { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
.rbx-content > * { max-width: 100%; }
@media (max-width: 1000px) {
  .mobile-only { display: flex !important; }
  .rbx-leftnav { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
}
@media (max-width: 720px) {
  body.has-tabbar { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; background: #fff; border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -1px 6px rgba(0, 0, 0, .08);
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px;
    color: var(--text-light); font-size: 11px; font-weight: 600; background: none; border: 0; text-decoration: none !important; font-family: inherit;
  }
  .tabbar a > span, .tabbar button > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .tabbar a, .tabbar button { min-width: 0; }
  .tabbar a.active { color: var(--blue); }
  .tabbar svg { width: 24px; height: 24px; }
  .rbx-header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); padding-left: 8px; padding-right: 8px; }
  .rbx-header .right a, .rbx-header .right button.icon-btn { padding: 4px 6px; }
  .rbx-content { padding: 16px 12px 40px; margin-top: calc(var(--header-h) + env(safe-area-inset-top)); }
  .rbx-leftnav { top: calc(var(--header-h) + env(safe-area-inset-top)); }
  h1 { font-size: 26px; }
  .section-header h2 { font-size: 19px; }
  .panel { padding: 12px; }
  .game-row .game-card { flex-basis: 136px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .game-card .name { font-size: 14px; }
  .avatar-card { width: 84px; }
  .avatar-card .headshot { width: 76px; height: 76px; }
  .friends-row { padding: 12px; }
  .greet { gap: 14px !important; }
  .greet .greet-head { width: 84px !important; height: 84px !important; }
  .greet h1 { font-size: 24px; }
  .tabs button { padding: 10px 12px; flex: 0 0 auto; }
  .btn-large { font-size: 17px; padding: 10px 18px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: 100% !important; border-radius: 12px 12px 0 0; padding-bottom: env(safe-area-inset-bottom); max-height: 90vh; overflow-y: auto; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .footer { margin-top: 24px; }
  input.input, select.input, textarea.input { font-size: 16px; } /* no zoom-on-focus on iOS */
}
@media (hover: none) {
  .game-card:hover, .item-card:hover { transform: none; }
}

/* ------------------------------------------------------------ dark theme (2019 style) */
html[data-theme="dark"] {
  --gray-bg: #232527;
  --panel: #393b3d;
  --text: #ffffff;
  --text-light: #b8b8b8;
  --border: #4d4f51;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--gray-bg); color: var(--text); }
html[data-theme="dark"] .dropdown,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .rbx-leftnav,
html[data-theme="dark"] .game-card,
html[data-theme="dark"] .item-card,
html[data-theme="dark"] .avatar-card { background: var(--panel); color: var(--text); }
html[data-theme="dark"] .dropdown a, html[data-theme="dark"] .dropdown button { color: var(--text); }
html[data-theme="dark"] .dropdown a:hover, html[data-theme="dark"] .dropdown button:hover { background: #4d4f51; }
html[data-theme="dark"] .btn { background: #4d4f51; color: #fff; border-color: #656668; }
html[data-theme="dark"] .btn:hover { background: #5a5c5e; }
html[data-theme="dark"] .btn-primary { background: var(--blue); border-color: var(--blue); }
html[data-theme="dark"] .btn-green { background: var(--green); border-color: var(--green); }
html[data-theme="dark"] .btn-red { background: var(--red); border-color: var(--red); }
html[data-theme="dark"] .input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #232527; color: #fff; border-color: #656668; }
html[data-theme="dark"] .item-card .thumb { background: linear-gradient(#4d4f51, #393b3d); }
html[data-theme="dark"] .rbx-leftnav a { color: var(--text); }
html[data-theme="dark"] .rbx-leftnav a:hover, html[data-theme="dark"] .rbx-leftnav a.active { background: #4d4f51; }
html[data-theme="dark"] .tabbar { background: #393b3d; border-color: var(--border); }
html[data-theme="dark"] .tabbar a { color: #d0d0d0; }
html[data-theme="dark"] .modal-head, html[data-theme="dark"] .modal-foot { border-color: var(--border); }
html[data-theme="dark"] .modal-head button { color: #fff; }
html[data-theme="dark"] .pill { background: #4d4f51; color: #fff; }
html[data-theme="dark"] .muted { color: var(--text-light); }
html[data-theme="dark"] .rbx-footer, html[data-theme="dark"] footer { color: var(--text-light); border-color: var(--border); }
html[data-theme="dark"] table.list th, html[data-theme="dark"] table.list td { border-color: var(--border); }
.stipend-banner { background: #fffbe6; border: 1px solid #f6d365; }
html[data-theme="dark"] .stipend-banner { background: #3d3a28; border-color: #6b5d1c; }
html[data-theme="dark"] .toast { background: #4d4f51; }
html[data-theme="dark"] a { color: #33b5ff; }
html[data-theme="dark"] .rbx-header a, html[data-theme="dark"] .btn, html[data-theme="dark"] .pill[style] { color: #fff; }
html[data-theme="dark"] .game-card .title, html[data-theme="dark"] .item-card .name, html[data-theme="dark"] .avatar-card .name { color: #fff; }

.item-card .beta-tag { background: #6b327c; }

/* ------------------------------------------------------------ Chat & Party (2016-2019) */
.chat-party { position: fixed; right: 16px; bottom: 0; z-index: 90; width: 260px; }
.cp-bar { width: 100%; display: flex; justify-content: space-between; align-items: center; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-bottom: 0; border-radius: 4px 4px 0 0; padding: 8px 12px; font-weight: 700; font-family: inherit; font-size: 15px; cursor: pointer; box-shadow: 0 -1px 6px rgba(0,0,0,.12); }
.cp-count { background: var(--green); color: #fff; border-radius: 10px; padding: 0 8px; font-size: 13px; }
.cp-panel { background: var(--panel); border: 1px solid var(--border); border-bottom: 0; max-height: 360px; overflow-y: auto; box-shadow: 0 -2px 10px rgba(0,0,0,.15); }
.cp-head { padding: 8px 12px; font-weight: 700; border-bottom: 1px solid var(--border); }
.cp-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.cp-head-img { position: relative; width: 36px; height: 36px; border-radius: 50%; background: #d4d4d4; flex: none; }
.cp-head-img img { width: 100%; height: 100%; border-radius: 50%; }
.cp-head-img .presence-dot { width: 11px; height: 11px; right: -1px; bottom: -1px; }
.cp-info { flex: 1; min-width: 0; font-size: 14px; }
.cp-info a { color: var(--text); font-weight: 600; }
.cp-empty { padding: 14px; text-align: center; }

/* ------------------------------------------------------------ name badges */
.name-badges { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; margin-left: 4px; }
.name-badge { display: inline-flex; width: 16px; height: 16px; }
.name-badge svg, .name-badge img { width: 100%; height: 100%; }
.name-badge.staff img { transform: rotate(-12deg); }
.name-badges.big { margin-left: 8px; }
.name-badges.big .name-badge { width: 26px; height: 26px; }
.user-link { display: inline-flex; align-items: center; }
.avatar-card .name { display: flex; justify-content: center; align-items: center; }
.game-card .by { display: flex; align-items: center; }

/* ---------------------------------------------------------------- trades */
.trade-list { display: flex; flex-direction: column; }
.trade-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--border, #e3e3e3); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.trade-row:hover { background: rgba(0,162,255,.06); }
.trade-row:last-child { border-bottom: 0; }
.trade-head img { width: 48px; height: 48px; border-radius: 50%; background: #d4d4d4; display: block; }
.trade-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.trade-status { background: #b8b8b8; color: #fff; }
.trade-status.pending { background: #00a2ff; }
.trade-status.accepted { background: #02b757; }
.trade-status.failed, .trade-status.declined { background: #d86868; }
.trade-with { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.trade-with.big { font-size: 26px; font-weight: 700; }
.trade-with.big h1 { margin: 0; }
.trade-with.big a { font-size: 26px; }
.trade-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.trade-side h4 { margin: 0 0 8px; }
.trade-slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.trade-slots .owned-tag, .trade-slots .limited-tag { display: none; }
.trade-slots .item-card .price { font-size: 12px; }
.trade-slots .item-card .info { padding: 4px 6px; }
.trade-slots .item-card .name { font-size: 12px; }
.trade-slot { border: 2px dashed var(--border, #d4d4d4); border-radius: var(--radius); aspect-ratio: 3 / 4; opacity: .7; }
.trade-robits { font-weight: 700; margin-bottom: 4px; }
.trade-window { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.trade-inventories { display: flex; flex-direction: column; gap: 16px; }
.trade-inventories .panel, .trade-offer { margin: 0; }
.trade-pick { max-height: 420px; overflow-y: auto; padding: 2px; }
.trade-offer { position: sticky; top: 60px; }
.trade-offer .btn-green { width: 100%; }
.item-card.dim { opacity: .45; }
@media (max-width: 900px) {
  .trade-window { grid-template-columns: 1fr; }
  .trade-offer { position: static; order: -1; }
  .trade-sides { grid-template-columns: 1fr; }
}
.take-grid { max-height: 55vh; overflow-y: auto; padding: 2px; }
.limited-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.limited-chip { background: #02b757; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 2px; }
/* serial numbers of Limited copies */
.item-card .serial-tag { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.72); color: #ffd23f; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 2px; z-index: 1; }
.serial-pill { background: #393b3d; color: #ffd23f; font-weight: 700; }
.owners-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; }
.owner-row { display: flex; align-items: center; gap: 8px; }
/* admin announcement */
.announcement-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; color: #fff; font-weight: 600; box-shadow: var(--shadow); }
.announcement-bar.blue { background: #00a2ff; } .announcement-bar.green { background: #02b757; }
.announcement-bar.orange { background: #f68802; } .announcement-bar.red { background: #d0021b; }
.announcement-text { flex: 1; overflow-wrap: anywhere; }
.announcement-close { background: none; border: 0; color: inherit; font-size: 22px; line-height: 1; cursor: pointer; opacity: .85; }
.item-card .card-tags { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 1; }
.item-card .card-tags .limited-tag { position: static; }
