/* styles — part 5 of 6 (css/5-card-matchups-charts.css). The site's one stylesheet, split in its
   original order: the parts are loaded in this order (partials/head.html,
   admin/index.html) and must stay so — later rules win ties. */

/* ✎ and ✓ stacked in the same spot, one turning out as the other turns in
   (.is-save is set by js/account-page.js the moment the mode switches). */
.pc-edit-btn svg {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
  transition:
    opacity 180ms ease,
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pc-icon-save,
.pc-edit-btn.is-save .pc-icon-edit {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

.pc-edit-btn.is-save .pc-icon-edit {
  transform: rotate(90deg) scale(0.4);
}

.pc-edit-btn.is-save .pc-icon-save {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .pc-edit-btn svg {
    transition: none;
  }
}

.pc-cancel-btn {
  position: absolute;
  top: -8px;
  right: 40px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  background: #fff;
  color: #6f5a5e;
  box-shadow: 0 6px 14px rgba(20, 8, 10, 0.25);
  cursor: pointer;
  transition: transform 150ms ease;
}

.pc-cancel-btn:hover {
  transform: translateY(-1px) scale(1.05);
}

.pc-cancel-btn[hidden] {
  display: none;
}

.pc-cancel-btn svg {
  width: 16px;
  height: 16px;
}

/* ---- Edit mode on touch screens (html.nav-mobile) ----
   The card sizes everything in cqw, so on a ~300px card its controls come
   out finger-unfriendly (colour toggles ~16px, the "Mostra foto" checkbox
   ~10px, ~22px-tall lists). On touch, edit mode switches them to fixed,
   finger-sized px instead — taps of 36-44px, text fields at 16px so iOS
   doesn't zoom the page in when they're focused. The card just grows
   taller while editing (its proportions are a minimum, see .pc-surface);
   view mode is untouched. */
html.nav-mobile .player-card.is-editing .pc-label {
  font-size: 11px;
}

html.nav-mobile .player-card .cs-search {
  padding: 10px 12px;
  font-size: 16px;
}

html.nav-mobile .player-card .cs-option {
  min-height: 44px;
  box-sizing: border-box;
}

html.nav-mobile .player-card.is-editing .pc-colors-edit.pc-edit-only {
  gap: 12px;
  margin-top: 8px;
}

html.nav-mobile .pc-mana {
  width: 36px;
  height: 36px;
}

html.nav-mobile .pc-description-edit textarea {
  /* 140 characters fit at this size, still not resizable. */
  height: 136px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 16px;
}

html.nav-mobile .pc-counter {
  margin-top: 4px;
  font-size: 12px;
}

html.nav-mobile .pc-avatar-toggle {
  box-sizing: border-box;
  gap: 8px;
  min-height: 36px;
  margin-top: 6px;
  padding: 6px 14px;
  font-size: 13px;
}

html.nav-mobile .pc-avatar-toggle input {
  width: 18px;
  height: 18px;
}

/* ✕ at ✓'s 44px, a 12px gap beside it. */
html.nav-mobile .pc-cancel-btn {
  top: -12px;
  right: 44px;
  width: 44px;
  height: 44px;
}

html.nav-mobile .pc-cancel-btn svg {
  width: 18px;
  height: 18px;
}

/* ---- account.html "Invia la tua decklist" (js/account-page.js) ----
   The profile's Decklist tab (and the Impostazioni tab's Account part, the
   same .decklist-body): the list in a monospaced box with a live count in
   its corner (green at a full 100-card deck); the send button (sent
   straight away, pulsing while it goes); the events already sent as green
   chips, a new one popping in. */

/* minmax(0, 1fr): the one column never wider than the card — by default a
   grid column grows to its widest unbreakable content (Account's email, kept
   on one line), which pushed the row, "Esci" included, out of the card on
   phones instead of letting the email end in "…". */
.decklist-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.decklist-hint {
  margin: 0 0 16px;
}

/* An open dropdown inside lifts the whole card above the Account card
   below it (the card's entrance animation makes it a stacking context —
   same fix as the claim card's). */
.card.profile-decklist:has(.cs-wrap.is-open) {
  position: relative;
  z-index: 30;
}

.decklist-form .field {
  margin-bottom: 14px;
}

.decklist-text-wrap {
  position: relative;
}

.decklist-form textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 210px;
  padding: 12px 14px 34px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fff;
  color: var(--text-body);
  font: 0.92rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

/* Phones: half as tall (4 lines instead of 9) — still draggable taller. */
@media (max-width: 640px) {
  .decklist-form textarea {
    height: calc(6em + 48px);
    min-height: calc(6em + 48px);
  }
}

.decklist-form textarea:focus {
  outline: none;
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(220, 24, 28, 0.15);
}

/* The live count, in the box's bottom-right corner. */
.decklist-meter {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: rgba(220, 24, 28, 0.08);
  color: var(--brand-red);
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
  transition: background 200ms ease, color 200ms ease;
}

.decklist-meter:empty {
  display: none;
}

.decklist-meter.is-full {
  background: rgba(30, 140, 80, 0.12);
  color: var(--accent-green-2);
}

.decklist-meter.is-full::after {
  content: " ✓";
}

.decklist-submit {
  gap: 8px;
}

.decklist-submit svg {
  width: 18px;
  height: 18px;
  transition: transform 200ms ease;
}

.decklist-submit:hover svg {
  transform: translate(2px, -2px);
}

/* Sending: the button pulses while the email goes out. */
.decklist-submit.is-sending {
  animation: decklist-sending 1s ease-in-out infinite;
  cursor: progress;
}

@keyframes decklist-sending {
  50% {
    opacity: 0.65;
  }
}

#decklist-message:empty {
  min-height: 0;
  margin-top: 0;
}

#decklist-message {
  margin-top: 12px;
}

/* The address to send it to by hand, when sending fails: a clear link
   inside the message. */
#decklist-message a {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

/* Events already sent: green chips, the newest first; one just sent pops in. */
.decklist-sent {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.decklist-sent[hidden] {
  display: none;
}

.decklist-sent-title {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decklist-sent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.decklist-sent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(30, 140, 80, 0.1);
  color: var(--text-title);
  font-size: 0.88rem;
  font-weight: 700;
}

.decklist-sent-chip svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--accent-green-2);
}

