:root {
  --bg: #efefef;
  --card: #ffffff;
  --ink: #171717;
  --muted: #737373;
  --line: #e4e4e4;
  --soft: #e8e8e8;
  --accent: #6366f1;
  --accent-ink: #ffffff;
  --on-ink: #ffffff;
  --side: #f5f5f5;
  --mythical: #7c4dff;
  --legendary: #f5c043;
  --ultra-rare: #c38bff;
  --rare: #5aa9f0;
  --uncommon: #6ccf8e;
  --common: #c9bfb3;
  --item: #d0d0d0;
  --neon: #8dc53e;
  --mega: #a855f7;
  --fly: #039ad6;
  --ride: #fb0279;
  --radius: 16px;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  font-family: Montserrat, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
h1, h2, .brand-text strong, .composer-title, .empty h3, .auth h1 {
  font-family: "Baloo 2", Montserrat, sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { max-width: 1120px; margin: 0 auto; padding: 22px 20px 160px; }

/* top bar */
.topbar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "brand switch actions";
  align-items: center; gap: 16px; margin-bottom: 28px;
}
.brand { grid-area: brand; }
.brand { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; }
.brand-logo { display: block; height: 40px; width: auto; }
.logo-light { display: none; }
html:not([data-theme="dark"]) .logo-dark { display: none; }
html:not([data-theme="dark"]) .logo-light { display: block; }
.brand-text { display: grid; text-align: left; line-height: 1.1; }
.brand-text strong { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }

.brand { text-decoration: none; color: inherit; min-width: 0; }
.brand-text { min-width: 0; }
.top-actions { grid-area: actions; display: flex; align-items: center; gap: 10px; justify-self: end; }
.online {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border-radius: 999px; background: var(--card); color: var(--muted);
  font-size: 12px; font-weight: 800; box-shadow: inset 0 0 0 1px var(--line);
}
.online i {
  width: 8px; height: 8px; border-radius: 50%; background: #1f9d55;
  box-shadow: 0 0 0 4px rgba(31, 157, 85, 0.18);
}
.online b { color: var(--ink); font-size: 13px; }
.game-switch {
  grid-area: switch; justify-self: center; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.game-thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3);
  border-radius: 999px; background: #ff5c93; box-shadow: 0 6px 14px rgba(255, 92, 147, 0.38);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), background 0.42s ease, box-shadow 0.42s ease;
}
.game-switch[data-game="mm2"] .game-thumb {
  transform: translateX(100%); background: #d62d3a; box-shadow: 0 6px 14px rgba(214, 45, 58, 0.38);
}
.game-switch[data-game="bf"] .game-thumb {
  transform: translateX(200%); background: #1d4ed8; box-shadow: 0 6px 14px rgba(29, 78, 216, 0.38);
}
.game-switch button {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; min-width: 52px; height: 44px; padding: 0;
  display: grid; place-items: center;
}
.game-switch button img {
  width: 32px; height: 32px; border-radius: 10px; display: block; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.game-switch button:not(.on) img { filter: saturate(0.8) brightness(0.82); }
.game-switch button.on { background: none; color: #fff; box-shadow: none; }
.game-switch button.on img { filter: none; box-shadow: 0 0 0 2px #fff; }
.game-switch button:hover:not(.on) { color: var(--ink); }
.game-switch button:active { transform: scale(0.96); }
.icon-btn {
  width: 40px; height: 40px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); font-weight: 900; font-size: 13px; display: grid; place-items: center; padding: 0;
}
.icon-btn svg { display: block; }
.action-pill {
  display: flex; align-items: center; gap: 0; padding: 3px;
  border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.action-pill .icon-btn,
.action-pill .btn.inbox-btn {
  width: 40px; height: 40px; background: transparent; border: 0; box-shadow: none; color: var(--ink);
}
.pill-bar {
  width: 1px; height: 16px; flex: 0 0 auto; border-radius: 1px;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}
.lang-btn .flag { width: 22px; height: 22px; display: block; }
.dock {
  position: fixed; left: 50%; z-index: 15; transform: translateX(-50%);
  bottom: calc(22px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: 999px; pointer-events: none;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
}
.dock a.dock-btn {
  pointer-events: auto; width: 72px; height: 72px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; line-height: 0;
  border: 0; box-shadow: none;
}
.dock a.dock-btn svg { width: 32px; height: 32px; display: block; margin: 0; flex: 0 0 auto; }
.dock .dock-btn.primary {
  width: 80px; height: 80px; background: #4f46e5; color: #fff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.4);
}
.dock .dock-btn.primary svg { width: 34px; height: 34px; }
.dock .dock-btn.calc,
.dock .dock-btn.items {
  background: color-mix(in srgb, var(--soft) 72%, var(--card));
  color: var(--ink);
}
.dock .dock-btn.items.on {
  background: var(--accent); color: #fff;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.32);
}
.dock-btn:hover { transform: translateY(-3px); }
.dock .dock-btn:active { transform: scale(0.96); }
.has-icon { display: inline-flex; align-items: center; gap: 7px; }
.has-icon svg { flex: 0 0 auto; }
.label-short { display: none; }
.boot { text-align: center; padding: 80px 20px; font-weight: 800; color: var(--muted); }
#toasts { position: fixed; right: 16px; bottom: calc(140px + env(safe-area-inset-bottom)); display: grid; gap: 8px; z-index: 30; width: min(320px, calc(100% - 32px)); }
.toast {
  background: var(--ink); color: var(--bg); border-radius: 16px; padding: 12px 14px;
  font-weight: 800; box-shadow: var(--shadow);
}
.me-chip {
  display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  text-decoration: none; color: inherit; font-weight: 800;
}
.me-chip span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip.wait {
  width: 42px; height: 42px; border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 8%, var(--card));
}
.role {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 0.03em; vertical-align: 1px;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.btn {
  display: inline-block; text-decoration: none; border: 0; border-radius: 10px; padding: 11px 20px;
  font-weight: 800; transition: transform 0.12s, box-shadow 0.12s;
}
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28); }
.btn.primary:hover { box-shadow: 0 10px 24px rgba(99, 102, 241, 0.38); }
.btn.ghost {
  background: var(--soft); color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 7%, var(--soft)); }
.btn.done { background: #2e9e5b; color: #fff; box-shadow: 0 6px 14px rgba(46, 158, 91, 0.28); }
.btn.done:hover { box-shadow: 0 8px 18px rgba(46, 158, 91, 0.38); }
.btn.report { background: #e23b32; color: #fff; box-shadow: 0 6px 14px rgba(226, 59, 50, 0.28); }
.btn.report:hover { background: #c92f27; box-shadow: 0 8px 18px rgba(226, 59, 50, 0.36); }
.btn.danger { background: #fff; color: #d9534f; box-shadow: var(--shadow); }
.btn.danger:hover { background: #fdeeee; color: #c0392b; }
.btn.big { padding: 15px 34px; font-size: 17px; }

/* hero + search */
.hero { text-align: center; margin: 8px 0 18px; }
.hero h1 {
  margin: 0 0 10px; font-size: clamp(30px, 6vw, 52px); line-height: 1.04; font-weight: 800; letter-spacing: -0.03em;
  color: var(--ink);
}
.hero p { margin: 0; color: var(--muted); font-size: 17px; font-weight: 600; }

.banner-rotator { position: relative; margin: 0 0 18px; }
.banner-viewport {
  overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
}
.banner-track { display: grid; }
.banner-slide {
  grid-area: 1 / 1; min-width: 0; display: flex;
  opacity: 0; pointer-events: none; z-index: 0;
}
.banner-slide.on { opacity: 1; pointer-events: auto; z-index: 1; }
.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 0;
  width: 100%; min-height: 176px; box-sizing: border-box;
  background: var(--card); border: 0; border-radius: 0;
  padding: 22px 28px 40px; color: inherit; text-decoration: none;
}
.banner h2 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.banner p { margin: 6px 0 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.banner-copy { min-width: 0; }
.banner-items { display: flex; gap: 14px; flex: 0 0 auto; }
.banner-item {
  width: 92px; display: grid; justify-items: center; gap: 6px;
  text-decoration: none; color: inherit;
}
.banner-item .icon { width: 64px; height: 64px; border-radius: 16px; background: var(--soft); }
.banner-item span {
  max-width: 92px; font-size: 12px; font-weight: 800; line-height: 1.15; text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.banner.tg {
  background:
    radial-gradient(420px 180px at 92% 50%, rgba(255, 255, 255, 0.16), transparent 62%),
    linear-gradient(115deg, #0f6f9e, #1c93cc 52%, #34b3ef);
  color: #fff; justify-content: flex-start; gap: 22px;
}
.banner.tg p { color: rgba(255, 255, 255, 0.88); }
.banner-art {
  width: 96px; height: 96px; flex: 0 0 auto;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.22));
}
.banner-art svg { width: 100%; height: 100%; display: block; }
.banner-dots {
  position: absolute; left: 50%; bottom: 12px; z-index: 2; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(8px);
}
.banner-dot {
  width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  transition: width 0.35s ease, background 0.35s ease;
}
.banner-dot.on { width: 18px; background: #fff; }

.search-input, .field input, .sheet-search {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px;
  padding: 14px 18px; outline: none; box-shadow: none; font-weight: 600;
}
.search-input:focus, .field input:focus, .sheet-search:focus { border-color: var(--accent); }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.filters .search-input { flex: 1 1 160px; min-width: 0; }
.segmented { display: flex; background: var(--card); border-radius: 16px; padding: 4px; box-shadow: var(--shadow); }
.segmented button {
  border: 0; background: none; border-radius: 12px; padding: 9px 14px; font-weight: 800; color: var(--muted);
}
.segmented button.on { background: var(--accent); color: #fff; }
.sort {
  display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 16px;
  padding: 4px 6px 4px 14px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.sort span { font-size: 13px; font-weight: 700; color: var(--muted); }
.filters .sort select { max-width: 180px; }
.sort select {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 12px; padding: 9px 30px 9px 12px;
  font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; outline: none; min-width: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
}
.sort select option, .sort select optgroup { background: var(--card); color: var(--ink); }
.count { margin: 4px 4px 14px; color: var(--muted); font-weight: 700; font-size: 13px; }

.filter-toggle {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  border-radius: 16px; padding: 12px 16px; font-weight: 800;
}
.filter-toggle.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-toggle b {
  min-width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 12px; padding: 0 6px;
}

.filter-panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-bottom: 12px;
}
.filter-group { display: grid; gap: 8px; min-width: 0; }
.filter-group.wide, .filter-foot { grid-column: 1 / -1; }
.filter-group h4 { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink); }
.filter-group h4 em { font-style: normal; font-weight: 600; color: var(--muted); }
.filter-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.filter-foot .link-btn[disabled] { opacity: 0.4; pointer-events: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 800; color: var(--muted);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.age-neon.on { background: var(--neon); border-color: var(--neon); }
.chip.age-mega.on { background: var(--mega); border-color: var(--mega); }
.chip.potion-fly.on { background: var(--fly); border-color: var(--fly); }
.chip.potion-ride.on { background: var(--ride); border-color: var(--ride); }
.chip.potion-fr.on { background: linear-gradient(90deg, var(--fly), var(--ride)); border-color: transparent; }
.chip span { opacity: 0.7; font-size: 15px; line-height: 1; }
.chip.rarity-chip { box-shadow: inset 0 -3px 0 var(--edge, var(--line)); }
.chip.rarity-chip.on { box-shadow: inset 0 -3px 0 var(--edge, var(--line)); }
.add-chip { border-style: dashed; color: var(--accent); }
.item-chip { padding: 3px 10px 3px 4px; }
.item-chip .icon { width: 24px; height: 24px; }

.active-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }

.picker-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sort.compact { box-shadow: none; padding: 2px 4px 2px 12px; }
.sort.compact select { padding: 6px 10px; }

/* profile */
.profile {
  display: flex; align-items: center; gap: 22px; background: var(--card); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.profile-text { flex: 1; min-width: 0; }
.profile-text h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.profile-text p { margin: 4px 0 14px; color: var(--muted); font-weight: 600; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat { text-align: center; background: var(--soft); border-radius: 20px; padding: 14px 20px; }
.stat strong { display: block; font-size: 30px; font-weight: 900; line-height: 1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 700; }

/* auth */
.auth {
  max-width: 520px; margin: 0 auto; background: var(--card); border-radius: 28px; padding: 32px;
  box-shadow: var(--shadow); display: grid; gap: 16px; text-align: center;
}
.auth h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.auth .lead { margin: 0; color: var(--muted); font-weight: 600; }
.auth-form { display: grid; gap: 14px; text-align: left; }
.auth-form .btn { justify-self: center; }
.auth .btn.big { justify-self: center; }
.auth-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; text-align: left; }
.auth-steps li {
  counter-increment: step; display: grid; gap: 10px; background: var(--soft); border-radius: 18px;
  padding: 14px 16px 14px 52px; position: relative; font-weight: 700;
}
.auth-steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 13px;
}
.auth-steps .btn { justify-self: start; }
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card);
  border-radius: 14px; padding: 8px 8px 8px 14px;
}
.code-box code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; font-weight: 700; word-break: break-word; }

/* feed */
.board { display: grid; gap: 14px; grid-template-columns: 1fr; align-items: start; }
.board > .empty { grid-column: 1 / -1; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--line); min-width: 0;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head .who { min-width: 0; }
.card-head .who-text { min-width: 0; }
.card-head .who-text strong, .card-head .who-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; border-radius: 14px; padding: 2px 8px 2px 2px; margin: -2px; }
.who:hover { background: var(--soft); }
.who-text { display: grid; line-height: 1.2; }
.who strong { font-weight: 800; }
.who small, .muted { color: var(--muted); font-weight: 600; font-size: 13px; }
.avatar {
  position: relative; overflow: hidden; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  flex: 0 0 auto; background: var(--soft); font-weight: 900; font-size: 15px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--soft); }
.avatar b { font-weight: 900; visibility: hidden; }
.avatar.broken b { visibility: visible; }
.avatar.sm { width: 30px; height: 30px; border-radius: 50%; font-size: 12px; }
.avatar.wfl-ava { width: 22px; height: 22px; border-radius: 50%; font-size: 9px; }
.avatar.xl { width: 104px; height: 104px; border-radius: 28px; font-size: 36px; background: linear-gradient(160deg, #f4f4f4, #d8d8d8); }
.avatar.xl img { background: linear-gradient(160deg, #f4f4f4, #d8d8d8); }
.avatar-full {
  position: relative; width: 168px; height: 168px; flex: 0 0 auto; border-radius: 28px; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #f7f7f7 0%, #e4e4e4 70%, #d4d4d4 100%);
  display: grid; place-items: center;
}
.avatar-full > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; }
.avatar-full > .avatar { visibility: hidden; }
.avatar-full.broken > .avatar { visibility: visible; }
.link-btn { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px; border-radius: 8px; text-decoration: none; }
.link-btn:hover { color: var(--ink); background: var(--soft); }

.actions-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions-row .act {
  width: 34px; height: 34px; padding: 0; border-radius: 12px;
  display: grid; place-items: center;
}
.actions-row .act svg { width: 18px; height: 18px; display: block; }
.badge.act { width: 34px; padding: 0; border-radius: 12px; }
.badge { font-size: 12px; font-weight: 800; border-radius: 999px; padding: 4px 10px; }
.badge.mine { background: #eef0ff; color: var(--accent); }
.badge.done { background: #e8f7ee; color: #2e9e5b; }
.card.mine { box-shadow: 0 0 0 2px #c7cbff, var(--shadow); }
.card.done .trade { opacity: 0.55; }

.action-pill .inbox-btn {
  position: relative; width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
}
.action-pill .inbox-btn svg { width: 20px; height: 20px; display: block; }
.action-pill .inbox-btn b {
  position: absolute; top: -6px; right: -6px; z-index: 1;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 6px;
  background: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--card);
  display: grid; place-items: center; font-size: 11px; line-height: 1;
}
.unread-badge {
  min-width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 12px; padding: 0 6px;
}

.stats { display: flex; gap: 8px; }

/* messages */
.page-head h1 { margin: 0 0 18px; font-size: 32px; font-weight: 900; letter-spacing: -0.02em; }
.inbox { display: grid; gap: 8px; }
.convo {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 20px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
}
.convo:hover { transform: translateY(-1px); }
.convo-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.convo-top { display: flex; justify-content: space-between; gap: 8px; }
.convo-top small { color: var(--muted); font-weight: 600; font-size: 12px; }
.convo-preview { color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo.unread strong { font-weight: 900; }
.convo.unread .convo-top small { color: var(--accent); font-weight: 800; }
.convo.unread .convo-preview { color: var(--ink); font-weight: 800; }

.chat {
  display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  height: min(78vh, 760px); overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head .who { min-width: 0; flex: 1; }
.chat-head .who-text { min-width: 0; }
.chat-head .who-text strong,
.chat-head .who-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.chat-actions .btn {
  margin-left: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px;
}
.btn.roblox {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; background: #191b1d; color: #fff; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}
.btn.roblox svg { width: 14px; height: 14px; display: block; flex: 0 0 auto; }
.btn.roblox:hover { background: #000; }
.chat-actions .btn.block {
  background: #e23b32; color: #fff; box-shadow: 0 6px 14px rgba(226, 59, 50, 0.28);
}
.chat-actions .btn.block:hover { background: #c92f27; }
.back { font-size: 20px; padding: 4px 10px; }
.messages {
  flex: 1; min-width: 0; overflow-y: auto; scrollbar-gutter: stable;
  padding: 18px 16px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; background: var(--bg);
}
.msg { display: flex; justify-content: flex-start; max-width: 100%; min-width: 0; }
.msg.mine { justify-content: flex-end; }
.bubble {
  width: fit-content; max-width: min(100%, 420px); min-width: 0;
  background: var(--card); border-radius: 18px 18px 18px 6px; padding: 10px 14px;
  box-shadow: 0 1px 2px rgba(43, 33, 24, 0.06); display: grid; gap: 6px;
}
.bubble:has(.trade-mini) { width: min(100%, 420px); }
.msg.mine .bubble { background: #e7e9ff; border-radius: 18px 18px 6px 18px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 600; }
.bubble time {
  display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px;
  font-size: 11px; color: var(--muted); font-weight: 700; justify-self: end;
}
.bubble time .when { vertical-align: 0; }
.ticks { display: inline-flex; color: #8d8d98; }
.ticks svg { width: 16px; height: 11px; display: block; }
.ticks.read { color: #4da3ff; }
.ticks.read svg { width: 22px; }
.unread-line {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 2px;
  color: #3d8bfd; font-size: 12px; font-weight: 800;
}
.unread-line::before, .unread-line::after {
  content: ""; flex: 1; height: 1px; background: color-mix(in srgb, #3d8bfd 50%, transparent);
}
.center { text-align: center; margin: auto; }
.chat-lock {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 12px 12px; padding: 12px 14px; border-radius: 16px;
  background: color-mix(in srgb, #e23b32 12%, var(--card));
  border: 1px solid color-mix(in srgb, #e23b32 34%, var(--line));
}
.chat-lock.them { background: var(--soft); border-color: var(--line); }
.chat-lock-ico {
  width: 42px; height: 42px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; background: #e23b32; color: #fff;
}
.chat-lock.them .chat-lock-ico { background: #3f3f46; }
.chat-lock-ico svg { width: 22px; height: 22px; display: block; }
.chat-lock-copy { min-width: 0; flex: 1; }
.chat-lock-copy strong { display: block; font-size: 14px; font-weight: 800; }
.chat-lock-copy p { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.35; }
.chat-lock .btn { flex: 0 0 auto; }
.chat-lock.request {
  background: color-mix(in srgb, #3d8bfd 14%, var(--card));
  border-color: color-mix(in srgb, #3d8bfd 42%, var(--line));
}
.chat-lock.request .chat-lock-ico { background: #3d8bfd; }
.chat-lock.request.declined {
  background: var(--soft);
  border-color: var(--line);
}
.chat-lock.request.declined .chat-lock-ico { background: #3f3f46; }
.chat-lock-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.convo-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px;
  background: #3d8bfd; color: #fff; font-style: normal; font-size: 10px; font-weight: 800;
  letter-spacing: 0.02em; vertical-align: 1px;
}

.trade-mini { display: grid; gap: 6px; min-width: 0; max-width: 100%; background: var(--soft); border-radius: 14px; padding: 8px 10px; text-align: left; }
.msg.mine .trade-mini { background: var(--side); }
.trade-mini > small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.trade-mini .note { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.trade-mini-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 8px; min-width: 0; max-width: 100%;
}
.tiles { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; max-width: 100%; }
.tiles.mini { gap: 4px; }
.tiles.mini .tile { width: 44px; height: 44px; border-radius: 10px; }
.tiles.mini .icon.lg { width: 34px; height: 34px; }
.tiles.mini .qty { top: 2px; right: 2px; font-size: 9px; padding: 1px 4px; }
.tiles.mini .tags { top: 2px; left: 2px; gap: 1px; }
.tiles.mini .tag { width: 12px; height: 12px; font-size: 8px; border-radius: 4px; }
.swap.mini { width: 26px; height: 26px; font-size: 14px; box-shadow: none; }

.attach-list {
  max-height: 260px; overflow-y: auto; display: grid; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line);
}
.attach-option { border: 2px solid transparent; background: none; padding: 0; border-radius: 16px; min-width: 0; width: 100%; text-align: left; }
.attach-option:hover { border-color: var(--accent); }
.attached { display: flex; align-items: flex-start; gap: 6px; padding: 10px 16px 0; border-top: 1px solid var(--line); min-width: 0; }
.attached .trade-mini { flex: 1; min-width: 0; }
.chat .error { margin: 8px 16px 0; }
.chat-tools { display: flex; gap: 4px; align-items: center; }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-form .attach-btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 12px; font-size: 18px; }
.chat-form .attach-btn svg { width: 18px; height: 18px; }
.emoji-pop {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  padding: 8px 12px; border-top: 1px solid var(--line);
  animation: rise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.emoji-pop button {
  border: 0; background: transparent; font-size: 22px; line-height: 1; padding: 6px 0;
  border-radius: 10px; cursor: pointer;
}
.emoji-pop button:hover { background: var(--soft); }
.blocked-link {
  display: inline-block; padding: 0 6px; border-radius: 6px;
  background: rgba(226, 59, 50, 0.14); color: #e23b32; font-size: 12px; font-weight: 800;
}
.chat-form textarea {
  flex: 1; resize: none; border: 1px solid var(--line); border-radius: 16px; padding: 11px 14px; font: inherit;
  font-weight: 600; outline: none; max-height: 140px; field-sizing: content; min-height: 44px;
  background: var(--bg); color: var(--ink);
}
.chat-form textarea:focus { border-color: var(--accent); }
.attach-btn { white-space: nowrap; align-self: center; }
.attach-btn.on { background: var(--accent); color: #fff; }

/* composer limits */
.column h2 { display: flex; justify-content: space-between; align-items: center; }
.limit { font-size: 13px; font-weight: 800; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 3px 10px; }
.limit.full { background: #eef0ff; color: var(--accent); }
.limit-hint { text-align: center; margin: 6px 0 0; font-size: 13px; }
.stepper button:disabled { opacity: 0.3; cursor: default; }

.trade { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.trade h3 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
}
.trade h3 span {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  background: var(--card); color: var(--ink); font-size: 11px; letter-spacing: 0;
}
.side-mark { display: grid; place-items: center; color: var(--accent); font-style: normal; }
.side-mark svg { width: 20px; height: 20px; display: block; }
.side-mark.seek { color: #d4533c; }
.when { display: inline-flex; align-items: center; gap: 4px; vertical-align: -2px; }
.when svg { width: 13px; height: 13px; flex: 0 0 auto; display: block; }
.trade > section {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--card) 55%, transparent), transparent 42%),
    var(--side);
  border-radius: 18px; padding: 12px; min-width: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 5%, transparent);
}
.trade-mid { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.swap {
  align-self: center; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); font-size: 18px; color: var(--accent); font-weight: 900;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.note {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--side);
  color: var(--muted); font-weight: 600; font-size: 14px; word-break: break-word;
}
.analyze-wrap { margin-top: 12px; }
.analyze {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--muted);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.analyze svg { display: block; width: 16px; height: 16px; }
.analyze.on { background: var(--accent); color: var(--accent-ink); }
.wfls { display: grid; gap: 8px; margin-top: 10px; }
.wfl {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center;
}
.wfl-logo { width: 28px; height: 28px; object-fit: contain; }
.wfl-meter { display: grid; gap: 3px; min-width: 0; }
.wfl-letters {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 8px; font-size: 11px; font-weight: 900; letter-spacing: 0.04em;
}
.wfl-who { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 22px; }
.wfl-who.you { justify-content: flex-start; }
.wfl-who.them { justify-content: flex-end; }
.wfl-letters i { font-style: normal; line-height: 1; }
.wfl-who.you i { color: #1f9d55; }
.wfl-fair { color: var(--muted); }
.wfl-who.them i { color: #d4533c; }
.wfl-track { position: relative; height: 28px; }
.wfl-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px;
  border-radius: 999px; background: linear-gradient(90deg, #3cba6a, #e2b340 50%, #e15b4a);
}
.wfl-track b {
  position: absolute; top: 50%; width: 4px; height: 16px; margin: -8px 0 0 -2px;
  border-radius: 999px; background: var(--ink);
  box-shadow: 0 0 0 2px var(--card);
}
.wfl-face {
  position: absolute; top: 50%; z-index: 2; transform: translate(-50%, -50%);
  animation: wfl-slide 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.wfl-face .avatar { box-shadow: 0 0 0 2px var(--card); }
@keyframes wfl-slide { from { left: 50%; } }
.wfl strong { font-size: 13px; font-weight: 900; min-width: 46px; text-align: right; padding-bottom: 0; }
.wfl.win strong { color: #1f9d55; }
.wfl.fair strong { color: #a07916; }
.wfl.lose strong { color: #d4533c; }
.wfl.partial { opacity: 0.72; }
html[data-theme="dark"] .wfl.fair strong { color: #e2b340; }
.trade-mini .note { padding: 0; background: none; }

.tile { flex: 0 0 auto; }
a.tile { text-decoration: none; color: inherit; }
a.tile:hover { box-shadow: inset 0 0 0 1px var(--accent), 0 1px 2px rgba(43, 33, 24, 0.04); }
.tile {
  position: relative; display: grid; place-items: center; width: 76px; height: 76px;
  background: var(--card); border-radius: 16px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent), 0 1px 2px rgba(43, 33, 24, 0.04);
}
.pick {
  --edge: var(--line);
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 8px 14px;
  background: var(--card); border-radius: 16px; border: 0;
}
.pick::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  border-radius: 0 0 16px 16px; background: var(--edge); pointer-events: none;
}
.edge-offer { --edge: #d97706; }
.edge-add { --edge: #22c55e; }
.edge-demand { --edge: #e85d4c; }
.edge-chromatic { --edge: #c026d3; }
.edge-voucher { --edge: #0d9488; }
.edge-mythical { --edge: var(--mythical); }
.edge-legendary { --edge: var(--legendary); }
.edge-ultra-rare { --edge: var(--ultra-rare); }
.edge-rare { --edge: var(--rare); }
.edge-uncommon { --edge: var(--uncommon); }
.edge-common { --edge: var(--common); }
.edge-item { --edge: var(--item); }
.edge-chroma { --edge: linear-gradient(90deg, #ff4d6d, #ffd60a 42%, #3ddc84 68%, #4da3ff); }
.edge-ancient { --edge: #8d6a3f; }
.edge-godly { --edge: #e23d4a; }
.edge-vintage { --edge: #d4893a; }
.edge-unique { --edge: #c4a574; }
.tile-name { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.15; }
.qty {
  position: absolute; top: 6px; right: 6px; background: var(--ink); color: var(--on-ink); font-size: 11px;
  border-radius: 999px; padding: 2px 6px;
}
.qty, .tags { z-index: 2; }
.tags { position: absolute; top: 6px; left: 6px; display: flex; gap: 3px; }
.tag {
  font-style: normal; font-size: 10px; font-weight: 900; color: #fff; width: 18px; height: 18px;
  border-radius: 6px; display: grid; place-items: center;
}
.tag.neon { background: var(--neon); }
.tag.mega { background: var(--mega); }
.tag.fly { background: var(--fly); }
.tag.ride { background: var(--ride); }

/* icons */
.icon { position: relative; width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; }
.icon.lg { width: 60px; height: 60px; }
.icon img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1;
  filter: drop-shadow(0 3px 4px rgba(43, 33, 24, 0.16));
}
.icon img + .icon-fallback { visibility: hidden; }
.icon.broken .icon-fallback { visibility: visible; }
.icon-fallback {
  width: 100%; height: 100%; border-radius: 30%; display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #fff;
}
.r-offer { background: #d97706; }
.r-add { background: #22c55e; }
.r-demand { background: #e85d4c; }
.r-chromatic { background: #c026d3; }
.r-voucher { background: #0d9488; }
.r-mythical { background: var(--mythical); }
.r-legendary { background: var(--legendary); }
.r-ultra-rare { background: var(--ultra-rare); }
.r-rare { background: var(--rare); }
.r-uncommon { background: var(--uncommon); }
.r-common { background: var(--common); }
.r-item { background: var(--item); }
.r-chroma { background: linear-gradient(135deg, #ff4d6d, #ffd60a 42%, #3ddc84 68%, #4da3ff); }
.r-ancient { background: #8d6a3f; }
.r-godly { background: #e23d4a; }
.r-vintage { background: #d4893a; }
.r-unique { background: #2b2118; }

/* empty */
.empty { text-align: center; padding: 56px 20px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.empty h3 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.empty p { margin: 0 0 18px; color: var(--muted); font-weight: 600; }

/* composer */
.composer { display: grid; gap: 18px; }
.composer-title { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.composer-trade { align-items: start; }
.composer-trade .trade-mid { margin-top: 60px; }
.column { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-height: 240px; }
.column h2 { margin: 0 0 12px; font-size: 20px; font-weight: 900; }
.rows { display: grid; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; background: var(--soft); border-radius: 16px; padding: 10px 12px; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.row-top strong, .row-top .row-name { font-weight: 800; font-size: 15px; }
a.row-name { color: inherit; text-decoration: none; }
a.row-name:hover { color: var(--accent); }
.row-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.toggles { display: flex; gap: 4px; flex-wrap: wrap; }
.toggles button {
  border: 0; background: var(--card); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 800; color: var(--muted);
}
.toggles button.on { color: #fff; }
.toggles button.neon { background: var(--neon); }
.toggles button.mega { background: var(--mega); }
.toggles button.fly { background: var(--fly); }
.toggles button.ride { background: var(--ride); }
.toggles button.normal { background: var(--accent); }
.toggles button.normal.on { color: #fff; }
.age-switch { display: inline-flex; background: var(--card); border-radius: 999px; padding: 2px; margin-right: 4px; }
.age-switch button { padding: 3px 9px; }
.stepper { display: flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 2px; }
.stepper button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; font-weight: 900; }
.stepper button:hover { background: var(--soft); }
.stepper span { min-width: 16px; text-align: center; font-weight: 800; font-size: 13px; }
.x { border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 4px; border-radius: 8px; }
.x:hover { color: var(--ink); }
.x.big { font-size: 28px; }

.add {
  border: 2px dashed var(--line); background: none; border-radius: 16px; padding: 14px;
  font-weight: 800; color: var(--muted); display: flex; justify-content: center; gap: 6px; transition: 0.12s;
}
.add span { color: var(--accent); font-size: 18px; line-height: 1; }
.add:hover { border-color: var(--accent); color: var(--ink); background: var(--soft); }

.field { display: grid; gap: 6px; text-align: left; }
.field > span { font-size: 13px; font-weight: 800; padding-left: 4px; }
.field em { font-style: normal; color: var(--muted); font-weight: 600; }
.error { background: #fdecec; color: #c4462a; border-radius: 14px; padding: 12px 16px; font-weight: 700; }
.actions { display: flex; justify-content: center; }

/* picker */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgba(43, 33, 24, 0.35); backdrop-filter: blur(4px);
}
.sheet {
  width: min(760px, 100%); max-height: min(86vh, 760px); overflow: auto; background: var(--bg);
  border-radius: 28px; padding: 20px; box-shadow: 0 30px 80px rgba(43, 33, 24, 0.25);
}
.report-sheet { width: min(420px, 100%); }
.report-sheet .hint { margin: 0 0 14px; }
.report-reasons { display: grid; gap: 8px; }
.report-reasons button {
  text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 14px; padding: 14px 16px; font-weight: 800;
}
.report-reasons button:hover { border-color: var(--accent); }
.report-reasons button:disabled { opacity: 0.6; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-size: 24px; font-weight: 900; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button {
  border: 0; background: var(--card); border-radius: 999px; padding: 8px 14px; white-space: nowrap; font-weight: 800; color: var(--muted);
}
.cats button.on { background: var(--accent); color: #fff; }
.picker-grid, .item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
a.pick { text-decoration: none; color: inherit; }
h1.composer-title + .filters { margin-top: 14px; }
.items-head { display: flex; align-items: center; gap: 4px; margin: 0 0 14px; }
.items-head .composer-title { margin: 0; }
.items-head .back { color: var(--ink); font-weight: 900; }
.item-cats { margin: 2px 0 12px; }
.items-more { display: flex; justify-content: center; margin: 16px 0 4px; }
.item-back { display: inline-flex; margin: 0 0 8px; color: var(--ink); font-weight: 900; }
.item-head {
  display: flex; align-items: center; gap: 18px; background: var(--card); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.item-art {
  --edge: var(--line);
  position: relative; width: 108px; height: 108px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 22px; background: var(--soft); box-shadow: inset 0 -4px 0 var(--edge);
}
.item-art .icon { width: 78px; height: 78px; }
.item-head h1 { margin: 0; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.item-head p { margin: 6px 0 0; color: var(--muted); font-weight: 700; }
.item-panel {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 18px;
}
.item-panel h2, .item-trades-title {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; font-size: 16px; font-weight: 900;
}
.item-panel h2 em, .item-trades-title em { font-style: normal; font-weight: 700; color: var(--muted); font-size: 13px; }
.item-variants { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.item-variants a {
  display: inline-flex; align-items: center; text-decoration: none; color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: 13px; background: var(--soft);
}
.item-variants .age-switch { background: var(--soft); }
.item-variants .age-switch a { padding: 5px 10px; background: transparent; }
.item-variants a.on { background: var(--accent); color: #fff; }
.item-variants a.on.neon { background: var(--neon); color: #fff; }
.item-variants a.on.mega { background: var(--mega); color: #fff; }
.item-variants a.on.fly { background: var(--fly); color: #fff; }
.item-variants a.on.ride { background: var(--ride); color: #fff; }
.item-variants a.on.fr { background: linear-gradient(90deg, var(--fly), var(--ride)); color: #fff; }
.value-list { display: grid; gap: 8px; }
.value-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  background: var(--soft); border-radius: 14px; padding: 8px 12px;
}
.value-row span { font-weight: 800; }
.value-row strong { font-weight: 900; font-size: 16px; }
.value-row strong.missing { color: var(--muted); font-weight: 700; font-size: 13px; }
.pick { box-shadow: var(--shadow); transition: transform 0.12s; }
.pick:hover { transform: translateY(-2px); }
.add.more { width: 100%; margin-top: 12px; }
.hint { color: var(--muted); font-weight: 600; }

.foot { margin-top: 40px; text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.foot a { color: inherit; }

@media (max-width: 860px) {
  .has-icon .label { display: none; }
  .has-icon { padding: 10px 12px; }
  .me-chip .me-name { display: none; }
  .me-chip { padding: 4px; }
  .me-chip .avatar { display: grid; }
}

@media (max-width: 720px) {
  .app { padding: 14px 12px 130px; }
  .composer-trade { grid-template-columns: 1fr; }
  .composer-trade .trade-mid { margin: 0 auto; }
  .composer-trade .swap { transform: rotate(90deg); }
  .topbar {
    margin-bottom: 18px; gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "switch switch";
  }
  .game-switch { width: 100%; justify-self: stretch; }
  .game-switch button { flex: 1; min-width: 0; }
  .brand-text strong { font-size: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions { flex-shrink: 0; }
  .online span { display: none; }
  .online { padding: 0 8px; }
  .top-actions > .lang-btn,
  .top-actions .me-chip,
  .action-pill { flex: 0 0 auto; }
  .top-actions { gap: 8px; padding: 0; background: none; border: 0; box-shadow: none; }
  .action-pill {
    gap: 0; padding: 3px; border-radius: 999px; background: var(--card);
    border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .action-pill .icon-btn,
  .action-pill .btn.inbox-btn {
    width: 38px; height: 38px; background: transparent; box-shadow: none; color: var(--ink);
  }
  .action-pill .inbox-btn svg,
  .action-pill .icon-btn svg { width: 20px; height: 20px; }
  .top-actions > .lang-btn,
  .top-actions .me-chip {
    width: 42px; height: 42px; padding: 0; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .top-actions .me-chip .avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; }
  .top-actions .me-chip .avatar img { object-fit: cover; object-position: center 18%; }
  .game-switch { border: 1px solid var(--line); }
  .top-actions .btn.primary { padding: 9px 14px; }
  .label { display: none; }
  .label-short { display: inline; }
  .hero { margin-bottom: 14px; }
  .banner { align-items: flex-start; flex-direction: column; min-height: 196px; padding: 16px 16px 40px; }
  .banner h2 { font-size: 22px; }
  .banner.tg { flex-direction: row; align-items: center; }
  .banner-art { width: 72px; height: 72px; }
  .hero p { font-size: 15px; }
  .filters {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: stretch;
  }
  .filters .search-input { grid-column: 1 / -1; }
  .filters .sort { min-width: 0; width: 100%; padding-left: 8px; }
  .filters .sort > span { display: none; }
  .filters .sort select { max-width: none; width: 100%; flex: 1; }
  .filters .filter-toggle { width: 100%; justify-content: center; min-height: 48px; }
  .filter-panel { grid-template-columns: 1fr; padding: 14px; }
  .segmented { flex: 1 1 100%; }
  .segmented button { flex: 1; }
  .card { padding: 12px; border-radius: 20px; }
  .trade { gap: 6px; }
  .trade > section { padding: 9px; border-radius: 14px; }
  .trade-mid { gap: 4px; }
  .swap { width: 28px; height: 28px; }
  .swap svg { width: 15px; height: 15px; }
  .analyze { width: 28px; height: 28px; }
  .analyze svg { width: 14px; height: 14px; }
  .tiles { gap: 6px; }
  .tile { width: 64px; height: 64px; padding: 0; border-radius: 14px; }
  .tile .tag { width: 15px; height: 15px; font-size: 9px; }
  .card-head { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
  .chat-head { flex-wrap: wrap; align-items: flex-start; row-gap: 8px; }
  .chat-actions { width: 100%; margin-left: 0; }
  .chat-lock { flex-wrap: wrap; }
  .chat-lock .btn { width: 100%; }
  .chat-lock-actions { width: 100%; }
  .chat-lock-actions .btn { width: auto; flex: 1; }
  .actions-row { margin-left: auto; }
  .profile {
    flex-direction: column; align-items: center; text-align: center;
    padding: 18px 14px; gap: 14px;
  }
  .item-head { gap: 14px; padding: 14px; }
  .item-art { width: 84px; height: 84px; border-radius: 18px; }
  .item-art .icon { width: 60px; height: 60px; }
  .item-head h1 { font-size: 24px; }
  .avatar-full { width: 128px; height: 128px; }
  .profile-text { width: 100%; }
  .profile-text h1 { font-size: 24px; overflow-wrap: anywhere; }
  .profile-actions { justify-content: center; }
  .stats { width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 12px 8px; }
  .auth { padding: 24px 18px; }
}

html[data-theme="dark"] {
  --bg: #141416;
  --card: #1c1c1f;
  --ink: #f4f4f5;
  --muted: #b4b4bc;
  --line: rgba(255, 255, 255, 0.1);
  --soft: #2a2a2e;
  --side: #232328;
  --on-ink: #141416;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(99, 102, 241, 0.18), transparent 62%),
    var(--bg);
}
html[data-theme="dark"] .dock {
  background: rgba(22, 22, 26, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .dock .dock-btn.calc,
html[data-theme="dark"] .dock .dock-btn.items {
  background: #2c2c32;
  color: #f4f4f5;
}
html[data-theme="dark"] .card.mine { box-shadow: 0 0 0 2px #4f46e5, var(--shadow); }
html[data-theme="dark"] .btn.danger { background: var(--card); }
html[data-theme="dark"] .btn.danger:hover { background: #3a2424; }
html[data-theme="dark"] .badge.mine,
html[data-theme="dark"] .limit.full { background: #2a2a4a; color: #c7cbff; }
html[data-theme="dark"] .badge.done { background: #1d3326; }
html[data-theme="dark"] .msg.mine .bubble { background: #2e2e4a; color: var(--ink); }
html[data-theme="dark"] .avatar-full {
  background: radial-gradient(circle at 50% 35%, #3a3a3a 0%, #242424 70%, #171717 100%);
}
html[data-theme="dark"] .avatar.xl,
html[data-theme="dark"] .avatar.xl img {
  background: linear-gradient(160deg, #3a3a3a, #242424);
}
html[data-theme="dark"] .add:hover { background: #2a2a2a; }
html[data-theme="dark"] .error { background: #3a2424; color: #ffb1a1; }
html[data-theme="dark"] .toast { background: #f4f4f4; color: #171717; }
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .field input,
html[data-theme="dark"] .sheet-search,
html[data-theme="dark"] .filters .sort,
html[data-theme="dark"] .filters .filter-toggle {
  background: #242428; border-color: rgba(255, 255, 255, 0.08); box-shadow: none;
}
html[data-theme="dark"] .game-switch,
html[data-theme="dark"] .action-pill,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .me-chip { border-color: rgba(255, 255, 255, 0.1); }

@property --bg { syntax: "<color>"; inherits: true; initial-value: #efefef; }
@property --card { syntax: "<color>"; inherits: true; initial-value: #ffffff; }
@property --ink { syntax: "<color>"; inherits: true; initial-value: #171717; }
@property --muted { syntax: "<color>"; inherits: true; initial-value: #737373; }
@property --line { syntax: "<color>"; inherits: true; initial-value: #e4e4e4; }
@property --soft { syntax: "<color>"; inherits: true; initial-value: #e8e8e8; }

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-color: #cfcfcf transparent;
  transition: --bg 0.45s ease, --card 0.45s ease, --ink 0.45s ease, --muted 0.45s ease, --line 0.45s ease, --soft 0.45s ease;
}
html[data-theme="dark"] { scrollbar-color: #4a4a4a transparent; }
::selection { background: #d9dcff; color: var(--ink); }
html[data-theme="dark"] ::selection { background: #4338ca; color: #fff; }
::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-input:focus, .field input:focus, .sheet-search:focus, .chat-form textarea:focus, .sort select:focus { outline: none; }
body { transition: background 0.45s ease, color 0.45s ease; }

.btn, .icon-btn, .analyze, .game-switch button, .me-chip, .chip, .filter-toggle, .cats button,
.segmented button, .toggles button, .stepper button, .link-btn, .add, .x, .attach-option, .attach-btn {
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, opacity 0.22s ease;
}
.search-input, .field input, .sheet-search, .chat-form textarea, .sort, .code-box {
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}
.card, .convo, .pick, .tile, .row, .who, .empty, .auth, .column, .chat, .stat, .bubble {
  transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.28s ease, border-color 0.22s ease, opacity 0.22s ease;
}
.btn:not(.small):hover, .icon-btn:hover, .me-chip:hover, .card:hover, .convo:hover, .pick:hover {
  transform: translateY(-2px);
}
.dock .dock-btn:hover { transform: translateY(-3px); }
.btn:active, .icon-btn:active, .analyze:active, .chip:active, .pick:active, .add:active { transform: translateY(0) scale(0.98); }
.dock .dock-btn:active { transform: scale(0.96); }
.game-switch button.on { color: #fff; }
.search-input:focus, .field input:focus, .sheet-search:focus, .chat-form textarea:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.22);
}

.app.enter .hero,
.app.enter .banner-rotator,
.app.enter .filters,
.app.enter .count,
.app.enter .empty,
.app.enter .auth,
.app.enter .page-head,
.app.enter .profile,
.app.enter .composer,
.app.enter .item-page,
.app.enter .chat {
  animation: rise 0.42s ease backwards;
}
.app.enter .board .card,
.app.enter .inbox .convo,
.app.enter .composer .column,
.app.enter .profile .card,
.app.enter .messages .msg,
.app.enter .item-grid .pick,
.app.enter .picker-grid .pick,
.app.enter .rows .row,
.app.enter .chat-form,
.app.enter .chat-lock {
  animation: rise 0.46s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.msg.in { animation: msg-in 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
.app.enter .board .card:nth-child(2),
.app.enter .inbox .convo:nth-child(2) { animation-delay: 0.04s; }
.app.enter .board .card:nth-child(3),
.app.enter .inbox .convo:nth-child(3) { animation-delay: 0.08s; }
.app.enter .board .card:nth-child(4),
.app.enter .inbox .convo:nth-child(4) { animation-delay: 0.12s; }
.app.enter .board .card:nth-child(5),
.app.enter .inbox .convo:nth-child(5) { animation-delay: 0.16s; }
.app.enter .board .card:nth-child(n + 6),
.app.enter .inbox .convo:nth-child(n + 6) { animation-delay: 0.2s; }
.filter-panel.enter { animation: rise 0.32s ease backwards; }
.overlay.enter { animation: shade 0.28s ease backwards; }
.overlay.enter .sheet { animation: sheet-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.toast { animation: toast-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.app.enter .unread-badge { animation: pop 0.35s ease backwards; }
.error { animation: rise 0.3s ease backwards; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes shade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.app.enter .item-grid .pick:nth-child(2),
.app.enter .picker-grid .pick:nth-child(2),
.app.enter .rows .row:nth-child(2) { animation-delay: 0.03s; }
.app.enter .item-grid .pick:nth-child(3),
.app.enter .picker-grid .pick:nth-child(3),
.app.enter .rows .row:nth-child(3) { animation-delay: 0.06s; }
.app.enter .item-grid .pick:nth-child(4),
.app.enter .picker-grid .pick:nth-child(4) { animation-delay: 0.09s; }
.app.enter .item-grid .pick:nth-child(n + 5),
.app.enter .picker-grid .pick:nth-child(n + 5) { animation-delay: 0.12s; }
.app.enter ~ .dock { animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards; }

@media (max-width: 720px) {
  .dock { padding: 6px; gap: 8px; }
  .dock a.dock-btn { width: 58px; height: 58px; }
  .dock .dock-btn.primary { width: 66px; height: 66px; }
  .dock a.dock-btn svg { width: 26px; height: 26px; }
  .dock .dock-btn.primary svg { width: 28px; height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
