/* TBH Market Observer — marketdb.info-inspired design system.
   Self-contained sheet: currently used only by the Item Database page
   while the new look is being reviewed. Will replace styles.css site-wide
   once approved. Dark theme, fixed left sidebar, glass panels, KPI cards. */

:root {
  --bg:            #0a0a0a;
  --bg-lift:       #0f0f10;
  --panel:         #121214;
  --panel-hover:   #17171a;
  --panel-inner:   #17171a;

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-hover:  rgba(255, 255, 255, 0.22);

  --text:       #fafafa;
  --text-muted: rgba(255, 255, 255, 0.68);
  --text-dim:   rgba(255, 255, 255, 0.45);
  --text-faint: rgba(255, 255, 255, 0.30);

  --accent:   #ffffff;
  --accent-2: rgba(255, 255, 255, 0.35);

  --success:    #86efac;
  --success-bg: rgba(134, 239, 172, 0.10);
  --danger:     #fca5a5;
  --warn:       #fcd34d;

  --sidebar-w:    clamp(190px, 15vw, 248px);
  --sidebar-gap:  16px;
  --content-pad:  clamp(16px, 2vw, 32px);

  --radius:    12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; color: inherit; background: none; border: 0; padding: 0; }
img, svg { display: block; }
::selection { background: rgba(255, 255, 255, 0.2); color: var(--text); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Ambient backdrop ---------------------------------------------------------- */
.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 1000px 500px at 50% -200px, rgba(255, 255, 255, 0.04), transparent 65%),
    radial-gradient(ellipse 700px 400px at 15% 40%, rgba(120, 100, 140, 0.05), transparent 60%),
    radial-gradient(ellipse 700px 400px at 85% 70%, rgba(80, 120, 140, 0.04), transparent 60%);
}

/* Sidebar ------------------------------------------------------------------- */
.side-nav {
  position: fixed;
  top: var(--sidebar-gap);
  left: var(--sidebar-gap);
  bottom: var(--sidebar-gap);
  width: var(--sidebar-w);
  z-index: 50;
}
.side-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  background: rgba(15, 15, 17, 0.6);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 10px 40px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  overflow-x: hidden;
}
.side-shell::-webkit-scrollbar { width: 4px; }
.side-shell::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 6px;
  margin-bottom: 6px;
  color: var(--text);
}
.logo-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.logo-mark img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-text-full {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logo-text-sub {
  font-size: 10px;
  color: var(--text-dim);
  white-space: pre-line;
  line-height: 1.3;
}

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  height: 36px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
}
.nav-link svg { color: var(--text-dim); flex-shrink: 0; transition: color 0.15s; }
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav-link:hover svg { color: var(--text); }
.nav-link.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.nav-link.active svg { color: var(--text); }

.nav-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.nav-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.side-foot {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.side-social:hover { color: var(--text); }
.side-social img { width: 16px; height: 16px; object-fit: contain; }
.side-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-version { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); }

/* Sidebar onboarding hint (styled like the Support modal box) -------------- */
.side-hint {
  position: relative;
  margin-top: auto;
  margin-bottom: 4px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.side-shell.has-hint .side-foot { margin-top: 12px; }
.side-hint-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-hint-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.side-hint-close {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: -4px -4px -4px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--text-faint);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.side-hint-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.side-hint-line {
  display: flex;
  gap: 7px;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.side-hint-ico { flex: 0 0 auto; line-height: 1.5; }
.side-hint-key {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}
.side-action {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-dim);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.side-action:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }
.side-action img { width: 18px; height: 18px; object-fit: contain; }
.side-actions { display: inline-flex; gap: 8px; }
.coin-action {
  position: relative;
  width: 48px;
  height: 48px;
  margin: -8px -6px -8px 0;
  overflow: visible;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  transition: transform 0.15s, filter 0.15s;
}
.coin-action:hover {
  background: transparent;
  border-color: transparent;
  transform: translateY(-1px);
  filter: drop-shadow(0 0 7px rgba(244, 171, 62, 0.35));
}
.coin-action > img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  image-rendering: pixelated;
}
.coin-burst {
  position: absolute;
  inset: -42px -14px 32px;
  pointer-events: none;
}
.coin-burst i {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 13px;
  height: 13px;
  opacity: 0;
  background: url("/static/img/coin_50th_anniversary.png") center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 4px rgba(244, 171, 62, 0.45));
}
.coin-action:hover .coin-burst i { animation: coin-float 1.45s ease-out infinite; }
.coin-burst i:nth-child(1) { --dx: -18px; --rot: -24deg; animation-delay: 0s; }
.coin-burst i:nth-child(2) { --dx: -6px; --rot: 15deg; animation-delay: 0.22s; }
.coin-burst i:nth-child(3) { --dx: 11px; --rot: -8deg; animation-delay: 0.42s; }
.coin-burst i:nth-child(4) { --dx: 22px; --rot: 28deg; animation-delay: 0.64s; }
@keyframes coin-float {
  0% { opacity: 0; transform: translate(-50%, 0) rotate(0deg) scale(0.55); }
  18% { opacity: 0.95; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -42px) rotate(var(--rot)) scale(1); }
}