.decklist-sent-chip.is-new {
  animation: decklist-chip-in 520ms cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes decklist-chip-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

:root[data-theme="dark"] .decklist-form textarea {
  background: rgba(255, 255, 255, 0.05);
}

:root[data-theme="dark"] .decklist-sent-chip {
  background: rgba(60, 190, 110, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .decklist-form textarea,
  .decklist-meter,
  .decklist-submit svg {
    transition: none;
  }

  .decklist-submit.is-sending,
  .decklist-sent-chip.is-new {
    animation: none;
  }
}

/* Phones and narrow tablets: the player card centred (the profile's one
   column: the 880px block of the profile layout above). */
@media (max-width: 820px) {
  .player-card {
    margin: 0 auto;
    max-width: 440px;
  }
}

@media (max-width: 640px) {
  /* Phones: the player card as wide as its column (300px from 641px to
     820px, where full width would make it far too tall). Scoped to the
     card's column so it outranks the 300px rule. */
  .profile-card-col .player-card {
    max-width: none;
  }

  /* Two stat tiles per row: an auto-fit of 150px minimum each fits only
     one in a phone-width card. */
  .profile-stats-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* White with Google's own multicolour "G", as Google's sign-in branding asks
   (not restyled in the site's red). */
/* account.html's "Account" card: the Google login as one row (logo,
   email, "Esci"), then — for non-admin accounts — a separate delete
   section, set apart by a line and the danger button. */
.account-login-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: #fff;
}

.account-provider svg {
  width: 20px;
  height: 20px;
}

.account-login-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.account-login-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-login-text strong {
  overflow: hidden;
  color: var(--text-title);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-danger {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
}

.account-danger[hidden] {
  display: none;
}

.account-danger-text {
  flex: 1;
  min-width: 0;
}

.account-danger-text p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.account-danger-text .account-danger-title {
  margin-bottom: 4px;
  color: var(--text-title);
  font-size: 0.95rem;
  font-weight: 800;
}

.account-danger .btn-danger {
  flex-shrink: 0;
}

.profile-account .form-message:empty {
  min-height: 0;
  margin-top: 0;
}

@media (max-width: 480px) {
  .account-danger {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Under the player card, once linked: the on/off switch showing the card on
   the player page too, as a small card of its own (the column's card +
   switch together are as tall as the cards beside them — alignCardToSide).
   The text on the left, a brand-red sliding switch on the right; the whole
   box toggles it. The real checkbox stays, invisible, for keyboard and
   screen readers. */
.profile-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0 0;
  padding: 14px 18px;
  cursor: pointer;
}

.profile-switch[hidden] {
  display: none;
}

.profile-switch:has(input:disabled) {
  cursor: default;
}

.profile-switch-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.profile-switch-label {
  color: var(--text-title);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.3;
}

.profile-switch-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.profile-switch-hint:empty {
  display: none;
}

.profile-switch-hint.is-error {
  color: #b3261e;
  font-weight: 700;
}

.profile-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.profile-switch-track {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: rgba(120, 104, 108, 0.35);
  transition: background 180ms ease, opacity 180ms ease;
}

.profile-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.profile-switch input:checked + .profile-switch-track {
  background: var(--brand-red);
}

.profile-switch input:checked + .profile-switch-track::after {
  transform: translateX(18px);
}

.profile-switch input:focus-visible + .profile-switch-track {
  outline: 3px solid rgba(220, 24, 28, 0.45);
  outline-offset: 2px;
}

.profile-switch input:disabled + .profile-switch-track {
  opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  .profile-switch-track,
  .profile-switch-track::after {
    transition: none;
  }
}

.google-signin-btn {
  width: 100%;
  gap: 10px;
}

/* Google's own sign-in button (js/account-page.js showGoogleButton): the
   card's full width, Google drawing it centred inside; its 40px reserved
   from the start, so nothing moves when it appears. */
.google-gsi-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  /* Google draws the button in its own frame, whose page is light: in dark
     mode (color-scheme: dark on the site) the browser gives a frame of a
     different scheme a solid white background — a white box around the
     button. The frame matching it, light, stays transparent; the button
     itself keeps its own dark look (theme: "filled_black"). */
  color-scheme: light;
}

.google-gsi-btn[hidden],
.google-signin-btn[hidden] {
  /* The fallback button's own .btn-secondary display: inline-flex would
     otherwise beat the hidden attribute (author styles win over the
     browser's [hidden] rule). */
  display: none;
}

.google-signin-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* account.html's sign-in card: what an account is for (a list with
   brand-red ticks), then what Google shares — small and muted, right under
   "Accedi con Google", where the data is collected. */
.account-perks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 18px;
  padding: 0;
  list-style: none;
}

.account-perks li {
  position: relative;
  padding-left: 26px;
  line-height: 1.45;
}

.account-perks li::before {
  content: "";
  position: absolute;
  top: 0.32em;
  left: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--brand-red);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.account-privacy-note {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.account-privacy-note a {
  color: var(--brand-red);
  font-weight: 700;
}

/* privacy.html (also the address Google's sign-in setup requires; linked
   from account.html's sign-in card): one card of plain prose, at a readable
   line length. */
.privacy-card {
  max-width: 760px;
  line-height: 1.6;
}

.privacy-card h2 {
  margin: 26px 0 8px;
  font-size: 1.15rem;
  color: var(--text-title);
}

.privacy-card p,
.privacy-card ul {
  margin: 0 0 10px;
}

.privacy-card ul {
  padding-left: 22px;
}

.privacy-card a {
  color: var(--brand-red);
  font-weight: 700;
}

.privacy-lead {
  font-size: 1.05rem;
}

.privacy-updated {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* League/event scope filter (Commanders, Archetypes) */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  /* Stretches every .field to the row's tallest sibling (the select/date
     fields' own height) instead of each sizing to its own content — a
     field with a shorter control (the color-swatch row, see
     .filter-bar-row below) still gets that same overall height, so its
     label lines up with every other field's label, and its own control
     can center itself within the leftover space below the label rather
     than being pinned to the top or bottom of a mismatched box. */
  align-items: stretch;
  gap: 14px;
  margin-bottom: 20px;
}

.filter-bar .field {
  margin-bottom: 0;
  min-width: 200px;
}

/* A fixed (not min-) width, but only for fields wrapping a plain
   select/date/search control — on pages with two stacked .filter-bar rows
   (Comandanti, Giocatori) this keeps e.g. "Lega" (row 1) and "Cerca"
   (row 2) the same width as each other so the two rows line up instead of
   each field just sizing to its own content. A <select>/date <input> is
   itself moved inside a .cs-wrap/.cd-wrap by custom-select.js/
   custom-date.js, so those wrappers (not the now-nested control) are what
   .field actually has as a direct child once enhanced — matched here
   alongside a plain <input> (e.g. the search box, never wrapped) so this
   leaves the color-identity field (whose direct child is a .filter-bar-row
   holding the swatches, not any of these) at its own natural width instead
   of squeezing it. */
.filter-bar .field:has(> .cs-wrap),
.filter-bar .field:has(> .cd-wrap),
.filter-bar .field:has(> input) {
  width: 220px;
}

/* Color-identity filter: the swatches and the "solo identità esatta"
   toggle sit on the same line, checkbox on the right, both bottom-aligned
   with each other. */
.filter-bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  /* Fills the leftover height .filter-bar's stretch (above) gives this
     field beyond the swatch row's own natural height, so align-items:
     center here centers the swatches against the taller select/date boxes
     next to it instead of leaving them pinned to the top. */
  flex: 1;
}

/* Search/sort (where a page has them) stay on their own top line, with a
   small round "funnel" button pinned to its right (js/filter-toggle.js)
   that expands/collapses a separate panel below holding the rest of that
   page's filters (league/event/date/color-identity) — keeps the page's
   own results visible without permanently reserving a whole extra row (or
   two) of vertical space for filters most visits never touch. Same
   the usual collapse mechanics (grid-template-rows: 1fr/0fr), the
   trigger a small icon button. */
.filter-toggle-line {
  display: flex;
  /* Not center — .field is a label-above-input column, so centering
     against its *full* height (label included) left the button sitting
     noticeably higher than the actual search/sort input boxes, not level
     with them. flex-end aligns every item's bottom edge instead, which
     lines the button up with the boxes themselves (label or not), since
     the input/select controls and the button are all close enough in
     height already for their bottoms lining up to read as centered
     against each other. */
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-toggle-line .field {
  margin-bottom: 0;
}

/* Grows to fill whatever space the sort field + funnel button don't need,
   rather than the fixed width .filter-bar's own fields get (that fixed
   width exists to line up multiple fields against each other within a
   single .filter-bar row, not relevant to this lone search field). */
.filter-toggle-search {
  flex: 1;
  min-width: 0;
}

.filter-toggle-sort {
  flex-shrink: 0;
  /* Wider than the fields inside the collapsible panel (160px) — the sort
     box now shows its own real current selection (e.g. "Winrate") rather
     than a fixed placeholder, so it needs room for the widest of those
     words plus the enhanced select's own icon/arrow padding, comfortably,
     not just barely. Taken from the search field's own space (flex: 1
     there absorbs the difference automatically), not the row's overall
     width, since the search field is the one with room to spare. */
  width: 220px;
}

/* Comandanti / Giocatori (user, 2026-11-04): no "Cerca" / "Ordina per"
   labels over the line (visually-hidden, still read out) — a line less;
   the search box says what it does in its placeholder, the sort box by a
   sort icon (two arrows, up and down) before its value, in the red of its
   arrow — in the select's empty icon slot (its options have none). */
.filter-toggle-sort .cs-trigger-icon::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--brand-red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8 4-4 4 4M7 4v16M21 16l-4 4-4-4M17 20V4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8 4-4 4 4M7 4v16M21 16l-4 4-4-4M17 20V4'/%3E%3C/svg%3E") center / contain no-repeat;
}

:root[data-theme="dark"] .filter-toggle-sort .cs-trigger-icon::before {
  background: #ff8a8d;
}

/* Their loading placeholder's search bar: the line's height, no labels
   (the 41px boxes, measured with the gap under it). */
main:is([data-page="commanders"], [data-page="players"]) .sk-search {
  height: 43px;
}

/* Giocatori's placeholder (players.html .is-players — measured against the
   loaded page, 2026-11-19): on touch screens the Dove bar (a 39px pill) 12px
   under the tabs; the search beside the sort menu (41px, 12px corners —
   the menu 220px wide, 140px on phones) 16px under it; the player rows 16px
   under that, 8px apart, 2px in from the sides, 14px corners — 59px tall,
   about 101px on phones (their numbers on a second line). */
.sk-page.is-players {
  gap: 8px;
}

.sk-page.is-players .sk-where {
  height: 39px;
  margin: -6px 0 8px;
  border-radius: var(--radius-pill);
}

.sk-page.is-players .sk-search-line {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.sk-page.is-players .sk-search-line .sk {
  height: 41px;
  border-radius: 12px;
}

.sk-page.is-players .sk-search-line .sk-search {
  flex: 1;
}

.sk-page.is-players .sk-sort {
  flex: 0 0 220px;
}

.sk-page.is-players .sk-row {
  height: 59px;
  margin-inline: 2px;
  border-radius: 14px;
}

@media (max-width: 640px) {
  .sk-page.is-players .sk-sort {
    flex-basis: 140px;
  }

  .sk-page.is-players .sk-row {
    height: 101px;
  }
}

/* Pinned to the row's right edge via the row's only auto margin — same
   trick as the nav's own Social tab (.nav-link[data-nav="social"]) —
   everything else stays left-packed regardless of how many (or how few —
   Archetipi has neither a search nor a sort field) fields sit before it. */
.filter-toggle-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  /* White, quiet (since 2026-10-26 — it was solid red): the site's light
     round button, a hairline edge, the funnel in red. */
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-red-deep);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: background 150ms ease, border-color 150ms ease;
  /* No entrance and not hidden while loading: on Comandanti / Archetipi /
     Matchups / Giocatori it sits on the title's line, outside
     .page-loading-region — there from the first paint, like the title (its
     "filters set" dot pops on once the page reads them). */
}

.filter-toggle-btn:hover,
.filter-toggle-btn.is-open {
  border-color: var(--hairline-hover);
  background: #fff7f4;
}

/* Open: the funnel in the brighter red. */
.filter-toggle-btn.is-open {
  color: var(--brand-red);
}

:root[data-theme="dark"] .filter-toggle-btn {
  border-color: rgba(255, 255, 255, 0.14);
  background: #2a1f22;
  color: #ff9a9d;
}

:root[data-theme="dark"] .filter-toggle-btn:hover,
:root[data-theme="dark"] .filter-toggle-btn.is-open {
  border-color: rgba(255, 255, 255, 0.22);
  background: #34262a;
}

/* At least one filter in the panel is set (js/filter-toggle.js) — as the
   "Dal" date is by default: quietly marked, a light red fill and a red
   edge, the funnel in the brighter red (since 2026-10-26: no more dot on
   its corner; solid red was tried and dropped — too loud for the default
   state), with a little pop the first time in a visit. */
.filter-toggle-btn {
  position: relative;
}

.filter-toggle-btn.has-active-filters {
  border-color: color-mix(in srgb, var(--brand-red) 45%, transparent);
  background: #fdecec;
  color: var(--brand-red);
  animation: filter-active-in 320ms cubic-bezier(0.2, 0.9, 0.3, 1.5) both;
}

.filter-toggle-btn.has-active-filters:is(:hover, .is-open) {
  background: #fbe0e0;
}

:root[data-theme="dark"] .filter-toggle-btn.has-active-filters {
  border-color: rgba(255, 110, 110, 0.45);
  background: #3a2226;
  color: #ff9a9d;
}

:root[data-theme="dark"] .filter-toggle-btn.has-active-filters:is(:hover, .is-open) {
  background: #44282c;
}

@keyframes filter-active-in {
  from {
    transform: scale(0.8);
  }
}

/* Already shown earlier in the visit (js/filter-toggle.js): just marked. */
.filter-toggle-btn.no-active-pop.has-active-filters {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .filter-toggle-btn.has-active-filters {
    animation: none;
  }
}

.filter-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* Giocatori and the Meta pages on a computer (user's choice, 2026-10-30 —
   the Meta pages' touch layout is their switcher's line, css/6): white in
   every state, the funnel dark — a filter set turns only the funnel red
   (no fill, no red edge). */
:is(#players-filter-toggle, html:not(.nav-mobile) .meta-head .filter-toggle-btn) {
  color: var(--text-value);
}

:is(#players-filter-toggle, html:not(.nav-mobile) .meta-head .filter-toggle-btn).has-active-filters {
  border-color: var(--hairline);
  background: #fff;
  color: var(--brand-red);
}

:is(#players-filter-toggle, html:not(.nav-mobile) .meta-head .filter-toggle-btn):is(:hover, .is-open) {
  border-color: var(--hairline-hover);
  background: #fff7f4;
}

:root[data-theme="dark"] :is(#players-filter-toggle, html:not(.nav-mobile) .meta-head .filter-toggle-btn) {
  color: var(--text-value);
}

:root[data-theme="dark"] :is(#players-filter-toggle, html:not(.nav-mobile) .meta-head .filter-toggle-btn).has-active-filters {
  border-color: rgba(255, 255, 255, 0.14);
  background: #2a1f22;
  color: #ff8a8d;
}

:root[data-theme="dark"] :is(#players-filter-toggle, html:not(.nav-mobile) .meta-head .filter-toggle-btn):is(:hover, .is-open) {
  border-color: rgba(255, 255, 255, 0.22);
  background: #34262a;
}

/* Comandanti/Archetipi: the funnel button on the title's own line, right
   side, centered on the title (not baseline-aligned like .page-heading's
   other content) — its filter panel then opens right below the title,
   above the charts. */
.page-heading-with-action {
  align-items: center;
  flex-wrap: nowrap;
}

.page-heading-with-action .filter-toggle-btn {
  margin-left: 0;
}

/* Title + a small control right after it (Matchups' "?"), kept together on
   the left while the heading's own action button stays on the right. */
.page-heading-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

/* Round "?" that opens a page's explanation pop-up (js/info-dialog.js,
   .info-dialog) — red foil (.help-toggle-btn, .pc-help-btn: below), a thin
   light ring in dark mode keeping it off the dark background. */
.help-toggle-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

/* Every "?" (.help-toggle-btn, the player card's .pc-help-btn): brand red
   with a faint rainbow foil tint, a bright glare sweeping across it now and
   then (only the glare layer moves: no-repeat, so it never wraps back in),
   then a pause. Brighter on hover. */
.help-toggle-btn,
.pc-help-btn {
  background:
    linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.7) 50%, transparent 65%) no-repeat,
    linear-gradient(135deg, rgba(255, 120, 200, 0.35), rgba(255, 210, 90, 0.3) 35%, rgba(120, 220, 255, 0.3) 70%, rgba(255, 120, 200, 0.35)),
    linear-gradient(135deg, #ff5257, #dc181c 50%, #9f141b);
  background-size: 300% 100%, 100% 100%, 100% 100%;
  background-position: 120% 0, 0 0, 0 0;
  text-shadow: 0 1px 2px rgba(80, 0, 0, 0.45);
  animation: help-foil 3.6s ease-in-out infinite;
  transition: filter 150ms ease, transform 150ms ease;
}

.help-toggle-btn:hover,
.pc-help-btn:hover {
  filter: brightness(1.12);
}

/* The glare crosses in the first 45%, then waits off the button. */
@keyframes help-foil {
  0% {
    background-position: 120% 0, 0 0, 0 0;
  }
  45%,
  100% {
    background-position: -20% 0, 0 0, 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-toggle-btn,
  .pc-help-btn {
    animation: none;
  }
}

/* Phones keep a bigger, easier-to-tap target. */
html.nav-mobile .help-toggle-btn {
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
}

:root[data-theme="dark"] .help-toggle-btn {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* Giocatori: the round "?" to the badge page (badges.html) at the end of
   the search line — level with the 40px boxes, not their labels (the line
   aligns its items' bottoms). */

/* badges.html (js/badges-page.js): one card per automatic badge. */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 18px;
}

/* A column, so the "Attualmente" section (label + holders) can be pushed to
   the bottom — cards in a row already stretch to the same height, so it
   lines up across them whatever the length of the text above. */
.badge-card {
  display: flex;
  flex-direction: column;
  min-width: 0; /* the holder row scrolls instead of widening the card */
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 246, 0.95));
  box-shadow: var(--shadow-card);
  padding: 18px;
  transition: box-shadow 180ms ease, border-color 180ms ease;
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The card a player page's badge link pointed at (badges.html#badge-<id>). */
.badge-card.is-target {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(220, 24, 28, 0.18), var(--shadow-card);
}

.badge-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.badge-card-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 52px;
  height: 52px;
  /* Same look as the small .badge-disc everywhere else. */
  border: 2.5px solid rgba(220, 24, 28, 0.45);
  border-radius: 50%;
  background: #fff;
}

.badge-card-icon-emoji {
  font-size: 1.7rem;
  line-height: 1;
}

.badge-card-icon-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.badge-card-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-title);
}

.badge-card-text {
  margin: 0 0 14px;
  color: var(--text-body);
  font-size: 0.92rem;
  line-height: 1.5;
}

.badge-card-holders-label {
  margin-top: auto;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* One row, scrolled sideways when the holders don't fit: swiped on touch,
   dragged with the mouse on desktop (js/drag-scroll.js, which also sets the
   classes below). No visible scrollbar; the edge fades show there's more.
   The vertical padding (cancelled by the negative margin) keeps the pills'
   focus ring from being clipped — overflow-x: auto clips vertically too. */
.badge-card-holders {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 3px 0;
  margin: -3px 0;
}

.badge-card-holders::-webkit-scrollbar {
  display: none;
}

/* No text selection either: a drag would otherwise start selecting names
   in its first few px, before it counts as a drag. */
.badge-card-holders.is-scrollable {
  cursor: grab;
  user-select: none;
}

.badge-card-holders.is-dragging {
  cursor: grabbing;
}

.badge-card-holders.is-dragging .badge-holder {
  cursor: grabbing;
}

.badge-card-holders.fade-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}

.badge-card-holders.fade-left {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px);
  mask-image: linear-gradient(to right, transparent, #000 32px);
}

.badge-card-holders.fade-left.fade-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

.badge-holder {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(220, 24, 28, 0.08);
  color: var(--brand-red-deep);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease;
}

.badge-holder:hover {
  background: rgba(220, 24, 28, 0.16);
  text-decoration: none;
}

.badge-card-holders-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.filter-panel {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 280ms ease;
}

.filter-panel.is-collapsed {
  grid-template-rows: 0fr;
}

/* The clipping
   boundary has to sit on a wrapper *inside* the collapsing grid row, not
   the row itself — an element's own margin/padding is never clipped away
   by its own overflow, only by an ancestor's. */
.filter-panel-clip {
  overflow: hidden;
  min-height: 0;
}

/* Lifted once the expand animation genuinely finishes (js/filter-toggle.js)
   — a select/date field inside opens its own popup positioned relative to
   itself, a descendant of this clipping box, so as long as overflow stays
   hidden here that popup gets cut off right at this box's own edge instead
   of floating freely over whatever page content sits above/below it. */
.filter-panel-clip.is-open {
  overflow: visible;
}

.filter-panel-body {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card-sm);
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
  margin-bottom: 20px;
}

.filter-panel-body .filter-bar {
  margin-bottom: 0;
}

/* .filter-toggle-line is nowrap (no flex-wrap set) so it can never break
   onto a second line — the search field's own min-width: 0 already lets
   it shrink as needed, but the sort field's fixed 220px doesn't, and on a
   narrow phone the two together plus the button can get tight enough to
   force the row to overflow sideways instead. Narrowing the sort field
   specifically (not the search field, which should stay the more usable
   one of the two) keeps everything fitting comfortably down to a small
   phone's actual width — still wide enough for its own longest option
   ("Winrate"/"Vittorie") without truncating, just less generously than
   on desktop. */
