/* ratings.html — player ratings flow (rate state: mobile deck / desktop list · compare state)
   Composition only; modules come from modules-match.css (scoreboard, rating-scale, rating-badge, rating-compare). */

.page-head.ratings-head { margin-bottom: var(--sp-4); }
.ratings-head .page-head__main { gap: var(--sp-2); }
.ratings-head__fans { display: inline-block; white-space: nowrap; color: var(--text-muted); }
.ratings-head__fans b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.ratings-head .page-head__intro { font-size: var(--fs-base); }

.ratings-sb { width: 100%; margin-bottom: var(--sp-4); }
/* keep the compact scoreboard short on phones */
@media (max-width: 679px) {
  .ratings-sb .scoreboard__foot, .ratings-sb .scoreboard__goals { display: none; }
  .ratings-head__fans { display: none; }
}

[data-if][hidden], .rate-state[hidden], .cmp[hidden] { display: none; }

/* -------------------------------------------------------------- shared small pieces */
.rfacts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin: 0; padding: 0; list-style: none; }
.rfacts--none { font-size: var(--fs-xs); color: var(--text-muted); }
.rfact {
  display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px;
  border: var(--bw) solid var(--border); border-radius: var(--r-xs);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text); font-variant-numeric: tabular-nums;
}
.rfact .icon { width: 14px; height: 14px; flex: none; }
.rfact--goal { border-color: var(--border-strong); color: var(--text-strong); font-weight: var(--fw-semibold); }
.rcap {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; vertical-align: 2px;
  border-radius: var(--r-xs); background: var(--yellow); color: var(--on-yellow);
  font-family: var(--font-display); font-size: var(--fs-xs); font-weight: var(--fw-black); line-height: 1;
}

/* -------------------------------------------------------------- sticky progress + submit bar */
.rbar {
  position: sticky; top: var(--header-h); z-index: var(--z-sticky);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-2) var(--sp-3);
  margin: 0 0 var(--sp-4); padding: var(--sp-2) var(--sp-3);
  background: var(--surface-1); border: var(--bw) solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.rbar__prog { display: grid; gap: 6px; min-width: 0; }
.rbar__count { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rbar__count b { font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black); font-size: var(--fs-lg); color: var(--text-strong); }
.rbar__reward { display: none; }
.rbar__submit { white-space: nowrap; }
@media (min-width: 600px) {
  .rbar { grid-template-columns: minmax(0, 1fr) auto auto; padding: var(--sp-3) var(--sp-4); gap: var(--sp-4); }
  .rbar__reward { display: inline-flex; }
}

/* -------------------------------------------------------------- layout switch (768px) */
.rlist { display: none; }
@media (min-width: 768px) {
  .rlist { display: block; }
}

/* ============================================================== MOBILE DECK */
.deck { display: grid; gap: var(--sp-3); min-width: 0; }
@media (min-width: 768px) { .deck { display: none; } }
.deck__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.deck__pos { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.deck__pos b { font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-black); font-size: var(--fs-lg); color: var(--text-strong); }
.deck__hint { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }

.deck__segs { display: flex; gap: 2px; }
.deck__seg { flex: 1 1 0; min-width: 0; height: 32px; padding: 0; display: grid; align-items: center; background: transparent; border: 0; cursor: pointer; }
.deck__seg i { display: block; height: 6px; border-radius: 2px; background: var(--bar-track); transition: background-color var(--dur-fast), height var(--dur-fast); }
.deck__seg.is-rated i { background: var(--yellow); }
.deck__seg.is-skipped i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.deck__seg.is-current i { height: 12px; box-shadow: 0 0 0 2px var(--surface-inverse); }
.deck__seg.is-current.is-rated i { box-shadow: 0 0 0 2px var(--surface-inverse); }
.deck__seg:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

.deck__track {
  display: flex; gap: var(--sp-3); margin: 0; padding: 0; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
  touch-action: pan-x pan-y; cursor: grab;
}
.deck__track::-webkit-scrollbar { display: none; }
.deck__track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.deck__track:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-md); }
@media (prefers-reduced-motion: no-preference) { .deck__track { scroll-behavior: smooth; } .deck__track.is-dragging { scroll-behavior: auto; } }

