/* HoloTrend design system. Mockup stylesheet: the Blazor app copies these tokens and components. */
@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..100,400..800&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap");

:root {
  /* Plum night (dark, default) */
  --bg: #1b1530;
  --surface: #251d40;
  --surface-2: #2f2652;
  --line: #3d3366;
  --text: #f1ecff;
  --muted: #a9a0c8;
  --marigold: #ffb627;
  --on-marigold: #1b1530;
  --accent-text: #ffb627;
  --up: #5fe0a8;
  --down: #ff7a93;
  --live: #ff4d6d;
  --focus: #9fd0ff;

  --display: "Bricolage Grotesque", "Zen Kaku Gothic New", system-ui, sans-serif;
  --body: "Zen Kaku Gothic New", system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r-chip: 999px; --r-cover: 6px; --r-panel: 14px;
  --page: 1240px;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #efecf8; --surface: #ffffff; --surface-2: #e4dff3; --line: #d3cce9;
    --text: #1b1530; --muted: #5e567f; --accent-text: #8a5200;
    --up: #0b7d50; --down: #bf2c4c; --live: #d4204a; --focus: #2a5bd7;
  }
}
:root[data-theme="light"] {
  --bg: #efecf8; --surface: #ffffff; --surface-2: #e4dff3; --line: #d3cce9;
  --text: #1b1530; --muted: #5e567f; --accent-text: #8a5200;
  --up: #0b7d50; --down: #bf2c4c; --live: #d4204a; --focus: #2a5bd7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--body);
}
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-stretch: 85%; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; font-stretch: 95%; }
p { margin: 0; max-width: 68ch; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--s4); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Site header ---------- */
.site-head { border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: var(--s5); min-height: 64px; flex-wrap: wrap; }
.brand { font: 800 1.5rem/1 var(--display); font-stretch: 75%; text-decoration: none; display: flex; align-items: baseline; gap: 2px; }
.brand b { background: var(--marigold); color: var(--on-marigold); padding: 2px 6px 3px; border-radius: 4px; }
.nav { display: flex; gap: var(--s4); flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; padding: 6px 2px; color: var(--muted); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -3px 0 var(--marigold); }
.head-actions { display: flex; gap: var(--s2); align-items: center; }