@media (max-width: 480px) {
  .filter-toggle-sort {
    /* 140px since its sort icon (2026-11-04), the icon, value and arrow
       closer: "Metashare" whole beside it, the search's placeholder too. */
    width: 140px;
  }

  .filter-toggle-sort .cs-trigger {
    gap: 6px;
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .filter-panel {
    transition: none;
  }
}

/* Matchups page: commander picker (search + capped checkbox list) and the
   win% heatmap matrix built from it. */

.matchups-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.matchups-toolbar h2 {
  margin: 0;
}

.matchups-picker-card {
  margin-bottom: 22px;
}

.matchups-picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.matchups-picker-head .field {
  min-width: 240px;
  flex: 1 1 240px;
}

.matchups-typeahead {
  position: relative;
}

/* Promoted to its own stacking context (via JS, matchups-page.js) only
   while the dropdown is actually open. .matchups-typeahead's own z-index
   wasn't enough — it's nested *inside* .matchups-picker-card, which is
   itself a plain, unpositioned element, so the z-index never actually got
   compared against the matrix table's own stacking context below it; it
   has to be the card itself that's promoted. */
.matchups-picker-card.is-dropdown-open {
  position: relative;
  z-index: 30;
}

.matchups-count {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.matchups-count.is-full {
  color: var(--brand-red-deep);
}

/* Same popup language as the custom-select dropdown (.cs-menu) elsewhere —
   border/radius/shadow/open animation — just live-filtered by the search
   box above it instead of a fixed option list. */
.matchups-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-card-hover);
  padding: 6px;
  animation: cs-menu-in 140ms ease both;
}

.matchups-dropdown-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  color: var(--text-body);
  cursor: pointer;
}

.matchups-dropdown-item:hover,
.matchups-dropdown-item:focus {
  outline: none;
  background: var(--hairline-hover);
}

.matchups-dropdown-empty {
  padding: 9px 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Selected commanders as removable chips (the site's pill language), with
   a small "x" appended to remove. */
.matchups-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.matchups-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-red-deep);
  font-weight: 700;
  font-size: 0.85rem;
}

.matchups-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(220, 24, 28, 0.12);
  color: var(--brand-red-deep);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease;
}

.matchups-chip-remove:hover {
  background: rgba(220, 24, 28, 0.25);
}

/* The matrix in the site's list look (.history-item's tiles), with no
   panel round it (like the boxless lists): every cell a small rounded tile
   with gaps between (no ruled lines), the row names tiles like the lists'
   sub-cards, straight on the page. --mx-bg is the page's own colour where
   the matrix sits (body's cream-2 — white; dark: its near-black): the
   scroller is painted with it (opaque, see below) and the sticky row names
   paint it round themselves (box-shadow), so cells scrolling under them
   don't show through the gaps — invisible against the page. The colours:
   the site's win / loss ones (.history-score: green, red; even neutral). */
/* The matrix on its own panel: a card in the panel colour (--mx-bg, which
   the sticky names already paint round themselves, so they blend in) —
   white, dark mode the dark one — no edge line, rounding and a soft
   shadow; the scrolling inside its padding. */
.matchups-matrix-wrap {
  position: relative;
  padding: 10px;
  border-radius: var(--radius-card);
  background: var(--mx-bg);
  box-shadow: var(--shadow-card);
  --mx-bg: #fff;
  --mx-win: #1fa45a;
  --mx-loss: #e0262b;
  --mx-mid: #f5b300;
  --mx-win-text: #0e6e37;
  --mx-loss-text: #a50f14;
  --mx-mid-text: #7d5300;
  --mx-tile: rgba(220, 24, 28, 0.055);
  --mx-tile-line: rgba(154, 28, 32, 0.14);
  /* The commanders' names (row and column): a stronger tint and edge than
     the result tiles, so they stand apart from them. */
  --mx-head: rgba(220, 24, 28, 0.12);
  --mx-head-line: rgba(154, 28, 32, 0.32);
  /* The empty slots' dashes. */
  --mx-empty-line: rgba(154, 28, 32, 0.34);
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

:root[data-theme="dark"] .matchups-matrix-wrap {
  --mx-bg: #140e10;
  --mx-win: #4fdc8c;
  --mx-loss: #ff5a5f;
  --mx-mid: #ffcc33;
  --mx-win-text: #7cf0ae;
  --mx-loss-text: #ff9a9d;
  --mx-mid-text: #ffe07a;
  --mx-tile: rgba(255, 255, 255, 0.06);
  --mx-tile-line: rgba(255, 255, 255, 0.1);
  --mx-head: rgba(255, 110, 110, 0.16);
  --mx-head-line: rgba(255, 110, 110, 0.34);
  --mx-empty-line: rgba(255, 255, 255, 0.3);
}

/* Its own solid background (the page's colour, so it doesn't show): a
   scroller without one isn't scrolled by the GPU in Chrome — it repaints
   the whole table on every scroll step instead, which lagged. */
.matchups-matrix-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--mx-bg);
  /* The site's scrollbar (like the scrolling lists'): thin, soft red. */
  scrollbar-width: thin;
  scrollbar-color: rgba(220, 24, 28, 0.3) transparent;
}

:root[data-theme="dark"] .matchups-matrix-scroll {
  scrollbar-color: rgba(255, 110, 110, 0.3) transparent;
}

/* Touch screens: none at all, like the lists — swiped with the finger. */
html.nav-mobile .matchups-matrix-scroll {
  scrollbar-width: none;
}

html.nav-mobile .matchups-matrix-scroll::-webkit-scrollbar {
  display: none;
}

/* More columns to the right (js/matchups-page.js syncScrollFade): the
   right edge fades out — the peeking next column fading into it on
   phones. The pinned names on the left untouched. */
.matchups-matrix-scroll.can-scroll-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
}

@media (max-width: 480px) {
  /* Otherwise this sticky column alone can eat most of a phone's viewport
     width, leaving barely a sliver of the next column peeking out — enough
     to technically be scrollable but not to look or feel like it. */
  .matchups-row-header {
    max-width: 84px;
  }
}

/* Phones: one result column at a time, read top to bottom — each column as
   wide as the room beside the pinned names, but a peek of the next
   (--mx-col-w, measured by js/matchups-page.js fitColumns, which also sets
   the panel's scroll-padding to where a column starts), and a swipe snaps
   to the next column, never past it (scroll-snap-stop). The numbers a size
   up, with the room. */
@media (max-width: 640px) {
  .matchups-matrix-scroll {
    scroll-snap-type: x mandatory;
  }

  .matchups-table .matchups-col-header {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .matchups-table :is(.matchups-col-header, .matchups-cell) {
    width: var(--mx-col-w, auto);
    min-width: var(--mx-col-w, 58px);
    box-sizing: border-box;
  }

  /* The names column as wide as a result column (--mx-head-w), and the
     names — row and column — on up to two lines before they're cut, now
     that there's room (scoped under .matchups-table to outrank the
     desktop rules' widths and nowrap, later in this file). */
  /* min-width too: a table wider than its box (it is, here) shrinks a
     column with only a width down to its narrowest content. */
  .matchups-table .matchups-row-header {
    width: var(--mx-head-w, auto);
    min-width: var(--mx-head-w, 0);
    max-width: var(--mx-head-w, 84px);
    box-sizing: border-box;
  }

  .matchups-table :is(.matchups-row-header, .matchups-col-header) {
    white-space: normal;
  }

  .matchups-table :is(.matchups-row-header-text, .matchups-col-header-text) {
    display: -webkit-box;
    max-width: none;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* A mouse drag (a narrow desktop window) moves freely; it snaps on
     release. */
  .matchups-matrix-scroll.is-dragging {
    scroll-snap-type: none;
  }

  .matchups-cell-pct {
    font-size: 1.15rem;
  }

  .matchups-cell-count {
    font-size: 0.78rem;
  }
}

.matchups-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.85rem;
}

.matchups-table th,
.matchups-table td {
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

/* Scoped under .matchups-table so it outranks `.matchups-table th`'s
   text-align: center above (class + element beats a class alone) — without
   it every row name was centered, which only showed on names short enough
   not to fill the cell via the ellipsis truncation. */
.matchups-table .matchups-row-header {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  color: var(--text-title);
  font-weight: 800;
  border: 1px solid var(--mx-head-line);
  border-radius: 10px;
  /* The sub-card tint over the panel's solid colour (opaque: cells scroll
     under it). Painted round it in the panel's colour too (box-shadow): the
     gaps between it and its neighbours, and — the second one, pushed 40px
     left — the whole strip between it and the panel's left edge (the
     panel's padding + the table's spacing), where scrolled cells showed
     through; its far end, rounded, lies past the edge, clipped. */
  background: linear-gradient(var(--mx-head), var(--mx-head)), var(--mx-bg);
  box-shadow:
    0 0 0 4px var(--mx-bg),
    -40px 0 0 4px var(--mx-bg);
  cursor: default;
}

.matchups-corner-header {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--mx-bg);
  box-shadow:
    0 0 0 4px var(--mx-bg),
    -40px 0 0 4px var(--mx-bg);
}

/* The column names: small tiles over their column, in the row names'
   stronger tint, so both stand apart from the results. */
.matchups-col-header {
  position: relative;
  border: 1px solid var(--mx-head-line);
  border-radius: 10px;
  background: var(--mx-head);
  color: var(--text-title);
  font-weight: 800;
  font-size: 0.8rem;
  vertical-align: middle;
  cursor: default;
}

/* The ellipsis truncation lives on this inner span rather than the <th>
   itself — overflow: hidden here would otherwise also clip the <th>'s own
   ::before/::after tooltip below, since they're positioned children of
   whichever element declares them (keep the clipping boundary off the
   element that also needs to render content outside its own box). */
.matchups-row-header-text,
.matchups-col-header-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matchups-row-header-text {
  max-width: 120px;
}

.matchups-col-header-text {
  max-width: 90px;
}

/* Full name on hover where a label truncates long ones with an ellipsis —
   Matchups' row/column headers, the Comandanti/Archetipi bar charts' labels.
   Same red-pill visual language as .icon-badge's own tooltip, but a real
   element positioned by js/floating-tooltip.js and appended to <body>
   rather than a CSS ::after anchored to the label — both live inside a
   horizontally-scrolling wrapper (.matchups-matrix-scroll, .chart-grid),
   which per the CSS overflow spec forces overflow-y to clip too, so
   anything anchored *inside* it gets cut off at its edge instead of
   escaping over the rest of the page. */
.floating-tooltip {
  position: fixed;
  z-index: 60;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--brand-red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-card-hover);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

/* Opened under the element (no room above it): it rises from above. */
.floating-tooltip.is-below {
  transform: translateY(-4px);
}

.floating-tooltip.is-visible {
  opacity: 1;
  transform: none;
}

/* Positioned via inline `left` in js/floating-tooltip.js — the tooltip box
   itself can get shifted off-center (clamped to stay on-screen), so the
   arrow needs to track the actual anchor instead of staying fixed at the
   tooltip's own midpoint. Points down (the tooltip above the element), or
   up when it opened under it (.is-below). */
.floating-tooltip-arrow {
  position: absolute;
  bottom: -5px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--brand-red);
}

/* A player badge's tooltip (js/floating-tooltip.js fillBadgeCard): a small
   white card — the badge's icon and name, its description, "Come si
   ottiene ›" (red) to its entry on badges.html. Clickable, unlike the pill. */
.floating-tooltip.badge-tip {
  width: max-content;
  max-width: min(240px, calc(100vw - 16px));
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: #fff;
  color: var(--text-body);
  font-weight: 400;
  white-space: normal;
  pointer-events: auto;
}

.badge-tip .floating-tooltip-arrow {
  bottom: -6px;
  border-left-width: 6px;
  border-right-width: 6px;
  border-top: 6px solid #fff;
}

.is-below .floating-tooltip-arrow {
  top: -5px;
  bottom: auto;
  border-top: 0;
  border-bottom: 5px solid var(--brand-red);
}

.badge-tip.is-below .floating-tooltip-arrow {
  top: -6px;
  border-bottom: 6px solid #fff;
}

.badge-tip-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-tip-head .badge-disc {
  flex: none;
  font-size: 1.6rem;
}

.badge-tip-name {
  color: var(--text-title);
  font-size: 0.95rem;
  font-weight: 800;
}

.badge-tip-text {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
}

.badge-tip-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--brand-red);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.badge-tip-link:hover {
  text-decoration: underline;
}

/* Dragged sideways with the mouse when it doesn't fit (js/drag-scroll.js
   enableDragScroll, the classes too): a grab cursor everywhere on it, no
   text selection starting in a drag's first few px. */
.matchups-matrix-scroll.is-scrollable,
.matchups-matrix-scroll.is-scrollable :is(th, td) {
  cursor: grab;
  user-select: none;
}

.matchups-matrix-scroll.is-dragging,
.matchups-matrix-scroll.is-dragging :is(th, td) {
  cursor: grabbing;
}

/* A result tile: the percentage over its V-S-P record (a list's number
   over its label). Its colour runs red → yellow → green: yellow at 50%,
   turning into the side's colour as it leans that way (fully by 30 points
   off even: --mix), the tint stronger the more one-sided (--heat,
   js/matchups-page.js: 0 at 50%, 1 at 0% or 100%). */
.matchups-cell {
  --mix: calc(min(1, var(--heat, 0) * 1.67) * 100%);
  min-width: 58px;
  border: 1px solid var(--mx-tile-line);
  border-radius: 10px;
  background: var(--mx-tile);
  color: var(--text-title);
  line-height: 1.15;
  cursor: default;
}