.rcard {
  flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always;
  display: grid; gap: var(--sp-4); align-content: start; padding: var(--sp-4);
  background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md);
}
.rcard.is-rated { border-color: var(--border-strong); }
.rcard__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); }
.rcard__id { min-width: 0; }
.rcard__name {
  margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-xc); font-weight: var(--fw-black);
  font-size: var(--fs-xl); line-height: 1.05; letter-spacing: .02em; text-transform: uppercase; color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rcard__name a { color: inherit; text-decoration: none; }
.rcard__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rcard__meta { margin: 3px 0 0; font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rcard__status { align-self: start; color: var(--text-muted); }
.rcard.is-rated .rcard__status { color: var(--text-strong); border-color: var(--success); }
.rcard.is-skipped:not(.is-rated) .rcard__status { border-style: dashed; }

.rcard__rate { display: grid; gap: var(--sp-3); padding-top: var(--sp-4); border-top: var(--bw) solid var(--border-subtle); }
.rcard__rate-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.rcard__rate-head .label { color: var(--text-muted); }
.rcard__out { display: inline-flex; align-items: center; gap: var(--sp-2); }
.rcard__half { min-height: 36px; padding: 0 var(--sp-3); }
.rcard__half:disabled { opacity: .45; cursor: not-allowed; }
.rcard__half .icon { width: 14px; height: 14px; }
.rcard__half[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }

.deck__nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-2); }
.deck__nav .btn:disabled { opacity: .4; }

/* ============================================================== DESKTOP LIST */
.rlist { container-type: inline-size; background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); overflow: hidden; }
.rlist__head, .rrow { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: var(--sp-4); padding: 0 var(--sp-4); }
.rlist__head {
  min-height: 36px; background: var(--surface-2); border-bottom: var(--bw) solid var(--border-subtle);
  font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold);
  font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}
.rlist__rows { margin: 0; padding: 0; list-style: none; }
.rrow { padding-block: var(--sp-3); border-bottom: var(--bw) solid var(--border-subtle); transition: background-color var(--dur-fast); }
.rrow:hover { background: var(--surface-2); }
.rrow.is-rated { box-shadow: inset 3px 0 0 var(--yellow); }
.rrow__id { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.rrow__txt { display: grid; gap: 4px; min-width: 0; }
.rrow__name { margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-lg); line-height: 1.1; color: var(--text-strong); }
.rrow__name a { color: inherit; text-decoration: none; }
.rrow__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rrow__pos { margin-left: 6px; font-family: var(--font-body); font-stretch: normal; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.rfacts--row { gap: 2px var(--sp-1); }
.rfacts--row .rfact { min-height: 20px; padding: 0 6px; border-color: var(--border-subtle); font-size: var(--fs-xs); }

.rrow__rate { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-width: 0; }
.rrow__slider { min-width: 0; }
.rrow__slider.is-unset::-webkit-slider-runnable-track { background: var(--bar-track); }
.rrow__slider.is-unset::-moz-range-progress { background: transparent; }
.rrow__slider.is-unset::-webkit-slider-thumb { border-style: dashed; border-color: var(--text-muted); opacity: .8; }
.rrow__slider.is-unset::-moz-range-thumb { border-style: dashed; border-color: var(--text-muted); opacity: .8; }
.rrow__rate .rating-badge { width: 52px; justify-content: center; }
.rrow__note .input { width: 100%; }
@container (max-width: 859px) {
  .rlist__head, .rrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); row-gap: var(--sp-2); }
  .rlist__head span:nth-child(3) { display: none; }
  .rrow__note { grid-column: 1 / -1; padding-left: calc(36px + var(--sp-3)); }
}
.rlist__foot { margin: 0; padding: var(--sp-3) var(--sp-4); font-size: var(--fs-sm); background: var(--surface-2); }

