
/* -- Scoring guide collapsible -- */
.scoring-guide { margin: 0 0 14px; border: 1px solid var(--border2); border-radius: 6px; overflow: hidden; }
.scoring-guide summary {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 0.78rem;
  font-weight: 600; color: var(--accent); background: var(--s1);
  list-style: none; user-select: none;
}
.scoring-guide summary::-webkit-details-marker { display: none; }
.scoring-guide summary::before { content: '▶'; font-size: 0.6rem; transition: transform .15s; }
.scoring-guide[open] summary::before { transform: rotate(90deg); }
.scoring-guide-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 0; background: var(--bg); }
.scoring-guide-row { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.scoring-guide-row:last-child { border-bottom: none; }
.scoring-guide-badge {
  font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; margin-top: 2px;
}
.scoring-guide-rule { font-size: 0.76rem; color: var(--muted); line-height: 1.5; }
.scoring-guide-section { font-size: 0.72rem; font-weight: 700; color: var(--accent); margin: 10px 0 4px; }
.scoring-guide-note { font-size: 0.74rem; color: var(--muted); line-height: 1.6; }

/* ---- Not-rated-yet toggle chip (home page Popular section) ---- */
.section-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label-row .section-label::after { display: none; }
.section-count {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}
.unrated-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.68rem;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.unrated-toggle:hover { border-color: var(--accent); color: var(--accent); }
.unrated-toggle--active { border-color: var(--accent); color: var(--accent); background: rgba(190,238,17,0.06); }
.unrated-count {
  background: var(--border2);
  border-radius: 2px;
  padding: 0 5px;
  font-size: 0.65rem;
  font-weight: 700;
}
.unrated-toggle--active .unrated-count { background: rgba(190,238,17,0.18); }

/* ---- Home filter bar ---- */
.home-filter-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.home-filter-selects { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.home-filter-item { display: flex; flex-direction: column; gap: 3px; }
.home-filter-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.home-filter-select {
  background: var(--s1);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 5px 8px;
  font-size: 0.76rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color .1s;
}
.home-filter-select:focus { border-color: var(--accent); }
.home-sort-group { display: flex; gap: 4px; flex-wrap: wrap; }
.home-sort-btn {
  padding: 5px 11px;
  background: var(--s1);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 4px;
  transition: background .1s, color .1s, border-color .1s;
}
.home-sort-btn:hover { background: var(--s2); color: var(--text); }
.home-sort-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(74,159,208,0.08); }
.home-layout-toggle { display: flex; gap: 4px; }
.home-layout-btn {
  padding: 5px 10px;
  background: var(--s1);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 4px;
  transition: background .1s, color .1s, border-color .1s;
}
.home-layout-btn:hover { background: var(--s2); color: var(--text); }
.home-layout-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(74,159,208,0.08); }

/* View controls: count sits above the card-size + grid/list toggle row so
   the count reads as a header for the section rather than crowding the
   controls sideways. */
.home-view-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.home-view-controls-row { display: flex; align-items: center; gap: 10px; }
.home-size-toggle { display: flex; gap: 4px; }
.home-size-btn {
  width: 28px;
  padding: 5px 0;
  background: var(--s1);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border-radius: 4px;
  transition: background .1s, color .1s, border-color .1s;
}
.home-size-btn:hover:not(:disabled) { background: var(--s2); color: var(--text); }
.home-size-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(74,159,208,0.08); }
.home-size-btn:disabled { opacity: 0.4; cursor: default; }
.home-size-toggle--disabled { opacity: 0.6; }
.home-size-btn--desktop-only { display: none; }
@media (min-width: 760px) {
  .home-size-btn--desktop-only { display: inline-flex; align-items: center; justify-content: center; }
}

/* Card size preference. Medium matches the default desktop row; small is
   denser, large is roomier. Title/sub scale with the boxart. The size class
   lives on the .cards container and overrides the responsive default. */
.cards--sm .game-card-thumb { width: 100px; height: 47px; }
.cards--md .game-card-thumb { width: 138px; height: 64px; }
.cards--lg .game-card-thumb { width: 200px; height: 93px; }
.cards--xl .game-card-thumb { width: 280px; height: 130px; }
/* Size-variant padding lives on .game-card-row so the bottom-bar strip
   (a sibling of the row) can still reach the card's bottom and side
   edges. Same change pattern as the matching .pg-list--XX rules in
   css/index/index.css for the homescreen card. */
.cards--sm .game-card-row { gap: 12px; padding: 8px 12px 8px 8px; }
.cards--lg .game-card-row { gap: 20px; padding: 14px 20px 14px 12px; }
.cards--xl .game-card-row { gap: 24px; padding: 16px 22px 16px 14px; }
.cards--sm .game-card-title { font-size: 0.92rem; }
.cards--lg .game-card-title { font-size: 1.12rem; }
.cards--lg .game-card-sub { font-size: 0.85rem; }
.cards--xl .game-card-title { font-size: 1.25rem; }
.cards--xl .game-card-sub { font-size: 0.9rem; }
@media (max-width: 560px) {
  /* Keep large from overwhelming small screens. */
  .cards--lg .game-card-thumb { width: 150px; height: 70px; }
}
/* Desktop sizes: every step gets noticeably roomier than the mobile
   defaults so the grid actually uses the wider viewport. Thumbnail width
   drives card height (~2.14:1 Steam header ratio); title/sub scale up to
   match. Default size on desktop is 'lg'. */