.matchups-cell-pct {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.matchups-cell-count {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.matchups-cell.is-win {
  --mx-hue: color-mix(in srgb, var(--mx-win) var(--mix), var(--mx-mid));
  --mx-hue-text: color-mix(in srgb, var(--mx-win-text) var(--mix), var(--mx-mid-text));
}

.matchups-cell.is-loss {
  --mx-hue: color-mix(in srgb, var(--mx-loss) var(--mix), var(--mx-mid));
  --mx-hue-text: color-mix(in srgb, var(--mx-loss-text) var(--mix), var(--mx-mid-text));
}

.matchups-cell.is-even {
  --mx-hue: var(--mx-mid);
  --mx-hue-text: var(--mx-mid-text);
}

.matchups-cell:is(.is-win, .is-loss, .is-even) {
  border-color: color-mix(in srgb, var(--mx-hue) calc(45% + var(--heat) * 35%), transparent);
  background: color-mix(in srgb, var(--mx-hue) calc(24% + var(--heat) * 34%), transparent);
}

.matchups-cell:is(.is-win, .is-loss, .is-even) .matchups-cell-pct {
  color: var(--mx-hue-text);
}

/* The record in the body colour on a coloured tile (grey faded into it). */
.matchups-cell:is(.is-win, .is-loss, .is-even) .matchups-cell-count {
  color: var(--text-body);
}

/* No match between the two: an empty dashed slot — its dashes and the dash
   inside it firm enough to read on the page. */
.matchups-cell-empty {
  border-style: dashed;
  border-color: var(--mx-empty-line);
  background: none;
  color: var(--text-muted);
  font-weight: 400;
}

/* A deck against itself: the even (50%) tile, just "50%" — no record under
   it (js/matchups-page.js renders it .is-even). */

/* The Bacheca's "Più giocati" card (its two bubble slides): a plain light
   card like the Bacheca's others (dark mode: the dark cards' look) — the
   slides' titles, legends and links in the site's usual colours. */
.card.dashboard-card-commanders {
  border-color: rgba(220, 24, 28, 0.28);
  background: #fff;
}

/* The Bacheca's "Commander più giocati" as bubbles (js/metagame-chart.js
   renderBubbleChart): each placed and sized by js in % of the box, which
   keeps the group's own proportions. A bubble: the commander's art (faded
   in, js hydrateBubbleArt) over its chart colour, darkened at the bottom
   for its % and — when it's big enough (a container query on it) — its
   name; it grows a little on hover. "Altri": a grey disc. */
.bubble-chart {
  position: relative;
  width: 100%;
  max-width: 440px;
  margin: 10px auto 4px;
}

.bubble {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  /* A neutral placeholder until the art fades in over it (not the chart
     colour, which flashed as a coloured disc while loading). A soft shadow
     and a thin light rim (--bubble-shadow: js/metagame-chart.js reads it
     for its pulse; dark mode its own, deeper). */
  --bubble-shadow: 0 6px 16px rgba(80, 10, 14, 0.22), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  background: rgba(154, 28, 32, 0.08);
  /* Always a ring in its colour — the same as its row's bar in the legend,
     so a bubble and its row match at a glance; thicker when pointed at. */
  box-shadow: var(--bubble-shadow), 0 0 0 3px var(--bubble-color);
  color: #fff;
  text-decoration: none;
  container-type: inline-size;
  /* Each motion on its own property, so they add up instead of replacing
     each other: the drift moves (translate) and turns (rotate) it, the
     entrance, hover, press and pulse (js, a Web Animation) size it
     (scale) — all of them composited, nothing repainted per frame: its own
     layer (will-change), so its drifting doesn't repaint the card around
     it (whose blurred backdrop is costly). */
  will-change: transform;
  transition: scale 320ms cubic-bezier(0.2, 0.9, 0.3, 1.3), box-shadow 320ms ease;
  animation:
    bubble-in 800ms cubic-bezier(0.2, 0.9, 0.3, 1.25) var(--enter-delay, 0ms) backwards,
    bubble-float var(--float-time, 6s) ease-in-out var(--float-delay, 0s) infinite alternate;
}

/* Drifting: a few px in its own direction and back, turning a little. */
@keyframes bubble-float {
  from {
    translate: 0 0;
    rotate: 0deg;
  }
  to {
    translate: var(--float-x, 0) var(--float-y, 0);
    rotate: var(--float-turn, 0deg);
  }
}

a.bubble:hover {
  z-index: 2;
  scale: 1.08;
  text-decoration: none;
}

/* Under the mouse, or its legend row is (.is-highlighted, js): a ring in
   its colour, a little bigger (js pulses it on the way in). */
.bubble.is-highlighted {
  scale: 1.08;
}

.bubble:hover,
.bubble.is-highlighted {
  z-index: 2;
  box-shadow: var(--bubble-shadow), 0 0 0 5px var(--bubble-color);
}

:root[data-theme="dark"] .bubble {
  --bubble-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

/* Pressed (a tap on a touch screen, a click): in for a moment. */
a.bubble:active {
  scale: 0.93;
  transition-duration: 90ms;
}

/* The legend rows lead to their bubble: a pointer cursor. */
.bubble-legend-item {
  cursor: pointer;
}

/* No art (an archetype, a colour): its colour fills it (a colour's: its
   mana symbol's pale disc, --bubble-fill), the % in the
   middle — in dark mode too (the dark .bubble's faint fill above outranks
   the plain selector). */
.bubble.is-solid,
:root[data-theme="dark"] .bubble.is-solid {
  align-items: center;
  background: var(--bubble-fill, var(--bubble-color, #9a9a94));
}

.bubble.is-solid .bubble-label {
  padding-bottom: 0;
}

.bubble-art {
  position: absolute;
  inset: 0;
  background-position: center 30%;
  background-size: cover;
  opacity: 0;
  transition: opacity 400ms ease;
}

.bubble-art.is-loaded {
  opacity: 1;
}

/* Each bubble a little sphere over its art: a soft highlight top-left,
   shading towards the rim, and the bottom darker for its %. */
.bubble::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.3), transparent 34%),
    radial-gradient(circle at 50% 45%, transparent 52%, rgba(8, 4, 5, 0.55) 100%),
    linear-gradient(180deg, transparent 45%, rgba(12, 7, 8, 0.7) 100%);
  pointer-events: none;
}

/* A solid bubble (an archetype): flat, just its colour — no sphere light
   or shading, no darker bottom (its label is in the middle). */
.bubble.is-solid::after {
  background: none;
}

/* Just the % (the name is on hover — the bubble's title — and in the
   legend). */
.bubble-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 78%;
  padding-bottom: 14cqw;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.bubble-label strong {
  font-size: max(11px, 22cqw);
  font-weight: 800;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    scale: 0.4;
  }
}

/* Below the bubbles, the donut's own legend (.pie-legend); each swatch a
   small round crop of the commander's art (js hydrateBubbleArt) over its
   colour. */
.bubble-legend {
  margin-top: 12px;
}

/* Swatch | name | % on the first line, the share bar under name and %.
   Two classes: .pie-legend-item's own display comes later in this file. */
.pie-legend-item.bubble-legend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 8px;
  row-gap: 4px;
}

.bubble-legend-item .pie-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bubble-legend-bar {
  grid-column: 2 / 4;
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(154, 28, 32, 0.1);
}

:root[data-theme="dark"] .bubble-legend-bar {
  background: rgba(255, 255, 255, 0.1);
}

.bubble-legend-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
}

.bubble-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-position: center 30%;
  background-size: cover;
  /* A neutral placeholder until its art arrives (the bar keeps the
     colour). */
  background-color: rgba(154, 28, 32, 0.1);
  /* Its bubble's ring, in the same colour. */
  box-shadow: 0 0 0 2px var(--bubble-color, rgba(154, 28, 32, 0.25));
}

:root[data-theme="dark"] .bubble-legend-swatch {
  background-color: rgba(255, 255, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  .bubble {
    animation: none;
    transition: none;
  }
}

/* Metagame share chart (ring + side legend), js/metagame-chart.js. A single
   mask cuts the hole directly out of the conic-gradient itself — it's a ring
   from the very first frame, not a pie with a disc laid on top of it — and
   the whole ring spins/scales/fades into place on render, legend rows
   following with a slight stagger. */

.pie-chart-wrap {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card-sm);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
  padding: 18px;
  margin-bottom: 20px;
  /* The card boundary itself was never animating — only the ring/legend
     content inside it (see the pie-ring-in/pie-legend-in animations right
     below). Fading the whole card up too covers every chart shape sharing
     this wrapper uniformly, including the line chart (js/line-chart.js),
     which had no entrance animation of its own at all. */
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pie-chart-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

/* An aside on the title's line, in brackets (Comandanti's Winrate: the
   matches needed to count). */
.pie-chart-title-note {
  color: var(--text-muted);
  font-size: 0.62em;
  font-weight: 700;
}

.pie-chart-body {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

/* Winrate bar chart (js/metagame-chart.js's renderBarChart) — shares the
   pie chart's own card wrapper/title, just a different body: one row per
   entry, each independently 0-100% rather than a slice of a 100% whole. */
.bar-chart-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: 108px 1fr 48px;
  align-items: center;
  gap: 10px;
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.bar-chart-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-title);
}

.bar-chart-track {
  position: relative;
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--hairline-hover);
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

/* Small muted line under a chart's title (renderBarChart's `subtitle`). */
.pie-chart-subtitle {
  margin: -8px 0 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.bar-chart-pct {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-title);
}

/* .bar-chart-body-spacious (see renderBarChart's `spacious` option) — a
   short, fixed-length list (Archetipi's 5 rows) stretched to actually fill
   the card's height (matched to the taller pie chart beside it) instead of
   clustering at the top, with larger rows/text to match. Scoped to the
   wrap that actually contains one, via :has(), rather than making every
   .pie-chart-wrap flex — the Comandanti page's own (much longer, already
   naturally fills the card) bar chart stays exactly as it was. */
.pie-chart-wrap:has(.bar-chart-body-spacious) {
  display: flex;
  flex-direction: column;
}

.pie-chart-wrap:has(.bar-chart-body-spacious) .pie-chart-title {
  flex-shrink: 0;
}

.bar-chart-body-spacious {
  flex: 1;
  justify-content: space-evenly;
}

.bar-chart-body-spacious .bar-chart-label,
.bar-chart-body-spacious .bar-chart-pct {
  font-size: 0.95rem;
}

.bar-chart-body-spacious .bar-chart-track {
  height: 18px;
}

/* Their labels are short (an archetype, a colour — "midrange",
   "Incolore"): a narrower label column than the commanders' 108px, the
   bars taking the room. */
.bar-chart-body-spacious .bar-chart-row {
  grid-template-columns: 80px 1fr 52px;
}

/* Comandanti/Archetipi chart row (Metashare, Winrate, + Comandanti's
   "Colori più giocati") as a
   horizontal carousel of whole blocks — 2 side by side when there's room,
   1 on phones — moved by swipe/trackpad (native scroll-snap, always landing
   on whole charts) or the arrows/dots js/chart-carousel.js adds below it.
   A flex row, so every chart in it stretches to the tallest one's height —
   phones included — with bar charts spreading their rows out to fill it.
   The row's own overflow (needed to scroll) would clip the cards' drop
   shadows at its edges, hence the padding + matching negative margin:
   room for the shadow inside the scroll box, same outer footprint as
   before. */
.chart-grid {
  --chart-gap: 20px;
  /* How far it reaches past the column on each side (room for the cards'
     shadows): 12px, never more than the page's own margin on phones
     (--page-pad-x) — past it, the carousel stuck out of the screen, and
     Chrome on phones then made the whole page wider than the screen: the
     sticky switcher and the tab bar lost their gap to the screen's edges. */
  --chart-bleed: min(12px, var(--page-pad-x, 12px));
  display: flex;
  gap: var(--chart-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--chart-bleed);
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  margin: -8px calc(-1 * var(--chart-bleed)) 0;
  padding: 8px var(--chart-bleed) 24px;
}

.chart-grid::-webkit-scrollbar {
  display: none;
}

/* Mouse drag (js/chart-carousel.js): a grab cursor while there's anywhere
   to go; no text selection, or the first px of a drag would start
   selecting labels. Snapping is off during the drag and its glide after. */
html:not(.nav-mobile) .chart-grid.is-draggable {
  cursor: grab;
  user-select: none;
}

.chart-grid.is-dragging {
  scroll-snap-type: none;
}

/* As specific as the grab rule above, and after it, so it wins mid-drag. */
html:not(.nav-mobile) .chart-grid.is-draggable.is-dragging {
  cursor: grabbing;
}

/* border-box: the card's own padding/border must count inside that width,
   or two cards + gap overshoot the row and the second gets cut off. */
.chart-grid > .pie-chart-wrap {
  box-sizing: border-box;
  flex: 0 0 100%;
  min-width: 0;
  margin-bottom: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  /* A tighter shadow than the site-wide --shadow-card (0 12px 28px, ~40px
     of spread below the card): the row's own scroll box clips anything
     past its padding, and that big shadow got cut off in a hard edge that
     read as a darker band behind the charts. This one (8px up, 12px to the
     sides, 16px down) fits inside .chart-grid's padding. */
  box-shadow: 0 4px 12px rgba(40, 24, 26, 0.08);
}

/* One chart per view by default; two side by side once the charts' own
   area (js/chart-carousel.js marks it .chart-carousel-host) is wide enough
   for two — a container query, not a viewport one, so the Bacheca's narrow
   side card stays at one per view on a wide desktop, while Comandanti and
   Archetipi (full-width) get two there, and one on phones. */
.chart-carousel-host {
  container-type: inline-size;
}

@container (min-width: 760px) {
  .chart-grid > .pie-chart-wrap {
    flex-basis: calc((100% - var(--chart-gap)) / 2);
  }
}

/* archetype.html's row (js/archetype-detail.js): "Utilizzo" over 2/3 of
   the row, "Contro gli altri archetipi" over 1/3 — both in view at once;
   one per view below 760px, like the others. */
@container (min-width: 760px) {
  .chart-grid.is-wide-first > .pie-chart-wrap:first-child {
    flex-basis: calc((100% - var(--chart-gap)) * 2 / 3);
  }

  .chart-grid.is-wide-first > .pie-chart-wrap:last-child {
    flex-basis: calc((100% - var(--chart-gap)) / 3);
  }
}

/* An edge-to-edge line chart stretched taller than its plot (to its row
   neighbour's height): the plot (fixed 240px — its overlays are placed in
   px) sits at the card's bottom, its area still reaching the bottom edge,
   the extra room above the curve, under the title. */