/* ---------- Buttons and chips ---------- */
.btn {
  font: 700 0.95rem/1 var(--body); padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn.primary { background: var(--marigold); color: var(--on-marigold); border-color: transparent; }
.btn.quiet { background: transparent; }
.btn.small { padding: 7px 11px; font-size: 0.85rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 0.82rem/1 var(--body); padding: 6px 10px; border-radius: var(--r-chip);
  border: 1px solid var(--line); background: transparent; color: var(--muted); white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.chip.owned { color: var(--text); border-color: var(--muted); }
.chip.free { color: var(--up); border-color: currentColor; }

/* ---------- Movement marks ---------- */
.move { font: 700 0.85rem/1 var(--body); display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.move.up { color: var(--up); } .move.down { color: var(--down); } .move.same { color: var(--muted); }
.move.new { background: var(--up); color: var(--bg); padding: 3px 7px; border-radius: 4px; font-size: 0.72rem; }
.rising { font: 700 0.72rem/1 var(--body); color: var(--accent-text); border: 1px solid currentColor; padding: 3px 7px; border-radius: 4px; }

/* ---------- Covers and avatars (placeholders: real art is hot-linked in the app) ---------- */
.cover {
  --h: 280; aspect-ratio: 3 / 4; border-radius: var(--r-cover);
  background: linear-gradient(160deg, hsl(var(--h) 55% 42%), hsl(calc(var(--h) + 40) 60% 24%));
  color: #fff; font: 700 0.62rem/1.15 var(--display); padding: 6px; display: flex; align-items: flex-end;
  overflow: hidden; flex: none;
}
.avatars { display: flex; }
.avatar {
  --h: 200; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: hsl(var(--h) 60% 70%); color: #1b1530; border: 2px solid var(--bg);
  font: 700 0.68rem/26px var(--body); text-align: center; margin-left: -8px;
}
.avatars .avatar:first-child { margin-left: 0; }
.avatar.more { background: var(--surface-2); color: var(--text); }
.avatar.lg { width: 96px; height: 96px; font-size: 2rem; line-height: 92px; margin: 0; }

/* ---------- 7-day strip: one bar per day, height = members who played ---------- */
.strip { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.strip i { width: 9px; background: var(--muted); opacity: 0.55; border-radius: 2px 2px 0 0; height: calc(var(--v) * 1%); min-height: 2px; }
.strip i:last-child { background: var(--marigold); opacity: 1; }
.strip.big { height: 120px; gap: 6px; } .strip.big i { width: 100%; flex: 1; }

/* ---------- Day bar and filters ---------- */
.daybar { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s6) 0 var(--s4); }
.daybar .pager { display: flex; gap: var(--s2); }
.filters { display: flex; gap: var(--s5); flex-wrap: wrap; align-items: center; padding: var(--s3) 0 var(--s5); }
.filters .group { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.filters .label { font-size: 0.85rem; color: var(--muted); }

/* ---------- Layout ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: var(--s4); }
.panel + .panel { margin-top: var(--s4); }
.panel h3 { margin-bottom: var(--s3); display: flex; justify-content: space-between; align-items: baseline; }
.section { padding: var(--s7) 0 0; }
.section > h2 { margin-bottom: var(--s2); }
.section > .lede { color: var(--muted); margin-bottom: var(--s4); }

/* ---------- The chart: signature element ---------- */
.top {
  background: var(--marigold); color: var(--on-marigold); border-radius: var(--r-panel);
  display: grid; grid-template-columns: auto 132px minmax(0, 1fr); gap: var(--s5); padding: var(--s5); align-items: center;
}
.top .rank { font: 800 11rem/0.78 var(--display); font-stretch: 75%; letter-spacing: -0.04em; }
.top h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; }
.top h2 a { text-decoration: none; } .top h2 a:hover { color: inherit; text-decoration: underline; }
.top .why { margin: var(--s2) 0 var(--s3); font-weight: 500; }
.top .row-meta { display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.top .move.up, .top .move.down { color: var(--on-marigold); }
.top .chip { color: var(--on-marigold); border-color: rgb(27 21 48 / 0.45); }
.top .chip.owned { border-color: var(--on-marigold); font-weight: 700; }
.top .avatar { border-color: var(--marigold); }
.top .strip i { background: var(--on-marigold); opacity: 0.35; } .top .strip i:last-child { opacity: 1; }
.top .btn { background: var(--on-marigold); color: #f1ecff; border-color: transparent; }

.chart { list-style: none; margin: var(--s3) 0 0; padding: 0; }
.chart li {
  display: grid; align-items: center; gap: var(--s4);
  grid-template-columns: 56px 52px 48px minmax(0, 1fr) 84px 118px; row-gap: var(--s2);
  padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line);
}
.chart li > .rank, .chart li > .move, .chart li > .cover { grid-row: 1 / span 2; }
.chart li > .info { align-self: end; }
.chart li > .strip, .chart li > .avatars { grid-row: 1 / span 2; }
.chart li > .chips { grid-column: 4; grid-row: 2; align-self: start; }
.chart .rank { font: 800 2.6rem/1 var(--display); font-stretch: 75%; text-align: right; }
.chart .title { font: 700 1.08rem/1.2 var(--display); font-stretch: 95%; text-decoration: none; display: block; }
.chart .sub { font-size: 0.85rem; color: var(--muted); }
.chart li.unowned { opacity: 0.42; }
.chart li.unowned .title::after { content: " (not on your platforms)"; font: 400 0.8rem var(--body); }

/* ---------- Side lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: var(--s3); align-items: center; padding: var(--s2) 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .cover { width: 34px; font-size: 0; }
.list .what { flex: 1; min-width: 0; }
.list .what b { display: block; font-weight: 700; line-height: 1.25; }
.list .what span { font-size: 0.83rem; color: var(--muted); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); flex: none; }
@media (prefers-reduced-motion: no-preference) { .live-dot { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Shelves ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4); }
.shelf a { text-decoration: none; display: block; }
.shelf .cover { width: 100%; font-size: 0.9rem; padding: 10px; }
.shelf b { display: block; margin-top: var(--s2); line-height: 1.25; }
.shelf span { font-size: 0.83rem; color: var(--muted); }

/* ---------- Detail pages ---------- */
.hero { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s6); padding: var(--s6) 0; align-items: end; }
.hero .cover { width: 200px; font-size: 1.1rem; padding: 14px; }
.hero .facts { display: flex; gap: var(--s6); flex-wrap: wrap; margin: var(--s4) 0; }
.fact b { font: 800 2.2rem/1 var(--display); font-stretch: 75%; display: block; }
.fact span { font-size: 0.85rem; color: var(--muted); }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
table.plain { width: 100%; border-collapse: collapse; }
table.plain th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.85rem; padding: var(--s2); border-bottom: 1px solid var(--line); }
table.plain td { padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tablewrap { overflow-x: auto; }
.who { display: flex; gap: var(--s2); align-items: center; }
.who .avatar { margin: 0; border: 0; line-height: 30px; }

/* ---------- Forms ---------- */
.form { max-width: 760px; }
fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: var(--s5) 0; }
legend { font: 700 1.2rem var(--display); padding: 0; float: left; width: 100%; margin-bottom: var(--s1); }
fieldset > p { clear: both; color: var(--muted); margin-bottom: var(--s3); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s2); clear: both; }
.check { display: flex; gap: var(--s2); align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.check:has(input:checked) { border-color: var(--marigold); box-shadow: inset 0 0 0 1px var(--marigold); }
.check input { accent-color: var(--marigold); width: 18px; height: 18px; }
input[type="search"], input[type="text"], select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; min-width: 0;
}
.savebar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: var(--s3) 0; display: flex; gap: var(--s3); align-items: center; }

