/* ============================================================================
   game-suggestions.css — /game-suggestions (Propozycje gier). Built from the
   kit (components.css: .page-header, .toolbar, .notice, .table (--hover,
   --stack), .chip (Shared/Chip tones), .btn, .pagination, .empty-state,
   .dlg, .field/.input, .skeleton, .spin, .horizon; layout.css: .page-top);
   this file lays the page out. Tokens only.

   Contents
     1. Poll banner     .gs-poll (kit .notice above the list)
     2. Legend          .gs-legend, .gs-stages (the legend dialog's body)
     3. List            .gs-table (kit .table--stack card per row on phones),
                        .gs-row, .gs-game, .gs-source, .gs-offsteam, .gs-state,
                        .gs-progress, .gs-steps, .gs-dates
     4. Dialogs         .gs-dialog, .gs-blocked, .gs-form, .gs-combobox*,
                        .gs-results, .gs-reason
     5. Motion          current-step pulse; reduced motion

   Status chips are Shared/Chip with the tone from the page's one status →
   tone map (gsStatusTones in game_suggestions.html.twig); the reason
   dialog's chip gets chip--{tone} from game-suggestions.js.

   The progress bar (.gs-steps / .gs-step) stays a page piece: the kit
   .meter is one continuous fill and cannot show five segments with their
   done / current / queued / stopped states.

   Motion is state / interaction only (no reveal, no load-in): row hover
   (kit .table--hover background + a 2px accent rail, mouse only), the
   "Otwarty" chip ring (kit .chip--live) and the pulse of the current step
   of open rows — the last two only while #gsTableWrap[data-loop] is on
   screen.

   JS contract (game-suggestions.js toggles / renders these): .gs-combobox
   [data-state], .gs-combobox-item(.is-highlighted), .gs-combobox-cover(--empty),
   .gs-combobox-name, .gs-combobox-year, .gs-combobox-empty, .is-invalid,
   .gs-form-feedback (+ .notice--success/--danger).
   ========================================================================== */


/* ── 1. Poll banner ─────────────────────────────────────────────────────────
   Shared/Notice (accent) across the list: icon | title over text | the
   Discord button on the right (the kit .notice__actions; on phones under
   the text at full width). Same corner radius as the list card under it. */
.gs-poll {
  margin-bottom: var(--space-6);
  border-radius: var(--radius-xl);
}
.gs-poll .notice__body strong { color: var(--text-strong); font-weight: 600; }
@media (max-width: 767px) {
  .gs-poll { margin-bottom: var(--space-5); }
}


/* ── 2. Legend ──────────────────────────────────────────────────────────────
   The body of the legend dialog: the five statuses (the chip above one
   line of text) and the five stages as a ladder of the row bar. */
.gs-legend { color: var(--text-2); }
.gs-legend__title { display: flex; margin: 0 0 var(--space-4); }
.gs-legend__title--stages {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
.gs-legend__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.gs-legend__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}
.gs-legend__text { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; }