.chart-grid > .line-chart-wrap.is-edge > .line-chart-plot {
  margin-top: auto;
}

/* The matchups in their card (a third of the row): one line per archetype —
   its badge (a size down), the track, the winrate — with tight columns and spacing, so the track keeps
   most of the width; the rows spread over the card's height (as tall as
   Utilizzo). The axis under the tracks lined up with them. */
/* (The value column as wide as the widest value, "100.0%" — narrower, it
   ran into the track.) */
.chart-grid > .vs-chart {
  --vs-label-w: 78px;
  --vs-value-w: 60px;
  --vs-gap: 12px;
  --vs-row-pad: 4px;
}

.chart-grid > .vs-chart > .vs-rows {
  flex: 1;
  justify-content: space-evenly;
}

.chart-grid > .vs-chart .vs-row {
  gap: var(--vs-gap);
  padding: 7px var(--vs-row-pad);
}

.chart-grid > .vs-chart .vs-value strong {
  font-size: 0.95rem;
}

.chart-grid > .vs-chart .vs-axis {
  margin: 2px calc(var(--vs-value-w) + var(--vs-gap) + var(--vs-row-pad)) 0
    calc(var(--vs-label-w) + var(--vs-gap) + var(--vs-row-pad));
}

/* The label: the archetype's own badge, a size down to fit its column on
   one line ("midrange" included). */
.chart-grid > .vs-chart .badge-archetype {
  min-height: 22px;
  padding: 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.chart-grid > .pie-chart-wrap > .pie-chart-body,
.chart-grid > .pie-chart-wrap > .bar-chart-body {
  flex: 1;
}

.chart-grid > .pie-chart-wrap > .bar-chart-body {
  justify-content: space-evenly;
}

/* Below the row: ‹ • • › as a small pill bar, the site's tab-bar look
   (white, a hairline edge, a soft shadow) — on touch devices, which swipe,
   no arrows and no bar, the dots alone. */
.chart-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: fit-content;
  /* Up into the row's 24px bottom padding (kept for the cards' shadows):
     about 10px under the charts, 10px down to what follows. */
  margin: -6px auto 10px;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: var(--shadow-card);
}

:root[data-theme="dark"] .chart-carousel-nav {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

html.nav-mobile .chart-carousel-nav,
:root[data-theme="dark"].nav-mobile .chart-carousel-nav {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

/* display: flex above would otherwise override the hidden attribute. */
.chart-carousel-nav[hidden] {
  display: none;
}

/* The arrows (the charts' and player.html's album, js/commander-carousel.js):
   small round light buttons — white, a hairline edge, a dark red chevron, a
   faint red on hover — not solid red discs; inside the charts' pill bar,
   no edge of their own. */
.chart-carousel-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-red-deep);
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.chart-carousel-nav .chart-carousel-arrow {
  border-color: transparent;
  background: transparent;
}

.chart-carousel-arrow:hover:not(:disabled) {
  border-color: var(--hairline-hover);
  background: color-mix(in srgb, var(--brand-red) 8%, #fff);
}

:root[data-theme="dark"] .chart-carousel-arrow {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #ff9a9d;
}

:root[data-theme="dark"] .chart-carousel-nav .chart-carousel-arrow {
  border-color: transparent;
  background: transparent;
}

:root[data-theme="dark"] .chart-carousel-arrow:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.chart-carousel-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.chart-carousel-arrow svg {
  width: 16px;
  height: 16px;
}

html.nav-mobile .chart-carousel-arrow {
  display: none;
}

.chart-carousel-dots {
  display: flex;
  gap: 8px;
}

.chart-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--hairline-hover-strong);
  transition: background 150ms ease, transform 150ms ease;
}

.chart-carousel-dot.is-active {
  background: var(--brand-red);
  transform: scale(1.25);
}

/* Reserves roughly the final chart-row height for the loading placeholder,
   so the filters (and everything below) don't visibly jump down once the
   async chart data actually arrives and replaces it — Archetipi's rendered
   charts settle noticeably shorter than Comandanti's. */
#commanders-chart {
  min-height: 300px;
}

/* Touch screens: its charts a line shorter (js/commanders-page.js), the
   room kept for them — and their loading placeholder — to match, so the
   list sits right under them. */
html.nav-mobile #commanders-chart {
  min-height: 247px;
}

/* (Measured: the placeholder starts 16px lower and has the 14px gap of
   .sk-page under it, so 30px less than the room above — its search bar
   then where the loaded line is.) */
html.nav-mobile main[data-page="commanders"] .sk-chart {
  height: 217px;
}

#archetypes-chart {
  min-height: 220px;
}

.pie-chart {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
  -webkit-mask: radial-gradient(circle, transparent 42%, #000 43%);
  mask: radial-gradient(circle, transparent 42%, #000 43%);
  transform-origin: 50% 50%;
  animation: pie-ring-in 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes pie-ring-in {
  from {
    opacity: 0;
    transform: scale(0.7) rotate(-80deg);
  }
  to {
    opacity: 1;
    /* Not "scale(1) rotate(0deg)" — any non-"none" transform value
       permanently creates a new stacking context once the animation
       settles there (fill-mode: both), even a visual no-op like this one.
       That let the chart end up painting above a dropdown menu that
       should sit on top of it, since the two ended up in different,
       unrelated stacking contexts instead of comparing z-index directly. */
    transform: none;
  }
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 190px;
}

.pie-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-body);
  opacity: 0;
  animation: pie-legend-in 420ms ease both;
}

@keyframes pie-legend-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pie-legend-label {
  flex: 1;
  text-transform: capitalize;
}

.pie-legend-pct {
  color: var(--text-title);
}

.pie-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

/* Comandanti / Archetipi on a phone-wide chart area (the carousel's
   container, .chart-carousel-host): the legend beside a smaller ring
   instead of under it — the ring card was the carousel's tallest, setting
   every slide's height. Long names cut with "…". */
@container (max-width: 559px) {
  :is(#commanders-chart, #archetypes-chart) .pie-chart-body {
    flex-wrap: nowrap;
    gap: 16px;
  }

  :is(#commanders-chart, #archetypes-chart) .pie-chart {
    width: 112px;
    height: 112px;
  }

  :is(#commanders-chart, #archetypes-chart) .pie-legend {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  :is(#commanders-chart, #archetypes-chart) .pie-legend-item {
    min-width: 0;
    gap: 6px;
    font-size: 0.82rem;
  }

  :is(#commanders-chart, #archetypes-chart) .pie-legend-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  :is(#commanders-chart, #archetypes-chart) .pie-legend-swatch {
    width: 12px;
    height: 12px;
  }
}

/* Comandanti / Archetipi on touch screens (user, 2026-11-04): the charts a
   bit shorter — the title closer to its chart (6px, not 14px: the tallest
   chart, Winrate, sets every slide's height) — and the dots closer under
   them (about 8px, up into the row's bottom padding, which keeps the
   cards' shadows: the dots drawn over its faint end). */
html.nav-mobile :is(#commanders-chart, #archetypes-chart) .chart-grid > .pie-chart-wrap > .pie-chart-title {
  margin-bottom: 6px;
}

html.nav-mobile :is(#commanders-chart, #archetypes-chart) .chart-carousel-nav {
  margin-top: -16px;
}

/* Commander detail's "decks played over time" line (js/line-chart.js) —
   shares the pie/bar charts' own .pie-chart-wrap card, just full-width
   instead of paired side-by-side. aspect-ratio (matching the SVG's own
   viewBox) rather than a fixed height: keeps x/y scaled together as the
   card's actual width changes, so the line's stroke width and the dots
   stay circular instead of stretching unevenly on narrow screens. */
.line-chart-wrap {
  margin-bottom: 20px;
}

.line-chart {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 280;
}

.line-chart-grid {
  stroke: var(--hairline);
  stroke-width: 1;
}

.line-chart-axis-label {
  fill: var(--text-muted);
  font-size: 13px;
}

.line-chart-area {
  fill: rgba(220, 24, 28, 0.12);
  stroke: none;
}

.line-chart-line {
  fill: none;
  stroke: var(--brand-red);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-dot {
  fill: var(--brand-red);
}

/* commander.html's "Utilizzo" (js/line-chart.js renderLineChart): the plot
   edge to edge in its card (no padding — the card's corners clip it), the
   title and the numbers (Ultimo / Picco / Totale) laid over its top, the
   gridlines' values small on the left just above each line, the months in
   the band under the zero line, the area filling it down to the card's
   bottom edge. The plot 240px tall (= the SVG's viewBox height, so its y
   units are px — the HTML overlays line up with it), stretched across. */
.line-chart-wrap.is-edge {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.line-chart-head {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
  pointer-events: none;
}

.line-chart-head .pie-chart-title {
  margin: 0;
}

.line-chart-stats {
  display: flex;
  gap: 18px;
}

.line-chart-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.line-chart-stat-value {
  color: var(--text-title);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;
}

.line-chart-stat:first-child .line-chart-stat-value {
  color: var(--brand-red);
}

.line-chart-stat-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line-chart-plot {
  position: relative;
  height: 240px;
}

.line-chart-plot .line-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  overflow: visible;
  animation: line-chart-reveal 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms both;
}

/* The curve drawn in from the left (paused with the rest while the page
   loads, body.is-loading). */
@keyframes line-chart-reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0 0 0 0);
  }
}

.line-chart-plot .line-chart-grid {
  stroke-dasharray: 3 5;
}

.line-chart-plot .line-chart-grid.is-zero {
  stroke-dasharray: none;
}

.line-chart-plot .line-chart-area {
  fill: rgba(220, 24, 28, 0.14);
}

.line-chart-plot .line-chart-line {
  stroke-width: 3;
}

.line-chart-y,
.line-chart-x {
  position: absolute;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.line-chart-y {
  left: 14px;
  transform: translateY(calc(-100% - 3px));
}

.line-chart-x {
  bottom: 9px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.line-chart-x.is-start {
  transform: translateX(14px);
}

.line-chart-x.is-end {
  transform: translateX(calc(-100% - 14px));
}

/* Hover / tap: the point's strip shows its guide, dot and tip. */
.line-chart-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
}

.line-chart-guide,
.line-chart-dot-html,
.line-chart-tip {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.line-chart-guide {
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px dashed rgba(220, 24, 28, 0.45);
}

.line-chart-dot-html {
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, -50%);
}

.line-chart-tip {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(12, 7, 8, 0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 12px));
  /* (Moved back inside the card near its edges by js/line-chart.js fitTip,
     through `translate`.) */
}

.line-chart-hit:hover > * {
  opacity: 1;
}

/* Touch screens: the strip under a finger moving along the chart
   (js/chart-scrub.js) — shown like :hover, the strip the browser still
   thinks is :hover (where the touch began) hidden meanwhile. pan-y: a
   sideways move stays with the chart, up / down still scrolls the page. */
.line-chart-hit,
.evo-plot {
  touch-action: pan-y pinch-zoom;
}

/* …except in a chart carousel swiped sideways ([data-no-scrub] —
   archetype.html's charts): there a sideways move swipes the carousel. */
[data-no-scrub] .line-chart-hit {
  touch-action: pan-x pan-y pinch-zoom;
}

.line-chart-hit.is-scrub > * {
  opacity: 1;
}

.is-scrubbing > .line-chart-hit:not(.is-scrub):hover > * {
  opacity: 0;
}

@media (max-width: 640px) {
  .line-chart-head {
    padding: 14px 14px 0;
  }

  .line-chart-stats {
    gap: 12px;
  }

  .line-chart-stat-value {
    font-size: 1.15rem;
  }

  .line-chart-stat-label {
    font-size: 0.6rem;
  }

  .line-chart-y,
  .line-chart-x {
    font-size: 0.66rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .line-chart-plot .line-chart {
    animation: none;
  }
}

:root[data-theme="dark"] .line-chart-plot .line-chart-area {
  fill: rgba(255, 106, 110, 0.14);
}

:root[data-theme="dark"] .line-chart-stat:first-child .line-chart-stat-value {
  color: #ff6a6e;
}

:root[data-theme="dark"] .line-chart-guide {
  border-left-color: rgba(255, 106, 110, 0.5);
}

/* Phones: narrow side margins, the content as wide as it can be
   (--page-pad-x — also what the edge-to-edge heroes cancel, and the hero
   back pill's alignment). */
@media (max-width: 640px) {
  :root {
    --page-pad-x: 6px;
  }

  .page-main {
    padding: 20px var(--page-pad-x) 36px;
  }
}

/* --- Social (social.html, js/moxfield.js) ------------------------------------
   Under the social-links pill: Video | Mazzi behind the site's segmented
   control (.profile-tabs.social-tabs). Video: a grid of rounded 16:9
   thumbnails, the matchup big over its series and date; Mazzi: the boxless
   sub-card list (#decks), the commander's art on the left, the commander
   big over the event and the pilot, the position chip and the date on the
   right. A small "Nuovo" chip on what came in the last day. */
/* The links to the social services, the page's point (social.html): one
   card in the site's look (white, a red hairline edge, the dark tiles' in
   dark mode) — the Telegram group as the invite (its own round logo, the
   name and a line, a red "Entra" on the right), then the other five as
   equal tiles in a row (a round logo, the name under it), a hairline
   between the two parts. A computer: the invite on the left, the tiles
   beside it; 820px down: the tiles under it. */
.social-links {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  margin-bottom: 26px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.social-links-main,
.social-links-main:hover {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  color: var(--text-title);
  text-decoration: none;
}

.social-links-main,
.social-link-btn {
  transition: background 150ms ease;
}

.social-links-main:hover,
.social-link-btn:hover {
  background: rgba(220, 24, 28, 0.04);
}

.social-links-main-logo img {
  display: block;
  width: 52px;
  height: 52px;
}

.social-links-main-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.social-links-main-text b {
  font-size: 1.15rem;
  line-height: 1.2;
}

.social-links-main-text span {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.social-links-cta {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--brand-red);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-red) 30%, transparent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  transition: transform 160ms ease;
}

.social-links-main:hover .social-links-cta {
  transform: translateY(-1px);
}

.social-links-rest {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-left: 1px solid var(--hairline);
}

.social-link-btn,
.social-link-btn:hover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 14px 4px;
  color: var(--text-title);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.social-link-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(40, 6, 9, 0.06);
}

