/* ==========================================================================
   VotingSite · per-item store verification.
   The one-item post-vote question, the "what the store sells" panel, the
   compact tags and the moderation queue.

   Loaded after style.css and reusing its tokens (--bg, --bg-elev, --panel,
   --panel-2, --border, --text, --muted, --accent, --gold, --danger, --r).
   Mobile-first: the question card is answered on a phone, one thumb, straight
   after voting, so the three answers are full-width targets before anything
   else about them is decided.
   ========================================================================== */

/* ------------------------------------------------------------- tones -- */
/* One place to map a tone name onto a colour. Every chip, bar and border
   below reads --tone, so a new state needs a selector here and nothing else. */
.sv-ask [data-tone],
.sv-panel [data-tone],
.sv-tags [data-tone],
.sv-dispute [data-tone] { --tone: var(--muted); }
[data-tone="good"]    { --tone: var(--accent); }
[data-tone="warn"]    { --tone: var(--gold); }
[data-tone="bad"]     { --tone: var(--danger); }
[data-tone="neutral"] { --tone: var(--muted); }
[data-tone="muted"]   { --tone: var(--muted); }

/* ----------------------------------------------------------- question -- */
.sv-ask { margin: 0 0 var(--gap); }

.sv-ask-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: var(--muted);
}

/* The question itself is the loudest thing on the card · it is the only
   thing the player has to read to answer correctly. */
.sv-ask-q {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  max-width: 34ch;
}
.sv-ask-help {
  margin: 0 0 var(--gap);
  font-size: .82rem;
  color: var(--muted);
}

.sv-answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 0 12px;
}

.sv-answer {
  min-height: 52px;
  padding: 12px 16px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.sv-answer:hover {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
}
.sv-answer:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .sv-answer:active { transform: scale(.98); }
}

.sv-ask-note {
  margin: 0 0 10px;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 60ch;
}

.sv-skip {
  font-size: .82rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sv-skip:hover { color: var(--text); }

/* -------------------------------------------------------------- panel -- */
/* On a server page this sits *inside* the About card, so it is a panel within a
   panel: it needs its own inset and its own surface, or its contents read as
   loose text belonging to the card around it. The padding is stated here rather
   than borrowed from `.card`, because the same fragment is also rendered on its
   own where that class may not be in play. */
.sv-panel {
  margin: var(--gap) 0;
  padding: 18px;
  background: var(--panel-2);
}
@media (max-width: 720px) {
  .sv-panel { padding: 14px; }
}

.sv-panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.sv-panel-head .card-title { flex: 1 1 auto; }

.sv-tier {
  padding: 3px 10px;
  font-size: .76rem;
  font-weight: 700;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  border-radius: 999px;
}
/* P2W_TIERS carries its own tone vocabulary; map the two that differ. */
.sv-tier[data-tone="ok"] { --tone: var(--accent); }

.sv-panel-sub,
.sv-foot {
  margin: 6px 0 0;
  font-size: .78rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 68ch;
}
.sv-foot { margin-top: 12px; }

.sv-empty {
  margin: var(--gap) 0 0;
  padding: 14px;
  font-size: .84rem;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: var(--r);
}

/* --------------------------------------------------------- item rows -- */
.sv-items {
  list-style: none;
  margin: var(--gap) 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.sv-item {
  --tone: var(--muted);
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  /* The state colour lives on the leading edge: scannable down the column
     without turning every row into a coloured block. */
  border-left: 3px solid var(--tone);
  border-radius: var(--r);
}
.sv-item[data-state="owner"]     { --tone: var(--border); }
.sv-item[data-state="reported"]  { --tone: var(--muted); }
.sv-item[data-state="confirmed"] { --tone: var(--accent); }
.sv-item[data-state="denied"]    { --tone: var(--gold); }
.sv-item[data-state="added"]     { --tone: var(--danger); }

/* A denied item is still listed by the owner · shown, struck, explained. */
.sv-item[data-state="denied"] .sv-item-name {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--gold) 70%, transparent);
  color: var(--muted);
}

.sv-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sv-item-name {
  flex: 1 1 auto;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.3;
}
.sv-item-help {
  margin: 2px 0 0;
  font-size: .76rem;
  color: var(--muted);
}

.sv-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 38%, transparent);
  border-radius: 999px;
}
.sv-chip-icon { font-size: .8em; line-height: 1; }

.sv-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: .74rem;
  color: var(--muted);
}
.sv-counts { white-space: nowrap; }
.sv-counts.is-empty { opacity: .75; font-style: italic; }

/* Confidence bar. Deliberately thin: it qualifies the counts, it is not the
   headline · a wide bar would read as a score for the server itself. */
.sv-bar {
  flex: 1 1 80px;
  min-width: 60px;
  max-width: 220px;
  height: 5px;
  background: color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.sv-bar-fill {
  display: block;
  height: 100%;
  background: var(--tone);
  border-radius: inherit;
}
.sv-bar-pct { white-space: nowrap; font-variant-numeric: tabular-nums; }

.sv-item-note {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft, var(--border));
  font-size: .76rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 62ch;
}

