@font-face { font-family: Inter; src: url('/fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url('/fonts/Inter-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0d0e10;
  --surface: #17181b;
  --surface-2: #202226;
  --surface-3: #2a2c31;
  --border: #2e3036;
  --border-strong: #42454d;
  --text: #f2f3f5;
  --muted: #9a9ea6;
  --faint: #62656d;
  --gold: #f1c40f;
  --gold-soft: rgba(241, 196, 15, 0.12);
  --stattrak: #e07a3f;
  --souvenir: #ffd700;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(241, 196, 15, 0.09), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(13, 14, 16, 0.82); border-bottom: 1px solid var(--surface-2); backdrop-filter: blur(12px); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: baseline; font-weight: 700; font-size: 23px; letter-spacing: -0.02em; line-height: 1; }
.brand .mark { transition: box-shadow 0.2s ease, filter 0.2s ease; }
.brand:hover .mark { filter: brightness(1.08); box-shadow: 0 0 18px rgba(241, 196, 15, 0.55); }
/* The gold tile hugs the "d" at the same size as "mon", so the two read as one word. */
.brand .mark {
  display: inline-block; padding: 3px 4px 4px; margin-right: 1px; border-radius: 7px;
  background: linear-gradient(135deg, #f7d54a, #d9a400); color: #1a1500;
  box-shadow: 0 3px 12px rgba(241, 196, 15, 0.3);
}
.topbar .search { margin-left: auto; width: min(340px, 52vw); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; white-space: nowrap;
  background: linear-gradient(135deg, #f7d54a, #e0ad00); color: #1a1500; box-shadow: 0 4px 14px rgba(241, 196, 15, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(241, 196, 15, 0.35); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--muted); font-weight: 700; font-size: 14px; padding: 7px 10px; border-radius: 9px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.topbar .btn { margin-left: auto; }
.topbar .search + .btn { margin-left: 0; }
.cta { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.cta a { color: var(--gold); font-weight: 700; }
.cta a:hover { text-decoration: underline; }

/* ---------- Search ---------- */
.search { position: relative; }
.search input {
  width: 100%; padding: 10px 14px 10px 40px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239a9ea6' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.search input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.search input::-webkit-search-cancel-button { filter: invert(0.6); }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20;
  list-style: none; margin: 0; padding: 6px; display: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.suggestions.open { display: block; }
.suggestions a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; }
.suggestions a:hover, .suggestions a.active { background: var(--surface-3); }
.suggestions .empty { padding: 8px 10px; color: var(--muted); }

.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); }

/* ---------- Home ---------- */
.hero { padding: 84px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(36px, 7vw, 60px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -0.04em; }
.hero h1 span { background: linear-gradient(135deg, #fbe17a, #f1c40f 45%, #d9a400); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 0 auto 30px; max-width: 460px; }
.hero .search { max-width: 520px; margin: 0 auto; text-align: left; }
.hero .search input { padding: 15px 18px 15px 44px; font-size: 16px; border-radius: 14px; background-position: 16px center; }
.hint { color: var(--faint); font-size: 13px; margin-top: 10px; }

.totals { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.total { background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius); padding: 16px 18px; text-align: center; }
.total .num { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.total .label { color: var(--muted); font-size: 13px; }

.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 28px 0 56px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--surface-2); border-radius: 18px; padding: 18px; }
.panel h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; transition: border-color 0.15s, background 0.15s; min-width: 0; }
a.row:hover { border-color: var(--border-strong); background: var(--surface-3); }
.row .rank { width: 26px; text-align: center; font-weight: 700; color: var(--faint); flex: none; }
.row .rank.top { color: var(--gold); }
.row .main { min-width: 0; flex: 1; }
.row .title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amount { font-weight: 700; white-space: nowrap; }
.row .swatch { width: 4px; align-self: stretch; border-radius: 4px; background: var(--rarity); flex: none; }
.empty-note { color: var(--muted); padding: 14px 4px; text-align: center; }

/* ---------- Profile ---------- */
.profile { position: relative; margin: 28px 0 20px; padding: 26px; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--surface-2); }
.profile::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 220px at 0% 0%, color-mix(in srgb, var(--accent, var(--gold)) 22%, transparent), transparent 70%); pointer-events: none; }
.profile-head { position: relative; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-head .avatar { width: 76px; height: 76px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--accent, var(--gold)) 70%, transparent); }
.profile-head h1 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
.profile-head .since { color: var(--muted); font-size: 14px; }
.stats { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 22px; }
.stat { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--surface-3); border-radius: 12px; padding: 12px 14px; min-width: 0; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; }
.stat .value { font-weight: 700; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value.accent { color: var(--accent, var(--gold)); }

.tabs { display: flex; gap: 4px; padding: 4px; max-width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--surface-2); border-radius: 12px; width: fit-content; margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 8px 14px; white-space: nowrap; color: var(--muted); cursor: pointer; border-radius: 9px; font-weight: 700; }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--surface-3); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input[type="search"], .toolbar select { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background-color: var(--surface); outline: none; }
.toolbar input[type="search"] { flex: 1 1 220px; }
.toolbar select { cursor: pointer; }
.toolbar input[type="search"]:focus, .toolbar select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.toolbar .count { color: var(--muted); margin-left: auto; white-space: nowrap; font-size: 14px; }

