/* ============================================================================
   CoopQueue — dark-first UI.
   Chart colours come from a validated categorical palette: the four player
   hues clear the CVD-separation, normal-vision and 3:1 contrast gates against
   the #1a1a19 surface. Do not re-pick them by eye.
   ========================================================================== */
/* Only the wordmark uses this small, self-hosted glyph subset. Keep product UI
   in the native font and preserve the font's accompanying OFL license. */
@font-face {
  font-family: 'IWannaPlay Manrope';
  src: url('/brand/manrope-wordmark-650.woff2') format('woff2');
  font-style: normal;
  font-weight: 650;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --plane:        #0d0d0d;   /* page background */
  --surface-1:    #1a1a19;   /* cards, panels, chart surface */
  --surface-2:    #232322;   /* raised: inputs, hover */
  --text-primary: #ffffff;
  --text-secondary:#c3c2b7;
  --text-muted:   #898781;
  --gridline:     #2c2c2a;
  --baseline:     #383835;
  --border:       rgba(255,255,255,0.10);

  /* categorical — fixed order, one hue per person, never cycled */
  --series-1: #3987e5;  /* blue    */
  --series-2: #d95926;  /* orange  */
  --series-3: #199e70;  /* aqua    */
  --series-4: #c98500;  /* yellow  */
  --series-5: #d55181;  /* magenta */
  --series-6: #008300;  /* green   */
  --series-7: #9085e9;  /* violet  */
  --series-8: #e66767;  /* red     */

  --good:     #0ca30c;
  --warning:  #fab219;
  --serious:  #ec835a;
  --critical: #d03b3b;

  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--plane);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
[hidden] { display: none !important; }
code { font-size: .88em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
kbd {
  font: inherit; font-size: .78em; background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--text-secondary);
}

/* ─────────────────────────── buttons & inputs ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 550; font-size: 14px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-primary);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { background: #2c2c2a; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.btn-primary { background: var(--series-1); border-color: transparent; color: #fff; }
.btn-primary:hover { background: #4d94ea; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-icon { padding: 6px 10px; background: transparent; border-color: transparent; font-size: 16px; }
.btn-steam { background: #1b2838; border-color: #2a475e; padding: 13px 26px; font-size: 16px; }
.btn-steam:hover { background: #24384f; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.input {
  font: inherit; font-size: 14px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary);
  min-width: 0;
}
.input:focus { outline: 2px solid var(--series-1); outline-offset: -1px; border-color: transparent; }
.input-lg { font-size: 16px; padding: 12px 16px; width: 100%; }

/* ─────────────────────────── sign-in / claim ──────────────────────────── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.gate-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px;
  padding: 44px 40px; text-align: center; max-width: 440px; box-shadow: var(--shadow);
}
.gate-card-wide { max-width: 620px; }
.gate-title { font-size: 34px; letter-spacing: -.02em; }
.gate-sub { color: var(--text-secondary); margin: 10px 0 28px; }
.gate-fine { color: var(--text-muted); font-size: 12.5px; margin: 18px 0 0; }
.gate-error {
  margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: rgba(208,59,59,.12); border: 1px solid rgba(208,59,59,.4);
  color: #f4b4b4; font-size: 13.5px; text-align: left;
}
.claim-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 12px; margin-bottom: 20px; }
.claim-opt {
  padding: 18px 12px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font: inherit; color: var(--text-primary);
  display: grid; gap: 4px; transition: border-color .12s, background .12s;
}
.claim-opt:hover { border-color: var(--series-1); background: #2c2c2a; }
.claim-opt b { font-size: 18px; }
.claim-opt span { font-size: 12.5px; color: var(--text-muted); }

/* ───────────────────────────── chrome ─────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 20px; background: rgba(13,13,13,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* icon.png is 348×246, not a square app icon. Height sets its scale; natural
   width and contain prevent the controller from stretching at any breakpoint. */