.social-link-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

:root[data-theme="dark"] .social-links {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .social-links-rest {
  border-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .social-link-icon {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

:root[data-theme="dark"] :is(.social-links-main, .social-link-btn):hover {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 820px) {
  .social-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .social-links-main,
  .social-links-main:hover {
    gap: 12px;
    padding: 16px;
  }

  .social-links-main-logo img {
    width: 46px;
    height: 46px;
  }

  .social-links-main-text b {
    font-size: 1.02rem;
  }

  .social-links-main-text span {
    font-size: 0.8rem;
  }

  .social-links-cta {
    padding: 8px 14px;
  }

  .social-links-rest {
    border-top: 1px solid var(--hairline);
    border-left: 0;
  }

  .social-link-btn,
  .social-link-btn:hover {
    padding: 12px 4px 14px;
  }
}

/* Video | Mazzi: one at a time behind the tabs on every screen (since
   2026-10-26 — a computer used to show the two side by side under their
   headings): the site's pill bar on a computer, the segmented control on
   touch screens; the tabs name them, the headings are for screen readers
   only. A computer: the open section's filters on the tabs' row, at its
   right (.social-bar); touch screens: the row dissolves (display:
   contents — the tabs stay sticky against the page), the filters full
   width under the tabs. */
.social-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.social-bar > .social-tabs {
  margin: 0;
}

html.app-header .social-bar {
  display: contents;
}

html.app-header .social-bar > .social-tabs {
  margin-bottom: 18px;
}

/* Only the open section's filters. */
.social-bar:has(~ .social-panels #social-panel-videos:not(.is-current)) #video-filters-slot,
.social-bar:has(~ .social-panels #social-panel-decks:not(.is-current)) #deck-filters-slot {
  display: none;
}

html:not(.app-header) .social-filters .social-chips {
  width: auto;
  margin-bottom: 0;
}

.social-panel-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The filters (js/moxfield.js): a small segmented control — a tinted
   track, the chosen one a raised white pill with red text (like account's
   Tema) — a quieter step under the Video | Mazzi control. Each as wide as
   its label; on touch screens the track the whole width. */
.social-chips {
  display: flex;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(154, 28, 32, 0.07);
}

.social-chip {
  flex: 1 1 auto;
  padding: 7px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.social-chip:hover {
  color: var(--brand-red-deep);
}

.social-chip.is-active {
  background: #fff;
  color: var(--brand-red-deep);
  box-shadow: 0 1px 2px rgba(40, 6, 9, 0.1), 0 3px 10px rgba(40, 6, 9, 0.1);
}

.social-chip:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

:root[data-theme="dark"] .social-chips {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .social-chip.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: #ff9a9d;
  box-shadow: none;
}

:root[data-theme="dark"] .social-chip:hover {
  color: #ff9a9d;
}

.social-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px 18px;
}

.social-video,
.social-video:hover {
  display: grid;
  align-content: start;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

/* The thumbnail: a firm shadow under it (a near one and a soft one), so it
   sits on the page like the site's cards; hovered, it lifts a little with
   a deeper shadow — the tiles' hover (Leghe & Eventi), not a zoom into the
   picture. */
.social-video-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-red) 8%, transparent);
  box-shadow: 0 2px 5px rgba(40, 6, 9, 0.12), 0 8px 20px rgba(40, 6, 9, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.social-video:hover .social-video-thumb {
  box-shadow: 0 4px 10px rgba(40, 6, 9, 0.16), 0 14px 30px rgba(40, 6, 9, 0.24);
  transform: translateY(-2px);
}

:root[data-theme="dark"] .social-video-thumb {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45), 0 8px 20px rgba(0, 0, 0, 0.5);
}

:root[data-theme="dark"] .social-video:hover .social-video-thumb {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55), 0 14px 30px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .social-video:hover .social-video-thumb {
    transform: none;
  }
}

.social-video-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-video-text {
  display: grid;
  gap: 3px;
}

.social-video-title {
  color: var(--text-title);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.25;
}

.social-video-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.social-new {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--brand-red);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.2em;
}

.history-item.social-deck {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.social-deck-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 64px;
  height: 48px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand-red) 10%, transparent);
  color: var(--brand-red-deep);
  font-weight: 800;
}

.social-deck-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-deck-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.social-deck-date {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Under each list: the whole channel / profile (the site's white pill link,
   .section-link, with the service's logo). */
.social-more {
  display: flex;
  justify-content: center;
  margin: 22px 0 0;
}

.social-more .section-link {
  gap: 8px;
  text-decoration: none;
}

.social-more .section-link img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .social-deck-art {
    width: 52px;
    height: 40px;
  }

  .social-deck-date {
    display: none;
  }
}

/* The archetypes' icons in the meta charts (js/archetype-icons.js, a row's
   `icon` in js/metagame-chart.js): over the % in a solid bubble (white, a
   size set by the bubble's width like its %); in the legends and before a
   bar's label a small disc in the archetype's colour with the icon in
   white (in place of the square swatch) — the label column a little wider
   for it. */
.bubble-label .bubble-icon {
  width: max(12px, 24cqw);
  height: max(12px, 24cqw);
  margin-bottom: 2cqw;
}

.pie-legend-swatch.has-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
}

.pie-legend-swatch.has-icon svg {
  width: 12px;
  height: 12px;
}

@container (max-width: 559px) {
  :is(#commanders-chart, #archetypes-chart) .pie-legend-swatch.has-icon {
    width: 18px;
    height: 18px;
  }
}

.bar-chart-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.bar-chart-label-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-chart-row:has(.bar-chart-icon) {
  grid-template-columns: 136px 1fr 48px;
}

/* Room for a mana symbol's 1px ring (css/3 .bar-chart-icon .mana-symbol),
   which the label's own clipping (for its "…") would cut. */
.bar-chart-label:has(.bar-chart-icon) {
  padding: 1px;
}

.bar-chart-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
}

.bar-chart-icon svg {
  width: 12px;
  height: 12px;
}

/* The matrix's crosshair (js/matchups-page.js wireCrosshair — the mouse
   over a cell, or a tap on touch screens): the lit row's and column's names
   in the accent (a stronger tint, a red edge, red text), the cell itself
   ringed, every other result faded. */
.matchups-cell {
  transition: opacity 150ms ease;
}

.matchups-table.has-crosshair .matchups-cell:not(.is-cross) {
  opacity: 0.28;
}

.matchups-table :is(.matchups-row-header, .matchups-col-header).is-cross {
  --mx-head: color-mix(in srgb, var(--brand-red) 22%, var(--mx-bg));
  --mx-head-line: var(--brand-red);
  color: var(--brand-red-deep);
}

:root[data-theme="dark"] .matchups-table :is(.matchups-row-header, .matchups-col-header).is-cross {
  --mx-head: color-mix(in srgb, #ff6e6e 26%, var(--mx-bg));
  --mx-head-line: #ff6e6e;
  color: #ffd6d6;
}

.matchups-cell.is-cross-cell {
  outline: 2px solid var(--text-title);
  outline-offset: 1px;
}

/* ---------------------------------------------------------------------------
   Evoluzione (evolution.html, js/evolution-page.js): the Meta section's
   fourth tab — five cards, the charts in commander.html's "Utilizzo" look
   (.line-chart-wrap.is-edge above: edge to edge, dashed gridlines, the
   dates in the bottom band, the guide on hover); the title, its numbers and
   the legend on top, in the flow (.evo-head), no subtitles. The SVGs are stretched to the card (preserveAspectRatio none, y
   in px): round things — dots, discs, bars — are HTML laid over them.
   --------------------------------------------------------------------------- */
.evo {
  --evo-fill: #fbf6f3;
  /* The five colours' lines (Colori nel tempo). */
  --colour-W: #cdb76a;
  --colour-U: #0e68ab;
  --colour-B: #3a3a3a;
  --colour-R: #d3202a;
  --colour-G: #00733e;
  --colour-C: #a8a39d;
  display: grid;
  gap: 20px;
}

:root[data-theme="dark"] .evo {
  --evo-fill: rgba(255, 255, 255, 0.06);
  --colour-U: #3d8fd6;
  --colour-B: #a39a9c;
  --colour-G: #2fa36a;
}

.evo .pie-chart-wrap {
  margin-bottom: 0;
}

/* Its links (the tiles, the chips, the discs) are cards, not text links:
   no underline on hover (the site's a:hover). */
.evo a:hover {
  text-decoration: none;
}

/* The filters' hidden "Evento" (one event has no evolution). */
.field[hidden] {
  display: none;
}

.evo-head {
  padding: 16px 18px 12px;
}

.evo-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.evo-head .pie-chart-title {
  margin: 0;
}

.evo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.evo-plot {
  position: relative;
}

.evo-plot > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: line-chart-reveal 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms both;
}

.evo-grid {
  stroke: var(--hairline);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

/* The bottom axis: solid, a shade stronger (it runs over the areas). */
.evo-grid.is-zero {
  stroke: var(--hairline-hover);
  stroke-dasharray: none;
}

.evo-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 5px;
  border-radius: var(--radius-pill);
  background: var(--evo-fill);
  color: var(--text-body);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  transition: opacity 150ms ease, background 150ms ease;
}

/* (Only the chips that are links: a plain legend does nothing on hover —
   user.) */
a.evo-chip:hover {
  background: color-mix(in srgb, var(--brand-red) 8%, var(--evo-fill));
}

.evo-chip i {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: #ccc center / cover;
}

.evo-chip i svg {
  width: 12px;
  height: 12px;
}

.evo-chip b {
  color: var(--text-muted);
  font-weight: 800;
}

/* A line's legend: its colour as a short bar. */
.evo-chip.is-line {
  padding-left: 11px;
}

.evo-chip.is-line i {
  width: 16px;
  height: 4px;
  border-radius: 2px;
}

/* The hover / tap tip: the site's dark pill, as a small box. */
.evo-tip {
  position: absolute;
  top: 6px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(12, 7, 8, 0.9);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.evo-tip strong {
  display: block;
  font-size: 0.78rem;
}

.evo-tip em {
  display: block;
  margin-bottom: 3px;
  opacity: 0.7;
  font-style: normal;
}

.evo-tip div {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.5;
}

.evo-tip i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.evo-tip span {
  margin-left: auto;
  padding-left: 14px;
}

.line-chart-hit:hover > .evo-tip {
  opacity: 1;
}

/* (Kept inside the card near its edges by js/evolution-page.js, through
   `translate`.) */

/* The tips over everything in the plot, the end discs included. */
.evo-plot .line-chart-hit:hover,
.evo-plot .line-chart-hit.is-scrub {
  z-index: 4;
}

/* Archetipi nel tempo: light tints, a solid line on each band's top. */
.evo-band {
  fill-opacity: 0.2;
}

.evo-band-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="dark"] .evo-band {
  fill-opacity: 0.24;
}

/* I più giocati: lines, the art discs on their ends (no dots: one
   on each line only on hover / tap, the site's .line-chart-dot-html). */
/* (Room on the right for the end discs' half beyond the last point.) */
.evo-race-plot {
  margin-right: 26px;
}

.evo-race-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 180ms ease, stroke-width 180ms ease;
}

.evo-race-end {
  position: absolute;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ccc center / cover;
  box-shadow: 0 0 0 3px var(--c), 0 3px 10px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

@media (max-width: 600px) {
  .evo-race-end {
    width: 34px;
    height: 34px;
  }
}

.evo-race.has-focus :is(.evo-race-line, .evo-race-end):not(.is-focus) {
  opacity: 0.14;
}

.evo-race.has-focus .evo-race-line.is-focus {
  stroke-width: 6;
}

.evo-race.has-focus .evo-race-end.is-focus {
  transform: translate(-50%, -50%) scale(1.12);
}


/* Ricambio del meta: its legend on the title's line, at the right end, on
   every screen — on phones its two entries stacked, bare (side by side they
   don't fit beside the title). */
.evo-turnover .evo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.evo-turnover .evo-head .pie-chart-title {
  white-space: nowrap;
}

.evo-turnover .evo-legend {
  flex-shrink: 0;
  margin-top: 0;
}

html.nav-mobile .evo-turnover .evo-legend {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

html.nav-mobile .evo-turnover .evo-chip {
  padding: 0;
  background: none;
  font-size: 0.76rem;
}

/* Computers: the archetypes' legend on the title's line, at its right end
   (under it only if the window is too narrow for both). */
html:not(.nav-mobile) .evo-archetypes .evo-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

html:not(.nav-mobile) .evo-archetypes .evo-legend {
  margin-top: 0;
}

/* Phones: the archetypes' legend on one line — bare icon + name, spread
   across. */
html.nav-mobile .evo-archetypes .evo-legend {
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 4px;
}

html.nav-mobile .evo-archetypes .evo-chip {
  gap: 5px;
  padding: 0;
  background: none;
  font-size: 0.76rem;
}

html.nav-mobile .evo-archetypes .evo-chip i {
  width: 18px;
  height: 18px;
}

/* The cards without an edge chart (Chi sale, Colori). */
.evo-card {
  padding: 0;
}

/* Chi sale, chi scende: art tiles. */
.evo-movers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding: 4px 18px 18px;
}

.evo-movers > div {
  min-width: 0;
}

/* One tile per line on narrow windows and on every touch screen (a phone
   held sideways, a tablet too). */
@media (max-width: 760px) {
  .evo-movers {
    grid-template-columns: minmax(0, 1fr);
  }
}

html.nav-mobile .evo-movers {
  grid-template-columns: minmax(0, 1fr);
}

.evo-movers h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.evo-arrow {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.75rem;
}

.evo-arrow.is-up {
  background: #1d9a55;
}

.evo-arrow.is-down {
  background: var(--brand-red);
}

.evo-mover {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 116px;
  margin-bottom: 12px;
  padding: 0 14px;
  overflow: hidden;
  border-radius: 16px;
  background: #2a2224 center 25% / cover;
  box-shadow: var(--shadow-card);
  color: #fff;
  text-decoration: none;
  transition: transform 160ms ease;
}

.evo-mover:hover {
  transform: translateY(-2px);
}

.evo-mover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 8, 9, 0.92) 0%, rgba(14, 8, 9, 0.7) 55%, rgba(14, 8, 9, 0.35) 100%);
}