/* ---------- Item cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; text-align: left; min-width: 0; padding: 10px 12px 12px;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--rarity) 30%, transparent) 0%, transparent 70%), var(--surface);
  border: 1px solid var(--surface-2); border-radius: var(--radius); cursor: pointer; overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rarity); }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rarity) 55%, var(--border)); box-shadow: 0 12px 28px color-mix(in srgb, var(--rarity) 18%, transparent); }
.card .id { position: absolute; top: 9px; left: 9px; font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(0, 0, 0, 0.5); padding: 2px 7px; border-radius: 6px; }
.card .art { position: relative; height: 116px; display: grid; place-items: center; margin: 16px 0 8px; }
.card .art img { max-width: 100%; max-height: 116px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); transition: transform 0.2s; }
.card:hover .art img { transform: scale(1.05); }
.card .stickers { position: absolute; left: 0; bottom: -2px; display: flex; gap: 2px; }
.card .stickers img { width: 26px; height: 26px; object-fit: contain; filter: none; }
.card .quality { font-size: 11px; font-weight: 700; min-height: 16px; letter-spacing: 0.02em; }
.card .name { font-weight: 700; line-height: 1.3; font-size: 14px; }
.card .skin { color: #d6d8dc; font-size: 13px; line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 12px; margin-top: auto; padding-top: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .meta .price { color: var(--text); font-weight: 700; font-size: 14px; }
.quality.stattrak { color: var(--stattrak); }
.quality.souvenir { color: var(--souvenir); }

/* Loading placeholders */
.skeleton { border-radius: var(--radius); height: 230px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } .card, .card .art img { transition: none; } }

.slot-empty { border: 2px dashed var(--surface-3); border-radius: var(--radius); display: grid; place-items: center; color: var(--faint); min-height: 230px; font-weight: 700; font-size: 22px; }
.showcase { margin-bottom: 36px; }
.showcase-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.showcase h2 { font-size: 20px; margin: 0; letter-spacing: -0.02em; }
.showcase .sub { color: var(--muted); font-size: 13px; }
.showcase .grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .showcase .grid { grid-template-columns: repeat(2, 1fr); } }

.notice { color: var(--muted); padding: 48px 0; text-align: center; }
.loader { height: 1px; }

/* ---------- Item details ---------- */
dialog {
  width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto;
  border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); }
