/* BGSI Tracker — 2026 dark glass. Only transform/opacity animate. */

:root {
  --bg: #070910;
  --bg-2: #0b0e18;
  --panel: #0d1020;
  --panel-2: #12162a;
  --line: #1c2140;
  --line-2: #262c52;
  --text: #eef1fb;
  --muted: #8b93b3;
  --dim: #5b6385;
  --gg: #b69cff;           /* BGSI.GG purple */
  --gg-soft: rgba(167, 139, 250, .14);
  --io: #58a6ff;           /* BGSI.IO blue */
  --io-soft: rgba(56, 189, 248, .14);
  --accent: #8b7bff;
  --accent-2: #38bdf8;
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; overflow-anchor: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  font-feature-settings: "ss01", "cv01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; }
a { color: var(--io); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
::selection { background: rgba(139, 123, 255, .4); }

/* ---------- aurora background (pure CSS, disabled on low-end) ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  width: 60vmax; height: 60vmax; transform: translate3d(0, 0, 0);
  background: radial-gradient(circle at center, var(--c, rgba(139,123,255,.35)), transparent 70%);
  will-change: transform;
}
.aurora i:nth-child(1) { top: -20vmax; left: -12vmax; --c: rgba(139,123,255,.4); animation: drift1 38s var(--ease) infinite alternate; }
.aurora i:nth-child(2) { top: -10vmax; right: -18vmax; --c: rgba(56,189,248,.32); animation: drift2 46s var(--ease) infinite alternate; }
.aurora i:nth-child(3) { bottom: -24vmax; left: 20vw; --c: rgba(167,139,250,.24); animation: drift3 52s var(--ease) infinite alternate; }
@keyframes drift1 { to { transform: translate3d(8vw, 10vh, 0); } }
@keyframes drift2 { to { transform: translate3d(-10vw, 8vh, 0); } }
@keyframes drift3 { to { transform: translate3d(6vw, -8vh, 0); } }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--panel); padding: 10px 16px; border-radius: var(--r-sm); }
.skip:focus { left: 12px; top: 12px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(14px, 4vw, 28px);
  background: rgba(7, 9, 16, .72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-text { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand-text em { font-style: normal; color: var(--accent-2); }
.mark { display: inline-flex; filter: drop-shadow(0 4px 10px rgba(139,123,255,.35)); }

.tabs { display: flex; gap: 4px; margin-inline: auto; }
.tab {
  position: relative; background: transparent; border: 0; color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: color .18s var(--ease), background .18s var(--ease), transform .12s var(--ease);
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.tab:active { transform: scale(.96); }
.tab[aria-selected="true"] { color: #0b0d16; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.tab[aria-selected="true"]::after { content: none; }

.top-actions { display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--good); font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(52,211,153,.25); background: rgba(52,211,153,.08); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(52,211,153,.5); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); transition: color .15s, border-color .15s, background .15s, transform .12s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,.06); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
#view { max-width: 1440px; margin: 0 auto; padding: clamp(16px, 3vw, 32px) clamp(14px, 4vw, 28px) 64px; outline: none; }
.view-in { animation: viewIn .34s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }

.glass { background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }

/* ---------- hero ---------- */
.hero { padding: clamp(24px, 5vw, 48px); position: relative; overflow: hidden; margin-bottom: 26px; }
.hero::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(120deg, rgba(139,123,255,.12), transparent 55%); pointer-events: none; }
.hero h1 { margin: 0 0 10px; font-size: clamp(26px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 850; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, var(--gg), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0 0 22px; color: var(--muted); max-width: 62ch; font-size: clamp(14px, 1.6vw, 17px); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; border-radius: var(--r); background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.stat b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12.5px; }

/* ---------- search ---------- */
.searchbar { margin-bottom: 18px; }
.search-wrap { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 14px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.3); transition: border-color .15s, box-shadow .15s; }
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139,123,255,.18), 0 8px 24px rgba(0,0,0,.3); }
.search-wrap svg { flex: none; color: var(--dim); }
#petSearch { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 17px; padding: 14px 0; }
#petSearch::placeholder { color: var(--dim); }
.kbd { flex: none; font: 12px var(--mono); color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); font-size: 13px; transition: all .15s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.search-meta { margin-top: 10px; color: var(--dim); font-size: 13px; min-height: 1.2em; }