/* ----------------------------------------------------------- callout -- */
.sv-callout {
  display: flex;
  gap: 10px;
  margin: var(--gap) 0 0;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
  border-radius: var(--r);
}
.sv-callout[data-severity="high"] {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}
.sv-callout-icon { font-size: 1.1rem; line-height: 1.3; }
.sv-callout-body { flex: 1 1 auto; min-width: 0; }
.sv-callout-title {
  display: block;
  font-family: var(--font-display);
  font-size: .9rem;
  margin-bottom: 4px;
}
.sv-callout-text,
.sv-callout-foot {
  margin: 0;
  font-size: .8rem;
  line-height: 1.55;
  color: var(--text);
  max-width: 64ch;
}
.sv-callout-foot {
  margin-top: 6px;
  font-size: .74rem;
  color: var(--muted);
}

/* The two versions, always styled the same way wherever they appear, so the
   reader learns the pair once: muted box = the listing, accent = the players. */
.sv-claim {
  padding: 1px 6px;
  border-radius: var(--r-sm, 5px);
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  color: var(--text);
}
.sv-community {
  padding: 1px 6px;
  border-radius: var(--r-sm, 5px);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
}

/* ---------------------------------------------------------- list tags -- */
.sv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 0;
}
.sv-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 32%, transparent);
  border-radius: 999px;
}
.sv-tag.is-more {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}
.sv-tag-icon { font-size: .8em; line-height: 1; }

/* --------------------------------------------------------- moderation -- */
.sv-intro { max-width: 72ch; margin-bottom: var(--gap); }

.sv-dispute { margin: 0 0 var(--gap); border-left: 3px solid var(--border); }
.sv-dispute[data-severity="high"] { border-left-color: var(--danger); }
.sv-dispute[data-severity="low"]  { border-left-color: var(--gold); }

.sv-dispute-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sv-dispute-head .card-title { flex: 1 1 auto; margin: 0; }
.sv-dispute-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
}
.sv-arrow { color: var(--muted); }
.sv-dispute-conf {
  font-size: .74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.sv-table { width: 100%; }
.sv-table td .muted { font-size: .74rem; }

.sv-dispute-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 0;
  font-size: .78rem;
  color: var(--muted);
}
.sv-dispute-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* -------------------------------------------------------------- light -- */
/* The dark theme leans on transparent tints over a dark panel; on light those
   tints wash out, so the surfaces get an explicit elevated background. */
html[data-theme="light"] .sv-answer,
html[data-theme="light"] .sv-item,
html[data-theme="light"] .sv-empty,
html[data-theme="light"] .sv-tag { background: var(--bg-elev); }

html[data-theme="light"] .sv-answer:hover { background: color-mix(in srgb, var(--tone) 10%, var(--bg-elev)); }
html[data-theme="light"] .sv-chip,
html[data-theme="light"] .sv-tier { background: color-mix(in srgb, var(--tone) 12%, var(--bg-elev)); }
html[data-theme="light"] .sv-bar { background: color-mix(in srgb, var(--border) 90%, transparent); }
html[data-theme="light"] .sv-callout { background: color-mix(in srgb, var(--gold) 12%, var(--bg-elev)); }
html[data-theme="light"] .sv-callout[data-severity="high"] { background: color-mix(in srgb, var(--danger) 8%, var(--bg-elev)); }
html[data-theme="light"] .sv-claim { background: color-mix(in srgb, var(--muted) 18%, transparent); }
html[data-theme="light"] .sv-community { background: color-mix(in srgb, var(--accent) 14%, transparent); }
html[data-theme="light"] .sv-item[data-state="owner"] { --tone: var(--border); }

/* ------------------------------------------------------------ desktop -- */
@media (min-width: 560px) {
  /* Three answers side by side once they still clear a comfortable target. */
  .sv-answers { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 720px) {
  .sv-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 14px;
    padding: 12px 14px;
  }
  .sv-item-main { grid-column: 1; }
  .sv-item-help { grid-column: 1; }
  .sv-item-meta { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; justify-content: flex-end; }
  .sv-item-note { grid-column: 1 / -1; }
  .sv-ask-q { font-size: 1.3rem; }
}

@media (max-width: 420px) {
  .sv-item-meta { font-size: .72rem; }
  .sv-bar { max-width: none; }
}

/* ==========================================================================
   Store-check tier chip: contrast  (a11y pass)
   --------------------------------------------------------------------------
   Lighthouse color-contrast on the server page:
     div.sv-panel-head > span.sv-tier · #8b949e on #28303f, 4.3:1 at 12.16px
     bold, against a 4.5:1 requirement.
   The chip paints `color: var(--tone)` over `color-mix(--tone 14%, transparent)`.
   For the accent / gold / danger tones that is a saturated ink on a faint wash
   of itself and clears AA comfortably. For the neutral and muted tones --tone
   IS --muted, so it renders muted-on-muted and collapses. Those two take the
   body ink instead; the wash and border still carry the "this is a chip, and it
   is the unremarkable one" signal.
   ========================================================================== */
.sv-tier[data-tone="muted"],
.sv-tier[data-tone="neutral"] { color: var(--text); }