/* Page shell ---------------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  height: 100dvh;
  padding-left: calc(var(--sidebar-w) + var(--sidebar-gap) * 2);
  padding-right: var(--content-pad);
  padding-top: var(--sidebar-gap);
  padding-bottom: var(--sidebar-gap);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.4vw, 20px);
  overflow: hidden;
}
/* Table panel fills the remaining viewport height; its body scrolls inside,
   so the footer (and the mascots standing on it) stay reachable. */
.table-card { flex: 1; min-height: 220px; }
.table-card .table-wrap { flex: 1; min-height: 0; }

/* KPI cards ----------------------------------------------------------------- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(8px, 0.9vw, 14px);
}
.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(14px, 1.2vw, 20px) clamp(16px, 1.4vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: border-color 0.2s, background 0.2s;
}
.kpi-card:hover { border-color: var(--border-strong); background: var(--panel-hover); }
.kpi-label {
  font-size: clamp(10px, 0.75vw, 12px);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-value {
  font-size: clamp(20px, 1.7vw, 28px);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-top: 2px;
}
.kpi-sub {
  font-size: clamp(10.5px, 0.8vw, 12px);
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}

/* Filter / toolbar row ------------------------------------------------------ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.grade-filter { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.grade-btn {
  --gc: #888;
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.grade-btn:hover { color: var(--text); border-color: var(--border-strong); }
.grade-btn.on {
  color: #fff;
  border-color: color-mix(in srgb, var(--gc) 70%, transparent);
  background: color-mix(in srgb, var(--gc) 18%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gc) 30%, transparent) inset;
}
.grade-btn::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--gc);
  box-shadow: 0 0 6px color-mix(in srgb, var(--gc) 60%, transparent);
}

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: clamp(180px, 22vw, 300px);
  transition: border-color 0.15s;
}
.search-pill:focus-within { border-color: var(--border-hover); }
.search-pill svg { color: var(--text-dim); flex-shrink: 0; }
.search-pill input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}
.search-pill input::placeholder { color: var(--text-faint); }

/* Panel --------------------------------------------------------------------- */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: border-color 0.2s;
}
.panel:hover { border-color: var(--border-strong); }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-head h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.panel-sub { font-size: 11.5px; color: var(--text-dim); margin: 0; max-width: 70ch; }
.panel-head-meta { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

/* Scan banner / last check / progress --------------------------------------- */
.scan-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--success-bg);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
  font-size: 11.5px;
  font-weight: 500;
}
.scan-banner[hidden] { display: none; }
.scan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent);
  animation: scan-pulse 1.6s ease-out infinite;
}
@keyframes scan-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); }
  100% { box-shadow: 0 0 0 7px transparent; }
}
.progress {
  position: absolute;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  opacity: 0;
  transition: width 0.4s ease, opacity 0.3s;
  z-index: 2;
}
.progress.on { opacity: 0.85; }

/* Table --------------------------------------------------------------------- */
.table-wrap { overflow: auto; }
.table-wrap::-webkit-scrollbar,
.movers-list::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap::-webkit-scrollbar-thumb,
.movers-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 5px; }
.table-wrap::-webkit-scrollbar-thumb:hover,
.movers-list::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