.evo-mover > * {
  position: relative;
}

.evo-mover-rank {
  width: 16px;
  font-size: 1.5rem;
  font-weight: 900;
  opacity: 0.35;
}

.evo-mover-text {
  flex: 1;
  min-width: 0;
}

.evo-mover-text b {
  display: block;
  overflow: hidden;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evo-mover-text small {
  font-size: 0.76rem;
  font-weight: 700;
  opacity: 0.8;
}

.evo-new {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.evo-mover-delta {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 900;
}

.evo-mover-delta.is-up {
  background: #1d9a55;
}

.evo-mover-delta.is-down {
  background: var(--brand-red);
}

.evo-mover svg {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  opacity: 0.85;
}

/* Colori nel tempo: five tiles, each a small edge chart (one per line on
   touch screens). */
.evo-colours {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 18px 18px;
}

/* As tall as Chi sale, chi scende's tiles (.evo-mover) above. */
.evo-colour {
  position: relative;
  height: 116px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--evo-fill);
}

.evo-colour-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 12px 0;
}

.evo-colour-top .mana-symbol {
  width: 22px;
  height: 22px;
}

.evo-colour-name {
  min-width: 0;
  padding-top: 4px;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* The share top right, its trend under it. */
.evo-colour-val {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-left: auto;
  color: var(--text-title);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.evo-colour-trend {
  margin-top: 3px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.evo-colour svg {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 62px;
  animation: line-chart-reveal 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms both;
}

.evo-colour-area {
  fill: var(--c);
  fill-opacity: 0.22;
}

.evo-colour-line {
  fill: none;
  stroke: var(--c);
  stroke-width: 2.5;
}

/* Ricambio del meta: two lines — the decks (the card's ink) and those with
   a never-seen commander (red), each with a faint area. */
.evo-turnover {
  --turnover-decks: #9a8286;
}

:root[data-theme="dark"] .evo-turnover {
  --turnover-decks: #bfaeb1;
}

.evo-turnover-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.evo-turnover-line.is-decks {
  stroke: var(--turnover-decks);
}

.evo-turnover-line.is-fresh {
  stroke: var(--brand-red);
}

.evo-turnover-area.is-decks {
  fill: var(--turnover-decks);
  fill-opacity: 0.12;
}

.evo-turnover-area.is-fresh {
  fill: var(--brand-red);
  fill-opacity: 0.16;
}

@media (max-width: 900px) {
  .evo-colours {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evo-colours > :last-child {
    grid-column: 1 / -1;
  }
}

/* Touch screens (and narrow windows): one tile per line, a little lower,
   the curve across the whole width. */
@media (max-width: 640px) {
  .evo-colours {
    grid-template-columns: minmax(0, 1fr);
  }
}

html.nav-mobile .evo-colours {
  grid-template-columns: minmax(0, 1fr);
}

html.nav-mobile .evo-colours > :last-child {
  grid-column: auto;
}

/* With colorless, six tiles: two lines of three on a computer, three of
   two on narrower windows, one per line on touch screens. */
.evo-colours.has-six {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .evo-colours.has-six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evo-colours.has-six > :last-child {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .evo-colours.has-six {
    grid-template-columns: minmax(0, 1fr);
  }
}

html.nav-mobile .evo-colours.has-six {
  grid-template-columns: minmax(0, 1fr);
}

/* Dark mode: Combo's near-black and the black colour's curve, a shade
   lighter so they don't vanish into the dark card. */
:root[data-theme="dark"] .evo .evo-band.is-combo {
  fill: #6e6267;
}

:root[data-theme="dark"] .evo .evo-band-line.is-combo {
  stroke: #8a7d81;
}

:root[data-theme="dark"] .evo .evo-chip i.is-combo {
  background: #6e6267 !important;
}


/* The loading placeholder (evolution.html's .sk-page.is-evolution). */
.sk-page.is-evolution .sk-chart {
  height: 420px;
}

.sk-page.is-evolution .sk-card {
  height: 320px;
}

@media (prefers-reduced-motion: reduce) {
  .evo-mover,
  .evo-race-end,
  .evo-race-line {
    transition: none;
  }
}

/* ===========================================================================
   Confronto (compare.html, js/compare-page.js): two players side by side.
   Their colours: A red (the site's) on the left, B blue (Control's / the
   Social blue) on the right. Chosen 2026-11-01 from three rounds of mockups.
   =========================================================================== */
.cmp-page {
  --pa: var(--brand-red);
  --pb: #2f5fdc;
  --pa-text: #c8151a;
  --pb-text: #2f5fdc;
  --cmp-fill: rgba(154, 28, 32, 0.06);
}

:root[data-theme="dark"] .cmp-page {
  --pa-text: #ff7a7e;
  --pb-text: #8fa9ff;
  --cmp-fill: rgba(255, 255, 255, 0.06);
}

/* --- The hero (option C "Numeri d'arte" of the 2026-11-01 mockups — user):
   a light card; the two names at its sides (each the picker's button, a
   short bar in its player's colour under it), each one's most played
   commander's art faint and blurred behind its side; in the middle the
   matches won against each other in giant numerals filled with that same
   art (the side behind faded; draws never shown). No pair yet: a big hollow
   VS; never met: "–" and "Mai affrontati". **One height in every state**
   (user): the card's own. Narrow screens: the numbers on top, the two names
   under them side by side. */
.cmp-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
  height: 214px;
  margin: 0 0 22px;
  padding: 0 44px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-card);
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

:root[data-theme="dark"] .cmp-hero {
  background: rgba(255, 255, 255, 0.045);
}

.cmp-side {
  position: relative;
  display: flex;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  --c: var(--pa);
}

.cmp-side.is-b {
  justify-content: flex-end;
  text-align: right;
  --c: var(--pb);
}

/* The art behind a side: the hero's --art-a / --art-b (js/compare-page.js,
   once loaded — the numerals use the same image). */
.cmp-art {
  position: absolute;
  top: -40px;
  bottom: -40px;
  width: 130%;
  background-position: center 30%;
  background-size: cover;
  filter: blur(26px) saturate(1.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
}

.cmp-art.is-loaded {
  opacity: 0.3;
}

.cmp-art.is-a {
  left: -90px;
  background-image: var(--art-a, none);
  mask-image: linear-gradient(90deg, #000 30%, transparent);
}

.cmp-art.is-b {
  right: -90px;
  background-image: var(--art-b, none);
  mask-image: linear-gradient(270deg, #000 30%, transparent);
}

/* The name: the picker's button, up to two lines, its colour's bar under
   it (longer on hover / while open). No player yet: "Scegli un giocatore",
   lighter. */
.cmp-pick {
  position: relative;
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-title);
  font: inherit;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.12;
  text-align: inherit;
  cursor: pointer;
}

.cmp-pick-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cmp-pick::after {
  content: "";
  display: block;
  width: 54px;
  height: 6px;
  margin-top: 12px;
  border-radius: var(--radius-pill);
  background: var(--c);
  transition: width 200ms ease;
}

.cmp-side.is-b .cmp-pick::after {
  margin-left: auto;
}

.cmp-pick:hover::after,
.cmp-pick[aria-expanded="true"]::after {
  width: 84px;
}

.cmp-pick.is-empty {
  color: var(--text-muted);
  font-size: 1.4rem;
  font-weight: 700;
}

.cmp-pick.is-empty::after {
  opacity: 0.35;
}

.cmp-mid {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 220px;
}

.cmp-vs {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.24em;
}

.cmp-score {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 0.84;
}

/* A numeral filled with its player's art (its colour until loaded),
   outlined in that colour. */
.cmp-score b {
  padding: 0 4px;
  background: var(--c) center 30% / cover;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  -webkit-text-stroke: 2px var(--c);
  filter: drop-shadow(0 8px 14px rgba(40, 24, 26, 0.16));
}

.cmp-score b.is-a {
  --c: var(--pa);
  background-image: var(--art-a, none);
}

.cmp-score b.is-b {
  --c: var(--pb);
  background-image: var(--art-b, none);
}

.cmp-score b.is-behind {
  filter: grayscale(0.7);
  opacity: 0.42;
}

.cmp-score i {
  color: var(--text-muted);
  font-size: 4rem;
  font-style: normal;
  font-weight: 700;
}

/* No pair yet: a hollow VS in the numbers' place. */
.cmp-score.is-ghost b {
  background: none;
  -webkit-text-stroke: 2px var(--hairline-hover);
  font-size: 8rem;
  letter-spacing: 0.02em;
  filter: none;
}

.cmp-score-note {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .cmp-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "mid mid" "a b";
    align-content: center;
    gap: 12px 16px;
    height: 232px;
    padding: 0 20px;
    border-radius: 24px;
  }

  /* (The art then placed against the card's corners.) */
  .cmp-side {
    position: static;
    align-self: start;
  }

  .cmp-side.is-a {
    grid-area: a;
  }

  .cmp-side.is-b {
    grid-area: b;
  }

  .cmp-art {
    top: -30px;
    bottom: -30px;
    width: 65%;
  }

  .cmp-art.is-a {
    left: -30px;
  }

  .cmp-art.is-b {
    right: -30px;
  }

  .cmp-pick {
    z-index: 1;
    font-size: 1.25rem;
  }

  .cmp-pick::after {
    width: 40px;
    height: 5px;
    margin-top: 8px;
  }

  .cmp-pick:hover::after,
  .cmp-pick[aria-expanded="true"]::after {
    width: 62px;
  }

  .cmp-pick.is-empty {
    font-size: 1.02rem;
  }

  .cmp-mid {
    z-index: 1;
    grid-area: mid;
    min-width: 0;
  }

  .cmp-score b {
    font-size: 6.2rem;
  }

  .cmp-score.is-ghost b {
    font-size: 5.6rem;
  }

  .cmp-score i {
    font-size: 3rem;
  }
}

/* No pair chosen yet: a line inviting to pick, instead of the cards. */
.cmp-empty {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

/* --- The cards (the site's chart card, .pie-chart-wrap): two columns on a
   computer — Statistiche and Archetipi on the left, Scontri diretti beside
   both, Andamento the whole width under them (Comandanti removed — user,
   2026-11-03); one column, in the page's order, on narrow screens. */
.cmp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "stats h2h" "arch h2h" "trend trend";
  gap: 22px;
  align-items: start;
}

.cmp-grid > .is-stats {
  grid-area: stats;
}

.cmp-grid > .is-h2h {
  grid-area: h2h;
}

.cmp-grid > .is-arch {
  grid-area: arch;
}

.cmp-grid > .cmp-trend {
  grid-area: trend;
}

@media (max-width: 820px) {
  .cmp-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
    gap: 16px;
  }

  .cmp-grid > .cmp-card {
    grid-area: auto;
  }
}

/* No pair yet: the cards hidden (their display would beat [hidden]). */
.cmp-grid[hidden] {
  display: none;
}

.cmp-card {
  position: relative;
  min-width: 0;
  margin: 0;
}

.cmp-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cmp-card-head .pie-chart-title {
  margin: 0;
}

/* --- Statistiche: winrate featured on a tinted panel (no W-D-L under it —
   user), then one row per
   number — A's value, the label over a tug-of-war bar (A's share from the
   left, B's from the right, a notch at the middle; the side ahead in full
   colour), B's value. */
.cmp-stat {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}

.cmp-stat + .cmp-stat:not(:nth-child(2)) {
  border-top: 1px solid var(--table-row-line);
}

.cmp-stat.is-main {
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  margin: -4px -6px 8px;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: var(--cmp-fill);
}

.cmp-stat-val {
  color: var(--text-muted-2);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.cmp-stat-val.is-b {
  text-align: right;
}

.cmp-stat-val.is-a.is-lead {
  color: var(--pa-text);
}

.cmp-stat-val.is-b.is-lead {
  color: var(--pb-text);
}

.cmp-stat.is-main .cmp-stat-val {
  font-size: 1.85rem;
}

.cmp-stat-mid {
  min-width: 0;
}

.cmp-stat-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.cmp-stat-bar {
  position: relative;
  display: flex;
  gap: 3px;
  height: 8px;
}

.cmp-stat.is-main .cmp-stat-bar {
  height: 12px;
}

.cmp-stat-bar i {
  min-width: 6px;
  border-radius: var(--radius-pill);
  opacity: 0.32;
  transition: flex-basis 800ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms ease;
}

.cmp-stat-bar .is-a {
  flex: 0 0 var(--w, 50%);
  background: var(--pa);
}

.cmp-stat-bar .is-b {
  flex: 1 1 0;
  background: var(--pb);
}

.cmp-stat-bar i.is-lead {
  opacity: 1;
}

.cmp-stat.is-even .cmp-stat-bar i {
  opacity: 0.6;
}

.cmp-stat-bar::after {
  content: "";
  position: absolute;
  top: -4px;
  bottom: -4px;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--text-title);
  opacity: 0.22;
}

@media (max-width: 520px) {
  .cmp-stat {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
    gap: 10px;
  }

  .cmp-stat.is-main {
    grid-template-columns: 80px minmax(0, 1fr) 80px;
    padding: 12px 12px 14px;
  }

  .cmp-stat.is-main .cmp-stat-val {
    font-size: 1.45rem;
  }
}

/* --- Scontri diretti (option C "Locandine" of the 2026-11-01 mockups —
   user): a strip per match, the two decks' art side by side split by a
   straight line (user: not diagonal), the loser's greyed, the winner's side
   tinted in its colour (no coloured edge — user); the event and round and
   the date along the top, each deck's name on one line at the bottom
   (shrunk to fit — js/compare-page.js fitLines, user), the games won in two
   boxes in the middle, the winner's filled with its colour. */
.cmp-matches {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cmp-match {
  position: relative;
  display: block;
  height: 96px;
  overflow: hidden;
  border-radius: 16px;
  background: #1a1416;
  color: #fff;
  text-decoration: none;
  isolation: isolate;
}

/* The entries are links: no underline on hover (the site's a:hover). */
.cmp-match:hover {
  text-decoration: none;
}

.cmp-match-art {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: #3a2c30 center 25% / cover;
  transition: filter 250ms ease;
}

.cmp-match-art.is-a {
  left: 0;
}

/* The straight line between the two. */
.cmp-match-art.is-b {
  right: 0;
  box-shadow: -1px 0 0 rgba(10, 6, 8, 0.9), -2px 0 0 rgba(255, 255, 255, 0.14);
}

.cmp-match.is-win-a .cmp-match-art.is-b,
.cmp-match.is-win-b .cmp-match-art.is-a,
.cmp-matches.is-empty .cmp-match-art {
  filter: grayscale(1) brightness(0.55);
}

.cmp-match:hover .cmp-match-art {
  filter: brightness(1.08);
}

.cmp-match.is-win-a:hover .cmp-match-art.is-b,
.cmp-match.is-win-b:hover .cmp-match-art.is-a {
  filter: grayscale(1) brightness(0.65);
}

.cmp-match-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 6, 8, 0.85), rgba(10, 6, 8, 0.12) 55%, rgba(10, 6, 8, 0.6));
}

.cmp-match.is-win-a .cmp-match-shade {
  background:
    linear-gradient(90deg, rgba(220, 24, 28, 0.42), transparent 40%),
    linear-gradient(0deg, rgba(10, 6, 8, 0.85), rgba(10, 6, 8, 0.12) 55%, rgba(10, 6, 8, 0.6));
}

.cmp-match.is-win-b .cmp-match-shade {
  background:
    linear-gradient(270deg, rgba(47, 95, 220, 0.46), transparent 40%),
    linear-gradient(0deg, rgba(10, 6, 8, 0.85), rgba(10, 6, 8, 0.12) 55%, rgba(10, 6, 8, 0.6));
}

.cmp-match-top {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 14px;
  left: 14px;
  display: flex;
  justify-content: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  text-transform: uppercase;
}

.cmp-match-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A deck's name: one line, as wide as its half beside the score. */
.cmp-match-deck {
  position: absolute;
  z-index: 2;
  bottom: 11px;
  max-width: calc(50% - 58px);
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.cmp-match-deck.is-a {
  left: 16px;
}

.cmp-match-deck.is-b {
  right: 16px;
  text-align: right;
}

.cmp-match.is-win-a .cmp-match-deck.is-b,
.cmp-match.is-win-b .cmp-match-deck.is-a {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
}

.cmp-match-score {
  position: absolute;
  z-index: 2;
  top: 56%;
  left: 50%;
  display: flex;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
}

.cmp-match-score b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 36px;
  background: rgba(14, 9, 10, 0.85);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cmp-match-score b.is-a.is-win {
  background: var(--pa);
  color: #fff;
}

.cmp-match-score b.is-b.is-win {
  background: var(--pb);
  color: #fff;
}

/* Never met: one strip, both arts greyed, the line over them. */
.cmp-match-msg {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 0 16px;
  text-align: center;
}

.cmp-match-msg b {
  font-size: 0.95rem;
}

.cmp-match-msg span {
  font-size: 0.8rem;
  opacity: 0.82;
}

@media (max-width: 600px) {
  .cmp-match {
    height: 92px;
  }

  .cmp-match-top {
    right: 12px;
    left: 12px;
    font-size: 0.6rem;
  }

  .cmp-match-deck {
    max-width: calc(50% - 46px);
    font-size: 0.76rem;
  }

  .cmp-match-deck.is-a {
    left: 13px;
  }

  .cmp-match-deck.is-b {
    right: 13px;
  }

  .cmp-match-score b {
    width: 28px;
    height: 32px;
    font-size: 1.05rem;
  }
}

.cmp-more {
  display: block;
  margin: 12px auto 0;
  padding: 7px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--brand-red-deep);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.cmp-more:hover {
  border-color: var(--hairline-hover);
  background: rgba(220, 24, 28, 0.06);
}

/* --- Andamento: commander.html's edge-to-edge chart (.line-chart-wrap
   .is-edge), two lines. The head over the hover strips (its selector
   reachable; the strips still get the pointer through the rest of it): the
   title, the Winrate / Piazzamenti selector at the right end — in place of
   the numbers, on every screen (user). */
.cmp-trend .line-chart-head {
  z-index: 3;
  align-items: center;
}

.cmp-trend .cmp-seg {
  pointer-events: auto;
}

.cmp-seg {
  margin-top: -3px;
  pointer-events: auto;
}

@media (max-width: 640px) {
  .cmp-trend .line-chart-head {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title stats" "seg seg";
    row-gap: 10px;
  }

  .cmp-trend .pie-chart-title {
    grid-area: title;
  }

  .cmp-trend .line-chart-stats {
    grid-area: stats;
  }

  .cmp-trend .cmp-seg {
    grid-area: seg;
    justify-self: center;
  }
}

html.nav-mobile .cmp-trend .line-chart-head {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title stats" "seg seg";
  row-gap: 10px;
}

html.nav-mobile .cmp-trend .pie-chart-title {
  grid-area: title;
}

html.nav-mobile .cmp-trend .line-chart-stats {
  grid-area: stats;
}

html.nav-mobile .cmp-trend .cmp-seg {
  grid-area: seg;
  justify-self: center;
}

.cmp-seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--bg-cream-1);
}

.cmp-seg button {
  padding: 4px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted-2);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.cmp-seg button[aria-pressed="true"] {
  background: var(--brand-red);
  color: #fff;
}

/* Touch screens: a bigger target for a finger (user). */
html.nav-mobile .cmp-seg {
  padding: 4px;
}

html.nav-mobile .cmp-seg button {
  padding: 8px 18px;
  font-size: 0.86rem;
}

.cmp-plot {
  height: 270px;
}

@media (max-width: 820px) {
  .cmp-plot {
    height: 240px;
  }
}

.cmp-plot > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: line-chart-reveal 900ms cubic-bezier(0.2, 0.8, 0.2, 1) 120ms both;
}