/* ============================================================== STATE 2 · COMPARE */
.cmp { display: grid; gap: var(--sp-8); min-width: 0; }
.cmp-sum { display: grid; gap: var(--sp-4); padding: var(--sp-4); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.cmp-sum__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.cmp-sum__head .section-head__title { margin: 0; }
.cmp-sum__sub { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
.cmp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.cmp-stats .stat-tile { padding: var(--sp-3); }
.cmp-stats .stat-tile__label { font-size: var(--fs-xs); }
.cmp-stats .stat-tile__value { font-size: var(--fs-2xl); }
.cmp-stats .stat-tile__value small { font-size: var(--fs-md); }
.cmp-stats .stat-tile--you { border-left: 3px solid var(--yellow); }
.cmp-stats .progress { margin-top: 2px; }
.cmp-cta { display: grid; gap: var(--sp-2); }
.cmp-cta .btn { width: 100%; }
.cmp-cta__sub { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); text-align: center; }
@media (min-width: 600px) {
  .cmp-sum { padding: var(--sp-6); }
  .cmp-stats .stat-tile { padding: var(--sp-4); }
  .cmp-cta { grid-template-columns: auto auto 1fr; align-items: center; }
  .cmp-cta .btn { width: auto; }
  .cmp-cta .btn--ghost { justify-self: start; }
  .cmp-cta__sub { grid-column: 1 / -1; text-align: left; }
}

.cmp-hl { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .cmp-hl { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cmp-hl__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); padding: var(--sp-3); background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); }
.cmp-hl__label { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.cmp-hl__name { display: block; margin-top: 1px; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-lg); line-height: 1.1; color: var(--text-strong); }
.cmp-hl__name a { color: inherit; text-decoration: none; }
.cmp-hl__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmp-hl__vals { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.cmp-hl .rating-compare__delta { min-height: 24px; font-size: var(--fs-sm); }

.cmp-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-legend i { width: 12px; height: 12px; border-radius: var(--r-xs); background: var(--bar-strong); }
.cmp-legend i.is-you { background: var(--yellow); }

.cmp-list { display: grid; margin: var(--sp-3) 0 0; padding: 0; list-style: none; background: var(--surface-1); border: var(--bw) solid var(--border-subtle); border-radius: var(--r-md); overflow: hidden; }
.crow { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-3) var(--sp-3); align-items: start; padding: var(--sp-3) var(--sp-4); border-bottom: var(--bw) solid var(--border-subtle); }
.crow:last-child { border-bottom: 0; }
.crow.is-harsh { box-shadow: inset 3px 0 0 var(--red); }
.crow.is-generous { box-shadow: inset 3px 0 0 var(--yellow); }
.crow.is-agreed { box-shadow: inset 3px 0 0 var(--success); }
.crow__main { display: grid; gap: var(--sp-2); min-width: 0; }
.crow__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-3); }
.crow__name { margin: 0; font-family: var(--font-display); font-stretch: var(--stretch-c); font-weight: var(--fw-bold); font-size: var(--fs-lg); line-height: 1.1; color: var(--text-strong); }
.crow__name a { color: inherit; text-decoration: none; }
.crow__name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crow__meta { font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.crow__tag { margin-left: auto; }
.crow__note { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); font-style: italic; overflow-wrap: anywhere; }
.crow__note::before { content: "“"; } .crow__note::after { content: "”"; }
.crow .rating-compare { max-width: 560px; }
.crow--skipped .crow__main > p { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
@media (min-width: 900px) {
  .crow { grid-template-columns: auto minmax(160px, 220px) minmax(0, 1fr); align-items: center; }
  .crow__main { display: contents; }
  .crow__top { grid-column: 2; grid-row: 1; flex-direction: column; align-items: flex-start; gap: 2px; }
  .crow__tag { margin-left: 0; }
  .crow .rating-compare { grid-column: 3; grid-row: 1; max-width: none; }
  .crow__note { grid-column: 2 / 4; grid-row: 2; }
  .crow--skipped .crow__main > p { grid-column: 3; grid-row: 1; }
}
/* ka: "გულშემატკივრების საშუალო" can't fit a 3-up tile on phones → 2-up, agreement spans the row */
@media (max-width: 479.98px) {
  :lang(ka) .cmp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :lang(ka) .cmp-stats .stat-tile--accent { grid-column: 1 / -1; }
}