#tbl { width: 100%; border-collapse: collapse; }
#tbl thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
#tbl thead th[data-col] { cursor: pointer; transition: color 0.15s; }
#tbl thead th[data-col]:hover { color: var(--text); }
#tbl thead th.sort-asc::after { content: " ↑"; color: var(--text); }
#tbl thead th.sort-desc::after { content: " ↓"; color: var(--text); }
#tbl thead th.c-icon, #tbl thead th:first-child { cursor: default; }

#tbl tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
#tbl tbody tr { transition: background 0.12s; cursor: default; }
#tbl tbody tr:hover { background: rgba(255, 255, 255, 0.035); }
#tbl tbody tr:last-child td { border-bottom: none; }
.c-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.c-type { overflow: hidden; text-overflow: ellipsis; }
.c-low { color: var(--text); }

/* Even column distribution: fixed layout + a colgroup spreads the item-info
   columns across the left side instead of bunching them. */
#tbl { table-layout: fixed; }
.col-icon { width: 5%; } .col-id { width: 10%; } .col-item { width: 19%; }
.col-type { width: 13%; } .col-grade { width: 12%; }
.col-lvl { width: 6%; } .col-qty { width: 5%; }
.col-low { width: 10%; } .col-upd { width: 6%; } .col-trend { width: 14%; }
.db-table .col-icon { width: 5%; } .db-table .col-id { width: 9%; } .db-table .col-item { width: 20%; }
.db-table .col-type { width: 12%; } .db-table .col-grade { width: 11%; } .db-table .col-low { width: 11%; }
.db-table .col-listings { width: 8%; } .db-table .col-upd { width: 8%; } .db-table .col-trend { width: 16%; }

/* Boundary between item info (icon…qty) and marketplace info (Lowest/Updated/
   Trend): a vertical divider down the Lowest column, with breathing room. */
#tbl thead th.c-low, #tbl tbody td.c-low {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  padding-left: 20px;
}
#tbl tbody td.c-qty, #tbl thead th.c-qty { padding-right: 20px; }

#tbl thead th.c-spark { text-align: right; }
#tbl thead th.c-spark, #tbl tbody td.c-spark { cursor: default; }
.c-spark { padding-top: 4px; padding-bottom: 4px; }
.spark { display: block; width: 100%; max-width: 200px; height: 34px; margin-left: auto; }
.spark-empty { display: block; text-align: right; color: var(--text-dim); }
.spark-line { fill: none; stroke: var(--success); stroke-width: 1.5;
  stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--success); opacity: 0.1; }
.spark-cursor { fill: var(--success); stroke: var(--panel); stroke-width: 1.5;
  opacity: 0; transition: opacity 0.1s; }
.spark-cursor.on { opacity: 1; }
.c-spark:hover .spark-line { stroke-width: 2; }

.spark-tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 9px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 11px;
  white-space: nowrap;
}
.spark-tip.show { display: flex; }
.spark-tip b { color: var(--success); font-size: 12.5px; font-family: var(--mono); }
.spark-tip span { color: var(--text-dim); }
.c-upd .upd-mark { font-weight: 700; margin-right: 5px; }
.c-upd.f-ok .upd-mark { color: var(--success); }
.c-upd.f-stale .upd-mark { color: var(--warn); }
.upd-time { color: var(--text-dim); font-size: 11px; }

.icon-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.icon-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 45%, var(--glow), transparent 70%);
  opacity: 0.28;
  transition: opacity 0.2s, transform 0.2s;
}
tr:hover .icon-wrap::before { opacity: 0.6; transform: scale(1.12); }
.icon-wrap img { position: relative; width: 30px; height: 30px; image-rendering: -webkit-optimize-contrast; transition: transform 0.2s; }
tr:hover .icon-wrap img, .movers-row:hover .icon-wrap img { transform: scale(1.5); }

.db-empty { padding: 28px; text-align: center; color: var(--text-dim); }
.db-empty[hidden] { display: none; }
.status-line { font-size: 12px; color: var(--text-dim); min-height: 1em; }
.status-line.err { color: var(--danger); }