.cmp-plot .line-chart-line.is-a {
  stroke: var(--pa);
}

.cmp-plot .line-chart-line.is-b {
  stroke: var(--pb);
}

/* Each player's area, flat, down to the card's bottom edge (the dates
   inside it, like commander.html's Utilizzo). */
.cmp-plot .line-chart-area.is-a {
  fill: rgba(220, 24, 28, 0.1);
}

.cmp-plot .line-chart-area.is-b {
  fill: rgba(47, 95, 220, 0.1);
}

:root[data-theme="dark"] .cmp-plot .line-chart-area.is-a {
  fill: rgba(255, 106, 110, 0.12);
}

:root[data-theme="dark"] .cmp-plot .line-chart-area.is-b {
  fill: rgba(127, 160, 255, 0.12);
}

.cmp-plot .line-chart-guide {
  border-left-color: var(--text-muted);
}

.cmp-plot .line-chart-dot-html.is-a {
  background: var(--pa);
}

.cmp-plot .line-chart-dot-html.is-b {
  background: var(--pb);
}

.cmp-plot-empty {
  padding-top: 110px;
}

/* The tip: the site's dark pill as a small box, beside the guide (left of
   it in the chart's right half). */
.cmp-tip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(12, 7, 8, 0.9);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.cmp-tip.is-left {
  transform: translateX(calc(-100% - 14px));
}

.line-chart-hit:hover > .cmp-tip {
  opacity: 1;
}

.cmp-tip strong {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cmp-tip div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.cmp-tip div i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cmp-tip div span {
  margin-left: auto;
  padding-left: 12px;
  font-variant-numeric: tabular-nums;
}

/* --- Archetipi (option A "Ciambelle" of the 2026-11-01 mockups — user): a
   ring per player split by archetype (the archetypes' colours; its first
   name inside), the legend under them — each archetype's icon, name and the
   two shares (A red, B blue); a piece or a legend tile picks an archetype:
   its pieces thicker, the rest faded, and inside each ring that player's
   winrate and events with it (no icon there — user). */
.cmp-dons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  gap: 16px;
}

.cmp-don {
  position: relative;
  width: min(100%, 190px);
  aspect-ratio: 1;
}

.cmp-don > svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: rotate(-90deg);
}

.cmp-don-track {
  fill: none;
  stroke: var(--cmp-fill);
  stroke-width: 16;
}

.cmp-don-seg {
  fill: none;
  stroke-width: 16;
  cursor: pointer;
  transition: stroke-width 250ms ease, opacity 250ms ease;
}

#compare-archetypes.has-pick .cmp-don-seg.is-picked {
  stroke-width: 24;
}

#compare-archetypes.has-pick .cmp-don-seg:not(.is-picked) {
  opacity: 0.2;
}

.cmp-don-c {
  position: absolute;
  inset: 22%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 3px;
  text-align: center;
  pointer-events: none;
}

.cmp-don-c b {
  max-width: 100%;
  overflow: hidden;
  color: var(--pa-text);
  font-size: 1.1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmp-don.is-b .cmp-don-c b {
  color: var(--pb-text);
}

.cmp-don-c.is-pick b {
  font-size: 1.6rem;
  line-height: 1;
}

.cmp-don-c span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
}

.cmp-don-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.cmp-don-leg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 2px;
  border: 0;
  border-radius: 14px;
  background: var(--cmp-fill);
  color: var(--text-body);
  font: inherit;
  cursor: pointer;
  transition: opacity 200ms ease, background 150ms ease;
}

.cmp-don-leg i {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
}

.cmp-don-leg svg {
  width: 13px;
  height: 13px;
}

.cmp-don-ln {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 800;
  text-overflow: ellipsis;
}

.cmp-don-v {
  display: flex;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cmp-don-v .is-a {
  color: var(--pa-text);
}

.cmp-don-v .is-b {
  color: var(--pb-text);
}

.cmp-don-leg:hover,
.cmp-don-leg.is-picked {
  background: color-mix(in srgb, var(--brand-red) 10%, var(--cmp-fill));
}

.cmp-don-leg.is-picked {
  box-shadow: inset 0 0 0 1.5px var(--hairline-hover);
}

.cmp-don-leg.is-unused,
#compare-archetypes.has-pick .cmp-don-leg:not(.is-picked) {
  opacity: 0.42;
}

@media (max-width: 600px) {
  .cmp-don-legend {
    gap: 4px;
  }

  .cmp-don-v {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }

  .cmp-don-ln {
    font-size: 0.62rem;
  }
}

/* Dark mode: Combo's near-black a shade lighter (it vanished). */
:root[data-theme="dark"] .cmp-don-seg.is-combo {
  stroke: #6e6267;
}

:root[data-theme="dark"] .cmp-don-leg i.is-combo {
  background: #6e6267 !important;
}

/* --- The picker (moved to <body> by js/compare-page.js): a popover under
   the name on a computer; full screen on touch screens (like the site
   search's overlay) — the search field on top, the results right under it,
   so filtering never pushes them down behind the keyboard (a bottom sheet
   did). The ones the other player met most first, then everyone. */
.cmp-picker {
  position: fixed;
  z-index: 1200;
  width: 320px;
  max-width: calc(100vw - 24px);
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--bg-cream-1);
  box-shadow: 0 24px 60px rgba(40, 20, 22, 0.25);
  animation: cs-menu-in 140ms ease;
}

.cmp-picker[hidden] {
  display: none;
}

.cmp-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1199;
}

html.nav-mobile .cmp-picker {
  inset: 0 !important;
  flex-direction: column;
  width: auto;
  max-width: none;
  height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  animation: cmp-picker-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* (Not on the [hidden] one: this display would beat it.) */
html.nav-mobile .cmp-picker:not([hidden]) {
  display: flex;
}

@keyframes cmp-picker-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* The page behind it doesn't scroll meanwhile. */
html.nav-mobile.cmp-picker-open,
html.nav-mobile.cmp-picker-open body {
  overflow: hidden;
}

.cmp-picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--table-row-line);
}

.cmp-picker-search svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* The browser's own clear button off: one ✕ only. */
.cmp-picker-search input::-webkit-search-cancel-button {
  display: none;
}

/* The ✕: touch screens only (a computer's popover closes on a click
   outside it, or Esc). */
.cmp-picker-close {
  display: none;
}

html.nav-mobile .cmp-picker-search {
  padding: 10px 12px 10px 16px;
}

html.nav-mobile .cmp-picker-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--cmp-fill, rgba(154, 28, 32, 0.06));
  color: var(--text-title);
  cursor: pointer;
}

html.nav-mobile .cmp-picker-close svg {
  width: 18px;
  height: 18px;
}

.cmp-picker-search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-size: 1rem;
  outline: none;
  box-shadow: none;
  animation: none;
}

.cmp-picker-list {
  max-height: min(380px, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

html.nav-mobile .cmp-picker-list {
  flex: 1;
  max-height: none;
  padding: 6px 8px 24px;
}

.cmp-picker-group {
  padding: 10px 10px 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cmp-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-body);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.cmp-picker-item:hover,
.cmp-picker-item.is-focus {
  background: rgba(220, 24, 28, 0.07);
}

.cmp-picker-item.is-current {
  color: var(--brand-red-deep);
}

.cmp-picker-count {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The loading placeholder (compare.html's .sk-page.is-compare): the hero,
   two cards. */
.sk-page.is-compare .sk-compare-hero {
  display: block;
  height: 214px;
  margin-bottom: 22px;
  border-radius: 28px;
}

.sk-compare-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.sk-page.is-compare .sk-compare-card {
  display: block;
  height: 400px;
  border-radius: var(--radius-card-sm);
}

@media (max-width: 820px) {
  .sk-page.is-compare .sk-compare-hero {
    height: 232px;
    border-radius: 24px;
  }

  .sk-compare-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .sk-compare-cards > :last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cmp-hero,
  .cmp-plot > svg,
  .cmp-picker {
    animation: none;
  }

  .cmp-stat-bar i,
  .cmp-art,
  .cmp-pick::after,
  .cmp-match-art,
  .cmp-don-seg,
  .cmp-don-leg {
    transition: none;
  }
}