.gs-stages {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gs-stages__item {
  display: grid;
  grid-template-columns: 1.25rem auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
}
.gs-stages__num {
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.gs-stages__item--last .gs-stages__num { color: var(--success-text); }
.gs-stages__item--last .gs-step.is-done { background-color: var(--success); }
.gs-stages__label { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.4; }
.gs-stages__note {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.gs-stages__note .gs-steps { flex-shrink: 0; }


/* ── 3. List ────────────────────────────────────────────────────────────────
   Kit .table.table--hover.table--stack in a radius-xl card. From 768px:
   four columns with a fixed layout, widths set on the heads:
     Gra (the rest) · Status 16rem · Postęp 15rem · Zgłoszono 9rem
   (tablets 768–1023: 10.5 / 12 / 8rem). Every row is at least 4.75rem
   tall and centred vertically, so the rhythm holds whatever a row holds.
   Head: a sunken strip with 11px mono labels. Rows: hairlines, no zebra;
   hover (mouse only) = the kit surface-hover + a 2px accent rail on the
   left (opacity only). Rejected / abandoned names step back to text-2.
   The cell sizing lives in the 768px block so the kit's phone stack
   (.table--stack) owns the cells on phones. */
.gs-table-wrap { border-radius: var(--radius-xl); }
.gs-table .gs-col-date { text-align: right; }
@media (min-width: 768px) {
  .gs-table { table-layout: fixed; }
  .gs-table th,
  .gs-table td { padding-inline: var(--space-5); }
  .gs-table thead th {
    padding-block: 0.6875rem;
    color: var(--text-2);
    background-color: var(--sunken);
    font-size: 0.6875rem;
    letter-spacing: 0.12em;
    border-bottom-color: var(--line);
  }
  .gs-table td { height: 4.75rem; padding-block: var(--space-4); }
  .gs-table th.gs-col-status   { width: 16rem; }
  .gs-table th.gs-col-progress { width: 15rem; }
  /* Room for the activity line under the date ("● aktywność 28 mar"
     ≈ 120px): the cell keeps 128px inside its padding. */
  .gs-table th.gs-col-date     { width: 10.5rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .gs-table th,
  .gs-table td { padding-inline: var(--space-4); }
  .gs-table th.gs-col-status   { width: 10.5rem; }
  .gs-table th.gs-col-progress { width: 11.5rem; }
  .gs-table th.gs-col-date     { width: 10rem; }
}

.gs-row > .gs-col-game { position: relative; }
.gs-row > .gs-col-game::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background-color: var(--accent-500);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-standard);
}
/* The rail: mouse only, like the kit row hover — a tap on a phone / tablet
   must not light the row up (owner, 2026-10-15). */
@media (hover: hover) and (pointer: fine) {
  .gs-row:hover > .gs-col-game::before { opacity: 1; }
}

/* Game: the name (two lines at most) over the source label. */
.gs-game {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3125rem;
  min-width: 0;
}
.gs-game__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}
.gs-row--rejected .gs-game__name,
.gs-row--abandoned .gs-game__name { color: var(--text-2); }

.gs-source {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.3;
}
.gs-source svg { flex-shrink: 0; font-size: 0.6875rem; color: var(--text-3); }
.gs-source--admin,
.gs-source--admin svg { color: var(--accent-text); }
/* The meta line: the source, then — a game outside Steam — a quieter note. */
.gs-game__meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-width: 0;
}
.gs-offsteam {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.3;
}
.gs-offsteam svg { flex-shrink: 0; font-size: 0.6875rem; color: var(--text-3); }

/* Status: the chip, then the icon-only "Zobacz powód" button (kit ghost
   .btn--icon.btn--sm). */
.gs-state { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }

/* Progress: the five-segment bar across the cell, the stage under it. */
.gs-progress {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}
.gs-steps { display: inline-flex; gap: 3px; flex-shrink: 0; }
.gs-step {
  width: 1.25rem;
  height: 6px;
  background-color: var(--surface-3);
  border-radius: var(--radius-full);
}
.gs-progress .gs-steps { display: flex; width: 100%; max-width: 13rem; }
.gs-progress .gs-step { flex: 1 1 0; width: auto; }
.gs-steps--mini { gap: 2px; }
.gs-steps--mini .gs-step { width: 0.75rem; height: 4px; }
.gs-step.is-done { background-color: var(--accent-500); }
.gs-progress--done .gs-step.is-done { background-color: var(--success); }
/* The step being worked on: a dim accent track with a bright streak running
   through it left → right ("w toku", section 7). The streak is a pseudo
   element moved with transform, clipped by the segment. */