/* Footer -------------------------------------------------------------------- */
.site-footer {
  position: relative;
  margin-top: auto;            /* always pinned to the bottom of the page column */
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  min-height: 92px;            /* matches the sidebar foot so the divider lines align */
  color: var(--text-dim);
  font-size: 11.5px;
}
.site-stats {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: min(360px, 100%);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.58);
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.site-stats b {
  color: var(--text-muted);
  font-weight: 600;
}
.legal-actions {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(360px, 100%);
  margin-top: -10px;
}
.legal-action {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 18, 20, 0.5);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.legal-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
}
.legal-action:active { transform: translateY(1px); }
/* Animated pixel sprites standing on the footer divider line. */
.footer-mascots {
  position: absolute; left: 50%; top: 1px;
  transform: translate(-50%, -100%);
  display: flex; align-items: flex-end; gap: 16px;
  pointer-events: none; z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .6));
}
.mascot {
  flex: none; display: block;
  background-repeat: no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
  pointer-events: auto; cursor: pointer;
}
.mascot.sorcerer {
  width: 61px; height: 55px;
  background-image: url(/static/img/mascots/sorcerer.png);
  background-size: 976px 55px;
  animation: mascot-sorcerer 1.033s steps(16) infinite;
}
.mascot.hunter {
  width: 80px; height: 54px;
  background-image: url(/static/img/mascots/hunter.png);
  background-size: 1920px 54px;
  animation: mascot-hunter 2.05s steps(24) infinite;
}
.mascot.ranger {
  width: 67px; height: 55px;
  background-image: url(/static/img/mascots/ranger.png);
  background-size: 1072px 55px;
  animation: mascot-ranger 1.033s steps(16) infinite;
}
.mascot.skeleton {
  width: 40px; height: 44px;
  margin-bottom: 16px;
  background-image: url(/static/img/mascots/burning_skeleton.png);
  background-size: 960px 44px;
  animation: mascot-skeleton 2.133s steps(24) infinite, mascot-bob 2.4s ease-in-out infinite;
}
@keyframes mascot-sorcerer { from { background-position: 0 0; } to { background-position: -976px 0; } }
@keyframes mascot-hunter   { from { background-position: 0 0; } to { background-position: -1920px 0; } }
@keyframes mascot-ranger   { from { background-position: 0 0; } to { background-position: -1072px 0; } }
@keyframes mascot-skeleton { from { background-position: 0 0; } to { background-position: -960px 0; } }
@keyframes mascot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.footer-inner p { margin: 2px 0; }
.foot-link { color: var(--text-muted); border-bottom: 1px solid var(--border-strong); }
.foot-link:hover { color: var(--text); }
.dot { color: var(--text-faint); margin: 0 4px; }
.footer-credit .ai-credit { color: var(--text-muted); }
.claude-credit, .chatgpt-credit { display: inline; width: 13px; height: 13px; vertical-align: -2px; }

/* Modal --------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; }
.modal.show { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); }
.modal-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: 86vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-box h2 { margin: 0 0 16px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal-box h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.legal-modal .modal-box { width: min(720px, calc(100vw - 32px)); padding: 26px; }
.legal-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.legal-modal-head h2 { margin: 0; }
.legal-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -6px -6px 0 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.legal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.legal-copy { display: flex; flex-direction: column; gap: 11px; }
.legal-copy p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}
.legal-copy a {
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
}
.legal-copy a:hover { color: #fff; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.settings-version { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.btn {
  height: 36px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); }
.btn.primary {
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06));
  border-color: var(--border-strong);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 2px 10px rgba(0, 0, 0, 0.3);
}
.btn.primary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.09));
  border-color: var(--border-hover);
}
.btn.primary:active { transform: translateY(1px); }

/* Header icon buttons (settings gear) --------------------------------------- */
.gear-icon {
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
          mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E");
}

/* Database loading overlay (blur + spinner while the DB loads) --------------- */
.db-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(10, 10, 10, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 0.3s ease;
}
.db-loading.hide { opacity: 0; pointer-events: none; }
.db-loading[hidden] { display: none; }
.db-loading-gear {
  width: 34px;
  height: 34px;
  color: var(--text-dim);
  animation: db-spin 1.4s linear infinite;
}
.db-loading-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}
@keyframes db-spin { to { transform: rotate(360deg); } }