.brand {
  display: inline-flex; align-items: center; gap: 11px; flex: none;
  color: #f4f4f5; text-decoration: none; white-space: nowrap;
}
.brand:visited { color: #f4f4f5; }
.brand:focus-visible { outline: 2px solid var(--series-1); outline-offset: 6px; border-radius: 3px; }
.brand-logo { display: block; flex: none; height: 28px; width: auto; object-fit: contain; }
.brand-name {
  color: inherit; font-family: 'IWannaPlay Manrope', var(--font); font-size: 21px;
  font-weight: 650; font-synthesis: none; line-height: 1.1; letter-spacing: -.035em;
}
.landing-top .brand { gap: 13px; }
.landing-top .brand-name { font-size: clamp(26px, 3vw, 32px); }
.landing-top .brand-logo { height: clamp(34px, 3.8vw, 42px); }
/* On a narrow phone the name competes with the group switcher and the tab row.
   Keep the recognisable controller at a readable size. */
@media (max-width: 560px) {
  .topbar > .brand { margin-right: 0; }
  .topbar .brand-name { display: none; }
  /* Leave room for the natural-width mark and all three account controls,
     including on browsers with a visible scrollbar. Truncate the group name. */
  .topbar .group-btn { max-width: min(200px, calc(100vw - 232px)); }
  .topbar .brand-logo {
    height: 24px; width: auto;
  }
}
.tabs { display: flex; gap: 2px; }
.tab {
  font: inherit; font-size: 14px; font-weight: 550; padding: 7px 14px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--text-secondary); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { background: var(--surface-2); color: var(--text-primary); }
.tab[aria-current="page"] { background: var(--surface-2); color: var(--text-primary); }
.pill {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: var(--series-1); color: #fff; min-width: 20px; text-align: center;
}
.pill:empty { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.activity-bell { position: relative; min-width: 40px; min-height: 40px; padding: 8px; }
.activity-count { position: absolute; top: -6px; right: -8px; padding: 1px 5px; }
.activity-panel {
  position: fixed; top: var(--activity-top, 64px); right: var(--activity-right, 16px);
  z-index: 30; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 600px);
  display: flex; flex-direction: column; background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.activity-head h3 { margin: 0; font-size: 16px; }
.activity-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.activity-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px 12px; }
.activity-tools > span { font-size: 12px; color: var(--text-muted); }
.activity-status { margin: 0; padding: 0 16px; font-size: 13px; color: var(--text-secondary); }
.activity-status:not(:empty) { padding-bottom: 16px; }
.activity-retry { align-self: flex-start; margin: 0 16px 16px; }
.activity-list { overflow-y: auto; overscroll-behavior: contain; }
.activity-item {
  display: block; width: 100%; padding: 14px 16px; text-align: left; font: inherit;
  background: transparent; color: var(--text-primary); border: 0; border-top: 1px solid var(--border);
  cursor: pointer; line-height: 1.5;
}
.activity-item:hover, .activity-item:focus-visible { background: var(--surface-2); }
.activity-item.is-unread { box-shadow: inset 3px 0 var(--series-1); }
.activity-item small { display: block; margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.add-game-btn { gap: 5px; }
.account { position: relative; }
.account-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  font: inherit; font-size: 14px; font-weight: 550; color: var(--text-primary);
  background: transparent; border: 1px solid transparent; border-radius: 999px; cursor: pointer;
}
.account-btn:hover, .account-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.account-btn:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.account-btn img, .account-initial {
  width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--surface-2);
}
.account-initial {
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--text-secondary);
}
.account-initial[hidden] { display: none; }
.account-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; min-width: 200px;
  max-width: calc(100vw - 32px); padding: 6px; display: grid; gap: 2px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.account-who { margin: 0; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.account-who strong { display: block; }
.account-who span { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.account-who span:empty { display: none; }
.account-item {
  display: block; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px;
  color: var(--text-primary); text-decoration: none;
}
.account-item:hover, .account-item:focus-visible { background: var(--surface-2); outline: none; }

.banner {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
  padding: 11px 20px; font-size: 13.5px; border-bottom: 1px solid var(--border);
}
.banner-warn { background: rgba(250,178,25,.10); color: #f2d79a; }

.main { max-width: 1180px; margin: 0 auto; padding: 26px 20px 80px; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

.view-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 20px; }
.view-head h2 { font-size: 22px; }
.view-sub { color: var(--text-secondary); font-size: 13.5px; margin: 6px 0 0; max-width: 62ch; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* The Library carries seven filters — far more than any other view. Beside the
   heading they wrap onto a second line at every realistic width, so here they get
   the full width and slightly tighter controls. Still allowed to wrap: this buys a
   single row on a desktop, it does not force one on a phone. */
[data-view="library"] .view-head { flex-direction: column; align-items: stretch; gap: 14px; }
[data-view="library"] .filters { gap: 6px; }
[data-view="library"] .filters .input { font-size: 13px; padding: 6px 9px; }
[data-view="library"] .filters #lib-search { flex: 1 1 140px; max-width: 240px; }
/* Icon-only, because as a labelled button it was the one control that pushed the
   row onto a second line — and it is a secondary action that only ever appears
   once you have already changed something. */
[data-view="library"] .filters #lib-reset { flex: none; align-self: stretch; padding: 0 10px; font-size: 15px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-secondary); cursor: pointer; }

.empty { text-align: center; padding: 80px 20px; color: var(--text-secondary); }
.empty h2 { font-size: 22px; color: var(--text-primary); margin-bottom: 8px; }
.empty p { max-width: 46ch; margin: 0 auto 20px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
/* A truly empty workspace has no useful controls or zero-filled charts. Keep the
   view itself reachable, but replace its normal contents with ways to begin (or
   restore an archived game). Filtered-empty and fully-rated libraries do not use
   this state. */
.view.is-library-empty > :not(.empty-library) { display: none; }

/* ────────────────────────── rating queue ──────────────────────────────── */
.queue-complete {
  max-width: 740px; margin: 28px auto; padding: clamp(32px, 6vw, 56px) 24px;
  text-align: center; border: 1px solid rgba(143,224,143,.2); border-radius: 18px;
  background: radial-gradient(ellipse at 50% 0, rgba(12,163,12,.12), transparent 65%), var(--surface-1);
  box-shadow: var(--shadow); animation: queue-complete-in .4s ease-out;
}
.queue-complete-mark { width: 120px; height: 100px; margin: 0 auto 16px; }
.queue-complete-mark svg { width: 100%; height: 100%; }
.queue-complete-mark circle { fill: rgba(12,163,12,.12); stroke: rgba(143,224,143,.3); }
.queue-complete-check { stroke: #8fe08f; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.queue-complete-spark { stroke: var(--warning); stroke-width: 2; stroke-linecap: round; }
.queue-complete-mark .queue-complete-dot { fill: var(--series-1); stroke: none; }
.queue-complete-kicker { margin: 0 0 10px; color: #8fe08f; font-size: 12px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.queue-complete h2 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -.025em; }
#queue-empty-copy { max-width: 49ch; margin: 16px auto 0; color: var(--text-secondary); }
.queue-complete-recap { margin: 22px 0 26px; color: var(--text-secondary); font-size: 13px; }
.queue-complete-skipped { margin-top: 20px; font-size: 13px; }
@keyframes queue-complete-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .queue-complete { animation: none; }
}
.rate-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow);
}
/* Fixed height, not aspect-ratio: an aspect-ratio box that hits max-height shrinks
   its width too and leaves a gap beside the card. */
/* overflow:hidden is load-bearing. The media box has a fixed height, but a
   <video> is a replaced element that sizes itself from the stream's intrinsic
   aspect ratio, and inside `place-items: center` it is not bound by the box —
   height:100% resolved to 448px in a 243px container on a short window, so the
   trailer covered the game's title and the first lines of its description. */
.rate-media { position: relative; height: min(48vh, 400px); background: #000; display: grid; place-items: center; overflow: hidden; }
/* Nothing to show: collapse to a slim strip instead of a viewport-eating black void. */
.rate-media.is-blank { height: auto; min-height: 64px; padding: 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.rate-media.is-blank .no-trailer { position: static; background: none; padding: 0; text-align: center; }
/* Pinned to the box rather than laid out in it, so the intrinsic aspect ratio of
   the stream can never decide how tall this gets. */
.rate-media video, .rate-media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.rate-media video { object-fit: contain; background: #000; }
/* The blank state has no video or image, so it lays out normally again. */
.rate-media.is-blank { display: block; }
.no-trailer {
  position: absolute; inset: auto 12px 12px auto; font-size: 12px; color: var(--text-secondary);
  background: rgba(0,0,0,.7); padding: 5px 10px; border-radius: 999px;
}
.rate-body { padding: 22px 26px 26px; }
.rate-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.rate-head h2 { font-size: 26px; letter-spacing: -.02em; }
.rate-progress {
  font-size: 13px; color: var(--text-muted); white-space: nowrap;
  font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px;
}
/* Sits beside the queue position because going back IS queue navigation, not one
   of the answers — keeping it out of the action row means a stray click cannot
   undo the rating you just gave. */
.rate-back {
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer;
  /* Sized as a tap target rather than to the glyph: at 3px padding it came out
     33x23, which is a miss waiting to happen on a phone. */
  min-height: 32px; min-width: 38px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-secondary);
}
.rate-back:hover { color: var(--text-primary); border-color: var(--text-muted); }
.rate-back:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.chip {
  font-size: 12px; font-weight: 550; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.chip-good { background: rgba(12,163,12,.14); border-color: rgba(12,163,12,.45); color: #8fe08f; }
.chip-bad  { background: rgba(208,59,59,.14); border-color: rgba(208,59,59,.45); color: #f0a3a3; }
.chip-warn { background: rgba(250,178,25,.13); border-color: rgba(250,178,25,.42); color: #f2d79a; }
.rate-desc { color: var(--text-secondary); font-size: 14.5px; margin: 16px 0 0; max-width: 72ch; }
.callout {
  margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13.5px;
  background: rgba(250,178,25,.09); border-left: 3px solid var(--warning); color: #f2d79a;
}
.others { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.other-vote {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  padding: 4px 11px 4px 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.other-vote b { font-variant-numeric: tabular-nums; }

.rate-controls { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.score-display { display: flex; align-items: baseline; gap: 12px; }
.score-display output { font-size: 46px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.score-hint { color: var(--text-muted); font-size: 13.5px; }
.slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 20px 0 6px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--series-1); border: 3px solid var(--surface-1); cursor: grab;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--series-1);
  border: 3px solid var(--surface-1); cursor: grab;
}
.slider:focus-visible { outline: 2px solid var(--series-1); outline-offset: 4px; }
.score-ticks {
  display: flex; justify-content: space-between; font-size: 11.5px;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.rate-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.kbd-hint { font-size: 12px; color: var(--text-muted); margin: 14px 0 0; }

/* "Would you play it again?" — sits between the group's opinions and your own
   score, because it is context for the number you are about to give. */
.replay-ask { display: grid; gap: 8px; margin: 4px 0 2px; }
.replay-ask-label { font-size: 13px; color: var(--text-secondary); margin: 0; }
.replay-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.replay-opts .seg { border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; }
.replay-opts .seg.is-on { border-color: rgba(57,135,229,.55); }
.replay-reveal { justify-self: start; margin: 4px 0 2px; }

/* ─────────────────────────── regular sessions ─────────────────────────── */
/* The strip sits under the topbar on every view. It wraps rather than truncates:
   on a phone the answer buttons drop to their own line, which is still one tap. */
.session-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  padding: 8px 20px; font-size: 13.5px; color: var(--text-secondary);
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.strip-label {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted);
}
.strip-when strong { color: var(--text-primary); font-weight: 600; }
.strip-rel { margin-left: 6px; color: var(--text-muted); }
.strip-out { color: #f2d79a; }
.strip-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.strip-answer .seg { padding: 4px 10px; font-size: 12.5px; }
.strip-answer .seg[data-strip-answer="out"].is-on { background: rgba(208,59,59,.22); color: #f0a3a3; }
.strip-answer .seg[data-strip-answer="maybe"].is-on { background: rgba(250,178,25,.18); color: #f2d79a; }

.session-panel .panel-head { flex-wrap: wrap; }
.session-rule { font-size: 13px; color: var(--text-secondary); }
.session-empty { margin: 0 0 10px; font-size: 13.5px; color: var(--text-secondary); }
/* Wide groups scroll inside the panel, never the page; the session column stays put. */
.session-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.session-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.session-table th, .session-table td { padding: 7px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--gridline); }
.session-table thead th {
  border-top: 0; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted); white-space: nowrap;
}
.session-table tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--surface-1);
  font-weight: 550; white-space: nowrap; color: var(--text-primary);
}
.session-table tbody th small { display: block; font-weight: 400; color: var(--text-muted); font-size: 12px; }
.session-person { display: inline-flex; align-items: center; gap: 6px; }
.attend {
  font: inherit; font-size: 12.5px; padding: 4px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-secondary);
}
.attend:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }
.attend-out { background: rgba(208,59,59,.16); border-color: rgba(208,59,59,.45); color: #f0a3a3; }
.attend-maybe { background: rgba(250,178,25,.12); border-color: rgba(250,178,25,.42); color: #f2d79a; }
.attend-src { display: block; margin-top: 3px; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.session-crew { white-space: nowrap; color: var(--text-secondary); }
.session-crew .btn { margin-left: 6px; padding: 3px 8px; font-size: 12.5px; }
.session-more { margin-top: 8px; font-size: 13px; }
.session-edit { display: block; margin-top: 4px; font-size: 12px; }
.session-table tbody th small.session-moved { color: #f2d79a; }
.session-table tr.is-cancelled th { color: var(--text-muted); }
.session-off { color: var(--text-muted); font-style: italic; }
.strip-off { margin-left: 6px; color: #f0a3a3; }
.session-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
#session-dialog { width: min(480px, calc(100vw - 32px)); }

.poll-list { display: grid; gap: 8px; margin: 0 0 16px; }
.poll-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 13.5px;
}
.poll-card.is-open { border-color: rgba(57,135,229,.45); }
.poll-card-sub { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-secondary); }
.poll-todo { color: #f2d79a; }
.poll-slots { display: grid; gap: 10px; margin-bottom: 10px; }
.poll-slot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.poll-slot .detail-field { flex: 1 1 140px; }
.pc-cantmake { margin-top: 14px; }
#poll-create-dialog { width: min(520px, calc(100vw - 32px)); }
.poll-share {
  margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.poll-share.is-new { border-color: rgba(12,163,12,.5); }
.poll-share label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.poll-share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.poll-share-row .input { flex: 1 1 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.poll-table tr.is-best th, .poll-table tr.is-chosen th { color: #8fe08f; }
.session-table tbody th small.poll-best { color: #8fe08f; }
.vote { display: inline-block; min-width: 2.5em; font-size: 12.5px; color: var(--text-muted); }
.vote-yes { color: #8fe08f; }
.vote-maybe { color: #f2d79a; }
.vote-no { color: #f0a3a3; }
select.vote-yes { background: rgba(12,163,12,.14); border-color: rgba(12,163,12,.45); }
select.vote-maybe { background: rgba(250,178,25,.12); border-color: rgba(250,178,25,.42); }
select.vote-no { background: rgba(208,59,59,.16); border-color: rgba(208,59,59,.45); }
/* Native selects size to their longest option, and only the "keep it" row has
   "Can't make it": a fixed width keeps every column the same. */
.poll-table select.vote-select { width: 8.5em; }
.vote-out { color: var(--text-muted); font-style: italic; }
select.vote-out { background: rgba(208,59,59,.10); border-color: rgba(208,59,59,.35); color: #f0a3a3; font-style: italic; }
.poll-table .session-crew .btn { display: block; margin: 4px 0 0; }
.poll-table tbody th { white-space: normal; min-width: 120px; max-width: 220px; }
.poll-add { margin-top: 12px; }
.poll-add summary { cursor: pointer; font-size: 13.5px; color: var(--text-secondary); margin-bottom: 8px; }

.away-block { margin-top: 14px; }
.away-block summary { cursor: pointer; font-size: 13.5px; color: var(--text-secondary); }
.away-block[open] summary { margin-bottom: 10px; }
.away-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }
.away-form .input { min-width: 140px; }
.away-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.away-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.away-list li > span { flex: 1; min-width: 0; }
.away-list small { color: var(--text-muted); }

.crew-note { margin: 8px 0 0; font-size: 12.5px; color: var(--text-muted); }
.link-btn {
  font: inherit; padding: 0; border: 0; background: none; color: var(--series-1);
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}

.weekday-pick { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.weekday-pick legend {
  display: block; margin-bottom: 7px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
}
.weekday-pick:disabled .attendee { cursor: default; opacity: .7; }
.schedule-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.schedule-fields .sch-zone { grid-column: span 2; }
.schedule-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

@media (max-width: 720px) {
  .session-strip { padding: 8px 14px; }
  .strip-actions { margin-left: 0; }
  .schedule-fields .sch-zone { grid-column: auto; }
}

/* ───────────────────────────── play next ──────────────────────────────── */
.attendee-filter { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.attendee-filter legend {
  display: block; margin-bottom: 7px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted);
}
.attendee-list { display: flex; gap: 7px; flex-wrap: wrap; }
.attendee {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1);
  color: var(--text-secondary); font-size: 13px; cursor: pointer;
}
.attendee:has(input:checked) { border-color: rgba(57,135,229,.55); color: var(--text-primary); }
.attendee input { margin: 0; }
.budget-filter {
  display: grid; grid-template-columns: auto minmax(140px, 260px) auto; gap: 12px;
  align-items: center; margin: 0 0 18px;
}
.budget-filter label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted);
}
.budget-filter output { font-size: 13px; font-weight: 600; color: var(--text-primary); }
/* The note explains what was hidden, so it spans the row rather than squeezing
   in beside the slider. */
.budget-filter .view-sub { grid-column: 1 / -1; margin: 0; }
.budget-filter .view-sub:empty { display: none; }
@media (max-width: 560px) {
  .budget-filter { grid-template-columns: minmax(0,1fr) auto; }
  .budget-filter label { grid-column: 1 / -1; }
}
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-row {
  display: grid; grid-template-columns: 40px 92px minmax(0,1fr) auto; gap: 16px; align-items: center;
  padding: 13px 16px; border-radius: var(--radius); background: var(--surface-1);
  border: 1px solid var(--border); cursor: pointer; transition: border-color .12s, background .12s;
}
.rank-row:hover { border-color: #3a3a38; background: #1f1f1e; }
.rank-num { font-size: 17px; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: center; }
.rank-art {
  display: block; width: 92px; aspect-ratio: 460 / 215; border-radius: 5px;
  object-fit: cover; background: var(--surface-2);
}
.rank-art-none { border: 1px solid var(--border); }
.rank-art-small { width: 58px; border-radius: 4px; }
.rank-main { min-width: 0; }
.rank-name { font-weight: 600; font-size: 15.5px; }
.rank-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 5px; }
.rank-score { text-align: right; }
.rank-score b { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.rank-score span { display: block; font-size: 11.5px; color: var(--text-muted); }
.unviable-block { margin-top: 34px; }
.unviable-block h3 { font-size: 15px; margin-bottom: 4px; }
.unviable-block p { color: var(--text-secondary); font-size: 13.5px; margin: 0 0 14px; }
.unviable-row {
  display: flex; justify-content: space-between; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; border-radius: var(--radius); background: rgba(208,59,59,.06);
  border: 1px solid rgba(208,59,59,.25); margin-bottom: 6px; font-size: 14px;
}
.unviable-game { display: inline-flex; gap: 10px; align-items: center; }
.unviable-row .why { color: #f0a3a3; font-size: 13px; text-align: right; }

/* ───────────────────────────── library ────────────────────────────────── */
.history-card {
  margin-bottom: 16px; padding: 18px 20px; overflow: hidden;
  border: 1px solid rgba(57,135,229,.38); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(57,135,229,.10), rgba(181,91,207,.05));
}
.history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.history-head h3 { font-size: 16px; }
.history-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 12.5px; }
.history-count {
  flex: none; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-secondary); background: rgba(13,13,13,.35); font-size: 11.5px;
}
.history-item {
  display: grid; grid-template-columns: 176px minmax(0,1fr); gap: 16px; align-items: center;
  margin-top: 16px;
}
.history-art {
  display: grid; place-items: center; width: 176px; height: 82px; object-fit: cover;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted);
  font-size: 20px; font-weight: 650;
}
.history-copy h4 { margin: 7px 0 2px; font-size: 18px; }
.history-copy > p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }
.history-suggestion {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-top: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm); background: rgba(13,13,13,.30);
}
.history-suggestion strong { font-size: 15px; color: #f2d79a; }
.history-suggestion span, .history-no-suggestion, .history-target {
  color: var(--text-muted) !important; font-size: 11.5px !important;
}
.history-no-suggestion { margin-top: 7px !important; }
.history-target { margin-top: 6px !important; }
.history-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.fact-source.is-approx { color: #f2d79a; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--gridline); white-space: nowrap; }
.table th { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); position: sticky; top: 0; background: var(--surface-1); z-index: 1; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.c-num, .c-p { text-align: right !important; font-variant-numeric: tabular-nums; }
.c-name { min-width: 220px; white-space: normal !important; }
.cell-strong { font-weight: 650; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); }
td.miss { color: #4a4a47; }

/* ───────────────────────────── stats ──────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 12px; margin-bottom: 24px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.tile-val { font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.tile-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.tile-note { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; }
.tile-alert .tile-val { color: var(--serious); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit,minmax(340px,1fr)); gap: 16px; margin-bottom: 16px; }
.stats-grid { align-items: stretch; }
/* A Stats row owns its spacing. The generic panel margin otherwise combines with
   the grid margin, while a shorter card stops early and makes that doubled gap
   look different in each column. Stretch the pair and leave one 16px gutter. */
.stats-grid > .panel { min-width: 0; height: 100%; margin-bottom: 0; }
#stats-people { display: flex; flex-direction: column; }
#stats-people .people { flex: 1; align-content: space-between; }
.grid-2.single { grid-template-columns: 1fr; }
.panel { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; }
.panel-title { font-size: 15.5px; margin-bottom: 14px; }
.panel-title + .panel-sub { margin-top: -9px; }
.panel-sub { font-size: 12.5px; color: var(--text-muted); margin: 5px 0 18px; max-width: 60ch; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.panel-head .panel-title { margin: 0; }

.metric-tabs {
  display: inline-flex; padding: 2px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--plane);
}
.metric-tabs button {
  font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 7px 9px; border: 0; border-radius: 5px; cursor: pointer;
  color: var(--text-muted); background: transparent;
}
.metric-tabs button[aria-pressed="true"] { color: var(--text-primary); background: var(--surface-2); }
.metric-tabs button:disabled { opacity: .35; cursor: default; }
.metric-tabs button:focus-visible { outline: 2px solid var(--series-1); outline-offset: 1px; }

/* Status colours are semantic rather than another categorical series. Failed to
   finish and dropped deliberately share the red treatment used by their chips. */
.shape-bar {
  display: flex; height: 22px; overflow: hidden; border-radius: 6px;
  background: var(--gridline); border: 1px solid var(--border);
}
.shape-bar > i { display: block; min-width: 3px; height: 100%; }
.shape-bar > i + i { border-left: 2px solid var(--surface-1); }
.shape-legend { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 14px; margin-top: 15px; }
.shape-legend span { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12px; color: var(--text-muted); }
.shape-legend span > i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.shape-legend b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.shape-backlog { background: var(--text-muted); }
.shape-playing { background: var(--series-1); }
.shape-finished { background: var(--good); }
.shape-sampled { background: var(--warning); }
.shape-unfinished, .shape-dropped { background: var(--critical); }

.stats-shape-compact {
  display: grid; grid-template-columns: minmax(180px,.42fr) minmax(0,1.58fr);
  align-items: center; gap: 28px; padding-top: 16px; padding-bottom: 16px;
}
.stats-shape-compact .panel-title { margin-bottom: 5px; }
.stats-shape-compact .panel-sub { margin: 0; }
.stats-shape-compact .shape-legend {
  grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 11px;
}

.timeline-legend { display: flex; gap: 16px; margin-bottom: 9px; font-size: 11.5px; color: var(--text-muted); }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.timeline-legend i { width: 9px; height: 9px; border-radius: 2px; background: var(--series-1); }
.timeline-legend span + span i { background: var(--good); }
.timeline-scroll { overflow-x: auto; padding: 4px 0 2px; }
.timeline-bars {
  display: grid; grid-template-columns: repeat(var(--timeline-years),minmax(52px,1fr));
  min-width: calc(var(--timeline-years) * 52px); border-bottom: 1px solid var(--baseline);
}
.timeline-year { display: grid; grid-template-rows: 132px 24px; min-width: 0; }
.timeline-columns { display: flex; align-items: stretch; justify-content: center; gap: 4px; padding: 0 4px; }
.timeline-columns span { width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.timeline-columns b { font-size: 10px; line-height: 16px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.timeline-columns i { display: block; width: 100%; min-height: 0; border-radius: 3px 3px 0 0; background: var(--series-1); }
.timeline-columns span + span i { background: var(--good); }
.timeline-year > strong { align-self: end; text-align: center; font-size: 10.5px; font-weight: 500; color: var(--text-muted); }

.scatter-layout { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 8px; }
.scatter-y { height: 210px; display: flex; flex-direction: column; justify-content: space-between; text-align: right; font-size: 10px; color: var(--text-muted); }
.scatter-main { min-width: 0; }
.scatter-plot { position: relative; height: 210px; border-left: 1px solid var(--baseline); }
.scatter-plot > i { position: absolute; left: 0; right: 0; height: 1px; background: var(--gridline); }
.scatter-point {
  position: absolute; z-index: 1; width: 13px; height: 13px; padding: 0;
  transform: translate(-50%,50%); border: 2px solid var(--surface-1); border-radius: 50%;
  background: var(--series-1); cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}
.scatter-point[data-tone="good"] { background: var(--good); }
.scatter-point[data-tone="bad"] { background: var(--critical); }
.scatter-point:hover, .scatter-point:focus-visible { z-index: 5; }
.scatter-point:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.scatter-point::after {
  content: attr(data-label); display: none; position: absolute; z-index: 4;
  left: 50%; bottom: 18px; width: max-content; max-width: min(220px,70vw);
  transform: translateX(-50%); padding: 6px 8px; border-radius: 5px;
  background: var(--plane); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text-primary); font: 500 11px/1.35 var(--font); text-align: left; white-space: normal;
  pointer-events: none;
}
.scatter-point[data-edge="left"]::after { left: -4px; transform: none; }
.scatter-point[data-edge="right"]::after { left: auto; right: -4px; transform: none; }
.scatter-point:hover::after, .scatter-point:focus-visible::after { display: block; }
.scatter-x { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 10px; color: var(--text-muted); }

.people { display: grid; gap: 14px; }
.person { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.person-swatch { width: 10px; height: 34px; border-radius: 3px; }
.person-name { font-weight: 600; font-size: 14px; }
.person-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.person-bar { height: 6px; border-radius: 999px; background: var(--gridline); overflow: hidden; margin-top: 6px; }
.person-bar i { display: block; height: 100%; border-radius: 999px; }
.person-mean { text-align: right; font-variant-numeric: tabular-nums; }
.person-mean b { font-size: 18px; }
.person-mean span { display: block; font-size: 11px; color: var(--text-muted); }

/* horizontal bars — 4px rounded data end, 2px gap, recessive track */
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 44%) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.bar-label { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 18px; background: var(--gridline); border-radius: 4px; overflow: hidden; }
/* "didn't play" sits beside the scores but is not one — muted and italic so it
   reads as absence rather than as a very low rating. */
.other-out { color: var(--text-muted); font-style: italic; }

/* The queue, listed. A disclosure on narrow screens so the card stays the focus;
   a standing panel beside the card once there is a column to spare. */
.rate-layout { display: grid; gap: 18px; align-items: start; }
.rate-list { margin-top: 10px; min-width: 0; }
.rate-list > summary {
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  padding: 4px 0; width: fit-content; list-style-position: inside;
}
.rate-list > summary:hover { color: var(--text-secondary); }
.rate-list-body { display: grid; gap: 8px; margin-top: 8px; }
.rate-search { font-size: 13px; padding: 7px 10px; }
.rate-list-items {
  list-style: none; margin: 0; padding: 6px;
  max-height: 280px; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px;
}
.rate-list-items:empty { display: none; }
.rate-list-none { font-size: 12.5px; color: var(--text-muted); margin: 0; }
/* A button that reads as a link: switching tab is a navigation, not a form action,
   and a full button here would out-shout the list it sits under. */
.linkish {
  font: inherit; font-size: 12.5px; background: none; border: 0; padding: 0;
  color: var(--series-1); cursor: pointer; text-decoration: underline;
}
.linkish:hover { color: var(--text-primary); }

@media (min-width: 1100px) {
  /* Explicit placement rather than DOM order: the list comes first in the markup so
     a phone gets it above the card, but reads better to the right of it here. */
  .rate-layout { grid-template-columns: minmax(0,1fr) 300px; gap: 22px; }
  /* A queue of one hides the list entirely; without this the column it left behind
     is 300px of nothing pinned beside the card. */
  .rate-layout:has(> .rate-list[hidden]) { grid-template-columns: minmax(0,1fr); }
  .rate-layout > .rate-card { grid-column: 1; grid-row: 1; }
  .rate-layout > .rate-list { grid-column: 2; grid-row: 1; margin-top: 0; }
  /* Forced open by syncQueuePane(), so the toggle would be a control that does
     nothing. Sticky under the topbar: the card is tall, and a queue you have to
     scroll back up to reach is the black box this was meant to fix. */
  .rate-list > summary { display: none; }
  .rate-list { position: sticky; top: 76px; }
  .rate-list-body { margin-top: 0; }
  .rate-list-items { max-height: calc(100vh - 190px); }
}
.rate-jump {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; font: inherit; font-size: 13px; text-align: left; cursor: pointer;
  padding: 7px 10px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-secondary);
}
.rate-jump:hover { background: var(--surface-2); color: var(--text-primary); }
.rate-jump.is-current { background: var(--surface-2); color: var(--text-primary); font-weight: 600; }
/* A left edge marks the current card without shifting anything as you move down. */
.rate-jump.is-current .rate-jump-name { box-shadow: -8px 0 0 -5px var(--series-1); }
.rate-jump-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate-jump-meta { color: var(--text-muted); font-variant-numeric: tabular-nums; flex: none; }
.bar-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); transition: width .3s; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-row[data-tone="good"] .bar-fill { background: var(--good); }
.bar-row[data-tone="bad"]  .bar-fill { background: var(--critical); }
/* ── browse: the global co-op catalogue ─────────────────────────────────── */
.browse-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.browse-card {
  display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.browse-card img, .browse-noart { width: 100%; aspect-ratio: 460 / 215; object-fit: cover; display: block; }
.browse-noart { background: var(--surface-2); }
.browse-body { padding: 12px 14px 0; flex: 1; }
.browse-body h3 { font-size: 14.5px; margin-bottom: 8px; }
/* Descriptions vary wildly in length; clamp so the grid stays a grid. */
.browse-body p {
  font-size: 12.5px; color: var(--text-muted); margin: 9px 0 0; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* Why a recommendation ranked where it did. Not clamped like the description
   above — it is one short line by construction (two tags at most). The
   descendant selector is load-bearing: `.browse-body p` would otherwise win on
   specificity and reapply the line-clamp. */
.browse-body .browse-fit {
  font-size: 12px; color: var(--series-3); margin: 9px 0 0; line-height: 1.4;
  display: block; overflow: visible;
}
.browse-body .browse-ea {
  font-size: 12px; color: #f2d79a; margin: 8px 0 0; display: block; overflow: visible;
}
.browse-act {
  padding: 12px 14px; display: flex; gap: 8px; flex-wrap: wrap;
  justify-content: flex-end; align-items: center;
}
.browse-foot { display: flex; justify-content: center; margin-top: 18px; }

/* The ranking's own explanation, above the grid. */
.browse-why {
  font-size: 13px; color: var(--text-muted); line-height: 1.9;
  margin: 10px 0 0; padding: 10px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
/* Keep a tag and its signed score as one pill. Let the whole pill move to the
   next line instead of breaking "Gore -0.63" across two rows inside one border. */
.browse-why .chip { display: inline-flex; white-space: nowrap; }

/* Secondary text inside a bar label, e.g. the raw 25/114 behind a percentage. */
.bar-sub { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Personal coverage strip above the rating queue. The track is deliberately
   slimmer than the Stats bars — it sits above the card and must not compete
   with the trailer for attention. */
.my-coverage { max-width: 900px; margin: 0 auto 14px; }
.my-coverage .bar-track { height: 8px; border-radius: 999px; }
.my-coverage .bar-fill { border-radius: 999px; }
.my-coverage-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 6px; font-size: 13px;
}
.my-coverage-head strong { font-weight: 600; }
.my-coverage-head span { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; font-size: 12.5px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* dot plot: one row per game, one dot per person on a shared 1–10 axis */
.dotplot { display: grid; gap: 12px; }
.dot-row { display: grid; grid-template-columns: 160px 1fr 34px; gap: 12px; align-items: center; font-size: 13px; }
.dot-track {
  position: relative; height: 26px; border-radius: 4px;
  background: linear-gradient(to right, var(--gridline) 1px, transparent 1px) 0 0 / 11.11% 100%;
  border-bottom: 1px solid var(--baseline);
}
.dot-mark {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  transform: translate(-50%,-50%); border: 2px solid var(--surface-1); /* 2px surface ring on overlap */
}
.dot-spread { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--serious); }
.dot-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted);
            margin-left: 172px; margin-right: 46px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ───────────────────────────── dialogs ────────────────────────────────── */
.dialog {
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface-1);
  color: var(--text-primary); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--shadow);
}
.dialog-wide { width: min(760px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.dialog-head h3 { font-size: 17px; }
.dialog-body { padding: 20px 22px 24px; max-height: 70vh; overflow-y: auto; }
.comment-delete-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.add-results { display: grid; gap: 6px; margin-top: 14px; }
.add-hit {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center;
  padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid transparent; text-align: left; font: inherit; color: inherit;
}
.add-hit:hover { border-color: var(--series-1); }
.add-hit img { width: 92px; height: 43px; object-fit: cover; border-radius: 4px; background: #000; }
.add-hit-copy { min-width: 0; }
.add-hit b { font-size: 14px; font-weight: 600; }
.add-hit span { font-size: 12px; color: var(--text-muted); }
.add-hit .add-hit-store {
  display: inline-block; margin-top: 3px; color: var(--text-secondary);
  font-size: 12px; font-weight: 550; text-decoration: none;
}
.add-hit .add-hit-store:hover { color: var(--text-primary); text-decoration: underline; }
.add-status { font-size: 13px; color: var(--text-muted); margin: 14px 0 0; min-height: 18px; }

.detail-grid { display: grid; gap: 18px; }
.detail-votes { display: grid; gap: 8px; }
.detail-vote {
  display: grid; grid-template-columns: clamp(112px, 16%, 180px) minmax(0,1fr) 40px;
  gap: 10px; align-items: center; font-size: 13.5px;
}
/* Group names can be 16 characters. Keep every bar aligned on wide dialogs,
   then truncate instead of painting through the bar on a narrow phone. */
.detail-vote-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
/* Your own row is a control, so it gets the same three-column geometry as the bars
   it sits among — the slider stands exactly where everyone else's bar does. */
.detail-score { width: 100%; margin: 0; }
.detail-vote-mine .detail-vote-name::after { content: ' (you)'; font-weight: 400; opacity: .6; }
.detail-vote-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-vote-actions .field-help { margin: 0; }
.detail-field { display: grid; gap: 5px; }
.detail-field label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
.detail-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.ownership-detail { padding: 13px 15px; border-radius: var(--radius-sm); background: var(--surface-2); }
.ownership-detail h4, .trophy h4 { margin: 0; font-size: 14px; }
.ownership-detail p { margin: 8px 0 0; color: var(--text-muted); font-size: 11.5px; }
.ownership-people { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.ownership-person {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); font-size: 12px;
}
.ownership-person.is-owned { color: #8fe08f; border-color: rgba(12,163,12,.35); }
.ownership-person.is-missing { color: #f2d79a; border-color: rgba(250,178,25,.35); }

.trophy {
  padding: 16px; border: 1px solid rgba(250,178,25,.28); border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(250,178,25,.07), rgba(181,91,207,.05));
}
.trophy-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.trophy-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.trophy-head > strong { font-size: 24px; color: #f2d79a; }
.trophy-track { height: 8px; margin: 12px 0; overflow: hidden; border-radius: 999px; background: var(--gridline); }
.trophy-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#fab219,#b55bcf); }
.trophy-people { display: grid; gap: 7px; margin-top: 12px; }
.trophy-person { display: grid; grid-template-columns: 110px 1fr 74px; gap: 9px; align-items: center; font-size: 12px; }
.trophy-person > span { display: inline-flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trophy-person .bar-track { height: 8px; }
.trophy-person b { color: var(--text-secondary); font-weight: 500; text-align: right; }
.trophy-note { margin: 11px 0 0; font-size: 12px; color: #f2d79a; }
.trophy-calls { display: grid; gap: 2px; margin-top: 10px; color: var(--text-muted); font-size: 12px; }
.trophy-calls strong { color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.trophy-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 13px; }
.trophy-actions span { color: var(--text-muted); font-size: 11.5px; }
.trophy-help { margin-top: 12px; color: var(--text-secondary); font-size: 12px; }
.trophy-help summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.trophy-help ol { padding-left: 22px; }
.trophy-help li + li { margin-top: 8px; }
.trophy-help p { margin: 10px 0 0; }
.trophy-help a { color: #a8cbf5; }
.trophy-score { display: grid; justify-items: end; gap: 1px; }
.trophy-score strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.trophy-score span { color: #f2d79a; font-size: 11px; white-space: nowrap; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; z-index: 100; box-shadow: var(--shadow);
  animation: rise .2s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

@media (max-width: 720px) {
  .topbar { gap: 10px; padding: 10px 14px; }
  /* Two rows: brand, switcher and the account controls, then the tabs across the
     full width. The tabs bleed to the screen edges and fade where more are hidden. */
  .tabs {
    order: 3; width: calc(100% + 28px); margin: 0 -14px; padding: 0 14px;
    overflow-x: auto; scrollbar-width: none;
    /* As wide as the fade, so scrolling the active tab into view never parks it
       under one: at the last tab that means scrolling all the way to the end. */
    scroll-padding-inline: 40px;
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
  .tabs.more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
  .tabs.more-left.more-right {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  }
  .tab { flex: none; }
  .topbar-right { gap: 6px; }
  /* All three right-hand controls share the bell's 40px box, which is also a
     comfortable touch target. */
  .add-game-btn { width: 40px; height: 40px; padding: 0; font-size: 20px; font-weight: 500; }
  .add-game-label, .account-name, .account-btn .caret { display: none; }
  .account-btn { padding: 3px; }
  .account-btn img, .account-initial { width: 32px; height: 32px; }
  .main { padding: 18px 14px 60px; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .rate-body { padding: 18px; }
  .rate-head h2 { font-size: 21px; }
  .bar-row { grid-template-columns: minmax(92px, 50%) 1fr 40px; }
  .dot-row { grid-template-columns: 110px 1fr 30px; }
  .dot-axis { margin-left: 122px; margin-right: 42px; }
  .detail-row2 { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 30px 72px minmax(0,1fr); gap: 10px; padding: 12px; }
  .rank-art { width: 72px; }
  .rank-art-small { width: 58px; }
  .rank-score { grid-column: 3; text-align: left; display: flex; gap: 7px; align-items: baseline; }
  .rank-score span { display: inline; }
  .trophy-person { grid-template-columns: 90px 1fr; }
  .trophy-person b { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* ═══════════════════════════ landing page ═══════════════════════════════ */
.landing { max-width: 1080px; margin: 0 auto; padding: 0 20px 60px; }
.landing-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
/* Keep a deliberate gap when the sign-in button wraps below the wordmark. */
@media (max-width: 560px) {
  .landing-top { gap: 20px; padding: 20px 0 18px; }
}
.hero { padding: 84px 0 64px; max-width: 44rem; }
.hero h1 { font-size: clamp(32px, 5.2vw, 52px); line-height: 1.08; letter-spacing: -.03em; }
.hero-sub { color: var(--text-secondary); font-size: 17px; line-height: 1.6; margin: 20px 0 32px; }
.hero-sub em { color: var(--text-primary); font-style: normal; font-weight: 600; }
.hero-fine { color: var(--text-muted); font-size: 13px; margin: 14px 0 0; }

.landing-showcase { margin-bottom: 34px; }
.landing-shot { margin: 0; min-width: 0; }
.landing-shot picture { display: block; }
.landing-shot > a { display: block; border-radius: 12px; }
.landing-shot > a:focus-visible { outline: 3px solid var(--series-1); outline-offset: 4px; }
.landing-shot img {
  display: block; width: 100%; height: auto; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface-1);
  box-shadow: 0 20px 60px rgba(0,0,0,.32);
}
.landing-shot figcaption {
  margin: 12px 4px 0; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5;
}
.landing-shot figcaption strong { color: var(--text-primary); }
.landing-shot-panel figcaption { text-align: center; }
.landing-shot-picker {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px;
  margin-bottom: 18px;
}
.landing-shot-choice {
  min-width: 0; padding: 8px; display: grid; grid-template-columns: minmax(86px,130px) minmax(0,1fr);
  align-items: center; gap: 12px; text-align: left; color: var(--text-secondary);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px;
  font: inherit; cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.landing-shot-choice:hover { border-color: var(--text-muted); color: var(--text-primary); }
.landing-shot-choice[aria-pressed="true"] {
  border-color: var(--series-1); background: rgba(56,139,229,.12); color: var(--text-primary);
}
.landing-shot-choice:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }
.landing-shot-choice picture { display: block; width: 100%; min-width: 0; }
.landing-shot-choice img {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
}
.landing-shot-choice span { display: grid; gap: 3px; min-width: 0; }
.landing-shot-choice strong { font-size: 13.5px; }
.landing-shot-choice small { color: var(--text-muted); font-size: 11.5px; line-height: 1.35; }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.feature { background: var(--surface-1); padding: 24px 22px; }
.feature h2 { font-size: 15px; margin-bottom: 8px; }
.feature p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; margin: 0; }
.landing-about {
  max-width: 47rem; margin: 46px auto 0; text-align: center;
}
.landing-about h2 { font-size: clamp(22px, 3vw, 29px); }
.landing-about p {
  color: var(--text-secondary); font-size: 15px; line-height: 1.65; margin: 14px 0 0;
}
.landing-foot {
  margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 12.5px; text-align: center;
}
.landing-foot p { margin: 4px 0; }
.landing-foot a { color: var(--text-secondary); }
.landing-foot a:hover { color: var(--text-primary); }

@media (max-width: 720px) {
  .stats-shape-compact { grid-template-columns: 1fr; gap: 12px; }
  .stats-shape-compact .shape-legend { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .landing-showcase { margin-bottom: 26px; }
  .landing-shot-panel figcaption { text-align: left; }
  .landing-shot-picker { gap: 7px; margin-bottom: 12px; }
  .landing-shot-choice { display: block; padding: 5px; }
  .landing-shot-choice span { padding: 7px 3px 3px; }
  .landing-shot-choice small { display: none; }
  .landing-about { margin-top: 34px; text-align: left; }
}

/* ═══════════════════════════ onboarding ═════════════════════════════════ */
.onboard-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; text-align: left; }
.onboard-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: grid; gap: 12px; align-content: start;
}
.onboard-card h2 { font-size: 15px; }
.workspace-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.workspace-choice label {
  display: flex; gap: 8px; align-items: flex-start; padding: 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.workspace-choice label:has(input:checked) { border-color: rgba(57,135,229,.65); background: rgba(57,135,229,.08); }
.workspace-choice input { margin: 3px 0 0; }
.workspace-choice span { display: grid; gap: 2px; }
.workspace-choice strong { font-size: 12.5px; }
.workspace-choice small { color: var(--text-muted); font-size: 11px; line-height: 1.3; }
.field { display: grid; gap: 5px; }
.field > span {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); font-weight: 600;
}
.field-help { font-size: 12px; color: var(--text-muted); margin: -4px 0 0; }

/* ═══════════════════════════ group switcher ═════════════════════════════ */
.group-switch { position: relative; }
.group-btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary);
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; max-width: 220px;
}
.group-btn:hover { background: #2c2c2a; }
.group-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.caret { color: var(--text-muted); font-size: 11px; }
.group-menu {
  /* Wide enough that the star column does not push "· 15 to rate" onto a second
     line. The mobile rule below drops the floor and lets the meta wrap instead. */
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 296px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px; box-shadow: var(--shadow); display: grid; gap: 2px;
}
/* The star is a sibling of the switch button, never inside it: nested interactive
   controls are invalid, and starring a workspace must not also navigate to it. */
.group-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: stretch; }
.group-item {
  font: inherit; text-align: left; padding: 9px 12px; border-radius: var(--radius-sm);
  background: transparent; border: 0; color: var(--text-primary); cursor: pointer; display: grid; gap: 3px;
  min-width: 0;
}
.group-item:hover { background: var(--surface-2); }
.group-pin {
  font: inherit; font-size: 15px; line-height: 1; padding: 0 11px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-muted); opacity: .35; border-radius: var(--radius-sm);
}
.group-pin:hover, .group-pin:focus-visible { opacity: 1; background: var(--surface-2); }
.group-pin:focus-visible { outline: 2px solid var(--series-1); outline-offset: -2px; }
.group-pin[aria-checked="true"] { color: var(--series-4); opacity: 1; }
.group-item.is-current { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--series-1); }
.group-item-name { font-size: 14px; font-weight: 600; }
.group-item-meta { font-size: 11.5px; color: var(--text-muted); }
.group-item-meta b { color: var(--series-1); }
.group-menu-sep { height: 1px; background: var(--border); margin: 5px 0; }

/* ═══════════════════════════ invite row ═════════════════════════════════ */
.invite-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.invite-row .input { flex: 1 1 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.person .chip { margin-left: 6px; vertical-align: middle; }
.invite-notice { border-color: rgba(57,135,229,.6); color: #a8cbf5; }
.invite-notice .pill { margin-left: 4px; }
.onboard-invites {
  display: grid; gap: 9px; margin: -10px 0 22px; padding: 14px;
  border: 1px solid rgba(57,135,229,.45); border-radius: var(--radius); text-align: left;
  background: rgba(57,135,229,.07);
}
.onboard-invites h2 { font-size: 15px; }
.invite-list { display: grid; gap: 8px; }
.invite-card {
  display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px;
  padding: 11px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.invite-card img, .invite-avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.invite-avatar {
  display: grid; place-items: center; background: rgba(57,135,229,.16);
  color: #a8cbf5; font-size: 10px; font-weight: 750;
}
.invite-card > div:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.invite-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.invite-card small { color: var(--text-muted); font-size: 11.5px; }
.invite-card-actions { display: flex; gap: 6px; }
.direct-invite-head { display: grid; grid-template-columns: minmax(0,1fr) minmax(220px,320px); gap: 18px; align-items: end; }
.direct-invite-head h4, .subsection-title { font-size: 13.5px; margin-bottom: 4px; }
.direct-invite-head .panel-sub { margin: 0; }
.compact-people { gap: 7px; margin-top: 12px; }
.compact-people .person { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.person-avatar { border-radius: 50%; object-fit: cover; }
.person-avatar.invite-avatar { width: 32px; height: 32px; }
.subsection-title { margin-top: 18px; }

@media (max-width: 720px) {
  .hero { padding: 48px 0 40px; }
  /* Whatever row 1 has left after the logo and three 36-40px controls. */
  .group-btn { max-width: min(200px, calc(100vw - 214px)); }
  /* Anchored to the button's LEFT edge, not its right. Right-aligning it was meant
     to keep the menu on screen, but the switcher sits near the left edge of the
     topbar, so a 260px menu hung ~114px off the left of a 375px phone. The cap is
     the switcher's own offset plus a margin, so it cannot overflow the other way. */
  .group-menu {
    left: 0; right: auto;
    min-width: 0; width: max-content; max-width: calc(100vw - 64px);
  }
  .group-item-meta { white-space: normal; }
}
@media (max-width: 480px) { .workspace-choice { grid-template-columns: 1fr; } }

@media (max-width: 480px) {
  .add-hit { grid-template-columns: 72px minmax(0,1fr); }
  .add-hit img { width: 72px; height: 34px; }
  .add-hit > :last-child { grid-column: 2; justify-self: start; }
}

/* Divider between the group's settings and the viewer's own preferences. */
.settings-rule { border: 0; border-top: 1px solid var(--border); margin: 20px 0 14px; }

/* ── library: sortable headers, status colour, thumbnails ───────────────── */
.th-sort { user-select: none; white-space: nowrap; }
.th-sort-btn {
  border: 0; padding: 4px 0; background: transparent; color: inherit;
  font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer;
}
.th-sort-btn span { display: inline-block; min-width: 1em; margin-left: 3px; }
.th-sort-btn:hover, .th-sort-btn:focus-visible { color: var(--text-primary); }
.th-sort.is-sorted { color: var(--text-primary); }

/* Status at a glance. Hues reuse the validated semantic tokens rather than new
   ones: backlog is deliberately neutral, since most of the library is backlog and
   colouring it would just add noise. */
.status-playing  { background: rgba(57,135,229,.14);  border-color: rgba(57,135,229,.45);  color: #a8cbf5; }
.status-finished { background: rgba(12,163,12,.14);   border-color: rgba(12,163,12,.45);   color: #8fe08f; }
.status-unfinished,
.status-dropped  { background: rgba(208,59,59,.13);   border-color: rgba(208,59,59,.42);   color: #f0a3a3; }
.status-sampled  { background: rgba(250,178,25,.12);  border-color: rgba(250,178,25,.40);  color: #f2d79a; }

/* Steam header art is a 460x215 banner, so the thumbnail keeps that ratio — a
   square crop cuts the logo off on most games and reads as a smudge. */
.lib-game { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.lib-open {
  display: grid; gap: 4px; width: 100%; padding: 0; border: 0;
  background: transparent; color: inherit; font: inherit; font-weight: inherit;
  text-align: left; cursor: pointer;
}
.lib-mobile-meta { display: none; color: var(--text-muted); font-size: 11.5px; font-weight: 400; }
.lib-art {
  flex: 0 0 auto; width: 46px; height: 21px; border-radius: 3px;
  object-fit: cover; background: var(--surface-2); display: block;
}
.lib-art-none { border: 1px solid var(--border); }

/* ── rate queue: which question am I being asked ────────────────────────── */
.rate-modes { max-width: 900px; margin: 0 auto 16px; }
.rate-modes .segmented { flex-wrap: wrap; }
.session-game-column { min-width: 230px; width: 270px; }
.session-choice {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 82px;
  padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-primary); font: inherit; text-align: left;
  white-space: normal;
}
button.session-choice { cursor: pointer; }
button.session-choice:hover { border-color: var(--series-1); }
.session-choice.has-game { border-style: solid; }
.session-choice.is-cancelled { opacity: .7; }
.session-choice-art { width: 64px; aspect-ratio: 460 / 215; object-fit: cover; border-radius: 4px; margin-top: 2px; }
.session-choice-copy { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.session-choice-copy strong { font-weight: 600; }
.session-choice-copy small { color: var(--text-muted); font-size: 11.5px; }
.session-choice-copy small.session-choice-warning { color: #f2d79a; }
.session-choice-action { color: var(--series-1); font-size: 12px; margin-top: 3px; }
.strip-game { color: var(--text-muted); font-size: 12px; }
#sg-game { min-height: 180px; }
#session-game-dialog { width: min(780px, calc(100vw - 32px)); }
#session-game-dialog[open] { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
#session-game-dialog .dialog-head, #session-game-dialog .session-dialog-actions { flex: none; }
#session-game-dialog .dialog-body { min-height: 0; max-height: none; }
#session-game-dialog .session-dialog-actions { margin: 0; padding: 14px 22px; border-top: 1px solid var(--border); justify-content: flex-end; }
.planning-filters .field { font-size: 12px; color: var(--text-secondary); }
#sg-game { max-width: 100%; margin-top: 6px; }
.session-game-preview { padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); margin: 12px 0; }
.session-game-preview .panel-sub { margin: 10px 0; }
.planning-filters { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(140px, 1fr)); gap: 12px; margin: 12px 0; }
.planning-filters .field { min-width: 0; margin: 0; }
.planning-filters .input { width: 100%; }
.planning-options { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 12px 0; }
.favourites-panel { margin-top: 24px; }
.favourites-panel .panel-head { flex-wrap: wrap; }
.favourite-card { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.favourite-card.is-top { border-color: rgba(57,135,229,.55); background: linear-gradient(110deg, rgba(57,135,229,.09), var(--surface-2)); }
.favourite-overview { display: grid; grid-template-columns: 28px 92px minmax(0,1fr) auto; gap: 14px; align-items: center; }
.favourite-card .rank-name { text-align: left; color: var(--text-primary); white-space: normal; }
.rank-score b small { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 3px; }
.member-scores { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.member-score { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.member-score b { color: var(--text-primary); font-weight: 550; }
.favourite-card > .btn { margin-top: 12px; }
.planning-empty { padding: 18px; border: 1px dashed var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 14px; }
.rating-privacy { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.rating-privacy legend { font-weight: 600; margin-bottom: 14px; }
.rating-privacy .field-help { margin: 0 0 6px; }
.export-links a[aria-disabled="true"] { opacity: .5; cursor: not-allowed; text-decoration: none; }
#gf-more { margin-top: 12px; }
.backlog-head { margin-top: 32px; flex-direction: column; align-items: flex-start; }
/* Planning remains available when every game has been archived. */
.view.is-library-empty[data-view="next"] > #session-panel { display: block; }
@media (max-width: 720px) {
  .planning-filters { grid-template-columns: 1fr 1fr; }
  .planning-filters .field:first-child { grid-column: 1 / -1; }
  .favourite-overview { grid-template-columns: 24px 58px minmax(0,1fr); gap: 10px; }
  .favourite-overview .rank-art { width: 58px; }
  .favourite-overview .rank-score { grid-column: 3; text-align: left; }
  .favourite-overview .rank-score span { display: inline; margin-left: 8px; }
  .session-game-column { min-width: 210px; }
  /* Each session becomes a small planner on phones, keeping the game box and
     every attendance control visible without sideways scrolling. */
  #session-grid .session-table, #session-grid .session-table tbody { display: block; }
  #session-grid .session-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #session-grid .session-table tbody tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; padding: 14px 0; border-top: 1px solid var(--border); }
  #session-grid .session-table tbody th, #session-grid .session-table td { border: 0; padding: 0; min-width: 0; }
  #session-grid .session-table tbody th { position: static; white-space: normal; }
  #session-grid .session-table tbody th, #session-grid .session-game-column,
  #session-grid .session-crew, #session-grid .session-off { grid-column: 1 / -1; width: auto; }
  #session-grid td[data-person]::before { content: attr(data-person); display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
  #session-grid select.attend { width: 100%; }
  #session-grid .session-crew::after { content: ' coming'; }
  #session-grid .session-game-column::before { content: 'Chosen game'; display: block; margin-bottom: 6px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); }
}
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px;
             background: var(--surface-1); border: 1px solid var(--border); }
.seg {
  font: inherit; font-size: 13.5px; font-weight: 550; padding: 7px 15px;
  border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary);
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.seg:hover:not(:disabled) { color: var(--text-primary); background: var(--surface-2); }
.seg.is-on { background: var(--surface-2); color: var(--text-primary); }
.seg:disabled { opacity: .4; cursor: default; }
.rate-ask { margin: 10px 0 0; font-size: 13.5px; color: var(--text-secondary); }
/* Already-owned search hits keep their Steam link fully actionable while the
   library state, art and title recede. */
.add-hit.is-have > img,
.add-hit.is-have .add-hit-copy > b,
.add-hit.is-have .add-hit-copy > span,
.add-hit.is-have > .chip { opacity: .65; }
.add-hit.is-have:hover { background: var(--surface-2); }

/* ── add by hand ────────────────────────────────────────────────────────── */
.add-manual { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.add-manual > summary {
  cursor: pointer; font-size: 13.5px; font-weight: 550; color: var(--text-secondary);
}
.add-manual > summary:hover { color: var(--text-primary); }
.add-manual[open] > summary { margin-bottom: 10px; }
.add-manual .field { margin-top: 10px; }
.field-opt { color: var(--text-muted); font-weight: 400; }

/* ── destructive actions ────────────────────────────────────────────────── */
.danger {
  border: 1px solid rgba(208,59,59,.42); border-radius: var(--radius);
  padding: 14px 16px; background: rgba(208,59,59,.06);
}
.danger > strong { color: #f0a3a3; font-size: 14px; }
.export-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 16px; font-size: 12.5px; color: var(--text-muted); }
.onboard-restore {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; text-align: left;
}
.discord-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.discord-connection { padding: 14px; margin-top: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.discord-connection .field-help { margin: 5px 0 10px; }
.discord-connection a { color: #a8cbf5; font-size: 13px; }
.discord-help { max-width: 68ch; font-size: 13px; line-height: 1.65; color: var(--text-secondary); }
.discord-help summary { cursor: pointer; color: var(--text); }
.discord-help ol { padding-left: 22px; }
.discord-help li + li { margin-top: 7px; }
.discord-limit { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 18px 0; }
.discord-limit .field { flex: 1 1 190px; margin: 0; }
.discord-limit .field-help { flex-basis: 100%; margin: 0; }
.discord-location { max-width: 68ch; border-top: 1px solid var(--border); padding-top: 18px; margin: 18px 0; }
.discord-location .field { max-width: 420px; margin-bottom: 8px; }
.discord-location .field-help { margin: 8px 0 14px; }
.discord-location select { width: 100%; }
.discord-location [hidden] { display: none; }
.export-links a:not(.btn) { color: #a8cbf5; }
.btn-danger { background: var(--critical); border-color: transparent; color: #fff; }
.btn-danger:hover { background: #e05252; }
/* Archived rows stay legible but visibly not part of the active library. */
.status-archived { background: var(--surface-2); color: var(--text-muted); }
tr.is-archived td { opacity: .55; }

/* ── extra statistics ───────────────────────────────────────────────────── */
.stat-callouts { display: grid; gap: 8px; margin-top: 14px; }
.pair-callouts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.pair-callouts .callout-stat { min-width: 0; padding: 11px 13px; }
.stats-detail-label {
  margin: 20px 0 11px; color: var(--text-muted); font-size: 10.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
}
.callout-stat {
  display: grid; gap: 1px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 12.5px; color: var(--text-muted);
}
.callout-stat strong { font-size: 14.5px; color: var(--text-primary); font-weight: 600; }
.shrug-list { display: flex; flex-wrap: wrap; gap: 8px; }
.shrug {
  font: inherit; font-size: 13px; display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
}
.shrug:hover { color: var(--text-primary); border-color: var(--series-1); }

/* ── comment thread ─────────────────────────────────────────────────────── */
.imported-note {
  margin: 0; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-secondary); font-size: 13.5px;
}
.thread { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.thread-title { font-size: 14.5px; margin-bottom: 12px; }
.thread-list { display: grid; gap: 12px; margin-bottom: 14px; }
.comment { display: grid; gap: 3px; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.comment-head strong { color: var(--text-primary); font-size: 13.5px; font-weight: 600; }
.comment-head time { margin-left: 2px; }
.comment p { margin: 0; font-size: 14px; color: var(--text-secondary); white-space: pre-wrap; }
.btn-x {
  margin-left: auto; font: inherit; font-size: 12px; line-height: 1; padding: 3px 6px;
  background: transparent; border: 0; border-radius: 4px; color: var(--text-muted); cursor: pointer;
}
.btn-x:hover { background: var(--surface-2); color: var(--critical); }
.thread-new { display: flex; gap: 8px; align-items: flex-start; }
.thread-new textarea { flex: 1; resize: vertical; font-family: inherit; }
/* An estimate is visually distinct from a number somebody typed. */
.est { color: var(--text-muted); border-bottom: 1px dotted var(--baseline); cursor: help; }
.pt-fix { display: block; margin-top: 3px; }

/* ── selective Steam import ────────────────────────────────────────────── */
.steam-tools { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.steam-import-dialog { width: min(820px, calc(100vw - 32px)); }
.steam-import-help { margin-top: -4px; color: var(--text-muted); font-size: 12px; }
.steam-import-help summary { cursor: pointer; width: fit-content; }
.steam-import-help p { margin: 8px 0 0; max-width: 66ch; line-height: 1.5; }
.steam-import-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.steam-import-feedback:has(> :not([hidden]):not(:empty)) { margin-top: 8px; }
.steam-import-feedback .add-status { margin: 0; }
.steam-import-feedback .add-status:empty { display: none; }
.steam-import-feedback progress { width: 100%; height: 7px; accent-color: var(--series-1); }
.steam-import-feedback .btn { margin-left: auto; }
.steam-import-filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px 20px; margin: 14px 0;
}
.steam-import-filters > label:not(.toggle) { display: grid; gap: 6px; min-width: min(280px,100%); }
.steam-import-filters > label:not(.toggle) > span {
  color: var(--text-muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
}
.steam-import-toggle { margin-bottom: 11px; }
.steam-import-types {
  display: flex; flex-wrap: wrap; gap: 10px 18px; margin: -2px 0 14px; padding: 0;
  border: 0;
}
.steam-import-types legend {
  width: 100%; margin-bottom: 7px; color: var(--text-muted); font-size: 11px;
  font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
}
.steam-import-types small { flex-basis: 100%; color: var(--text-muted); font-size: 11.5px; }
.steam-import-summary { color: var(--text-secondary); font-size: 13.5px; }
.steam-import-actions,
.steam-import-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 10px; }
.steam-import-actions span { color: var(--text-muted); font-size: 12.5px; }
.steam-import-actions {
  position: sticky; top: -20px; z-index: 1; padding: 10px 0;
  background: var(--surface-1); border-bottom: 1px solid var(--border);
}
.steam-import-foot { justify-content: space-between; margin: 14px 0 0; }
.steam-import-submit { margin-left: auto; }
.steam-import-list { display: grid; gap: 6px; }
.steam-import-item {
  display: grid; grid-template-columns: auto 42px minmax(0,1fr) auto;
  align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid transparent; cursor: pointer;
}
.steam-import-item:hover { border-color: var(--border-strong); }
.steam-import-item img,
.steam-import-placeholder { width: 42px; height: 42px; object-fit: cover; border-radius: 7px; background: var(--surface-1); }
.steam-import-item > span:not(.steam-import-placeholder) { min-width: 0; display: grid; gap: 3px; }
.steam-import-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.steam-import-item small { color: var(--text-muted); font-size: 11.5px; }
.steam-import-item a { color: #a8cbf5; font-size: 12.5px; white-space: nowrap; }

/* ── personal statistics ───────────────────────────────────────────────── */
.personal-stat-callouts { grid-template-columns: repeat(2,minmax(0,1fr)); }
.personal-records { grid-template-columns: repeat(2,minmax(0,1fr)); }
.completion-suggestions { display: grid; gap: 7px; }
.completion-suggestion {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2);
}
.completion-suggestion > span { min-width: 0; display: grid; gap: 2px; }
.completion-suggestion strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.completion-suggestion small { color: var(--text-muted); font-size: 11.5px; }
.compact-list { display: grid; gap: 7px; }
.compact-list > span { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.compact-list b { font-weight: 550; color: var(--text-secondary); }
.compact-list em { color: var(--text-muted); font-style: normal; text-align: right; }

@media (max-width: 720px) {
  .history-card { padding: 16px; }
  .history-item { grid-template-columns: 112px minmax(0,1fr); gap: 12px; }
  .history-art { width: 112px; height: 64px; }
  .history-actions .btn { flex: 1 1 180px; }
  /* The desktop table is too wide to scan on a phone. Keep one tappable summary
     column and put the decision-making fields directly under the title. */
  .table-wrap { overflow-x: visible; }
  #lib-table th:not(.c-name), #lib-table td:not(.c-name) { display: none; }
  #lib-table .c-name { width: 100%; min-width: 0; padding: 12px; }
  #lib-table .lib-mobile-meta { display: block; }
  #lib-table .lib-game { flex-wrap: wrap; }
  .steam-import-item { grid-template-columns: auto 36px minmax(0,1fr); }
  .steam-import-dialog .dialog-body { max-height: calc(100dvh - 120px); }
  .steam-import-item img, .steam-import-placeholder { width: 36px; height: 36px; }
  .steam-import-item a { grid-column: 3; }
  .steam-import-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .steam-import-actions #steam-import-select-all { grid-column: 1; grid-row: 2; }
  .steam-import-actions #steam-import-select-none { grid-column: 2; grid-row: 2; }
  .steam-import-actions .steam-import-submit { grid-column: 2; grid-row: 1; margin-left: 0; }
  .steam-import-actions #steam-import-selected { grid-column: 1; grid-row: 1; }
  .invite-card { grid-template-columns: auto minmax(0,1fr); }
  .invite-card-actions { grid-column: 2; }
  .direct-invite-head { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 480px) {
  .pair-callouts { grid-template-columns: 1fr; }
  .personal-stat-callouts, .personal-records { grid-template-columns: 1fr; }
}

/* A dismissed card, shown only when the toggle asks for it. Greyed rather than
   hidden so it reads as "we said no to this" instead of looking like a loading
   glitch; the art carries most of a card's weight, so that is what desaturates. */
.browse-card.is-dismissed { opacity: .55; }
.browse-card.is-dismissed img { filter: grayscale(1); }
.browse-card.is-dismissed:hover, .browse-card.is-dismissed:focus-within { opacity: 1; }
.browse-card.is-dismissed:hover img { filter: grayscale(.4); }

/* ── "not interested", and the way back ─────────────────────────────────── */
.dismissed { margin: 0 0 16px; }
.dismissed > summary {
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  padding: 4px 0; width: fit-content; list-style-position: inside;
}
.dismissed > summary:hover { color: var(--text-secondary); }
.dismissed-list {
  list-style: none; margin: 8px 0 0; padding: 6px; display: grid; gap: 2px;
  max-height: 320px; overflow-y: auto;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px;
}
.dismissed-list li {
  display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 12px;
  align-items: center; padding: 6px 10px; border-radius: 6px; font-size: 13px;
}
.dismissed-list li:hover { background: var(--surface-2); }
.dismissed-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Who said no, so a game does not silently vanish on the other three. */
.dismissed-by { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
@media (max-width: 560px) {
  .dismissed-list li { grid-template-columns: minmax(0,1fr) auto; }
  .dismissed-by { grid-column: 1 / -1; }
}