.gs-step.is-current {
  position: relative;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--accent-500) 40%, var(--surface-3));
}
@supports not (background-color: color-mix(in srgb, red 50%, blue)) {
  .gs-step.is-current { background-color: var(--accent-soft-hover); }
}
.gs-step.is-current::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 70%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent-300) 55%, var(--accent-400) 80%, transparent);
  transform: translateX(-100%);
}
.gs-step.is-queued { background-color: var(--warning-line); }
.gs-progress--rejected .gs-step.is-stopped { background-color: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger-line); }
.gs-progress--abandoned .gs-step.is-stopped { background-color: var(--surface-active); box-shadow: inset 0 0 0 1px var(--line-strong); }
.gs-progress__label {
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

/* Dates, right-aligned: "8 wrz" in text weight with the year quieter (mono)
   beside it; recent work on an open project as one quiet line under it —
   a small success dot, "aktywność" and the day ("● aktywność 7 paź"). */
.gs-dates { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3125rem; }
.gs-activity {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  color: var(--text-3);
  font-size: var(--fs-xs);
  line-height: 1.3;
  white-space: nowrap;
}
.gs-activity__dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--success-soft);
}
.gs-activity__day { color: var(--text-2); font-weight: 500; }
.gs-date {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  white-space: nowrap;
}
.gs-date__day {
  color: var(--text-strong);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.gs-date__year {
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

/* Phones: the kit .table--stack makes every row a compact card inside the
   list frame; this places the cells —
     name + source
     status (+ reason)      date
     bar, stage under it
   centred, with a little more room at the bottom. The rail runs down the
   whole card. */
@media (max-width: 767px) {
  .gs-table tbody tr {
    position: relative;
    grid-template-areas:
      "game     game"
      "status   date"
      "progress progress";
    align-items: center;
    padding-bottom: var(--space-5);
  }
  .gs-table td.gs-col-game { grid-area: game; }
  .gs-table td.gs-col-status { grid-area: status; }
  .gs-table td.gs-col-date { grid-area: date; }
  .gs-table td.gs-col-progress { grid-area: progress; }
  .gs-row > .gs-col-game { position: static; }
  .gs-game__name { display: block; font-size: 1rem; }
  .gs-progress .gs-steps { max-width: none; }
}


/* ── 4. Dialogs ─────────────────────────────────────────────────────────────
   "Suggestions paused" dialog: a centred card without the header bar — a
   small scene (three cover placeholders, the middle one "being built" with
   a light streak running through it and a gently bobbing tool), a chip, the
   title and two full-width actions. Transform / opacity only; still under
   reduced motion. */
.gs-dialog--blocked .dlg__body { position: relative; padding: var(--space-8) var(--space-6) var(--space-6); }
.gs-blocked {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gs-blocked__scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.625rem;
  width: 10.5rem;
  height: 6.75rem;
  margin-bottom: var(--space-5);
  padding: 0.75rem 0.875rem;
}
.gs-blocked__frame { --frame-inset: 0px; --frame-len: 0.75rem; }
.gs-blocked__card {
  position: relative;
  width: 2.5rem;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background-color: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.gs-blocked__card--build {
  display: grid;
  place-items: center;
  width: 3.25rem;
  color: var(--warning-text);
  background-color: var(--warning-soft);
  border-color: var(--warning-line);
  box-shadow: 0 10px 24px -10px var(--warning-glow);
  font-size: 1rem;
}
.gs-blocked__card--build svg { position: relative; z-index: 1; }
.gs-blocked__card--build::after {   /* the streak: the kit sweep light at ~half strength */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--sheen-sweep) 50%, transparent 70%);
  opacity: 0.47;
  transform: translateX(-120%);
}
.gs-blocked__chip { margin-bottom: var(--space-3); }
.gs-blocked__title {
  margin: 0 0 var(--space-2);
  color: var(--text-strong);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.gs-blocked__text {
  max-width: 22rem;
  margin: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.gs-blocked__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-6);
}
@media (prefers-reduced-motion: no-preference) {
  .gs-dialog--blocked .gs-blocked__card--build::after { animation: gs-blocked-sweep 2.2s ease-in-out infinite; }
  .gs-dialog--blocked .gs-blocked__card--build svg { animation: gs-blocked-tool 2.2s ease-in-out infinite; }
}
@keyframes gs-blocked-sweep {
  0%, 15% { transform: translateX(-120%); }
  70%, 100% { transform: translateX(120%); }
}
@keyframes gs-blocked-tool {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}

/* Submission form */
.gs-form { display: flex; flex-direction: column; gap: var(--space-4); }
.gs-required { color: var(--danger-text); }
.gs-hint code {
  padding: 0.0625rem 0.3125rem;
  color: var(--text-1);
  background-color: var(--surface-3);
  border-radius: var(--radius-xs);
}

.gs-combobox { display: flex; flex-direction: column; gap: var(--space-2); }
.gs-combobox-input-wrap { position: relative; }
.gs-combobox-lead {
  position: absolute;
  top: 50%;
  left: 0.875rem;
  display: inline-flex;
  color: var(--text-3);
  font-size: 1rem;
  transform: translateY(-50%);
  pointer-events: none;
  transition: color var(--dur-fast) var(--ease-standard);
}
.gs-combobox-input.input {
  height: 2.75rem;
  padding-left: 2.5rem;
  padding-right: 2.75rem;
}
.gs-combobox-input[readonly] { border-color: var(--success-line); cursor: default; }
.gs-combobox-input[readonly]:focus { box-shadow: none; }
.gs-combobox-input.is-invalid { border-color: var(--danger-line); }
.gs-combobox-status {
  position: absolute;
  top: 50%;
  right: 0.875rem;
  display: inline-flex;
  color: var(--accent-text);
  transform: translateY(-50%);
  pointer-events: none;
}
.gs-combobox-status svg { display: none; }
.gs-combobox[data-state="typing"] .gs-combobox-icon-loading,
.gs-combobox[data-state="loading"] .gs-combobox-icon-loading { display: block; }
.gs-combobox[data-state="selected"] .gs-combobox-lead { color: var(--success-text); }
.gs-combobox-clear {
  position: absolute;
  top: 50%;
  right: 0.375rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transform: translateY(-50%);
  transition: color var(--dur-fast) var(--ease-standard),
              background-color var(--dur-fast) var(--ease-standard);
}
.gs-combobox-clear:hover { color: var(--text-strong); background-color: var(--surface-hover); }
.gs-combobox-clear:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* The results panel: one fixed-height box under the field; the combobox
   state decides what shows in it (the dialog never changes size). */
.gs-results {
  position: relative;
  height: 15.5rem;
  overflow: hidden;
  background-color: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.gs-combobox-list {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0.375rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.gs-results__state {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.55;
  text-align: center;
}
.gs-results__state p { max-width: 22rem; margin: 0; }
/* Typing again while results are shown: keep the current list (dimmed, the
   spinner in the field says a new search runs) instead of laying the loading
   skeleton over it — the two used to overlap. The skeleton only appears when
   there is no list yet. */
.gs-combobox-list { transition: opacity var(--dur-fast) var(--ease-standard); }
.gs-combobox[data-state="typing"] .gs-combobox-list:not([hidden]),
.gs-combobox[data-state="loading"] .gs-combobox-list:not([hidden]) { opacity: 0.45; pointer-events: none; }
.gs-combobox-list:not([hidden]) ~ .gs-results__state--loading { display: none !important; }
.gs-combobox[data-state="empty"] .gs-results__state--idle,
.gs-combobox[data-state="selected"] .gs-results__state--selected { display: flex; }
.gs-combobox[data-state="typing"] .gs-results__state--loading,
.gs-combobox[data-state="loading"] .gs-results__state--loading {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0.375rem;
}
.gs-results__ok { color: var(--success-text); background-color: var(--success-soft); border-color: var(--success-line); }
.gs-results__ghost {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: 0.5rem;
}
.gs-results__ghost-cover { height: 1.875rem; border-radius: var(--radius-xs); }
.gs-results__ghost .skeleton--text { width: 60%; }
.gs-results__ghost:nth-child(2) .skeleton--text { width: 42%; }
.gs-results__ghost:nth-child(3) .skeleton--text { width: 70%; }
.gs-results__ghost:nth-child(4) .skeleton--text { width: 50%; }

/* Rows rendered by game-suggestions.js */
.gs-combobox-item {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  padding: 0.5rem;
  color: var(--text-1);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}
@media (hover: hover) and (pointer: fine) {   /* no tap flash on touch */
  .gs-combobox-item:hover { background-color: var(--surface-hover); }
}
.gs-combobox-item.is-highlighted {
  color: var(--text-strong);
  background-color: var(--accent-soft);
  border-color: var(--accent-line);
}
.gs-combobox-cover {
  display: block;
  width: 5rem;
  height: 1.875rem;
  object-fit: cover;
  background-color: var(--surface-2);
  border-radius: var(--radius-xs);
  box-shadow: inset 0 0 0 1px var(--line);
}
.gs-combobox-cover--empty { display: grid; place-items: center; color: var(--text-3); font-size: 0.875rem; }
.gs-combobox-name {
  min-width: 0;
  overflow: hidden;
  font-size: 0.9375rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-combobox-year { color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-xs); }
.gs-combobox-empty {
  padding: var(--space-8) var(--space-4);
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
}

.gs-turnstile { min-height: 65px; }
.gs-form-feedback { font-size: var(--fs-sm); }

/* Reason */
.gs-reason__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.gs-reason__game { margin: 0; color: var(--text-strong); font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.gs-reason__text {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  color: var(--text-1);
  background-color: var(--sunken);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  line-height: 1.65;
}
.gs-reason__text p { margin: 0; white-space: pre-line; }

@media (max-width: 767px) {
  .gs-dialog .dlg__body { padding: var(--space-4); }
  .gs-results { height: 13rem; }
}


/* ── 5. Motion ──────────────────────────────────────────────────────────────
   The current step of an open row (and the legend dialog's sample): a light
   streak sweeps through it left → right every 1.8s while its [data-loop]
   box is on screen ("w toku"). Transform only. Done rows never move.
   Reduced motion: everything stands still (the dim track, no streak). */
@media (prefers-reduced-motion: no-preference) {
  .gs-table-wrap.is-visible .gs-progress--open .gs-step.is-current::after,
  .gs-stages__note.is-visible .gs-step.is-current::after {
    animation: gs-step-sweep 1.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  }
}
@keyframes gs-step-sweep {
  0%   { transform: translateX(-100%); }
  70%  { transform: translateX(150%); }
  100% { transform: translateX(150%); }
}

@media (prefers-reduced-motion: reduce) {
  .gs-step.is-current::after { animation: none; }
  .gs-row > .gs-col-game::before { transition: none; }
}