/* ===== Inventory (index) ==================================================== */
.toolbar .btn { flex-shrink: 0; }
.dropzone {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: var(--panel);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 24px;
}
.dropzone[hidden] { display: none; }
body.dragging .dropzone { border-color: var(--accent); background: var(--panel-hover); }
.dropzone-icon { color: var(--text-dim); }
.dropzone h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dropzone-hint { margin: 0; color: var(--text-muted); font-size: 13px; }
.dropzone-note { margin: 4px 0 0; color: var(--text-faint); font-size: 11.5px; }
#loadedState[hidden] { display: none; }
#loadedState { display: flex; flex-direction: column; gap: clamp(12px, 1.4vw, 20px); flex: 1; min-height: 0; }

/* Inventory grade breakdown inside the Items KPI card */
.grade-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.grade-bar[hidden] { display: none; }
.grade-bar i { display: block; height: 100%; }
.grade-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 10.5px; color: var(--text-dim); }
.grade-legend[hidden] { display: none; }
.grade-legend span { display: inline-flex; align-items: center; gap: 5px; }
.grade-legend .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ===== Market Movers ======================================================== */
.page-head { display: flex; flex-direction: column; gap: 4px; }
.page-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-size: clamp(18px, 1.6vw, 22px); font-weight: 600; letter-spacing: -0.015em; }
.page-head .page-sub { margin: 0; color: var(--text-dim); font-size: 12px; max-width: 80ch; }
.movers { flex: 1; min-height: 220px; }
.movers-meta { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.movers-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1;
  min-height: 0;
}
.movers-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.movers-col + .movers-col { border-left: 1px solid var(--border); }
.movers-col-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.movers-col-head.up { color: var(--success); }
.movers-col-head.down { color: var(--danger); }
.movers-col-count { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--text-dim); }
.movers-col-sub { margin-left: auto; font-weight: 400; font-size: 11px; color: var(--text-dim); }
.movers-list { overflow-y: auto; min-height: 0; flex: 1; }
.movers-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  transition: background 0.12s;
}
.movers-row:hover { background: rgba(255, 255, 255, 0.035); }
.movers-name { display: flex; flex-direction: column; min-width: 0; }
.movers-item { color: var(--text); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movers-grade { font-size: 11px; }
.movers-num { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.movers-price { color: var(--text); font-size: 12.5px; }
.movers-delta { font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.movers-delta.up { color: var(--success); }
.movers-delta.down { color: var(--danger); }
.movers-none { padding: 24px; text-align: center; color: var(--text-dim); font-size: 12px; }

/* ===== Leaderboard ========================================================== */
.auth-card { padding: 14px 20px; flex-shrink: 0; }
.lb-auth { display: flex; align-items: center; min-height: 36px; }
.lb-auth:empty { display: none; }
.lb-account { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; flex-wrap: wrap; }
.lb-who { display: flex; align-items: center; gap: 10px; }
.lb-avatar img { width: 34px; height: 34px; border-radius: 8px; display: block; }
.lb-name { font-weight: 600; }
.lb-actions { display: flex; align-items: center; gap: 10px; }
.btn.lb-logout { color: var(--text-dim); }
.btn.lb-logout:hover { color: var(--text); }
.btn.steam-btn { display: inline-flex; align-items: center; gap: 8px; }
.btn.steam-btn .steam-logo { flex: none; }
.lb-table thead th { cursor: default; }
/* Leaderboard has only 4 columns: drop the database's fixed full-width layout so
   columns size to content and sit close together instead of being stretched. */
#tbl.lb-table { table-layout: auto; width: auto; margin-inline: auto; }
.lb-table .c-rank { width: 56px; }
.lb-table .c-player { min-width: 160px; }
/* Center every header and cell so titles and their values line up centered. */
#tbl.lb-table thead th, #tbl.lb-table tbody td { text-align: center; }
.player-name { color: var(--text); }
.player-name:hover { color: #fff; text-decoration: underline; }
tr.lb-top .c-rank { font-weight: 700; }
tr.lb-top-1 .c-rank { color: #fcd34d; }
tr.lb-top-2 .c-rank { color: #d4d4d8; }
tr.lb-top-3 .c-rank { color: #d8a36b; }

/* ===== Support ============================================================== */
.support-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 22px);
  align-items: stretch;
}
.support-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(22px, 2.4vw, 36px);
}
.support-copy h2 { margin: 0 0 14px; font-size: clamp(20px, 2vw, 28px); font-weight: 600; letter-spacing: -0.02em; }
.support-copy p { margin: 0 0 10px; color: var(--text-muted); font-size: 13.5px; line-height: 1.65; }
.support-copy p:last-child { margin-bottom: 0; }
/* Donation buttons sit in a row under the text, pinned to the card bottom. */
.donation-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.donate-link {
  flex: 1 1 0;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-inner);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.donate-link:hover { border-color: var(--border-hover); background: var(--panel-hover); transform: translateY(-2px); }
.patreon-anim { width: 50px; height: 50px; border-radius: 10px; object-fit: contain; }
.patreon-name { font-weight: 600; font-size: 15px; }
.boosty-logo { height: 50px; }
.steam-trade-logo { height: 36px; }

/* Reserved block (same size) for the upcoming cursor-tracking animated chibi
   (tomari-guruguru). #chibiStage is where that widget will mount. */
.support-chibi {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(22px, 2.4vw, 36px);
  border-style: dashed;
}
.support-chibi-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  color: var(--text-faint);
  text-align: center;
}
.support-chibi-stage svg { color: var(--text-ghost, rgba(255,255,255,0.15)); }
.support-chibi-soon {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (max-width: 760px) {
  .support-layout { grid-template-columns: minmax(0, 1fr); }
  .support-chibi { min-height: 240px; }
}
@media (max-width: 720px) {
  .movers-cols { grid-template-columns: minmax(0, 1fr); }
  .movers-col + .movers-col { border-left: none; border-top: 1px solid var(--border); }
}

/* ===== About (/info) ======================================================== */
.about-card { flex: 1; min-height: 0; overflow-y: auto; padding: clamp(24px, 3vw, 48px); margin-bottom: 64px; justify-content: safe center; }
/* Centered column, content left-aligned. */
.about-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}
.about-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 24px; flex-wrap: wrap; }
.about-title { margin: 0; font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.about-prefs { display: flex; gap: 10px; }
.about-pref { display: flex; flex-direction: column; gap: 7px; min-width: 132px; }
.about-pref > span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-left: 2px;
}
.about-pref select {
  height: 34px;
  padding: 0 30px 0 12px;
  background: var(--panel) 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='%23ffffff' stroke-opacity='0.45' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.about-pref select:hover { border-color: var(--border-strong); background-color: var(--panel-hover); }
.about-pref select:focus-visible { outline: none; border-color: var(--border-hover); }
.about-pref select option { background: var(--panel); color: var(--text); }
.about-intro p { margin: 0 0 10px; color: var(--text-muted); font-size: 13.5px; line-height: 1.65; }
.about-intro p:last-child { margin-bottom: 0; }
.about-subhead { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); margin: 4px 0 0; }
.about-divider { width: 100%; height: 0; border: 0; border-top: 1px dashed var(--border-strong); margin: 6px 0; }
.about-contacts { display: flex; flex-direction: column; gap: 12px; }
.about-side-title { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.about-btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.about-link-btn, .about-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
}
.about-link-btn img { width: 16px; height: 16px; object-fit: contain; }
.about-support-btn { position: relative; overflow: visible; }
.about-heart { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: fill 0.2s, stroke 0.2s; }
.about-support-btn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.about-support-btn:hover .about-heart { fill: var(--danger); stroke: var(--danger); }

/* Pulsing red ring around the button (only on hover) */
.about-support-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 0%, transparent);
}
.about-support-btn:hover::after { animation: support-pulse 2s ease-out infinite; }
@keyframes support-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); }
  70%  { box-shadow: 0 0 0 10px color-mix(in srgb, var(--danger) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 0%, transparent); }
}