/* ---------- Admin queue ---------- */
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s5); align-items: center; }
.match .guess { display: flex; gap: var(--s3); align-items: center; }
.match .guess .cover { width: 54px; font-size: 0; }
.conf { font: 800 1.4rem/1 var(--display); }
.conf.low { color: var(--down); } .conf.mid { color: var(--accent-text); }
.quote { font-size: 0.92rem; border-left: 3px solid var(--line); padding-left: var(--s3); color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot { margin-top: var(--s8); border-top: 1px solid var(--line); padding: var(--s5) 0 var(--s7); font-size: 0.88rem; color: var(--muted); }
.site-foot .wrap { display: flex; gap: var(--s5); justify-content: space-between; flex-wrap: wrap; }
.sample { background: var(--surface-2); font-size: 0.82rem; text-align: center; padding: 6px var(--s4); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1020px) {
  .chart li { grid-template-columns: 44px 48px 44px minmax(0, 1fr) 84px; }
  .chart li > .avatars { display: none; }
  .match { grid-template-columns: 1fr; gap: var(--s3); }
}
@media (max-width: 640px) {
  .top { grid-template-columns: auto minmax(0, 1fr); gap: var(--s4); padding: var(--s4); }
  .top .rank { font-size: 6rem; }
  .top > .cover { width: 84px; justify-self: end; grid-column: 2; grid-row: 1; }
  .top > .body { grid-column: 1 / -1; }
  .chart li { grid-template-columns: 34px 40px minmax(0, 1fr) auto; gap: var(--s3); }
  .chart li > .strip { display: none; }
  .chart .rank { font-size: 1.9rem; }
  .chart li > .move { grid-column: 4; grid-row: 1; }
  .chart li > .cover { grid-column: 2; }
  .chart li > .info { grid-column: 3; grid-row: 1; }
  .chart li > .chips { grid-column: 3 / -1; }
  .hero { grid-template-columns: 110px minmax(0, 1fr); gap: var(--s4); align-items: start; }
  .hero .cover { width: 110px; font-size: 0.8rem; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: var(--s2); overflow-x: auto; flex-wrap: nowrap; }
}

/* Chart rows without rank and movement (member page) */
.chart.simple li { grid-template-columns: 48px minmax(0, 1fr) 84px auto; }
.chart.simple li > .cover, .chart.simple li > .strip, .chart.simple li > .info { grid-row: auto; grid-column: auto; align-self: center; }
@media (max-width: 640px) { .chart.simple li { grid-template-columns: 40px minmax(0, 1fr) auto; } }