/* ---------- pet grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.pet {
  position: relative; text-align: left; color: inherit; padding: 0; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden; transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);

  animation: cardIn .38s var(--ease) both; animation-delay: calc(min(var(--i, 0), 14) * 24ms);
}
@keyframes cardIn { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
.pet:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.pet:active { transform: translateY(-1px) scale(.995); }
.pet-art { position: relative; height: 128px; display: grid; place-items: center; background: radial-gradient(120% 100% at 50% 0%, rgba(139,123,255,.14), transparent 70%); }
.pet-art img { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.5)); transition: transform .25s var(--ease); }
.pet:hover .pet-art img { transform: scale(1.09) rotate(-3deg); }
.rarity { position: absolute; top: 8px; right: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(9,10,18,.78); color: var(--muted); text-transform: uppercase; }
.pet-info { padding: 12px 14px 14px; }
.pet-info h3 { margin: 0 0 8px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.val { min-width: 0; padding: 8px 10px; border-radius: var(--r-sm); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.val .src { display: block; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--dim); }
.val.gg { border-color: rgba(167,139,250,.25); background: var(--gg-soft); }
.val.gg .src { color: var(--gg); }
.val.io { border-color: rgba(56,189,248,.25); background: var(--io-soft); }
.val.io .src { color: var(--io); }
.val strong { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.val .sub { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty-val { color: var(--dim); }

/* demand pills */
.d { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.d::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.d0 { color: var(--dim); }
.d1 { color: #86efac; border-color: rgba(134,239,172,.35); background: rgba(134,239,172,.08); }
.d2 { color: #7dd3fc; border-color: rgba(125,211,252,.35); background: rgba(125,211,252,.08); }
.d3 { color: #c4b5fd; border-color: rgba(196,181,253,.4); background: rgba(196,181,253,.1); }
.d4 { color: #f0abfc; border-color: rgba(240,171,252,.4); background: rgba(240,171,252,.1); }
.d5 { color: #fcd34d; border-color: rgba(252,211,77,.45); background: rgba(252,211,77,.12); }

/* ---------- section heads ---------- */
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.count { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.section-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: all .15s var(--ease); }
.seg button.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0d16; }

select.input, input.input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13px; }

/* ---------- feeds ---------- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.card { padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), var(--panel)); transition: border-color .18s, transform .18s var(--ease); content-visibility: auto; contain-intrinsic-size: 90px; animation: cardIn .3s var(--ease) both; }
.card:hover { border-color: var(--line-2); }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row + .row { margin-top: 8px; }
.spread { justify-content: space-between; }
.avatar { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; background: var(--line); flex: none; }
.name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { color: var(--dim); font-size: 12px; white-space: nowrap; }
.muted { color: var(--muted); }
.src-badge { font-size: 10px; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line-2); }
.src-gg { color: var(--gg); border-color: rgba(167,139,250,.4); background: var(--gg-soft); }
.src-io { color: var(--io); border-color: rgba(56,189,248,.4); background: var(--io-soft); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.045); border: 1px solid var(--line); color: var(--muted); }
.tag.pet { padding-left: 3px; }
.tag img { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }
.amt { font-variant-numeric: tabular-nums; font-weight: 800; }
.up { color: var(--good); } .down { color: var(--bad); }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; display: none; }
.drawer[aria-hidden="false"] { display: block; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(4,5,10,.62); backdrop-filter: blur(4px); animation: fadeIn .2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); display: flex; flex-direction: column; background: var(--bg-2); border-left: 1px solid var(--line-2); box-shadow: -24px 0 60px rgba(0,0,0,.5); animation: slideIn .3s var(--ease); }
@keyframes slideIn { from { transform: translate3d(24px, 0, 0); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-crumb { color: var(--dim); font-size: 13px; }
.drawer-body { overflow-y: auto; padding: 18px 18px 48px; overscroll-behavior: contain; }

.d-head { display: flex; gap: 14px; align-items: center; }
.d-art { width: 84px; height: 84px; border-radius: 16px; background: radial-gradient(120% 100% at 50% 0%, rgba(139,123,255,.18), transparent 70%); border: 1px solid var(--line); display: grid; place-items: center; flex: none; }
.d-art img { width: 68px; height: 68px; object-fit: contain; }
.d-name { font-size: 21px; font-weight: 850; letter-spacing: -.02em; line-height: 1.15; }
.d-sub { color: var(--muted); font-size: 13px; margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

.variants { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.variant { padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); font-size: 13px; font-weight: 600; transition: all .15s var(--ease); display: inline-flex; align-items: center; gap: 8px; }
.variant img { width: 20px; height: 20px; object-fit: contain; }
.variant.on { border-color: var(--accent); background: rgba(139,123,255,.14); color: var(--text); }

.vs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .vs-grid { grid-template-columns: 1fr; } }
.panel-gg { border-color: rgba(167,139,250,.3); }
.panel-io { border-color: rgba(56,189,248,.3); }
.vcard { padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.vcard h4 { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.vcard .big { font-size: 24px; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.eq { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 8px 0 10px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { padding: 8px 10px; border-radius: var(--r-sm); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.metric b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric span { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; }

.scan { margin: 12px 0; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.spinner { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent-2); animation: spin .8s linear infinite; flex: none; }

/* ---------- settings ---------- */
.settings { border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel-2); color: var(--text); padding: 0; width: min(460px, calc(100vw - 24px)); box-shadow: var(--shadow); }
.settings::backdrop { background: rgba(4,5,10,.6); backdrop-filter: blur(4px); }
.settings-card { margin: 0; }
.settings header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.settings header h2 { margin: 0; font-size: 17px; }
.settings section { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.settings h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.settings footer { padding: 14px 18px; text-align: right; }
.hint { color: var(--dim); font-size: 12.5px; margin: 4px 0 10px; }
.mult-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.mult-grid label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.mult-grid input { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--text); padding: 8px; font-size: 14px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.switch input { width: 17px; height: 17px; accent-color: var(--accent); }
.btn { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b0d16; border: 0; border-radius: 999px; padding: 9px 18px; font-weight: 700; transition: transform .12s var(--ease); }
.btn:active { transform: scale(.96); }

/* ---------- misc ---------- */
.skeleton { border-radius: var(--r); background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.07) 50%, rgba(255,255,255,.03) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-pet { height: 150px; }
.skeleton-line { height: 12px; margin: 8px 0; }
.more { display: block; margin: 18px auto 0; }
.empty { padding: 30px; text-align: center; color: var(--dim); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.foot { max-width: 1440px; margin: 0 auto; padding: 18px clamp(14px, 4vw, 28px) 34px; color: var(--dim); font-size: 12.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.foot-links { display: flex; gap: 14px; }
.noscript { padding: 24px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); padding: 10px 16px; border-radius: 999px; opacity: 0; pointer-events: none; transition: all .25s var(--ease); z-index: 100; font-size: 13.5px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- marquee ticker ---------- */
.ticker { overflow: hidden; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.025); padding: 9px 0; margin-bottom: 22px; }
.ticker-track { display: flex; gap: 26px; width: max-content; animation: marquee 60s linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; color: var(--muted); }
.ticker-item img { width: 20px; height: 20px; object-fit: contain; border-radius: 5px; }
.ticker-item b { color: var(--text); font-variant-numeric: tabular-nums; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- trade card internals ---------- */
.sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
@media (max-width: 560px) { .sides { grid-template-columns: 1fr; } .vs-arrow { text-align: center; } }
.vs-arrow { color: var(--dim); font-weight: 800; }
.tagwrap { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.trade-total { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .tabs { order: 3; width: 100%; margin-inline: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .live span { display: none; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 10px; }
  .pet-art { height: 104px; }
  .pet-art img { width: 76px; height: 76px; }
  .val strong { font-size: 13.5px; }
  .kbd { display: none; }
  .vs-grid { grid-template-columns: 1fr; }
}

/* ---------- low-end / reduced-motion mode ---------- */
:root.lowend .aurora i, :root.lowend .ticker-track { animation: none !important; }
:root.lowend .aurora i { filter: none; opacity: .18; }
:root.lowend .top, :root.lowend .drawer-scrim { backdrop-filter: none !important; }
:root.lowend .pet, :root.lowend .card, :root.lowend .hero::after { animation: none !important; }
:root.lowend .pet:hover { transform: none; }
:root.lowend .pet:hover .pet-art img { transform: none; }
:root.lowend .pet-art img { filter: none; }
:root.lowend .live i { animation: none; }
:root.lowend .skeleton { animation: none; background: rgba(255,255,255,.04); }
:root.lowend .icon-btn:active, :root.lowend .tab:active, :root.lowend .btn:active { transform: none; }
:root.lowend .chip:hover { transform: none; }
:root.lowend .view-in { animation: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* hover motion only on devices that have real hover — cheap on touch + low-end */
@media (hover: none) { .pet:hover { transform: none; } .pet:hover .pet-art img { transform: none; } }

/* virtual-scroll lists: render only the visible window + buffer */
.vlist { position: relative; }
.vlist .spacer-top, .vlist .spacer-bot { width: 1px; flex: none; }
.vlist .vcontent { display: flex; flex-direction: column; gap: 10px; }
.vlist .vcontent > .card { content-visibility: visible; contain-intrinsic-size: none; }

/* ================= scaling hardening (all breakpoints) ================= */
*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }
#view, .section, .card, .pet, .hero, .feed, .sides, .vs-grid, .tagwrap, .metrics, .stats { max-width: 100%; }
.tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: normal; word-break: break-word; }
.name, .d-name { overflow: hidden; text-overflow: ellipsis; }
.tagwrap { overflow: visible; }
.section-head { row-gap: 8px; }
.pet-art img { max-width: 100%; }

/* medium screens */
@media (max-width: 720px) {
  .sides { grid-template-columns: 1fr; }
  .vs-arrow { text-align: center; padding: 4px 0; }
  .section-head .right { margin-left: 0; width: 100%; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

/* small screens */
@media (max-width: 640px) {
  .hero { padding: 18px; margin-bottom: 18px; }
  .vs-grid { grid-template-columns: 1fr; }
  .drawer-panel { width: 100vw; border-left: 0; }
  .mult-grid { grid-template-columns: 1fr 1fr; }
  .ticker { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pet-info h3 { font-size: 14px; }
  .val strong { font-size: 13px; }
  #view { padding-inline: 12px; }
}

/* very small */
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
  .mult-grid { grid-template-columns: 1fr; }
  .top-actions .live { display: none; }
}

/* never let any child paint past its card */
.card, .pet, .val, .pet-art, .pet-info { overflow: hidden; }
.d { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name, .meta, .trade-total { min-width: 0; }
.avatar { flex: none; }
.skip { left: -9999px; }

/* demand pill: own full-width row, wraps, never clipped/pushed out of frame */
.pet .val { display: flex; flex-direction: column; min-width: 0; max-width: 100%; gap: 3px; overflow: visible; }
.pet .val .src { order: 0; }
.pet .val strong { order: 1; width: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet .val .sub { order: 2; width: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet .val .d {
  order: 3;
  display: inline-flex; align-self: flex-start; align-items: center; gap: 4px;
  max-width: 100%; width: auto;
  white-space: normal; text-overflow: clip; overflow: visible;
  font-size: 9.5px; line-height: 1.25; padding: 2px 7px; margin-top: 1px;
  min-width: 0;
}
.pet .val .d::before { flex: none; }
.pet { overflow: hidden; }
.pet .pet-info { overflow: visible; }

/* demand pill full-width inside its value cell */
.pet .val .demand-row { display: block; width: 100%; margin-top: 2px; overflow: visible; }
.pet .val .demand-row .d { margin-top: 0; }
.pet .val { gap: 3px; }

/* ---- more breathing room per trade/ad item ---- */
.tag { padding: 4px 10px; gap: 6px; font-size: 12px; }
.tag.pet { padding: 4px 10px 4px 4px; gap: 7px; font-size: 12px; }
.tag.pet img { width: 24px; height: 24px; border-radius: 6px; object-fit: contain; flex: none; }
.tagwrap { gap: 8px; }
.trade-total { margin-top: 5px; }
.card { padding: 16px 18px; }

/* clickable players */
.player-card { cursor: pointer; transition: border-color .15s, transform .15s; }
.player-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.player-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* player inventory grid */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
.inv-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: rgba(255,255,255,.03); text-align: center;  overflow: hidden; }
.inv-art { height: 56px; display: grid; place-items: center; margin-bottom: 6px; }
.inv-art img { width: 52px; height: 52px; object-fit: contain; }
.inv-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inv-val { font-size: 12px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; margin-top: 2px; }
.inv-rarity { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }
@media (max-width: 480px) { .inv-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); } }

/* ================= ANTI-FLICKER / EPILEPSY SAFETY ================= */
/* nothing restarts animation on scroll; list items never animate in */
.card, .pet, .inv-item { animation: none !important; }
.vlist .vcontent, .vlist .vcontent > * { animation: none !important; transition: none !important; }
.vlist { contain: layout; }
.view-in { animation: none !important; }
/* fresh trades pop in on live arrival */
.vlist .vcontent > .card.fresh { animation: tradeFresh .35s var(--ease) both; }
@keyframes tradeFresh { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }
/* no re-animation of images when nodes are recreated */
img { animation: none !important; }
/* kill any rapid infinite animation for reduced-motion AND for safety on scroll lists */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
/* never strobe: no blink/flash keyframes applied in lists */
.vlist, .feed { animation: none !important; }

html, body { scroll-behavior: auto !important; overflow-anchor: none !important; }
.vlist { overflow-anchor: none; }

/* ---- per-pet value next to pet + highlight + flashy ---- */
.tag.pet { background: rgba(139,123,255,.10); border-color: rgba(139,123,255,.28); padding-right: 9px; }
.tag.pet:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(139,123,255,.25); }
.pv { font-size: 11px; font-weight: 800; color: var(--good); font-variant-numeric: tabular-nums; margin-left: 5px; padding-left: 6px; border-left: 1px solid rgba(52,211,153,.3); }
.tag.pet .pv { background: transparent; }
.more-tag { cursor: pointer; background: linear-gradient(135deg, rgba(139,123,255,.3), rgba(56,189,248,.3)); border-color: rgba(139,123,255,.5); color: var(--text); font-weight: 800; transition: transform .12s, box-shadow .15s; }
.more-tag:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,123,255,.4); }

/* flashy (non-flickering, GPU-cheap) — does NOT restart on scroll/re-render */
.section-head h2 { background: linear-gradient(120deg, var(--text), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card { border-top: 2px solid transparent; background-image: linear-gradient(var(--panel), var(--panel)), linear-gradient(120deg, rgba(139,123,255,.5), rgba(56,189,248,.5)); background-origin: border-box; background-clip: padding-box, border-box; }
.card:hover { border-top-color: transparent; box-shadow: 0 10px 30px rgba(139,123,255,.18); }
.pet-info h3 { color: #fff; }
.name { color: #fff; }
.amt, .trade-total { color: var(--good); }
.d-name { background: linear-gradient(120deg, var(--gg), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat b { background: linear-gradient(120deg, #fff, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (hover: none) { .card:hover { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .more-tag:hover { transform: none; } }

/* never force pet-name capitalization */
.pet-info h3, .name, .d-name, .inv-name, .tag.pet, .tag.pet b, .d-name, .more-tag { text-transform: none !important; }
/* keep labels intentional but readable */
.d { text-transform: none; }
.rarity { text-transform: none; }
.pet-controls select { min-width: 130px; }

/* ================= smoother scrolling ================= */
html { scroll-behavior: smooth !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto !important; } }
body { -webkit-overflow-scrolling: touch; }
html, body { overflow-anchor: none !important; }
.vlist { overscroll-behavior: contain; contain: layout; }
.vlist .vcontent { will-change: transform; }

/* ================= flashy (cheap GPU transforms/opacity, no flicker) ================= */
.player-card { cursor: pointer; }
.player-card:hover { border-color: var(--accent); }
.tag.pet { transition: transform .12s var(--ease), border-color .12s, box-shadow .12s; }
.tag.pet:hover { transform: translateY(-1px); }
.card { transition: box-shadow .18s var(--ease), border-color .18s var(--ease); }
.section-head h2 { letter-spacing: -.02em; }
.pet .val { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); }
.pet .val.gg { background: linear-gradient(180deg, rgba(167,139,250,.16), rgba(167,139,250,.05)); }
.pet .val.io { background: linear-gradient(180deg, rgba(56,189,248,.16), rgba(56,189,248,.05)); }
.d { box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.trade-total { font-weight: 800; }
.amt { color: var(--good); }
@media (prefers-reduced-motion: reduce) { .tag.pet:hover { transform: none; } }

/* ================= FOR icon ================= */
.for-icon { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; color: var(--accent-2); background: rgba(56,189,248,.10); border: 1px solid rgba(56,189,248,.28); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.for-icon svg { flex: none; }
.vs-arrow { display: flex; justify-content: center; }

/* ================= mobile scaling: center + containment ================= */
@media (max-width: 720px) {
  .hero { text-align: center; }
  .hero p { margin-inline: auto; }
  .stats { text-align: center; }
  .section-head { justify-content: center; text-align: center; }
  .section-head .right { justify-content: center; }
  .search-meta, .pet-controls { justify-content: center; text-align: center; }
  .pet-controls select { flex: 1 1 140px; }
  .grid { justify-content: center; }
  .sides { justify-items: center; }
  .tagwrap { justify-content: center; }
}
/* demand pill can never escape its cell */
.pet .val { overflow: hidden; }
.pet .val .demand-row { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.pet .val .d { white-space: normal; overflow-wrap: anywhere; word-break: break-word; max-width: 100%; min-width: 0; }
.pet .val .sub, .pet .val strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pet .pet-info { padding-inline: 10px; }
@media (max-width: 380px) { .pet .val .d { font-size: 9px; padding: 2px 6px; } }

/* ================= bgsi.io-like polish ================= */
:root { --r: 16px; --r-lg: 22px; --r-sm: 12px; }
.card { border-radius: 16px; }
.tag { border-radius: 999px; }
.vcard { border-radius: 18px; }
.d { border-radius: 999px; }
.btn { box-shadow: 0 6px 18px rgba(139,123,255,.35); }
.icon-btn { border-radius: 12px; }
.val { border-radius: 14px; }
.section-head h2 { font-weight: 800; }

/* no content-visibility on lists: it collapses card heights and makes the page jump while scrolling */
.card, .pet, .inv-item, .vlist .vcontent > * { content-visibility: visible !important; contain-intrinsic-size: none !important; }

/* ================= account dialog scaling ================= */
.settings { width: min(500px, calc(100vw - 16px)) !important; max-width: calc(100vw - 16px); }
.settings-card { max-height: 86vh; overflow-y: auto; overscroll-behavior: contain; }
.settings section { overflow-wrap: anywhere; }
.settings .input, .settings textarea, .settings input[type=number] { width: 100%; min-width: 0; box-sizing: border-box; }
.acct-row { gap: 12px; align-items: center; flex-wrap: wrap; }
.acct-avatar { width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 100% at 50% 0%, rgba(139,123,255,.25), transparent 70%); border: 1px solid var(--line-2); color: var(--muted); }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
@media (max-width: 420px) { .settings { width: calc(100vw - 8px) !important; } .settings header, .settings section, .settings footer { padding-inline: 12px; } .mult-grid { grid-template-columns: 1fr; } }

/* ================= pet card controls ================= */
.pet { position: relative; }
.pet .fav { position: absolute; top: 8px; left: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(9,10,18,.8); color: var(--muted); font-size: 16px; line-height: 1; display: grid; place-items: center; transition: color .15s, border-color .15s, transform .12s; }
.pet .fav:hover { color: var(--warn); border-color: var(--warn); }
.pet .fav.on { color: var(--warn); border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.12); }
.pet .fav:active { transform: scale(.92); }
.pet .fav:focus-visible { outline: 2px solid var(--warn); outline-offset: 2px; }
.pet .edited { position: absolute; top: 10px; right: 10px; z-index: 2; color: var(--accent-2); font-size: 13px; background: rgba(9,10,18,.8); border: 1px solid var(--line-2); border-radius: 8px; padding: 2px 6px; }
.pet[role=button]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= drawer pet actions ================= */
.pet-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 16px; }
.pet-actions .chip.on { border-color: var(--accent); background: rgba(139,123,255,.16); color: var(--text); }
.pet-actions .ov { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.pet-actions .ov input { width: 110px; padding: 6px 8px; font-size: 12.5px; }

/* ================= tracker ================= */
.spark { display: block; margin-top: 4px; max-width: 100%; }
.tracker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 14px; align-items: start; }
.tracker-card { min-width: 0; display: grid; gap: 14px; align-content: start; }
.tracker-card-head, .tracker-pet, .tracker-source-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tracker-card-head { justify-content: space-between; }
.tracker-pet img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: rgba(255,255,255,.04); flex: none; }
.tracker-title { display: grid; gap: 4px; min-width: 0; }
.tracker-title b { font-size: 15px; overflow-wrap: anywhere; }
.tracker-title span, .tracker-base { color: var(--dim); font-size: 11px; overflow-wrap: anywhere; }
.tracker-stop { flex: none; }
.tracker-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.tracker-source { min-width: 0; display: grid; gap: 8px; align-content: start; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.tracker-source-head { justify-content: space-between; flex-wrap: wrap; }
.tracker-current { font-size: clamp(20px, 2vw, 27px); line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tracker-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tracker-metrics .metric { min-width: 0; padding: 7px 8px; }
.tracker-metrics .metric b { font-size: clamp(12px, 1.2vw, 15px); overflow-wrap: anywhere; }
.tracker-metrics .metric span { font-size: 9px; }
.tracker-trend { display: grid; grid-template-columns: auto auto minmax(70px, 1fr); align-items: center; gap: 8px; color: var(--dim); font-size: 11px; min-width: 0; }
.tracker-trend .spark { width: 100%; height: auto; }
.tracker-footer { color: var(--dim); font-size: 11px; border-top: 1px solid var(--line); padding-top: 10px; }
@media (max-width: 680px) {
  .tracker-grid { grid-template-columns: minmax(0, 1fr); }
  .tracker-values { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
  .tracker-card-head { align-items: flex-start; }
  .tracker-stop { padding: 5px 8px; font-size: 11px; }
  .tracker-source { padding: 10px; }
  .tracker-trend { grid-template-columns: auto auto; }
  .tracker-trend .spark { grid-column: 1 / -1; }
}
.tracker-card :focus-visible, .tracker-page button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* Keep section controls and content inside the viewport at desktop/tablet widths. */
.section, .section-head, .section-head .right, .tracker-page, .tracker-card, .tracker-source { min-width: 0; }
.section-head .right > *, .pet-controls > * { max-width: 100%; }
@media (max-width: 720px) {
  .section-head { justify-content: flex-start; text-align: left; }
  .section-head .right { width: 100%; margin-left: 0; justify-content: flex-start; }
  .section-head .right > select.input { flex: 1 1 120px; }
  .tracker-page .section-head .count { width: 100%; margin-left: 0; }
  .pet-controls select.input { flex: 1 1 130px; }
}
@media (max-width: 420px) {
  #view { padding-inline: 8px; }
  .tracker-card-head { flex-wrap: wrap; }
  .tracker-stop { margin-left: 54px; }
  .section-head .right .seg { max-width: 100%; overflow-x: auto; }
  .section-head .right .seg button { padding-inline: 8px; white-space: nowrap; }
  .matches-controls, [data-matchcontrols] { width: 100%; }
}
.db-row { grid-template-columns: 28px minmax(120px, 1.4fr) repeat(3, minmax(82px, 1fr)) auto auto; }
.db-name { display: grid; gap: 2px; min-width: 0; white-space: normal; text-overflow: clip; }
.db-name small { color: var(--dim); font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
@media (max-width: 900px) and (min-width: 641px) {
  .db-row { grid-template-columns: 26px minmax(100px, 1.2fr) repeat(3, minmax(70px, 1fr)) auto auto; gap: 6px; padding-inline: 8px; }
}
@media (max-width: 640px) {
  .db-row { grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 6px; }
  .db-row .db-name { grid-column: 2 / -1; }
  .db-row label { grid-column: span 2; }
}

/* ================= mobile layout v2 ================= */
@media (max-width: 640px) {
  #view { padding-inline: 10px; }
  .hero { padding: 16px 14px; }
  .hero h1 { font-size: 24px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 18px; }
  /* two real columns on phones */
  .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr)); gap: 8px; }
  .pet-art { height: 96px; }
  .pet-art img { width: 68px; height: 68px; }
  .pet-info { padding: 8px 8px 10px; }
  .pet-info h3 { font-size: 13px; }
  /* value cells stack so values and demand always fit */
  .values { grid-template-columns: 1fr; gap: 6px; }
  .val { padding: 6px 8px; }
  .val strong { font-size: 13px; }
  .val .sub { font-size: 10px; }
  .pet .val .d { font-size: 9px; padding: 1px 6px; }
  .pet .fav { width: 26px; height: 26px; font-size: 14px; }
  /* header */
  .top { gap: 8px; }
  .brand-text { font-size: 15px; }
  .tabs { width: 100%; overflow-x: auto; justify-content: flex-start; padding-bottom: 2px; }
  .tab { padding: 7px 11px; font-size: 13px; flex: none; }
  .top-actions { margin-left: auto; }
  .account-label { display: none; }
  /* drawer */
  .drawer-panel { width: 100vw; }
  .drawer-body { padding: 14px 12px 40px; }
  .vs-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
  .metrics .metric b { font-size: 13px; }
  .pet-actions .ov { flex: 1 1 100%; }
  .pet-actions .ov input { width: 100%; }
  .settings { width: calc(100vw - 12px) !important; max-width: calc(100vw - 12px); }
  /* feeds */
  .card { padding: 12px; }
  .tag { font-size: 11px; padding: 3px 8px; }
  .tag.pet img { width: 20px; height: 20px; }
  .sides { grid-template-columns: 1fr; gap: 6px; }
  .vs-arrow { padding: 2px 0; }
  .foot { flex-direction: column; text-align: center; }
}
@media (max-width: 360px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
  .pet-art { height: 84px; }
  .pet-art img { width: 60px; height: 60px; }
}

/* ================= database / matches ================= */
.db-list { display: flex; flex-direction: column; gap: 8px; }
.db-row { display: grid; grid-template-columns: 28px minmax(90px, 1.4fr) repeat(3, minmax(90px, 1fr)) auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.db-row img { width: 28px; height: 28px; object-fit: contain; }
.db-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-row label { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .04em; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.db-row .input { width: 100%; padding: 5px 7px; font-size: 12px; min-width: 0; }
@media (max-width: 640px) { .db-row { grid-template-columns: 26px 1fr auto; grid-auto-rows: auto; } .db-row .db-name { grid-column: 2 / 4; } .db-row label { grid-column: span 1; } }
.linkbtn { background: none; border: 0; color: var(--io); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }

/* account chip: never overlap the other header buttons */
.top-actions { flex: none; min-width: 0; }
.account-btn { max-width: min(190px, 34vw); display: inline-flex; align-items: center; gap: 6px; min-width: 0; width: auto; padding-inline: 9px; }
.account-btn .account-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 13px; font-weight: 600; }
.account-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: none; }
/* glowing Roblox join button */
.roblox-join { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; border:1px solid rgba(52,211,153,.55); background:linear-gradient(135deg, rgba(52,211,153,.2), rgba(16,185,129,.15)); color:#34d399; font-weight:800; font-size:12px; letter-spacing:.04em; text-transform:uppercase; box-shadow:0 0 10px rgba(52,211,153,.35), inset 0 1px 0 rgba(255,255,255,.15); transition:transform .12s var(--ease), box-shadow .18s var(--ease); }
.roblox-join:hover { color:#0b0d16; background:linear-gradient(135deg,#34d399,#10b981); box-shadow:0 0 18px rgba(52,211,153,.6), 0 0 4px rgba(52,211,153,.4); text-decoration:none; }
.roblox-join:active { transform:scale(.96); }
.roblox-join svg { width:14px; height:14px; flex:none; }
@media (max-width: 480px) { .roblox-join { padding:5px 8px; font-size:11px; } }
@media (max-width: 640px) { .account-btn { max-width: 40px; padding-inline: 0; justify-content: center; } .account-btn .account-label { display: none; } }
@media (max-width: 860px) and (min-width: 641px) { .account-btn { max-width: 110px; } }