@media (min-width: 760px) {
  .cards--sm .game-card-thumb { width: 140px; height: 65px; }
  .cards--md .game-card-thumb { width: 200px; height: 93px; }
  .cards--lg .game-card-thumb { width: 290px; height: 135px; }
  .cards--xl .game-card-thumb { width: 400px; height: 187px; }
  .cards--sm .game-card-row { gap: 16px; padding: 12px 16px 12px 10px; }
  .cards--md .game-card-row { gap: 20px; padding: 14px 20px 14px 12px; }
  .cards--lg .game-card-row { gap: 26px; padding: 18px 26px 18px 14px; }
  .cards--xl .game-card-row { gap: 32px; padding: 22px 32px 22px 18px; }
  .cards--sm .game-card-title { font-size: 1.05rem; }
  .cards--md .game-card-title { font-size: 1.18rem; }
  .cards--lg .game-card-title { font-size: 1.35rem; }
  .cards--xl .game-card-title { font-size: 1.55rem; }
  .cards--sm .game-card-sub { font-size: 0.82rem; }
  .cards--md .game-card-sub { font-size: 0.9rem; }
  .cards--lg .game-card-sub { font-size: 1rem; }
  .cards--xl .game-card-sub { font-size: 1.1rem; }
}
.home-tier-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 12px; }
.home-tier-chip {
  padding: 4px 11px;
  background: var(--s1);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition: background .1s, color .1s, border-color .1s;
}
.home-tier-chip:hover { background: var(--s2); color: var(--text); }
.home-tier-chip.active { color: var(--accent); border-color: var(--accent); background: rgba(74,159,208,0.08); }
.home-tier-chip[data-tier="platinum"].active { color: #b5c4f0; border-color: #b5c4f0; background: rgba(181,196,240,0.08); }
.home-tier-chip[data-tier="gold"].active { color: #f5c518; border-color: #f5c518; background: rgba(245,197,24,0.08); }
.home-tier-chip[data-tier="silver"].active { color: #aaa; border-color: #aaa; background: rgba(170,170,170,0.08); }
.home-tier-chip[data-tier="bronze"].active { color: #cd7f32; border-color: #cd7f32; background: rgba(205,127,50,0.08); }
.home-tier-chip[data-tier="borked"].active { color: #e05; border-color: #e05; background: rgba(238,0,85,0.08); }
.home-results-note { font-size: 0.72rem; color: var(--muted); text-align: center; margin: 8px 0 4px; }
/* Tile (grid) mode: Steam library look. The container becomes a CSS grid
   of header-aspect thumbnails; each card re-flows into a vertical tile.
   S/M/L/XL still applies -- it controls the minimum tile width and via
   auto-fill, how many columns fit on screen. */
.home-cards-tile-mode {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.home-cards-tile-mode.cards--sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.home-cards-tile-mode.cards--md { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.home-cards-tile-mode.cards--lg { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.home-cards-tile-mode.cards--xl { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Mobile tile grid: tighten the minmax so the four size steps actually
   produce different column counts on a ~360-430px viewport. Desktop
   values (above) already spread cleanly at larger widths; the mobile
   defaults collapsed sm+md to 2 cols each and lg+xl to 1 col each. */
@media (max-width: 560px) {
  .home-cards-tile-mode.cards--sm { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); }
  .home-cards-tile-mode.cards--md { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
  .home-cards-tile-mode.cards--lg { grid-template-columns: 1fr; }
  .home-cards-tile-mode.cards--xl { grid-template-columns: 1fr; }
}
.home-cards-tile-mode .game-card { display: flex; flex-direction: column; min-width: 0; }
/* Push the tier strip to the bottom edge even on cards that have less
   body content (e.g. no reports subtitle). Without this, cards with a
   shorter body ended up with the strip floating in the middle instead
   of aligning with neighbors. */
.home-cards-tile-mode .game-card-strip { margin-top: auto; }
.home-cards-tile-mode .game-card-row {
  flex-direction: column;
  gap: 0;
  padding: 0;
  align-items: stretch;
}
.home-cards-tile-mode .game-card-thumb-wrap { width: 100%; }
.home-cards-tile-mode .game-card-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 460 / 215;
  border-radius: 0;
  display: block;
}
.home-cards-tile-mode .game-card-body { padding: 8px 10px; min-width: 0; }
.home-cards-tile-mode .game-card-title {
  font-size: 0.95rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.home-cards-tile-mode .game-card-sub { font-size: 0.78rem; }
.home-cards-tile-mode .game-card-right { display: none; }

/* ---- Stub page (game with no reports yet) ---- */
.stub-page { max-width: 640px; }
.stub-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.stub-img {
  width: 184px;
  height: 69px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.stub-meta { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.stub-pills { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stub-title { margin: 0; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.stub-body { margin-bottom: 4px; }
.stub-message { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin: 0 0 12px; }
.tier-badge--pending { background: #3a4a5a; color: #c8d4e0; border-radius: 3px; }
@media (max-width: 480px) {
  .stub-header { flex-direction: column; }
  .stub-img { width: 100%; height: auto; }
}

/* ---- Signed-in library breakdown chart (#199) ---- */
.home-library-chart {
  margin: 4px 0 20px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}
/* Title + source chips share one row: title on the left, chips floating
   to the right so a single-tap swap is close to the eye's landing zone. */
.hlc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.hlc-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.hlc-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}
.hlc-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  font-family: inherit;
}
.hlc-chip:hover { color: var(--text); }
.hlc-chip--active {
  background: var(--accent);
  color: #0a0c10;
}
/* Deck chip carries the Steam Deck brand mark (D-shield + gradient dot)
   next to the "Steam Deck" text on desktop. Mobile drops the text so
   the row stays compact -- the glyph is distinct enough that people
   who know the Deck recognize it at a glance. Icon bumps to 18px on
   mobile because it's carrying the full label. */
.hlc-chip--device { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; padding-right: 12px; }
.hlc-chip-glyph { flex: 0 0 auto; display: block; }
@media (max-width: 620px) {
  .hlc-chip--device { padding: 4px 8px; }
  .hlc-chip--device .hlc-chip-text { display: none; }
  .hlc-chip-glyph { width: 18px; height: 18px; }
}
.hlc-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}
/* Legacy: two-bar-group section titles from an earlier chart layout.
   The chip toggle now shows one group at a time so these no longer
   render, but the rule stays defensive in case the markup regresses. */
.hlc-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 12px 0 6px;
}
.hlc-bars { display: flex; flex-direction: column; gap: 6px; }
.hlc-row {
  display: grid;
  /* Fixed label column so every pill is the SAME width and lines up in a tidy
     column (a fixed grid track reliably stretches its item, unlike an
     intrinsic max-content track). 84px fits the tier labels; the deck view
     has longer labels ("Deck Verified") so it widens the column below. */
  grid-template-columns: 84px 1fr 56px;
  gap: 10px;
  align-items: center;
}
/* Clickable rows (#290): each row links to app.html with the matching filter
   pre-applied. Kill the default link chrome and add a light hover so users
   see the affordance without adding a separate button. */
a.hlc-row--link {
  text-decoration: none;
  color: inherit;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 4px;
  transition: background-color 120ms ease;
}
a.hlc-row--link:hover,
a.hlc-row--link:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}
a.hlc-row--link:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
/* Deck view labels are longer, so give them a wider uniform column that fits
   "Deck Verified" / "Deck Playable" on one line without clipping. */
.home-library-chart--device .hlc-row {
  grid-template-columns: 116px 1fr 56px;
}
.hlc-label {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.hlc-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.hlc-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.35s ease-out;
}
.hlc-count {
  text-align: right;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
}
.home-library-chart--empty .hlc-empty-body {
  font-size: 0.82rem;
  color: var(--muted);
}
.home-library-chart--empty .hlc-empty-body a { color: var(--accent); }

/* My Library page header (only rendered when ?filter=mine deep-links here). */
.home-page-header {
  padding: 12px 0 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.home-page-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.home-page-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--strong);
  margin: 4px 0 0;
  letter-spacing: -0.01em;
}

.page-nav {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
/* Mirror nav under the grid: centered so it reads as a footer rather
   than a top-right menu, and given breathing room above so it doesn't
   crowd the last row of tiles. */
.page-nav--bottom {
  justify-content: center;
  margin-top: 16px;
  margin-bottom: 0;
}
.page-nav-inner {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}
.page-nav-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding: 4px 8px 4px 0;
  white-space: nowrap;
}
.page-nav-btn--arrow {
  min-width: 30px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1;
}
.page-nav-btn--arrow[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.page-nav-btn {
  min-width: 30px;
  padding: 4px 8px;
  background: var(--s1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.page-nav-btn:hover { background: var(--s2); border-color: var(--border2); }
.page-nav-btn--active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  cursor: default;
}
.page-nav-btn--active:hover { background: var(--accent); }
.page-nav-ellipsis {
  padding: 4px 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  align-self: center;
}

/* Bottom "Show more" button: appends the next page's tiles below the
   current view. Wider and taller than the numbered buttons since it's
   the main call to action when the user reaches the end. */
.page-nav-show-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--s1);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.page-nav-show-more:hover {
  background: var(--s2);
  border-color: var(--accent);
  color: var(--accent);
}

/* Sign-in callout banner */
.home-signin-callout {
  margin: 12px 0 16px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--s1);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}
.home-signin-callout a {
  color: var(--accent-hi);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.home-signin-callout a:hover {
  color: var(--green-hi);
}