.detail-art { position: relative; display: grid; place-items: center; height: 240px; background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--rarity) 50%, transparent) 0%, transparent 65%), var(--surface-2); border-bottom: 3px solid var(--rarity); }
.detail-art img { max-width: 82%; max-height: 200px; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.5)); }
.detail-body { padding: 20px 22px 22px; }
.detail-body h2 { margin: 2px 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; }
.detail-body .rarity { color: var(--rarity); font-weight: 700; font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin: 18px 0; }
.facts div { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.facts a:hover { color: var(--gold); }
.float-bar { position: relative; height: 8px; border-radius: 4px; margin: 4px 0 20px; background: linear-gradient(90deg, #3fae5a 0 7%, #8ec63f 7% 15%, #e7c64a 15% 38%, #e78a3a 38% 45%, #d9493b 45% 100%); }
.float-bar span { position: absolute; top: -5px; width: 4px; height: 18px; background: #fff; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--surface); }
.detail-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.detail-stickers div { background: var(--surface-2); border-radius: 12px; padding: 10px 8px; text-align: center; font-size: 12px; }
.detail-stickers img { width: 68px; height: 68px; object-fit: contain; margin: 0 auto 6px; }
.detail-stickers .muted { color: var(--muted); }
.close { position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, 0.55); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1; color: var(--text); }
.close:hover { background: rgba(0, 0, 0, 0.8); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--surface-2); color: var(--faint); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 24px; }

@media (max-width: 860px) { .columns { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .card .art { height: 86px; }
  .card .art img { max-height: 86px; }
  .totals { gap: 8px; }
  .total { padding: 12px 8px; }
  .total .num { font-size: 20px; }
  .topbar .btn { padding: 8px 12px; font-size: 13px; }
  .topbar .search { width: auto; flex: 1; }
  .profile { padding: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat:last-child:nth-child(odd) { grid-column: span 2; }
  .stat .value { font-size: 17px; }
  .hero { padding-top: 56px; }
}
.profile-skeleton { height: 120px; }

/* ---------- Leaderboards ---------- */
.page-head { padding: 40px 0 18px; }
.page-head h1 { margin: 0 0 4px; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.03em; }
.page-head p { margin: 0; color: var(--muted); }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; margin-bottom: 56px; }
.board { background: var(--surface); border: 1px solid var(--surface-2); border-radius: 18px; padding: 16px; min-width: 0; }
.board h2 { margin: 0; font-size: 16px; }
.board .about { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.board .row { padding: 8px 10px; gap: 10px; }
.board .avatar { width: 28px; height: 28px; }
.row .rank.first { color: #f1c40f; }
.row .rank.second { color: #c9d1d9; }
.row .rank.third { color: #d08a4c; }
.amount.positive { color: #4ade80; }
.amount.negative { color: #f87171; }
@media (max-width: 560px) {
  .nav { margin-left: 2px; }
  .nav a { padding: 6px 8px; font-size: 13px; }
  .boards { grid-template-columns: minmax(0, 1fr); }
}

.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.see-all { color: var(--gold); font-size: 13px; font-weight: 700; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }
.back { display: inline-block; color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 24px; }
.back:hover { color: var(--text); }
.board-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.board-tools .search { flex: 1 1 280px; max-width: 420px; }
.board-tools .count { color: var(--muted); font-size: 14px; }
.board-full { margin-bottom: 16px; }
.row.highlight { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface-2)); box-shadow: 0 0 0 3px var(--gold-soft); }
.row .rank { min-width: 26px; width: auto; }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin: 0 0 56px; flex-wrap: wrap; }
.pager button { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; cursor: pointer; font-weight: 700; }
.pager button:hover:not(:disabled) { border-color: var(--border-strong); }
.pager button:disabled { opacity: 0.4; cursor: default; }
.pager .where { color: var(--muted); font-size: 14px; padding: 0 6px; }
@media (prefers-reduced-motion: reduce) { .brand .mark { transition: none; } }

/* ---------- Charts ---------- */
.chart-wrap { background: var(--surface-2); border-radius: 12px; padding: 12px 12px 4px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 4px; flex-wrap: wrap; }
.chart-head .positive { color: #4ade80; font-weight: 700; }
.chart-head .negative { color: #f87171; font-weight: 700; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-axis { fill: var(--faint); font-size: 12px; font-family: Inter, sans-serif; }
.chart-dot { opacity: 0; transition: opacity 0.15s; }
.chart:hover .chart-dot { opacity: 1; }
.chart-empty { color: var(--muted); font-size: 13px; background: var(--surface-2); border-radius: 12px; padding: 14px; margin: 0; }
.section-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 18px 0 8px; }
.highlights { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 0 0 22px; }
.highlight-card { background: var(--surface); border: 1px solid var(--surface-2); border-radius: 18px; padding: 16px; min-width: 0; }
.highlight-card h2 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.highlight-card h2 span { color: var(--muted); font-weight: 400; font-size: 13px; }
.featured { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.featured .card { padding: 6px 8px 8px; }
.featured .card .art { height: 64px; margin: 12px 0 4px; }
.featured .card .art img { max-height: 64px; }
.featured .card .name, .featured .card .skin { font-size: 12px; }
.featured .card .meta { font-size: 11px; }
@media (max-width: 860px) { .highlights { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .featured { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Recent big pulls ---------- */
.feed { margin-top: 12px; }
.feed .section-title { margin-top: 20px; }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.feed-grid .empty-note { grid-column: 1 / -1; background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius); }
.feed-grid .meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 32px 0 12px; }

.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #4ade80; text-transform: uppercase; letter-spacing: 0.08em; }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .live::before { animation: none; } }
#recent { max-height: 560px; overflow-y: auto; }
@media (max-width: 1080px) { .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .columns { grid-template-columns: minmax(0, 1fr); } }

/* Stands */
.stand-card { position: relative; padding: 34px 14px 14px; border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--rarity) 22%, var(--surface)), var(--surface)); border: 1px solid var(--surface-2); overflow: hidden; }
.stand-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rarity); }
.stand-card.aura { border-color: color-mix(in srgb, var(--rarity) 60%, var(--surface-2)); }
.stand-card .id { position: absolute; top: 9px; left: 9px; font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(0, 0, 0, 0.5); padding: 2px 7px; border-radius: 6px; }
.stand-card .team { position: absolute; top: 9px; right: 9px; font-size: 11px; font-weight: 700; color: #1e1f22; background: var(--gold); padding: 2px 7px; border-radius: 6px; }
.stand-card .tier { font-size: 12px; font-weight: 700; color: var(--rarity); }
.stand-card .name { font-weight: 800; font-size: 17px; margin-top: 2px; }
.stand-card .skin { font-size: 12px; color: var(--muted); }
.stand-card .grades, .detail-body .grades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.stand-card .grades div, .detail-body .grades div { background: rgba(0, 0, 0, 0.25); border-radius: 8px; padding: 5px 0; text-align: center; }
.stand-card .grades dt, .detail-body .grades dt { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.stand-card .grades dd, .detail-body .grades dd { margin: 0; font-weight: 800; font-size: 16px; }
.stand-card .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.stand-card .meta .price { color: var(--rarity); font-weight: 700; }
@media (max-width: 430px) {
  .topbar .wrap { gap: 8px; }
  .topbar .btn { padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  .nav { margin-left: 0; }
  .nav a { padding: 6px 6px; }
}
/* Phones: the top bar wraps into two rows, the logo and links on top and the search and Invite button
   underneath, so the page never gets wider than the screen. */
@media (max-width: 560px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; row-gap: 10px; column-gap: 8px; }
  .topbar .search { flex: 1 0 calc(100% - 100px); }
  .topbar .btn { margin-left: auto; }
}
.tabs { scrollbar-width: none; }
@media (max-width: 560px) {
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 8px 4px; font-size: 13px; }
}

/* Stand database */
.stand-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.stand-tools .tabs { margin-bottom: 0; }
.stand-tools input[type="search"] { flex: 1; min-width: 180px; max-width: none; background: var(--surface); border: 1px solid var(--surface-2); border-radius: 12px; padding: 10px 14px; color: var(--text); font: inherit; }
.stand-tools input[type="search"]:focus { outline: none; border-color: var(--gold); }
.stand-entry { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.stand-entry:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rarity) 55%, var(--surface-2)); }
.stand-entry .team { background: color-mix(in srgb, var(--rarity) 80%, #fff); }
dialog .detail-body { position: relative; }
.close.plain { background: var(--surface-2); }
.stand-section .muted-line, .move .muted-line { color: var(--muted); font-size: 13px; margin: 0; }
/* Elements: what a stand's moves hit with and what hurts it or doesn't, as chips (like the m!stand card). */
.elements { display: flex; flex-direction: column; gap: 8px; }
.element-row { display: flex; align-items: center; gap: 10px; }
.element-row .kind { flex: none; width: 76px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.el-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--rarity) 55%, transparent); font-size: 13px; font-weight: 700; line-height: 1.3; }
.moves { display: flex; flex-direction: column; gap: 6px; }
.move { background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.move-head { display: flex; justify-content: space-between; gap: 8px; }
.move-head span { color: var(--muted); font-size: 13px; font-weight: 700; }
.btn .short { display: none; }
@media (max-width: 430px) {
  .btn .long { display: none; }
  .btn .short { display: inline; }
}
@media (min-width: 561px) { .detail-body .grades { grid-template-columns: repeat(6, 1fr); } }
.detail-body .row .sub { white-space: normal; }

/* Rows that open a window instead of a page */
button.row { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.row:hover { border-color: var(--border-strong); background: var(--surface-3); }
.section-title .section-link { margin-left: auto; font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--gold); }
.section-title:has(.section-link) { display: flex; align-items: baseline; gap: 12px; }

/* Database / Guide switch */
.subnav { margin-bottom: 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-radius: 9px; font-weight: 700; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.tabs a:hover { color: var(--text); }

/* One stand copy */
.stand-hero { position: relative; padding: 22px 22px 18px; background: linear-gradient(150deg, color-mix(in srgb, var(--rarity) 34%, var(--surface)), var(--surface)); border-bottom: 3px solid var(--rarity); }
.stand-hero .tier { font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--rarity) 70%, #fff); }
.stand-hero h2 { margin: 4px 40px 2px 0; font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; }
/* The Part tab: "PART 5" on a slanted band in the rarity colour, reaching the window's corner, then the name. */
.part-tab { display: flex; align-items: center; gap: 12px; margin: -22px 0 12px -22px; }
.part-tab .band { background: var(--rarity); color: var(--rarity-ink, #fff); font-size: 13px; font-weight: 800; letter-spacing: 0.04em; padding: 7px 28px 7px 22px; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
.part-tab .part-name { font-size: 14px; font-weight: 700; color: color-mix(in srgb, var(--text) 82%, transparent); }
.stand-hero .owner { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 700; }
.stand-hero .owner:hover { color: var(--gold); }
.avatar.small { width: 24px; height: 24px; }
.stand-overview { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; align-items: center; }
.stand-overview .facts { margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radar { width: 100%; max-width: 240px; margin: 0 auto; display: block; }
.radar-ring { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 1; }
.radar-label { fill: var(--muted); font-size: 11px; font-weight: 700; }
.radar-grade { fill: var(--text); font-size: 17px; font-weight: 800; }
.xp { margin: 14px 0 4px; }
.xp-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.xp-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.xp-bar span { display: block; height: 100%; background: var(--rarity); border-radius: 4px; }
@media (max-width: 560px) {
  .stand-overview { grid-template-columns: minmax(0, 1fr); }
}

/* Guide */
.guide { background: var(--surface); border: 1px solid var(--surface-2); border-radius: 18px; padding: 8px 22px 22px; margin-bottom: 56px; }
.guide h2 { font-size: 20px; margin: 16px 0 4px; }
.guide h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 20px 0 8px; }
.guide p { margin: 6px 0; line-height: 1.55; }
.guide code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; font-size: 0.92em; }
.guide-section + .guide-section { border-top: 1px solid var(--surface-2); margin-top: 14px; }
.guide-rows { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 0; }
.guide-rows div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; }
.guide-rows dt { font-weight: 800; }
.guide-rows dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .guide-rows div { grid-template-columns: minmax(0, 1fr); gap: 2px; } .guide { padding: 6px 16px 18px; } }
.totals .total { flex: 1 1 104px; }

/* Inventory filters: search on its own line, then one dropdown per filter */
.toolbar input[type="search"] { flex-basis: 100%; }
.toolbar .filters { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 auto; }
.toolbar .filters select { flex: 1 1 130px; min-width: 0; }
.clear-filters { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.clear-filters:hover { border-color: var(--gold); }
.clear-filters[hidden] { display: none; }
.stat-link { text-align: left; font: inherit; color: inherit; cursor: pointer; }
.stat-link:hover { border-color: var(--border-strong); background: rgba(255, 255, 255, 0.06); }
@media (max-width: 560px) { .toolbar .count { margin-left: 0; } }

/* Stand database dropdowns */
.stand-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.stand-filters select { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--surface-2); background-color: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.stand-filters select:focus { outline: none; border-color: var(--gold); }
@media (max-width: 560px) { .stand-filters { width: 100%; } .stand-tools input[type="search"] { max-width: none; } }

/* Filter menus with checkboxes */
details.multi { position: relative; flex: 1 1 130px; min-width: 0; }
details.multi summary { list-style: none; cursor: pointer; padding: 10px 30px 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
details.multi summary::-webkit-details-marker { display: none; }
details.multi summary::after { content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
details.multi.active summary { border-color: var(--gold); color: var(--gold); font-weight: 700; }
details.multi[open] summary { border-color: var(--gold); }
.multi-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 100%; width: max-content; max-width: min(300px, 80vw); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); }
.multi-menu label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.multi-menu label:hover { background: var(--surface-2); }
.multi-menu input[type="checkbox"] { flex: none; accent-color: var(--gold); width: 16px; height: 16px; min-width: 0; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }

.stand-tools .stand-filters { flex: 1 1 100%; }
.stand-filters details.multi summary { border-color: var(--surface-2); }
.stand-filters select { flex: 1 1 130px; min-width: 0; }
.multi-menu label { justify-content: flex-start; text-align: left; font-weight: 600; }
.multi-menu label span { flex: 1; }

/* Evolved stands: their rarity colour flowing into the evolved blue */
:root { --evolved: #3fd0d4; }
.stand-card.evolved { background: linear-gradient(155deg, color-mix(in srgb, var(--rarity) 26%, var(--surface)) 0%, var(--surface) 55%, color-mix(in srgb, var(--evolved) 24%, var(--surface)) 100%); border-color: color-mix(in srgb, var(--evolved) 35%, var(--surface-2)); }
.stand-card.evolved::after { background: linear-gradient(90deg, var(--rarity), var(--evolved)); height: 4px; }
.stand-card.evolved .tier { background: linear-gradient(90deg, var(--rarity), var(--evolved)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stand-card.evolved:hover { box-shadow: 0 10px 28px color-mix(in srgb, var(--evolved) 22%, transparent); }
.stand-hero.evolved { background: linear-gradient(140deg, color-mix(in srgb, var(--rarity) 36%, var(--surface)), color-mix(in srgb, var(--evolved) 32%, var(--surface))); border-image: linear-gradient(90deg, var(--rarity), var(--evolved)) 1; }
.stand-hero.evolved .tier { background: linear-gradient(90deg, color-mix(in srgb, var(--rarity) 70%, #fff), var(--evolved)); -webkit-background-clip: text; background-clip: text; color: transparent; width: fit-content; }
.more-filters { margin-top: 8px; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.more-filters[hidden] { display: none; }

/* Profile stats: six across on wide screens; best pull and best stand take two tiles each */
@media (min-width: 1100px) { .stats { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 700px) and (max-width: 1099px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 699px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat.wide { grid-column: span 2; }
.card .card-owner { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Stand cards: the same layout on every card ---------- */
/* The name always takes two lines' space and the part line one, so grades and the bottom line sit at
   the same height on every card in a row. */
.stand-card { display: flex; flex-direction: column; }
.stand-card .tier, .stand-card .skin { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand-card .name { line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stand-card .meta { margin-top: auto; align-items: baseline; }
.stand-card .meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stand-card > *:not(.id):not(.team):not(.badges) { position: relative; z-index: 1; }
.stand-card .id, .stand-card .team, .stand-card .badges { z-index: 2; }

/* ---------- Aura finishes ----------
   Every card's base colour is its rarity (fading into the evolved blue for evolved stands). An aura is a finish
   laid over it, so a Gilded Common still reads blue and a Gilded Legendary gold, as on the m!stand card. */
.stand-card.aura::before, .stand-hero.aura::before { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.stand-card.aura .tier { color: color-mix(in srgb, var(--rarity) 80%, #fff); }
.stand-card.aura::after { background: var(--rarity); height: 4px; }
.stand-card.evolved.aura::after { background: linear-gradient(90deg, var(--rarity), var(--evolved)); }

/* Inverted: pale, tinted by the rarity, with dark text and a rarity border. */
.stand-card.aura-inverted { background: linear-gradient(160deg, color-mix(in srgb, var(--rarity) 34%, #d6d8de), color-mix(in srgb, var(--rarity) 20%, #8f929b)); border: 2px solid color-mix(in srgb, var(--rarity) 75%, #fff); color: #121317; }
.stand-card.aura-inverted.evolved { background: linear-gradient(160deg, color-mix(in srgb, var(--rarity) 34%, #d6d8de), color-mix(in srgb, var(--evolved) 28%, #a3a7b0)); }
.stand-card.aura-inverted .skin, .stand-card.aura-inverted .meta, .stand-card.aura-inverted .grades dt { color: #2a2c31; }
.stand-card.aura-inverted .grades div { background: rgba(0, 0, 0, 0.1); }
.stand-card.aura-inverted .id { background: rgba(0, 0, 0, 0.16); color: #1f2024; }
.stand-card.aura-inverted .tier { color: color-mix(in srgb, var(--rarity) 60%, #000); }
.stand-card.aura-inverted .meta .price { color: #121317; }

/* Gilded: a gold border, and a gold shine sweeping across from off the card to off the card. */
.stand-card.aura-gilded { border-color: color-mix(in srgb, var(--rarity) 35%, #d4af37); box-shadow: 0 0 16px rgba(212, 175, 55, 0.16); }
.stand-card.aura-gilded::before, .stand-hero.aura-gilded::before { background: linear-gradient(110deg, transparent 30%, rgba(255, 223, 120, 0.24) 50%, transparent 70%); transform: translateX(-110%); animation: aura-sweep 5s ease-in-out infinite; }
.stand-card.aura-gilded .grades div { box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.22); }

/* Shadow: the rarity colour darkened almost to black, with drifting glows in that colour (and in the evolved
   blue for evolved stands). */
.stand-card.aura-shadow { background: radial-gradient(130% 90% at 50% 0%, color-mix(in srgb, var(--rarity) 26%, #08080a) 0%, #060607 75%); border-color: color-mix(in srgb, var(--rarity) 45%, #000); box-shadow: 0 0 22px color-mix(in srgb, var(--rarity) 22%, transparent), inset 0 0 30px rgba(0, 0, 0, 0.8); }
.stand-card.aura-shadow.evolved { background: radial-gradient(80% 60% at 100% 100%, color-mix(in srgb, var(--evolved) 28%, transparent), transparent 70%), radial-gradient(130% 90% at 50% 0%, color-mix(in srgb, var(--rarity) 26%, #08080a) 0%, #060607 75%); border-color: color-mix(in srgb, var(--evolved) 40%, #000); }
.stand-card.aura-shadow::before { background: radial-gradient(60% 40% at 20% 85%, color-mix(in srgb, var(--rarity) 24%, transparent), transparent 70%), radial-gradient(50% 35% at 85% 30%, color-mix(in srgb, var(--rarity) 18%, transparent), transparent 70%); animation: aura-drift 7s ease-in-out infinite alternate; }
.stand-card.aura-shadow .name { color: color-mix(in srgb, var(--rarity) 35%, #fff); text-shadow: 0 0 14px color-mix(in srgb, var(--rarity) 70%, transparent); }
.stand-card.aura-shadow .grades div { background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rarity) 14%, transparent); }

/* Prismatic: a turning rainbow border and a holographic sheen over the rarity colour, both shifted per stand. */
@property --aura-turn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.stand-card.aura-prismatic { --prism: conic-gradient(from calc(var(--aura-turn) + var(--aura-shift, 0deg)), #ff6b6b, #ffd93d, #6bff95, #4ecdc4, #6b8bff, #c56bff, #ff6b6b); border: 2px solid transparent; background: linear-gradient(160deg, color-mix(in srgb, var(--rarity) 22%, var(--surface)), var(--surface)) padding-box, var(--prism) border-box; animation: aura-turn 6s linear infinite; }
.stand-card.aura-prismatic.evolved { background: linear-gradient(155deg, color-mix(in srgb, var(--rarity) 26%, var(--surface)) 0%, var(--surface) 55%, color-mix(in srgb, var(--evolved) 24%, var(--surface)) 100%) padding-box, var(--prism) border-box; }
.stand-card.aura-prismatic::before, .stand-hero.aura-prismatic::before { background: linear-gradient(120deg, rgba(255, 107, 107, 0.14), rgba(255, 217, 61, 0.12), rgba(107, 255, 149, 0.12), rgba(78, 205, 196, 0.14), rgba(107, 139, 255, 0.14), rgba(197, 107, 255, 0.14)); background-size: 300% 300%; filter: hue-rotate(var(--aura-shift, 0deg)); animation: aura-holo 8s ease-in-out infinite alternate; }

/* Evolved stands stay recognisable under any aura: a badge, and the rarity-to-blue stripe. */
.stand-card .badges { position: absolute; top: 9px; right: 9px; display: flex; gap: 4px; z-index: 2; }
.stand-card .badges .team { position: static; }
.evo-badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #04282a; background: linear-gradient(90deg, color-mix(in srgb, var(--rarity) 60%, #fff), var(--evolved)); }

/* The stand window's header gets the same finish over its rarity colour. */
.stand-hero.aura-inverted { background: linear-gradient(140deg, color-mix(in srgb, var(--rarity) 34%, #d6d8de), color-mix(in srgb, var(--rarity) 20%, #8f929b)); color: #121317; }
.stand-hero.aura-inverted.evolved { background: linear-gradient(140deg, color-mix(in srgb, var(--rarity) 34%, #d6d8de), color-mix(in srgb, var(--evolved) 28%, #a3a7b0)); }
.stand-hero.aura-inverted .part-tab .part-name, .stand-hero.aura-inverted .owner { color: #2e3036; }
.stand-hero.aura-inverted .tier { color: color-mix(in srgb, var(--rarity) 60%, #000); }
.stand-hero.aura-gilded { border-bottom-color: color-mix(in srgb, var(--rarity) 35%, #d4af37); }
.stand-hero.aura-shadow { background: radial-gradient(130% 130% at 50% 0%, color-mix(in srgb, var(--rarity) 30%, #08080a), #060607 75%); }
.stand-hero.aura-shadow.evolved { background: radial-gradient(70% 90% at 100% 100%, color-mix(in srgb, var(--evolved) 26%, transparent), transparent 70%), radial-gradient(130% 130% at 50% 0%, color-mix(in srgb, var(--rarity) 30%, #08080a), #060607 75%); }
.stand-hero.aura-shadow h2 { text-shadow: 0 0 16px color-mix(in srgb, var(--rarity) 70%, transparent); }
.stand-hero.aura-prismatic { border-image: linear-gradient(90deg, #ff6b6b, #ffd93d, #6bff95, #4ecdc4, #6b8bff, #c56bff) 1; }
.stand-hero > *:not(.close) { position: relative; z-index: 1; }

@keyframes aura-sweep { 0% { transform: translateX(-110%); } 55%, 100% { transform: translateX(110%); } }
@keyframes aura-drift { from { transform: translate(-4%, 2%); opacity: 0.8; } to { transform: translate(4%, -3%); opacity: 1; } }
@keyframes aura-turn { to { --aura-turn: 360deg; } }
@keyframes aura-holo { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
  .stand-card.aura::before, .stand-card.aura-prismatic, .stand-hero.aura::before { animation: none; }
}