/* Floating hearts on hover */
.about-support-btn > .about-heart,
.about-support-btn > span[data-i18n] { position: relative; z-index: 1; }
.support-hearts {
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 70px;
  pointer-events: none;
  z-index: 2;
}
.support-hearts i {
  position: absolute;
  bottom: 0;
  width: 8px; height: 8px;
  background: var(--danger);
  opacity: 0;
  transform: rotate(-45deg);
}
.support-hearts i::before,
.support-hearts i::after {
  content: '';
  position: absolute;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
}
.support-hearts i::before { top: -4px; left: 0; }
.support-hearts i::after  { top: 0; left: 4px; }
.about-support-btn:hover .support-hearts i { animation: support-float 4s ease-in infinite; }
.support-hearts i:nth-child(1) { left: 18%; --drift: -6px; }
.support-hearts i:nth-child(2) { left: 34%; --drift: 5px; }
.support-hearts i:nth-child(3) { left: 50%; --drift: -4px; }
.support-hearts i:nth-child(4) { left: 64%; --drift: 7px; }
.support-hearts i:nth-child(5) { left: 78%; --drift: -5px; }
.support-hearts i:nth-child(6) { left: 44%; --drift: 6px; }
.about-support-btn:hover .support-hearts i:nth-child(1) { animation-delay: 0s;   animation-duration: 4.2s; }
.about-support-btn:hover .support-hearts i:nth-child(2) { animation-delay: 0.8s; animation-duration: 3.6s; }
.about-support-btn:hover .support-hearts i:nth-child(3) { animation-delay: 1.6s; animation-duration: 4.6s; }
.about-support-btn:hover .support-hearts i:nth-child(4) { animation-delay: 2.3s; animation-duration: 3.8s; }
.about-support-btn:hover .support-hearts i:nth-child(5) { animation-delay: 3s;   animation-duration: 5s; }
.about-support-btn:hover .support-hearts i:nth-child(6) { animation-delay: 1.2s; animation-duration: 4.4s; }
@keyframes support-float {
  0%   { opacity: 0; transform: translate(0, 0) rotate(-45deg) scale(0.5); }
  15%  { opacity: 0.9; }
  70%  { opacity: 0.7; }
  100% { opacity: 0; transform: translate(var(--drift, 4px), -64px) rotate(-45deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .about-support-btn::after { animation: none; }
  .about-support-btn:hover .support-hearts i { animation: none; }
}
/* Slide-out Support panel (toggled by support_modal.js on the About page).
   Overlays the stage region above the contacts; the trigger button stays
   exposed below so a re-click can toggle it closed. */
.about-stage { position: relative; display: flex; flex-direction: column; gap: 16px; }
.support-drawer {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  border: 2px dashed var(--danger);
  border-radius: var(--radius);
  background: var(--panel-inner);
  padding: clamp(18px, 2vw, 28px);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.support-drawer.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.support-drawer-inner { display: flex; flex-direction: column; gap: 14px; margin: auto 0; width: 100%; }
.support-drawer h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.support-drawer .donation-grid { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) {
  .support-drawer { transform: none; transition: opacity 0.22s ease; }
}

.about-meta { display: flex; flex-direction: column; gap: 8px; }
.about-disclaimer { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; margin: 0; }
.about-version { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

/* Support modal (support_modal.js) — a bit larger than Settings. */
.support-modal .modal-box { width: min(640px, calc(100vw - 32px)); padding: 28px; }
.support-modal-copy p { margin: 0 0 10px; color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.support-modal-copy p:last-child { margin-bottom: 0; }
.support-modal .donation-grid { margin: 18px 0 0; }

/* Legal buttons + cookie consent (legal.js) --------------------------------- */
.cookie-banner {
  position: fixed;
  left: calc(var(--sidebar-w) + var(--sidebar-gap) * 2);
  right: var(--content-pad);
  bottom: var(--sidebar-gap);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(18, 18, 20, 0.9);
  color: var(--text-muted);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.cookie-banner.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.cookie-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 1.45;
}
.cookie-copy strong { color: var(--text); font-size: 12.5px; font-weight: 600; }
.cookie-actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cookie-actions .btn { height: 30px; padding: 0 12px; font-size: 12px; }

/* Shared "site sections" list (About page + Settings modal) */
.about-sections { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.about-sections li { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.about-sec { color: var(--text); font-weight: 600; }
.info-inline-link { color: var(--text); border-bottom: 1px solid var(--border-strong); }
.info-inline-link:hover { color: #fff; }
@media (max-width: 760px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Site-wide status banner (status_banner.js) -------------------------------- */
.status-banner {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
  margin-bottom: 4px;
}
.status-banner-inner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 12.5px; }
.status-banner-text { flex: 1; }
.status-banner-close { font-size: 18px; line-height: 1; color: var(--text-dim); }
.status-banner-close:hover { color: var(--text); }
.status-banner.level-info    { border-color: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); }
.status-banner.level-warning { border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.status-banner.level-danger  { border-color: color-mix(in srgb, var(--danger) 40%, transparent); color: var(--danger); }

/* Stats hover card ---------------------------------------------------------- */
.stats-card {
  position: fixed;
  z-index: 120;
  width: 320px;
  max-width: calc(100vw - 24px);
  padding: 14px 16px;
  background: rgba(18, 18, 20, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.stats-card.show { opacity: 1; transform: translateY(0) scale(1); }
.card-head { display: flex; gap: 11px; align-items: center; margin-bottom: 10px; }
.card-icon { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.card-icon::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle, var(--glow), transparent 70%); opacity: 0.4; filter: blur(3px); }
.card-icon img { position: relative; width: 38px; height: 38px; }
.card-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.card-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.card-loading { color: var(--text-faint); font-style: italic; padding: 6px 0; }
.card-block { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; }
.card-block-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-faint); margin-bottom: 5px; }
.card-stat { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; font-size: 12px; color: var(--text-muted); }
.card-stat b { font-family: var(--mono); color: var(--success); font-weight: 500; }
.stat-tier { color: var(--text-dim); font-weight: 400; }
.stat-chance { color: var(--warn); }
.card-note { color: var(--text-dim); font-size: 11.5px; margin-bottom: 2px; }
.card-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-inner); border: 1px solid var(--border); border-radius: 7px; padding: 2px 7px; font-size: 11px; color: var(--text-muted); }
.chip-icon { width: 14px; height: 14px; object-fit: contain; }
.card-foot { margin-top: 9px; font-size: 11px; font-weight: 600; }
.card-foot.yes { color: var(--success); }
.card-foot.no { color: var(--danger); }

/* Mascot interaction particles (from mascots.js) ---------------------------- */
.heart-burst-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 9999; }
.heart-particle { position: absolute; width: 26px; height: 22px; will-change: transform, opacity; }
.heart-particle svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); }
.coin-particle {
  position: absolute; width: 68px; height: 68px;
  will-change: transform, opacity; image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 0 4px rgba(162, 59, 240, .95)) drop-shadow(0 0 9px rgba(162, 59, 240, .6));
}
.coin-particle img { width: 100%; height: 100%; display: block; }
.rare-banner {
  position: fixed; inset: 0; z-index: 9998; display: grid; place-items: center;
  padding: 20px; pointer-events: none; background: rgba(4, 3, 8, .62);
  animation: rare-banner-show 2s ease both;
}
.rare-banner img {
  display: block; max-width: min(760px, 92vw); max-height: 78vh; border-radius: 14px;
  border: 1px solid var(--border-strong); box-shadow: 0 22px 70px rgba(0, 0, 0, .72);
}
@keyframes rare-banner-show {
  0%, 100% { opacity: 0; transform: scale(.96); }
  10%, 88% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot { animation-play-state: paused !important; }
  .mascot.skeleton { animation: none; }
}

/* Responsive ---------------------------------------------------------------- */
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .side-nav {
    position: static;
    width: auto;
    margin: var(--sidebar-gap) var(--sidebar-gap) 0;
  }
  .side-shell { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .logo { margin: 0 auto 0 0; }
  .nav-group { flex-direction: row; flex-wrap: wrap; }
  .nav-divider, .nav-link svg { display: none; }
  .side-foot { width: 100%; margin-top: 8px; border-top: 0; flex-direction: row; justify-content: space-between; padding: 8px 0 0; }
  .side-shell.has-hint .side-foot { margin-top: 8px; }
  .side-hint { width: 100%; margin-top: 8px; order: 99; }
  .page { padding-left: var(--content-pad); padding-right: var(--content-pad); }
  .cookie-banner { left: var(--content-pad); }
}
@media (max-width: 640px) {
  .legal-actions { align-self: stretch; max-width: none; justify-content: flex-end; }
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; }
}
