/* styles — part 4 of 6 (css/4-profile-card.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. */

/* "Sei già nelle classifiche? …": the card's main sentence, not a hint. */
.profile-claim .account-hint {
  color: var(--text-body);
  font-size: 1.02rem;
  line-height: 1.5;
}

/* "Richiesta inviata." etc.: its own line under the card's buttons, with
   the same spacing as the rest of the card; no gap at all when empty. */
.profile-claim .form-message {
  margin-top: 14px;
}

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

/* The player page's stat tiles, inside a card here: no shadow of their own
   (the card already has one), a touch smaller. */
.profile-stats-tiles {
  margin-bottom: 0;
}

.profile-card .stat-tile {
  padding: 14px;
  box-shadow: none;
}

.profile-card .stat-tile-value {
  font-size: 1.7rem;
}

/* The profile (account.html): a hero on top — the player card (+ its
   switch) on the favourite commander's art, blurred and darkened; beside it
   the name, "Dal …", the numbers (once linked) and quick actions — then
   "Il tuo giocatore" (until linked), then the sections one at a time behind
   tabs (js/account-page.js selectTab): a pill bar on desktop, a full-width
   segmented control on phones, sticky on touch screens. */
.profile-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 22px;
  border-radius: 28px;
  /* Lighter than the (always dark) player card in it, so the card stands
     out against it — under the art, and alone while there's none. */
  background: linear-gradient(135deg, #6f6a67, #3b3735);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

/* The art (js/player-card.js createArtPainter: .is-loaded once loaded),
   blurred, only lightly darkened (the card reads against it), a little
   larger than the hero so the blur's soft edge stays outside; a gradient
   over it darkening only the text's side. */
.profile-hero-art {
  position: absolute;
  inset: -40px;
  background-position: center 30%;
  background-size: cover;
  filter: blur(24px) saturate(1.3) brightness(1);
  opacity: 0;
  transition: opacity 600ms ease;
}

.profile-hero-art.is-loaded {
  opacity: 1;
}

/* Every hero (account, player, commander, league), on every screen: the art
   and the plain reds under it dimmed evenly, a little more on the right (a
   card in the hero sits above it, undimmed). */
.profile-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 12, 13, 0.32), rgba(18, 12, 13, 0.58));
  pointer-events: none;
}

/* A soft shadow under the hero's text, for a bright art behind it. */
.profile-hero-text {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.profile-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 32px;
}

.profile-hero-kicker {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-hero-name {
  margin: 6px 0;
  color: #fff;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

/* The numbers (js/winrate.js's tiles + "Leghe"): big and bare, value over
   label, in a row; the winrate in light red. */
.profile-hero .profile-stats-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-top: 24px;
}

/* Bare: no tile box at all — background, border, shadow, and the tiles'
   own backdrop blur (which, over the hero's art, showed as a faint
   rectangle behind some numbers). The label centred under its number, at
   every width (user's choice 2026-11-03; phones already did). */
.profile-hero .stat-tile,
:root[data-theme="dark"] .profile-hero .stat-tile {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.profile-hero .stat-tile-label {
  color: rgba(255, 255, 255, 0.65);
}

.profile-hero .stat-tile-value,
:root[data-theme="dark"] .profile-hero .stat-tile-value {
  margin: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

/* The winrate: white on a solid brand-red pill — readable on any art
   behind it, light or red — in every hero: account, player, commander.
   Every other number gets the pill's same vertical padding (no box), so
   all the numbers, and the labels under them, stay on one line. */
.profile-hero .stat-tile-value,
:root[data-theme="dark"] .profile-hero .stat-tile-value {
  padding: 0.12em 0;
}

.profile-hero .stat-tile:first-child .stat-tile-value,
:root[data-theme="dark"] .profile-hero .stat-tile:first-child .stat-tile-value {
  align-self: center;
  padding: 0.12em 0.32em;
  border-radius: 0.28em;
  /* The hero buttons' colour (--hero-btn: taken from the hero's art,
     neutral grey before it loads — js/player-card.js heroTone), like the
     back pill, a white edge — drawn as an inset shadow,
     not a border, so the box stays the size the other numbers line up
     with. */
  background: var(--hero-btn);
  transition: background 150ms ease;
  box-shadow: inset 0 0 0 1px #fff, 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #fff;
  text-shadow: none;
}

.profile-hero .page-empty {
  color: rgba(255, 255, 255, 0.7);
}

/* player.html / account.html / commander.html: the hero art's colour as the page's accent
   (js/player-card.js applyHeroTone, once the art is read): the site's red
   variables redefined on <main> — its buttons, chips, active tabs, carousel
   arrows and dots, red text and links follow it; the header and the nav,
   outside <main>, keep the brand red, and so do the few fixed red tints. In
   dark mode red text takes a light shade of it. */
main.has-hero-accent {
  --brand-red: var(--hero-accent);
  --brand-red-deep: var(--hero-accent-deep);
  --brand-red-deep-2: var(--hero-accent-deep-2);
  --brand-red-darker: var(--hero-accent-deep);
}

:root[data-theme="dark"] main.has-hero-accent {
  --brand-red-deep: var(--hero-accent-light);
  --brand-red-darker: var(--hero-accent-light);
}

/* The page itself on those pages (every hero page: player, commander,
   league, event, archetype, account — js/player-card.js puts the colour on
   <body> too): its background — the glow at the top and the cream under
   it — and the footer in faint tints of the hero's colour instead of the
   site's red-warm ones, light and dark. The cream variables redefined
   (not just body's background), so what paints "the page's colour"
   elsewhere (the phone's full-screen search) follows too. */
body.has-hero-accent {
  --bg-cream-1: color-mix(in srgb, var(--hero-accent) 7%, #fff);
  --bg-cream-2: color-mix(in srgb, var(--hero-accent) 2%, #fff);
  --bg-cream-3: color-mix(in srgb, var(--hero-accent) 4%, #fff);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--hero-accent) 10%, transparent), transparent 32%),
    linear-gradient(180deg, var(--bg-cream-1) 0%, var(--bg-cream-2) 24%, var(--bg-cream-3) 100%);
}

:root[data-theme="dark"] body.has-hero-accent {
  --bg-cream-1: color-mix(in srgb, var(--hero-accent) 12%, #141214);
  --bg-cream-2: color-mix(in srgb, var(--hero-accent) 7%, #100e10);
  --bg-cream-3: color-mix(in srgb, var(--hero-accent) 5%, #0e0c0d);
}

/* A hero page whose art's colour isn't known yet (main[data-accent-from-hero]
   without .has-hero-accent — not account.html's signed-out view, which has
   no hero to colour it): a neutral warm grey instead of the site's red, so
   the page arriving and then taking the colour (js/player-card.js
   applyHeroTone) is a soft blend from grey, not a jump from red. On <body>,
   so the header, the nav pill and the content all inherit it; the colour's
   own rules (main / .site-nav .has-hero-accent) then take over, and once
   <main> has it this no longer applies. The desktop bar (its gradient's own
   variables), the dark pill's fixed red-brown, and the hero's own starting
   background follow suit. */
body:has(main[data-accent-from-hero]:not(.has-hero-accent)):not(:has([data-view="login"]:not([hidden]))) {
  --brand-red: #5b5552;
  --brand-red-deep: #45403e;
  --brand-red-deep-2: #3a3634;
  --brand-red-darker: #45403e;
}

:root[data-theme="dark"] body:has(main[data-accent-from-hero]:not(.has-hero-accent)):not(:has([data-view="login"]:not([hidden]))) {
  --brand-red-deep: #d4ceca;
  --brand-red-darker: #d4ceca;
}

html:not(.nav-mobile) body:has(main[data-accent-from-hero]:not(.has-hero-accent)):not(:has([data-view="login"]:not([hidden]))) .site-header:not(.site-header--admin) {
  --bar-c1: #1d1b1a;
  --bar-c2: #4a4542;
}

body.has-hero-accent footer {
  background: color-mix(in srgb, var(--hero-accent) 8%, #f4f2f2);
}

:root[data-theme="dark"] body.has-hero-accent footer {
  background: color-mix(in srgb, var(--hero-accent) 9%, #121012);
}

/* …and the bits tinted with a fixed red: the "?" help buttons (their foil
   over a base in the accent's shades), the position chips and the count
   badges (a faint tint of it; :root to outrank the dark-mode ones). */
main.has-hero-accent .help-toggle-btn,
main.has-hero-accent .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, color-mix(in srgb, var(--hero-accent) 70%, #fff), var(--hero-accent) 50%, var(--hero-accent-deep-2));
  background-size: 300% 100%, 100% 100%, 100% 100%;
  background-position: 120% 0, 0 0, 0 0;
}

:root main.has-hero-accent .history-pos,
:root main.has-hero-accent .history-count {
  background: color-mix(in srgb, var(--hero-accent) 15%, transparent);
}

:root main.has-hero-accent .history-pos.is-first {
  background: var(--hero-accent);
}

:root[data-theme="dark"] main.has-hero-accent .history-pos,
:root[data-theme="dark"] main.has-hero-accent .history-count {
  background: color-mix(in srgb, var(--hero-accent-light) 22%, transparent);
}

/* The edges of its cards and tiles (the Album's stat tiles…: the shared
   --hairline colours) and Storico partite's match cards — border, hover
   edge and tint — in it too, and commander.html's Giocatori / Storico
   partite. (The ids: to outrank the boxless lists' own id-scoped rules.) */
main.has-hero-accent {
  --hairline: color-mix(in srgb, var(--hero-accent) 20%, transparent);
  --hairline-hover: color-mix(in srgb, var(--hero-accent) 34%, transparent);
  --hairline-hover-strong: color-mix(in srgb, var(--hero-accent) 40%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent {
  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-hover: color-mix(in srgb, var(--hero-accent-light) 32%, transparent);
  --hairline-hover-strong: color-mix(in srgb, var(--hero-accent-light) 42%, transparent);
}

/* The lists' sub-cards (their fixed reds — edges, hover, the top-8 and
   "Tu" tints: "Their sub-cards, straight on the page") in it too:
   league.html's Classifica, event.html's lists, and the rest. */
main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) .history-item {
  border-color: color-mix(in srgb, var(--hero-accent) 20%, transparent);
}

main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) a.history-item:hover {
  border-color: color-mix(in srgb, var(--hero-accent) 34%, transparent);
  background: color-mix(in srgb, var(--hero-accent) 4%, #fff);
}

main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) .history-item.is-top8 {
  background: color-mix(in srgb, var(--hero-accent) 8.5%, #fff);
}

main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) a.history-item.is-top8:hover {
  background: color-mix(in srgb, var(--hero-accent) 12%, #fff);
}

main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) .history-item.is-me-row {
  border-color: color-mix(in srgb, var(--hero-accent) 30%, transparent);
  background: color-mix(in srgb, var(--hero-accent) 12%, #fff);
}

main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) a.history-item.is-me-row:hover {
  border-color: color-mix(in srgb, var(--hero-accent) 38%, transparent);
  background: color-mix(in srgb, var(--hero-accent) 16%, #fff);
}

:root[data-theme="dark"] main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) a.history-item:hover {
  background: color-mix(in srgb, var(--hero-accent-light) 12%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) .history-item.is-top8 {
  background: color-mix(in srgb, var(--hero-accent-light) 11%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) a.history-item.is-top8:hover {
  background: color-mix(in srgb, var(--hero-accent-light) 15%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) .history-item.is-me-row {
  border-color: color-mix(in srgb, var(--hero-accent-light) 30%, transparent);
  background: color-mix(in srgb, var(--hero-accent-light) 17%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent :is(#players-list, #commanders-table, #event-entries, #event-matches, #event-leaderboard, #player-matches, #commander-matches, #commander-players, #archetypes-table, #league-leaderboard, #archetype-commanders) a.history-item.is-me-row:hover {
  border-color: color-mix(in srgb, var(--hero-accent-light) 36%, transparent);
  background: color-mix(in srgb, var(--hero-accent-light) 21%, transparent);
}

main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) .history-item {
  border-color: color-mix(in srgb, var(--hero-accent) 22%, transparent);
}

main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) a.history-item:hover {
  border-color: color-mix(in srgb, var(--hero-accent) 38%, transparent);
  background: color-mix(in srgb, var(--hero-accent) 5%, #fff);
}

:root[data-theme="dark"] main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) .history-item {
  border-color: rgba(255, 255, 255, 0.14);
}

:root[data-theme="dark"] main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) a.history-item:hover {
  border-color: color-mix(in srgb, var(--hero-accent-light) 32%, transparent);
  background: color-mix(in srgb, var(--hero-accent-light) 10%, transparent);
}

/* commander.html's Utilizzo chart: its area and hover guide (fixed red
   tints) in it too — the line, the dot and the first number already follow
   the red variables. */
main.has-hero-accent .line-chart-plot .line-chart-area {
  fill: color-mix(in srgb, var(--hero-accent) 16%, transparent);
}

main.has-hero-accent .line-chart-guide {
  border-left-color: color-mix(in srgb, var(--hero-accent) 50%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent .line-chart-plot .line-chart-area {
  fill: color-mix(in srgb, var(--hero-accent-light) 16%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent .line-chart-guide {
  border-left-color: color-mix(in srgb, var(--hero-accent-light) 50%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent .line-chart-stat:first-child .line-chart-stat-value {
  color: var(--hero-accent-light);
}

/* Dark mode: what the site paints in a fixed light red there follows the
   colour's light shade instead — the Album's loading shimmer, the
   commander card's placeholder, the stat tiles' numbers, the lists' hover
   tint and "Tu" rows (the boxless lists' id-scoped ones too), the decklist
   confirmation box. */
:root[data-theme="dark"] main.has-hero-accent .commander-card-skeleton,
:root[data-theme="dark"] main.has-hero-accent .cmd-carousel-slide.is-loading:not(.fx-rim) {
  background-image: linear-gradient(100deg, rgba(255, 255, 255, 0.04) 30%, color-mix(in srgb, var(--hero-accent-light) 14%, transparent) 50%, rgba(255, 255, 255, 0.04) 70%);
}

/* (The Album's stat numbers only — the hero's own stay white.) */
:root[data-theme="dark"] main.has-hero-accent .cmd-carousel-stats .stat-tile-value {
  color: var(--hero-accent-light);
}

:root[data-theme="dark"] main.has-hero-accent a.history-item:hover {
  background: color-mix(in srgb, var(--hero-accent-light) 10%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent .history-item.is-me-row,
:root[data-theme="dark"] main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) .history-item.is-me-row {
  border-color: color-mix(in srgb, var(--hero-accent-light) 30%, transparent);
  background: color-mix(in srgb, var(--hero-accent-light) 17%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent a.history-item.is-me-row:hover,
:root[data-theme="dark"] main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) a.history-item.is-me-row:hover {
  border-color: color-mix(in srgb, var(--hero-accent-light) 36%, transparent);
  background: color-mix(in srgb, var(--hero-accent-light) 21%, transparent);
}

/* Dark mode: those lists' cards and the Album's stat tiles tinted with the
   colour's light shade (not the default reddish surface). */
:root[data-theme="dark"] main.has-hero-accent :is(#player-matches, #commander-matches, #commander-players) .history-item,
:root[data-theme="dark"] main.has-hero-accent .cmd-carousel-stats .stat-tile {
  border-color: color-mix(in srgb, var(--hero-accent-light) 20%, transparent);
  background: color-mix(in srgb, var(--hero-accent-light) 7%, rgba(255, 255, 255, 0.04));
}

/* The site's warm (pinkish) greys — muted labels, values, body text —
   tinted toward the colour instead, so no text reads red-ish; the match
   results keep their fixed meaning: a loss red, a win green. */
main.has-hero-accent {
  --text-muted: color-mix(in srgb, var(--hero-accent) 22%, #7a7a7a);
  --text-muted-2: color-mix(in srgb, var(--hero-accent) 18%, #5f5f5f);
  --text-value: color-mix(in srgb, var(--hero-accent) 14%, #444);
  --text-body: color-mix(in srgb, var(--hero-accent) 6%, #1d1d1d);
  --text-title: color-mix(in srgb, var(--hero-accent) 6%, #1a1a1a);
}

:root[data-theme="dark"] main.has-hero-accent {
  --text-muted: color-mix(in srgb, var(--hero-accent-light) 25%, #9a9a9a);
  --text-muted-2: color-mix(in srgb, var(--hero-accent-light) 20%, #888);
  --text-value: color-mix(in srgb, var(--hero-accent-light) 14%, #d6d6d6);
  --text-body: color-mix(in srgb, var(--hero-accent-light) 6%, #e6e6e6);
  --text-title: color-mix(in srgb, var(--hero-accent-light) 5%, #f4f4f4);
}

main.has-hero-accent .history-score.is-loss {
  color: #8d1d22;
}

:root[data-theme="dark"] main.has-hero-accent .history-score.is-loss {
  color: #ff7a7e;
}

/* The commander card's flip button in it too. */
main.has-hero-accent .commander-card-flip-btn {
  background: color-mix(in srgb, var(--hero-accent) 80%, transparent);
}

/* The scrolling lists' scrollbar (Storico partite) in it too. */
:root main.has-hero-accent .history-scroll {
  scrollbar-color: color-mix(in srgb, var(--hero-accent) 40%, transparent) transparent;
}

:root[data-theme="dark"] main.has-hero-accent .history-scroll {
  scrollbar-color: color-mix(in srgb, var(--hero-accent-light) 40%, transparent) transparent;
}

/* The heroes' buttons — the back pill, account's quick actions — in a colour taken from the hero's art (js/player-card.js
   heroTone, set inline on .detail-hero-wrap / account's .profile-hero);
   a neutral dark grey until then (no red flash before the art's colour
   arrives), and without art. */
.detail-hero-wrap,
.profile-hero:not(.detail-hero) {
  --hero-btn: #4a4345;
  --hero-btn-hover: #383233;
}

.profile-hero-actions .btn-primary {
  background: var(--hero-btn);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.profile-hero-actions .btn-primary:hover {
  background: var(--hero-btn-hover);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.3);
}

.profile-hero-actions .btn-secondary,
:root[data-theme="dark"] .profile-hero-actions .btn-secondary {
  border-color: transparent;
  background: #fff;
  color: var(--hero-btn);
}

.profile-hero-actions .btn-secondary:hover,
:root[data-theme="dark"] .profile-hero-actions .btn-secondary:hover {
  background: color-mix(in srgb, var(--hero-btn) 10%, #fff);
}

/* Quick actions; each only when it applies — the decklist one with its
   section, the player ones once linked (the numbers shown). */
.profile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.profile:has(#profile-decklist[hidden]) #profile-action-decklist,
.profile:has(#profile-stats[hidden]) .profile-action-linked {
  display: none;
}

/* Tabs: a pill bar, a tab only for a section that's shown. */
.profile-tabs {
  display: flex;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 6px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  /* Solid: sticky on touch screens, the lists scroll under it — nothing
     showing through. */
  background: #fff;
  box-shadow: var(--shadow-card);
}

:root[data-theme="dark"] .profile-tabs {
  background: #1e1517;
}

/* A tab hidden by a page's script (league.html's Classifica for a Topdeck
   series): really hidden — its own display (below, and the touch screens'
   segmented control) would otherwise win over the [hidden] attribute. */
.profile-tabs .profile-tab[hidden] {
  display: none;
}

.profile-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-title);
  font: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.profile-tab svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.profile-tab:hover {
  background: rgba(220, 24, 28, 0.08);
}

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

.profile-tab.is-active,
.profile-tab.is-active:hover {
  background: var(--brand-red);
  color: #fff;
}

/* A page coloured by its hero (main.has-hero-accent — js/player-card.js
   applyHeroTone: account, commander): the open tab in that colour. */
main.has-hero-accent .profile-tab.is-active,
main.has-hero-accent .profile-tab.is-active:hover {
  background: var(--hero-accent-deep);
}

main.has-hero-accent .profile-tab:focus-visible {
  outline-color: var(--hero-accent-deep);
}

/* …and a tab under the mouse tinted with it, not the fixed red. */
main.has-hero-accent .profile-tab:not(.is-active):hover {
  background: color-mix(in srgb, var(--hero-accent) 12%, transparent);
}

:root[data-theme="dark"] main.has-hero-accent .profile-tab:not(.is-active):hover {
  background: color-mix(in srgb, var(--hero-accent-light) 14%, transparent);
}

.profile:has(#profile-decklist[hidden]) [data-tab="profile-decklist"] {
  display: none;
}

/* The panels: only the open one; a size container, for what's inside to
   fit itself to the panel's width. */
.profile-panels {
  container-type: inline-size;
}

.profile-panel:not(.is-current) {
  display: none;
}

/* player.html / commander.html: the same hero (.detail-hero on top of
   .profile-hero — js/player-detail.js, js/commander-detail.js). No card
   (none to show, or no image): the text alone, the whole width. */
.detail-hero.is-no-card .profile-hero-inner {
  grid-template-columns: minmax(0, 1fr);
}

.detail-hero.is-no-card .detail-hero-card {
  display: none;
}

/* Back to the list ("‹ Giocatori" / "‹ Comandanti"): a pill in the hero's
   colour (--hero-btn, from its art; a deeper shade on hover) with a white
   border, readable on any art, beside the hero rather than in it
   (.detail-hero-wrap; the hero clips what's inside it). Desktop: on the
   hero's top edge — half on it, half on the page — centred over the card's
   column (its 32px padding + half its 280px), at the left padding without a
   card. Up to 820px (one centred column): inside the hero's top-left
   corner, the hero's content moved down to make room. */
.detail-hero-wrap {
  position: relative;
}

.detail-hero-back {
  position: absolute;
  top: 0;
  left: 172px;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 40px;
  box-sizing: border-box;
  max-width: 176px;
  padding: 6px 16px 6px 10px;
  border: 1px solid #fff;
  border-radius: var(--radius-pill);
  background: var(--hero-btn);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  text-shadow: none;
  transition: background 150ms ease, border-color 150ms ease;
}

.detail-hero-back:hover {
  background: var(--hero-btn-hover);
  color: #fff;
  text-decoration: none;
}

.detail-hero-back svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* The page the visitor came from (js/router.js syncBackButton): a player's
   or an event's name can be long — cut with an ellipsis (the pill at most
   176px: centred at 96px on a computer, inside the hero's left edge). */
.detail-hero-back-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-hero-wrap:has(.is-no-card) .detail-hero-back {
  left: 32px;
  transform: translateY(-50%);
}

/* The back pill on a page without a hero (badges.html): the site's red
   (no art colour to take). On touch screens the header lies over the page
   like the hero pages' (absolute), the pill in its row; the empty wrap
   keeps the header's room (its height = the header's, pulled up over the
   page's top padding), so the title stays where it was. */
.page-back-wrap {
  --hero-btn: var(--brand-red);
  --hero-btn-hover: var(--brand-red-deep-2);
}

html.app-header body:has(.page-main > .page-back-wrap) {
  --hero-header-h: calc(80px + env(safe-area-inset-top));
}

html.app-header body:has(.page-main > .page-back-wrap) .site-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
}

html.app-header .page-back-wrap {
  margin-top: -28px;
  height: calc(var(--hero-header-h) + 28px);
}

@media (max-width: 640px) {
  html.app-header .page-back-wrap {
    margin-top: -20px;
    height: calc(var(--hero-header-h) + 20px);
  }
}

/* Desktop: left of the card column's centre. */
@media (min-width: 821px) {
  .detail-hero-back {
    left: 96px;
  }
}

@media (max-width: 820px) {
  .detail-hero-back,
  .detail-hero-wrap:has(.is-no-card) .detail-hero-back {
    top: 14px;
    left: 14px;
    max-width: calc(100% - 96px);
    transform: none;
  }

  .detail-hero .profile-hero-inner {
    padding-top: 68px;
  }
}

/* Phones: the hero runs edge to edge (pulled out by the page's 16px side
   padding — the wrap isn't, so 0 here is 16px in from the hero's edge). Its
   pull up under the header (-20px) does move the wrap too (the margin
   collapses through it), so the top stays 14px. */
@media (max-width: 640px) {
  .detail-hero-back,
  .detail-hero-wrap:has(.is-no-card) .detail-hero-back {
    top: 14px;
    left: 0;
  }
}

/* The commander's card in the hero's column (not pinned beside the title
   any more): in flow, the column's width, Scryfall's proportions; the
   placeholder the same, a light shimmer on the dark hero. */
.detail-hero .commander-card-figure,
.detail-hero .commander-card-skeleton {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
  width: 100%;
  height: auto;
  margin: 0;
}

.detail-hero .commander-card-skeleton,
:root[data-theme="dark"] .detail-hero .commander-card-skeleton {
  aspect-ratio: 488 / 680;
  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0.05) 30%,
    rgba(255, 255, 255, 0.16) 50%,
    rgba(255, 255, 255, 0.05) 70%
  );
}

.detail-hero .commander-card-face {
  width: 100%;
  height: auto;
  max-width: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

/* A pairing picked (js/commander-detail.js — commander.html?partner=…):
   the two cards together, the commander's in front, a little smaller and
   tilted back, the partner's behind it to the right, tilted the other way
   (sliding in from behind it, and back out when the pairing changes). The
   commander's card shrinks by a scale, not its width: the column — and with
   it the hero — keeps its size whatever the pairing. */
.detail-hero-card {
  position: relative;
}

.detail-hero-card #commander-card-figure {
  z-index: 1;
  transform-origin: 70% 80%;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.detail-hero-card.has-partner #commander-card-figure {
  transform: translateX(-13%) scale(0.88) rotate(-3deg);
}

/* No partner picked but some to pick: the commander's card a touch smaller
   and to the left, so the first partner's card tucked behind it shows
   (still inside the column — clear of the title beside it). */
.detail-hero-card.has-pairings:not(.has-partner) #commander-card-figure {
  transform: translateX(-7%) scale(0.92);
}

/* The partner's figure: with no partner picked, the first partner's card
   tucked behind the commander's, dimmed — the hint there are partners
   to pick; with one picked (.has-partner), the same figure brought forward
   beside it. Between the two it moves (transitions) — the first partner
   picked from "Tutti" is that same card coming forward; a different card
   slides out and the next one in (the animations). */
.commander-partner-figure {
  position: absolute;
  top: 7%;
  right: -2%;
  z-index: 0;
  width: 60%;
  margin: 0;
  filter: brightness(0.7) saturate(0.85);
  transform: rotate(8deg);
  transform-origin: 30% 80%;
  /* backwards, not both: once in, its transform free for the transitions. */
  animation: partner-card-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  transition: top 240ms cubic-bezier(0.2, 0.8, 0.2, 1), right 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    width 240ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 240ms ease;
}

/* (A little higher than the commander's card — a card's name is along its
   top, so the partner's shows above it — and further right.) */
.detail-hero-card.has-partner .commander-partner-figure {
  top: 1%;
  right: -6%;
  width: 70%;
  filter: none;
  transform: rotate(6deg);
}

.commander-partner-figure[hidden] {
  display: none;
}

.commander-partner-figure.is-leaving {
  animation: partner-card-out 180ms cubic-bezier(0.4, 0, 1, 1) both;
}

.commander-partner-figure .commander-card-face {
  display: block;
  border-radius: 4.75% / 3.4%;
}

/* One motion, the cards' own stacking: a partner leaving slides back in
   behind the commander's card (it's under it), one arriving comes out from
   behind it. */
@keyframes partner-card-in {
  from {
    opacity: 0.4;
    transform: translateX(-55%) scale(0.9) rotate(0deg);
  }
}

@keyframes partner-card-out {
  to {
    opacity: 0.4;
    transform: translateX(-55%) scale(0.9) rotate(0deg);
  }
}

/* The picker under the cards' row: one glass badge — ‹ the pairing shown ›.
   Centred where the hero's text is (up to 820px). */
.pairing-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 4px;
}

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

.pairing-compact {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
}

.pairing-step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease;
}

.pairing-step:hover {
  background: rgba(255, 255, 255, 0.32);
}

.pairing-step svg {
  width: 16px;
  height: 16px;
}

.pairing-compact-label {
  min-width: 120px;
  padding: 0 8px;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

/* The partner's name after the commander's in the title. */
.commander-title-partner {
  opacity: 0.8;
}

/* The title and the picker's label, a pairing picked (js/commander-detail.js
   replaySwap): the new text slides in from the side of the arrow used — ›
   from the right, ‹ from the left — fading in. */
#commander-title.is-swapped-next,
.pairing-compact-label.is-swapped-next {
  animation: pairing-text-in-next 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#commander-title.is-swapped-prev,
.pairing-compact-label.is-swapped-prev {
  animation: pairing-text-in-prev 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes pairing-text-in-next {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
}

@keyframes pairing-text-in-prev {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  #commander-title:is(.is-swapped-next, .is-swapped-prev),
  .pairing-compact-label:is(.is-swapped-next, .is-swapped-prev) {
    animation: none;
  }
}

/* A computer (two columns): the name's row always as tall as a full-size
   name — the name itself is shrunk to fit one line (js/page-title-fit.js),
   more so for a commander + partner — the name centred in it: the name's
   centre line, the picker and the numbers under it stay put whatever the
   name's length (the text column is centred in the hero, so a shorter name
   moved all of it). */
@media (min-width: 821px) {
  #commander-hero .profile-hero-heading {
    display: flex;
    align-items: center;
    min-height: calc(clamp(2rem, 4.5vw, 3rem) * 1.05 + 12px);
  }
}

@media (max-width: 820px) {
  .pairing-picker {
    align-items: center;
  }

  /* One column (the hero stacked): the title keeps the commander's name
     alone — with the partner's too it wrapped to a second line, changing
     the hero's height between pairings; the badge under the cards names
     the partner. */
  .commander-title-partner {
    display: none;
  }

  /* One column: a hero with the pairing picker as tall as one without —
     the picker slimmer (smaller arrows, no margins), the hero's
     rows closer together (12px, not 22px) and the card a little smaller
     (19px narrower), together exactly the picker's room. (A computer, two
     columns: the card already sets the hero's height either way.) */
  .detail-hero:has(.pairing-picker:not([hidden])) .profile-hero-inner {
    gap: 12px;
  }

  .detail-hero:has(.pairing-picker:not([hidden])) .detail-hero-card {
    max-width: 261px;
  }

  .pairing-picker {
    margin: 0;
  }

  .pairing-compact {
    padding: 3px;
  }

  .pairing-step {
    width: 26px;
    height: 26px;
  }

  .pairing-compact-label {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commander-partner-figure,
  .commander-partner-figure.is-leaving,
  .detail-hero-card #commander-card-figure {
    animation: none;
    transition: none;
  }
}

.detail-hero .commander-card-flip-btn {
  right: -12px;
}

/* The player card in the hero's column: its own entrance, played with the
   page. */
.detail-hero .player-card {
  animation: commander-card-in 450ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Phones: the detail heroes' numbers (4-5 of them) on one row — equal
   columns, value over label, both a size down, a label too long for its
   column cut with an ellipsis. Three classes / :root: to outrank the
   phone rules further down (the hero's 1.6rem values, the profile tiles'
   two-column grid). */
@media (max-width: 640px) {
  .profile-hero.detail-hero .profile-stats-tiles {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .profile-hero.detail-hero .stat-tile {
    align-items: center;
    min-width: 0;
    text-align: center;
  }

  .profile-hero.detail-hero .stat-tile:first-child .stat-tile-value,
  :root[data-theme="dark"] .profile-hero.detail-hero .stat-tile:first-child .stat-tile-value {
    align-self: center;
  }

  .profile-hero.detail-hero .stat-tile-value,
  :root[data-theme="dark"] .profile-hero.detail-hero .stat-tile-value {
    font-size: 1.25rem;
  }

  .profile-hero.detail-hero .stat-tile-label {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Narrower: the hero in one column, centred — the card first. */
@media (max-width: 820px) {
  .profile-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 24px 20px;
    text-align: center;
  }

  .profile-hero .profile-card-col {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }

  /* "Il tuo profilo", the name and "Dal …" above the card; the numbers and
     the actions under it: the text column dissolves into the hero's grid
     (display: contents), its heading moved first. */
  .profile-hero-text {
    display: contents;
  }

  .profile-hero-heading {
    order: -1;
  }

  .profile-hero .profile-hero-stats .profile-stats-tiles,
  .profile-hero-actions {
    margin-top: 0;
  }

  .profile-hero .profile-stats-tiles,
  .profile-hero-actions {
    justify-content: center;
  }
}

/* Phones: the tabs become a segmented control — the bar's full width split
   in equal parts (only the tabs shown), icon over a short label — never
   scrolling sideways; sticky on touch screens (the nav is the tab bar at
   the bottom there). */
@media (max-width: 640px) {
  /* overflow hidden + the labels allowed to shrink (an ellipsis if one ever
     doesn't fit its share): a label kept on one line and wider than its
     equal column stuck out of the bar, which then scrolled a little. */
  .profile-tabs {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 4px;
    width: auto;
    overflow: hidden;
    border-radius: 18px;
  }

  .profile-tab {
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 8px 2px;
    border-radius: 14px;
    font-size: 0.72rem;
  }

  .profile-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Room for the letters' tails (the "g" of "Più giocati"): the
       clip (for the "…") is the line box, cut short by a tight line. */
    line-height: 1.3;
  }

  .profile-tab svg {
    width: 20px;
    height: 20px;
  }

  .profile-hero .stat-tile-value,
  :root[data-theme="dark"] .profile-hero .stat-tile-value {
    font-size: 1.6rem;
  }

  /* The two actions side by side, sharing the line equally (a long label
     wraps inside its button rather than pushing the other one down). */
  .profile-hero-actions {
    flex-wrap: nowrap;
  }

  .profile-hero-actions > * {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding-inline: 10px;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
  }

  /* The hero edge to edge, right under the red header: it cancels the
     page's phone padding (.page-main: 20px top, --page-pad-x sides) — no rounded
     corners or shadow there. Under "Il tuo giocatore" (not linked yet, the
     banner on top) it isn't pulled up — still edge to edge. */
  .profile-hero {
    margin: -20px calc(-1 * var(--page-pad-x, 16px)) 22px;
    border-radius: 0;
    box-shadow: none;
  }

  .profile-claim:not([hidden]) + .profile-hero {
    margin-top: 0;
  }

  /* The hero's side padding trimmed. */
  .profile-hero-inner {
    padding-inline: 16px;
  }

  /* account.html's card (and the switch under it), centred: at most 260px
     wide — the whole width made it taller than the screen; a little more
     than player.html / commander.html's 240px below, for edit mode's
     finger-sized fields. */
  .profile-hero .profile-card-col {
    max-width: 260px;
  }

  .detail-hero .detail-hero-card {
    max-width: 240px;
  }

  /* (With the pairing picker: 19px narrower too — see .pairing-picker.) */
  .detail-hero:has(.pairing-picker:not([hidden])) .detail-hero-card {
    max-width: 221px;
  }
}

/* The player card (account.html's, player.html's) is landscape since
   2026-10-23 (twice as wide as high): its column in the hero is wider —
   400px on a computer instead of the 280px a portrait card (commander.html's
   Magic card) keeps —, and in the one-column layout (820px down) it's up to
   440px wide, the whole width on phones. The back pill on the hero's top
   edge stays centred over the column (its 32px padding + half of 400px). */
@media (min-width: 821px) {
  .profile-hero:has(.player-card) .profile-hero-inner {
    grid-template-columns: 400px minmax(0, 1fr);
  }

  /* account.html: the card centred on the text from the name down to the
     quick actions — "Il tuo profilo" above the name left out of it (out of
     the flow, just above the name), so the card and that block line up. */
  #profile-hero .profile-hero-heading {
    position: relative;
  }

  #profile-hero .profile-hero-kicker {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
  }

  #profile-hero .profile-hero-name {
    margin-top: 0;
  }

  .detail-hero-wrap:has(.player-card) .detail-hero-back {
    left: 232px;
  }
}

@media (max-width: 820px) {
  .profile-hero .profile-card-col:has(.player-card),
  .detail-hero .detail-hero-card:has(.player-card) {
    max-width: 440px;
  }
}

/* Touch screens at any width (a phone in landscape, a large phone, a
   tablet): the same segmented control as above, sticky — the pill bar is
   for mouse users only (html.nav-mobile, like the rest of the site's phone
   layout). */
html.nav-mobile .profile-tabs {
  position: sticky;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 10;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 4px;
  width: auto;
  
  border-radius: 18px;
}

html.nav-mobile .profile-tab {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 2px;
  border-radius: 14px;
  font-size: 0.72rem;
}

html.nav-mobile .profile-tab span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Room for the letters' tails (the "g" of "Più giocati"): the
     clip (for the "…") is the line box, cut short by a tight line. */
  line-height: 1.3;
}

html.nav-mobile .profile-tab svg {
  width: 20px;
  height: 20px;
}

.profile-card-col > .form-message {
  text-align: center;
}

/* No message (the usual case): nothing under the card at all — an empty
   paragraph's own margin left the hero's bottom gap bigger than its top. */
.profile-card-col > .form-message:empty {
  display: none;
}

/* ---------------------------------------------------------------------------
   The player card (js/account-page.js renderCard): Magic-card proportions,
   the favourite commander's art (Scryfall art crop) as its background, the
   first favourite colour as its glow (--pc-glow, set from JS: the avatar's
   ring), and the cosmetics earned by playing (js/card-cosmetics.js, the
   .fx-* rules at the end of this section). The upper part is the art alone; then avatar and
   name straight on it; then a frosted-glass panel, tinted in the favourite
   colours, with the links and the description; "Dal <year>" and the logo at the foot. Always dark — it reads as an object, the same in both
   themes. Everything inside sizes in cqw (% of the card's width), so the
   card scales as one piece on any screen.
   --------------------------------------------------------------------------- */

.player-card {
  position: relative;
  width: 100%;
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* The entrance animation makes the card a stacking context (gotcha #10): a
   commander-list dropdown opened in edit mode is lifted with it above the
   cards beside/under it, only while open (same fix as .admin-form-card). */
.player-card:has(.cs-wrap.is-open) {
  z-index: 30;
}

/* The card's edge: no border of its own any more (the favourite colours
   used to draw one) — a thin outline and a drop shadow. From 10 events
   played, the Presenze frame (js/card-cosmetics.js, .fx-rim-* below) is
   drawn here, as the frame's padding + background with the surface wholly
   inside it: drawn as a ring over the dark surface instead, along the same
   rounded edge, the surface's dark edge pixels showed through it (a thin
   black line outside, worst at the corners). --rim: its width (0 = none). */
.pc-frame {
  --rim: 0px;
  padding: var(--rim);
  border-radius: calc(19px + var(--rim));
  box-shadow:
    0 0 0 1px rgba(20, 8, 10, 0.18),
    0 22px 48px rgba(20, 8, 10, 0.35);
}

:root[data-theme="dark"] .pc-frame {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 22px 48px rgba(0, 0, 0, 0.5);
}

/* With a Presenze frame: no dark outline (it would ring the frame), just
   the shadow. */
.player-card.fx-rim .pc-frame {
  box-shadow: 0 22px 48px rgba(20, 8, 10, 0.35);
}

:root[data-theme="dark"] .player-card.fx-rim .pc-frame {
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
}

/* Landscape, twice as wide as high (since 2026-10-23 — it was Scryfall's
   portrait card, 488×680: too tall). */
.pc-surface {
  position: relative;
  display: flex;
  aspect-ratio: 2 / 1;
  border-radius: 19px;
  background: #160e10;
  color: #fff;
  container-type: inline-size;
}

/* Edit mode: those proportions become the minimum, and the card grows
   taller with its form instead (on touch screens especially, where the
   controls are finger-sized px, not cqw) — not left to aspect-ratio's own
   "grow to fit the content" minimum, which didn't hold here: the controls
   spilled out of the card. The minimum height is the view-mode one, from
   the card's width — .player-card is a size container just for this (the
   surface is its width minus .pc-frame's --rim each side: 0, or the
   Presenze frame's width; inherited from the frame), the content's own cqw
   still being the surface's. */
.player-card {
  container-type: inline-size;
}

.player-card.is-editing .pc-surface {
  aspect-ratio: auto;
  min-height: calc((100cqw - 2 * var(--rim, 0px)) / 2);
}

/* The art, under everything, centred a little high (where faces usually
   are in a landscape art crop shown portrait). */
.pc-art {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: #1d1315;
  background-size: cover;
  background-position: center 30%;
}

/* Before any art (no favourite commander, Scryfall unreachable, or still
   loading): a glow in the card's colour with the logo faintly in it. */
.pc-art::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    url("../dc_pc.svg") center 30% / 38% no-repeat,
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--pc-glow, #8d959c) 55%, transparent), transparent 70%);
  opacity: 0.32;
  transition: opacity 400ms ease;
}

.pc-art.is-loaded::before {
  opacity: 0;
}

/* Depth over the art, top layer first: a soft warm light from the top-left,
   a vignette darkening the edges and corners, then the darkening towards
   the bottom, so the panel's text reads on any art. */
.pc-art::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(circle at 22% 12%, rgba(255, 236, 214, 0.16), transparent 42%),
    radial-gradient(ellipse 125% 95% at 50% 32%, transparent 52%, rgba(12, 7, 8, 0.6) 100%),
    linear-gradient(
      180deg,
      rgba(12, 7, 8, 0.35) 0%,
      rgba(12, 7, 8, 0) 22%,
      rgba(12, 7, 8, 0.12) 45%,
      rgba(12, 7, 8, 0.82) 70%,
      rgba(12, 7, 8, 0.96) 100%
    );
}

/* The art itself a touch punchier: more contrast and colour. */
.pc-art.is-loaded {
  filter: contrast(1.1) saturate(1.15);
  animation: pc-art-in 600ms ease;
}

@keyframes pc-art-in {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

/* Top-left corner: the player's badges (js/player-card.js cardBadgesHtml) —
   discs over the art, wrapping onto a second row if there are many. Above
   .pc-content, so they get the hover tooltip. Nothing to show (no badges,
   or not linked): no box. */
.pc-badges {
  position: absolute;
  top: 2.88cqw;
  left: 2.88cqw;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 1.02cqw;
  max-width: 62%;
}

.pc-badges:empty {
  display: none;
}

/* The site's badge look (main's .badge-disc): white, so every icon keeps
   its own colours at full contrast, with a red ring — the lighter red the
   site uses on dark backgrounds, since the card is always dark — a whole
   number of px wide (a fractional ring renders blurry), inside the disc's
   size (border-box). .pc-badges .pc-badge: outranks the site's own
   .icon-badge sizing. */
.pc-badges .pc-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 8.32cqw;
  height: 8.32cqw;
  margin: 0;
  border: 2px solid rgba(255, 106, 110, 0.6);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  line-height: 1;
}

/* The icon in a same-size centred box — an emoji left as plain text sits
   wherever its font puts it, off-centre next to an image. */
.pc-badge-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.12cqw;
  height: 5.12cqw;
  font-size: 4.61cqw;
  line-height: 1;
}

img.pc-badge-glyph {
  object-fit: contain;
}

.pc-content {
  position: relative;
  z-index: 1;
  
  flex: 1;
  flex-direction: column;
  
  min-width: 0;
  padding: 2.88cqw;
}

/* The upper part of the card: nothing but the commander art. */
.pc-art-space {
  flex: 1;
  min-height: 0;
}

/* Edit mode on phones / touch screens (finger-sized controls filling the
   card): some art always left free at the top — the card grows taller for
   it instead of the controls reaching its top edge. */
html.nav-mobile .player-card.is-editing .pc-art-space {
  min-height: 16.64cqw;
}

@media (max-width: 640px) {
  .player-card.is-editing .pc-art-space {
    min-height: 16.64cqw;
  }
}

/* Nameplate, straight on the art just above the glass panel: avatar (the
   Google picture, or the initial on red) with a ring in the card's colour,
   the name beside it. */
/* The name sits on the avatar's bottom line rather than its middle — lower,
   closer to the glass panel below. */
.pc-nameplate {
  display: flex;
  align-items: flex-end;
  gap: 1.92cqw;
  min-width: 0;
  padding-inline: 0.64cqw;
}

.pc-nameplate-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.pc-avatar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  
  overflow: hidden;
  /* The ring in the favourite colours (--pc-avatar-ring, js/player-card.js
     applyCardAccents: one solid, several blended round; white without),
     painted on the border box under the red fill (the initial's, when
     there's no picture) — the picture sits inside it. A soft glow in the
     first colour around it. */
  border: 0.64cqw solid transparent;
  border-radius: 50%;
  background:
    linear-gradient(var(--brand-red), var(--brand-red)) padding-box,
    var(--pc-avatar-ring, linear-gradient(rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.92))) border-box;
  color: #fff;
  font-size: 4.16cqw;
  font-weight: 800;
  box-shadow:
    0 0 1.54cqw color-mix(in srgb, var(--pc-glow, #8d959c) 60%, transparent),
    0 4px 12px rgba(0, 0, 0, 0.45);
}

.pc-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The owner hid the Google picture: outside edit mode, no circle at all —
   the nameplate is just the name (js/account-page.js renderCard). */
.player-card.hides-avatar:not(.is-editing) .pc-avatar {
  display: none;
}

.pc-name {
  margin: 0;
  color: #fff;
  
  font-weight: 800;
  line-height: 1.15;
  /* No box behind it: a tight shadow plus a wide one keep it readable on
     any art. */
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 2px 12px rgba(0, 0, 0, 0.75);
  overflow-wrap: anywhere;
}

/* Bottom: the frosted-glass panel — (edit mode only) the commander list and
   the colour toggles, then the links, then the description. Faintly tinted
   in the favourite colours (--pc-panel-tint, js/player-card.js
   applyCardAccents: a gradient across them; none without). */
.pc-panel {
  display: flex;
  flex-direction: column;
  gap: 1.92cqw;
  padding: 2.56cqw;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 2.88cqw;
  background: var(--pc-panel-tint, none), rgba(14, 9, 10, 0.58);
  /* The art behind it well hidden: heavily blurred, darkened and muted, so
     only its broad colours come through — the text and the tint read on
     any art. */
  -webkit-backdrop-filter: blur(18px) brightness(0.72) saturate(0.7);
  backdrop-filter: blur(18px) brightness(0.72) saturate(0.7);
}

.pc-field {
  min-width: 0;
}

.pc-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.79cqw;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Up to five lines on the card (it keeps its proportions); the whole text
   is in edit mode. Under the links, a hairline between them — only when
   there are links (an empty .pc-links isn't shown). */
.pc-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 2.37cqw;
  font-style: italic;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

.pc-description.is-empty {
  color: rgba(255, 255, 255, 0.55);
}

/* The owner's own words, in italics between quotes (not the placeholder
   inviting them to write some). */
.pc-description:not(.is-empty)::before {
  content: "\201C";
}

.pc-description:not(.is-empty)::after {
  content: "\201D";
}

.pc-links:not(:empty) ~ .pc-description {
  padding-top: 1.92cqw;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* Footer: since when the player plays (first event's year), the logo. */
/* Its own strip under the panel, with room around it: "Dal …" (+ the
   Campione star), the seal in the middle, the logo on the right. */
.pc-foot {
  justify-content: space-between;
  
  
  padding-inline: 0.64cqw;
}

.pc-since {
  color: rgba(255, 255, 255, 0.78);
  font-size: 2.43cqw;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pc-logo {
  flex-shrink: 0;
  
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

/* ---- The landscape layout (option C, "Striscia", of a mockup on Michele
   Ferri's own card, 2026-10-23) ----
   A banner: the art fills the card, the name big on it; along the bottom
   one glass strip — the links, then the words beside them after a hairline
   (two lines at most) — and at its right end the foot standing: the
   Collezione seal on top, "Dal …" (+ the Campione star) and the logo on
   one line under it. Every size above is already scaled for it (a card
   ~1.6× wider than the portrait one: × 0.64). Edit mode: the same pieces
   stacked — art, name, the form, the foot — the card growing taller. */
.pc-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "space space"
    "name name"
    "panel foot";
  gap: 1.92cqw 2.4cqw;
}

.pc-art-space {
  grid-area: space;
}

.pc-nameplate {
  grid-area: name;
}

.pc-avatar {
  width: 9cqw;
  height: 9cqw;
}

.pc-name {
  font-size: 4.6cqw;
}

.pc-panel {
  grid-area: panel;
}

.player-card:not(.is-editing) .pc-panel {
  flex-direction: row;
  align-items: center;
  gap: 2.2cqw;
  padding: 1.8cqw 2.4cqw;
}

.player-card:not(.is-editing) .pc-links {
  flex-wrap: nowrap;
}

/* The words take all the room beside the links; a short one bigger, as
   big as still fits on one line (--pc-desc-size, js/player-card.js
   fitCardDescription). */
.player-card:not(.is-editing) .pc-description {
  flex: 1 1 0;
  min-width: 0;
  font-size: var(--pc-desc-size, 2.2cqw);
  text-align: start;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.player-card:not(.is-editing) .pc-links:not(:empty) ~ .pc-description {
  padding: 0 0 0 2.2cqw;
  border-top: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.pc-foot {
  grid-area: foot;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-areas:
    "seal seal"
    "since logo";
  align-content: center;
  align-items: center;
  justify-items: end;
  gap: 1.2cqw 1.6cqw;
  min-height: 0;
  margin-top: 0;
}

.pc-since {
  grid-area: since;
}

.pc-logo {
  grid-area: logo;
  width: 4.6cqw;
  height: 4.6cqw;
}

/* No description (player.html's card — account.html's own always has its
   "premi ✎" line): the name comes down into the bottom row, beside the foot
   — and the links, if any, between them — rather than over an empty strip. */
.player-card.no-description .pc-content {
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "space space"
    "name foot";
  align-items: end;
}

.player-card.no-description .pc-content:has(.pc-panel) {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "space space space"
    "name panel foot";
}

/* There the name's column is about as wide as the name, so the Podio bar
   (.pc-fx-ribbon, 70% of it) stopped mid-name: the nameplate as wide as
   its avatar + name, the bar the whole of it, ending in the gap before the
   links' glass (2.4cqw, .pc-content's). Its right end fades out rather
   than ending in the notch (user's choice): its gradient stretched past
   that end (its own fade falling outside), a mask fading the last 3.5cqw
   instead — short, so the name's letters stay on the solid part (a longer
   tail, under the glass, was too long). */
.player-card.no-description:not(.name-own-row) .pc-content:has(.pc-panel) .pc-nameplate {
  justify-self: start;
}

.player-card.no-description:not(.name-own-row) .pc-content:has(.pc-panel) .pc-fx-ribbon {
  width: calc(100% + 2.88cqw + 2.4cqw);
  background-size: 112% 100%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 4% 50%);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3.5cqw), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 3.5cqw), transparent);
}

/* With the bar, the links' glass lined up with its bottom edge rather than
   the name's: moved down by as much as the bar hangs below the nameplate
   (its 7.4cqw height centred on the name's 5.29cqw line — .pc-fx-ribbon). */
.player-card.no-description:not(.name-own-row) .pc-content:has(.pc-fx-ribbon):has(.pc-panel) .pc-panel {
  translate: 0 calc((7.4cqw - 5.29cqw) / 2);
}

/* …but only while the name fits there on one line (js/player-card.js
   fitCardNameRow): otherwise it gets its row back, the whole width, the
   links under it beside the foot — the layout with a description. */
.player-card.no-description.name-own-row .pc-content:has(.pc-panel) {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "space space"
    "name name"
    "panel foot";
}

/* Only links in it (no description beside them): the glass as wide as the
   links, not the row. */
.player-card.no-description.name-own-row .pc-panel {
  justify-self: start;
}

.player-card.is-editing .pc-content {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "space"
    "name"
    "panel"
    "foot";
}

.player-card.is-editing .pc-foot {
  justify-content: end;
}

/* ---- Cosmetics earned by playing (js/card-cosmetics.js) ----
   Each family dresses its own part of the card, so they stack: the frame
   (Presenze, .fx-rim-*), over the art (Vittorie, .fx-art-*), behind the
   name (Podio, .fx-podium-*), the foot's seal (Collezione, .fx-seal-*) and
   stars (Campione). Their extra layers are .pc-fx elements added by JS. */
@property --pc-fx-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes pc-fx-turn {
  to {
    --pc-fx-angle: 360deg;
  }
}

.pc-fx {
  pointer-events: none;
}

/* Presenze — 10 eventi: a silver frame, still. Every tier's frame is
   the same 4px wide, only its look changes. */
.fx-rim-1 .pc-frame {
  --rim: 4px;
  background: linear-gradient(135deg, #f4f6f8, #9aa3ab 35%, #e9edf0 55%, #8a939b 80%, #f4f6f8);
}

/* 25 eventi: foil — rainbow-tinted silver, a highlight travelling round. */
.fx-rim-2 .pc-frame {
  --rim: 4px;
  background: conic-gradient(
    from var(--pc-fx-angle),
    #ffffff,
    #c9f3ff 8%,
    #b9c4ff 18%,
    #e9b8ff 30%,
    #ffd3e8 42%,
    #fff2c2 55%,
    #c6ffe2 68%,
    #b8eaff 82%,
    #ffffff
  );
  animation: pc-fx-turn 5s linear infinite;
}

/* 50 eventi: gold (the album's gilded frame). */
.fx-rim-3 .pc-frame {
  --rim: 4px;
  background: conic-gradient(
    from var(--pc-fx-angle),
    #fffbe6,
    #ffe17d 8%,
    #f0bd3c 22%,
    #c8901a 50%,
    #f0bd3c 78%,
    #ffe17d 92%,
    #fffbe6
  );
  animation: pc-fx-turn 4s linear infinite;
}

/* 100 eventi: mythic orange (Magic's mythic-rarity colour). */
.fx-rim-4 .pc-frame {
  --rim: 4px;
  background: conic-gradient(
    from var(--pc-fx-angle),
    #ffe2c4,
    #ffab5e 8%,
    #f26b1d 22%,
    #b8400c 50%,
    #f26b1d 78%,
    #ffab5e 92%,
    #ffe2c4
  );
  animation: pc-fx-turn 4s linear infinite;
}

/* Vittorie — a finish over the commander art, fading out over its lower,
   darkened part where the panel sits. Right after .pc-art, under the
   content. */
.pc-fx-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 78%);
  mask-image: linear-gradient(to bottom, #000 45%, transparent 78%);
}

/* 25 vittorie: a light foil sheen — soft rainbow wash + a glare band
   sweeping across, then a pause. */
.fx-art-1 .pc-fx-art {
  background:
    linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.45) 48%, transparent 60%),
    linear-gradient(125deg, rgba(255, 0, 132, 0.35), rgba(255, 196, 0, 0.3), rgba(0, 255, 170, 0.3), rgba(0, 170, 255, 0.35), rgba(190, 0, 255, 0.3));
  background-size: 300% 300%, 100% 100%;
  background-repeat: no-repeat;
  background-position: 100% 100%, 0 0;
  mix-blend-mode: overlay;
  animation: pc-fx-glare 5s ease-in-out infinite;
}

@keyframes pc-fx-glare {
  0% {
    background-position: 100% 100%, 0 0;
  }
  55%,
  100% {
    background-position: 0% 0%, 0 0;
  }
}

/* 50 and 100 vittorie: a moving rainbow that loops without a seam — a
   repeating gradient on an oversized layer (::before, inset -100%) slid by
   exactly one period along the gradient's own direction, so the last frame
   is the first (shifting a background by a percentage of its size didn't
   land on a repeat, and visibly reset). The blend is on .pc-fx-art itself,
   so the whole layer group blends with the art underneath. */
.fx-art-2 .pc-fx-art::before,
.fx-art-3 .pc-fx-art::before,
.fx-art-2 .pc-fx-art::after,
.fx-art-3 .pc-fx-art::after {
  content: "";
  position: absolute;
}

.fx-art-2 .pc-fx-art::before,
.fx-art-3 .pc-fx-art::before {
  inset: -100%;
}

.fx-art-2 .pc-fx-art::after,
.fx-art-3 .pc-fx-art::after {
  inset: 0;
}

/* 50 vittorie: etched foil — fine diagonal lines (::after, still) catching
   a drifting rainbow light (::before; period 80cqw along 115deg: one period
   = (sin 115°, −cos 115°) × 80cqw). */
.fx-art-2 .pc-fx-art {
  mix-blend-mode: overlay;
}

.fx-art-2 .pc-fx-art::before {
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 60, 160, 0.5) 0,
    rgba(255, 210, 60, 0.45) 16cqw,
    rgba(60, 255, 190, 0.45) 32cqw,
    rgba(60, 170, 255, 0.5) 48cqw,
    rgba(200, 60, 255, 0.45) 64cqw,
    rgba(255, 60, 160, 0.5) 80cqw
  );
  animation: pc-fx-etched 7s linear infinite;
}

.fx-art-2 .pc-fx-art::after {
  background:
    repeating-linear-gradient(60deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(-60deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 6px);
}

@keyframes pc-fx-etched {
  to {
    transform: translate(72.5cqw, 33.8cqw);
  }
}

/* 100 vittorie (and 150, which adds the sparks): rainbow holo — strong
   prismatic bands drifting (::before; period 60cqw along 125deg), glitter
   over them (::after, moved by exactly one tile, seamless too). */
.fx-art-3 .pc-fx-art {
  mix-blend-mode: color-dodge;
  opacity: 0.55;
}

.fx-art-3 .pc-fx-art::before {
  background: repeating-linear-gradient(
    125deg,
    #ff3f8e 0,
    #ffcf3f 12cqw,
    #3fffb0 24cqw,
    #3fb4ff 36cqw,
    #b43fff 48cqw,
    #ff3f8e 60cqw
  );
  animation: pc-fx-holo 9s linear infinite;
}

.fx-art-3 .pc-fx-art::after {
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.8) 0 1px, transparent 2px);
  background-size: 26px 26px, 34px 34px;
  animation: pc-fx-glitter 9s linear infinite;
}

@keyframes pc-fx-holo {
  to {
    transform: translate(49.1cqw, 34.4cqw);
  }
}

@keyframes pc-fx-glitter {
  to {
    background-position: 26px 26px, -34px 34px;
  }
}

/* 150 vittorie: sparks rising over the whole card, on top of the holo. */
.pc-fx-sparks {
  --sparks-tile-w: 70px;
  --sparks-tile-h: 100px;
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background-image:
    radial-gradient(circle at 20% 30%, #ffe48a 0 1.5px, rgba(255, 200, 80, 0.5) 2.5px, transparent 5px),
    radial-gradient(circle at 65% 70%, #fff3c4 0 1px, rgba(255, 210, 100, 0.5) 2px, transparent 4px),
    radial-gradient(circle at 85% 20%, #ffd76a 0 2px, rgba(255, 190, 60, 0.45) 3px, transparent 6px),
    radial-gradient(circle at 40% 90%, #fff 0 1px, rgba(255, 220, 120, 0.5) 2px, transparent 4px);
  background-size: var(--sparks-tile-w) var(--sparks-tile-h);
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent);
  mask-image: linear-gradient(to top, #000 35%, transparent);
  animation: pc-fx-sparks 6s linear infinite;
}

@keyframes pc-fx-sparks {
  to {
    background-position: 0 calc(var(--sparks-tile-h) * -1);
  }
}

/* Podio — a bar behind the name in Magic's rarity colours: grey (3 top 8)
   → gold (10) → mythic orange (20), fading out at both ends. The nameplate
   isolates it, so it sits behind the name, not behind the art. */
.pc-nameplate {
  position: relative;
  isolation: isolate;
}

/* Anchored to the nameplate's bottom, where the name sits (on the avatar's
   bottom line): centred on the name's one line (6cqw × 1.15 line height),
   not on the avatar. */
.pc-fx-ribbon {
  position: absolute;
  z-index: -1;
  left: -2.88cqw;
  width: 70%;
  bottom: calc((5.29cqw - 7.4cqw) / 2);
  height: 7.4cqw;
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%);
}

/* Edit mode: the "Mostra foto" switch sits under the name, where the bar
   would be — none while editing. */
.player-card.is-editing .pc-fx-ribbon {
  display: none;
}

.fx-podium-1 .pc-fx-ribbon {
  background: linear-gradient(90deg, transparent, rgba(150, 156, 162, 0.45) 12%, rgba(196, 201, 206, 0.55) 50%, rgba(140, 146, 152, 0.45) 88%, transparent);
}

.fx-podium-2 .pc-fx-ribbon {
  background: linear-gradient(90deg, transparent, rgba(240, 189, 60, 0.45) 12%, rgba(255, 220, 110, 0.6) 50%, rgba(200, 144, 26, 0.45) 88%, transparent);
}

.fx-podium-3 .pc-fx-ribbon {
  background: linear-gradient(90deg, transparent, rgba(232, 92, 28, 0.55) 12%, rgba(255, 140, 50, 0.68) 50%, rgba(214, 70, 20, 0.55) 88%, transparent);
}

/* Collezione — a foil seal centred in the foot, like real rares: silver
   (5 commanders) → gold (10) → rainbow (20), a glint passing over it. Its
   hover text says how many. */
.pc-foot {
  position: relative;
}

.pc-fx-seal {
  position: relative;
  grid-area: seal;
  width: 8.96cqw;
  height: 4.86cqw;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.26cqw rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.fx-seal-1 .pc-fx-seal {
  background: radial-gradient(ellipse at 35% 35%, #ffffff, #c3cad1 45%, #7e8790);
}

.fx-seal-2 .pc-fx-seal {
  background: radial-gradient(ellipse at 35% 35%, #fff6d0, #f0bd3c 45%, #a8760f);
}

.fx-seal-3 .pc-fx-seal {
  background: conic-gradient(from var(--pc-fx-angle), #ff3f8e, #ffcf3f, #3fffb0, #3fb4ff, #b43fff, #ff3f8e);
  animation: pc-fx-turn 4s linear infinite;
}

/* Campione — one gold star after "Dal …" with the number of real leagues
   won beside it, the leagues on hover (js/card-cosmetics.js). */
.pc-fx-stars {
  display: inline-flex;
  gap: 0.51cqw;
  margin-left: 1.28cqw;
  vertical-align: middle;
  pointer-events: auto;
}

.pc-fx-star {
  color: #ffd34f;
  font-size: 3.46cqw;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 0.96cqw rgba(255, 200, 60, 0.9);
  cursor: default;
}

.pc-fx-star-count {
  margin-left: 0.51cqw;
  font-size: 2.69cqw;
  font-weight: 800;
  vertical-align: 0.19cqw;
}

@media (prefers-reduced-motion: reduce) {
  .fx-rim-2 .pc-frame,
  .fx-rim-3 .pc-frame,
  .fx-rim-4 .pc-frame,
  .pc-fx-art,
  .pc-fx-art::before,
  .pc-fx-art::after,
  .pc-fx-sparks,
  .pc-fx-seal,
  .pc-fx-seal::after {
    animation: none !important;
  }
}

/* ---- Edit mode: same layout, each value swapped for its editable twin ---- */

.pc-edit-only {
  display: none;
}

.player-card.is-editing .pc-view-only {
  display: none;
}

.player-card.is-editing .pc-edit-only {
  display: block;
}

/* "Mostra nella pagina giocatore" (account.html): in edit mode, at the
   bottom of the glass panel under a hairline — flex like the switch it is,
   and still hidden while not linked (its [hidden] outranking the edit-only
   display). Light on the dark card, no box of its own. */
.player-card.is-editing .pc-public-switch {
  display: flex;
}

/* Outside edit mode: none — stated here because .profile-switch's own
   display: flex (later in this file, same weight as .pc-edit-only) would
   otherwise win and show it all the time. */
.player-card:not(.is-editing) .pc-public-switch {
  display: none;
}

.player-card.is-editing .pc-public-switch[hidden] {
  display: none;
}

.pc-panel .pc-public-switch,
:root[data-theme="dark"] .pc-panel .pc-public-switch {
  margin: 0;
  padding: 1.92cqw 0 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #fff;
  animation: none;
}

.pc-panel .pc-public-switch .profile-switch-label {
  color: #fff;
  font-size: 0.8rem;
  line-height: 1.25;
}

.pc-panel .pc-public-switch .profile-switch-hint {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.75rem;
}

/* Under the name, in the nameplate: show the Google picture or not. Not
   offered when the account has no picture at all. */
.player-card.is-editing .pc-avatar-toggle.pc-edit-only {
  display: inline-flex;
}

.player-card.is-editing .pc-avatar-toggle.is-unavailable {
  display: none;
}

.pc-avatar-toggle {
  align-items: center;
  gap: 1.02cqw;
  margin-top: 0.9cqw;
  padding: 0.51cqw 1.66cqw;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(12, 7, 8, 0.6);
  color: #fff;
  font-size: 1.92cqw;
  font-weight: 700;
  cursor: pointer;
}

.pc-avatar-toggle input {
  width: 2.18cqw;
  height: 2.18cqw;
  margin: 0;
  accent-color: var(--brand-red);
}

/* The background card's search (js/account-page.js): a field like the
   links' on the glass, × to clear it, and Scryfall's names in a list
   opening under it — over the card (the card is lifted above what's
   around it while the list is open). */
.pc-card-search {
  position: relative;
  margin-top: 0.64cqw;
}

.pc-card-search input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.9cqw 4.48cqw 0.9cqw 1.54cqw;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1.54cqw;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 2.43cqw;
  font-weight: 800;
}

.pc-card-search input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.65);
}

.pc-card-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.pc-card-clear {
  position: absolute;
  top: 50%;
  right: 0.77cqw;
  display: grid;
  place-items: center;
  width: 3.2cqw;
  height: 3.2cqw;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 2.3cqw;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.pc-card-clear:hover {
  background: rgba(255, 255, 255, 0.3);
}

.pc-card-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-card-hover);
  animation: cs-menu-in 140ms ease both;
}

.player-card:has(.pc-card-list:not([hidden])) {
  z-index: 30;
}

.pc-card-option {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-body);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.pc-card-option.is-highlighted,
.pc-card-option:hover {
  background: var(--hairline-hover);
  color: var(--text-title);
}

.pc-card-empty {
  margin: 0;
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

:root[data-theme="dark"] .pc-card-list {
  background: #241a1d;
}

/* "Versione": the background card's illustrations as a strip of small
   art crops, scrolling sideways; the one in use outlined in white. */
.pc-art-picker {
  margin-top: 1.54cqw;
}

.pc-art-strip {
  display: flex;
  gap: 1.02cqw;
  margin-top: 0.77cqw;
  padding: 0.38cqw 0.13cqw 1.02cqw;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.pc-art-option {
  flex: 0 0 12.8cqw;
  aspect-ratio: 626 / 457;
  padding: 0;
  overflow: hidden;
  border: 0.38cqw solid transparent;
  border-radius: 1.15cqw;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 150ms ease, border-color 150ms ease;
}

.pc-art-option img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pc-art-option:hover {
  opacity: 1;
}

.pc-art-option.is-selected {
  border-color: #fff;
  opacity: 1;
}

html.nav-mobile .pc-art-option {
  flex-basis: 76px;
  border-width: 2px;
  border-radius: 8px;
}

/* Touch screens: finger-sized, 16px so iOS doesn't zoom. */
html.nav-mobile .pc-card-search input {
  min-height: 44px;
  padding: 8px 44px 8px 12px;
  border-radius: 10px;
  font-size: 16px;
}

html.nav-mobile .pc-card-clear {
  right: 8px;
  width: 28px;
  height: 28px;
  font-size: 18px;
}

html.nav-mobile .pc-card-option {
  min-height: 44px;
}

/* The colour pips as toggles — faded until picked. */
.player-card.is-editing .pc-colors-edit.pc-edit-only {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15cqw;
  margin-top: 0.9cqw;
}

.pc-mana {
  position: relative;
  width: 3.46cqw;
  height: 3.46cqw;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 50%;
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.pc-mana input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pc-mana:has(input:checked) {
  opacity: 1;
  box-shadow: 0 0 0 2px #fff;
  transform: scale(1.08);
}

.pc-mana:has(input:focus-visible) {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The description as editable text, in its own place and style. */
.pc-description-edit {
  padding-top: 1.92cqw;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

/* A fixed size the user can't drag bigger: 140 characters fit in it. */
.pc-description-edit textarea {
  box-sizing: border-box;
  width: 100%;
  height: 12.8cqw;
  padding: 1.28cqw 1.54cqw;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 1.54cqw;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 2.37cqw;
  font-style: italic;
  line-height: 1.45;
  resize: none;
}

.pc-description-edit textarea:focus {
  outline: none;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.65);
}

.pc-description-edit textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.pc-counter {
  display: block;
  margin-top: 0.64cqw;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.66cqw;
  text-align: right;
}

/* The owner's profiles elsewhere (js/player-card.js cardLinksHtml): white
   discs with the badges' red ring, on the glass panel; none set, no row.
   In edit mode one field per site, the same translucent look as the
   description's. */
/* The discs 2cqw bigger than the row's room: -1cqw above and below, so the
   panel stays as tall as with the old 8cqw discs. */
.pc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.28cqw;
  margin-block: -0.64cqw;
}

.pc-links:empty {
  display: none;
}

.pc-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  width: 6.4cqw;
  height: 6.4cqw;
  border: 2px solid rgba(255, 106, 110, 0.6);
  border-radius: 50%;
  background: #fff;
  color: #1d1315;
  transition: transform 150ms ease;
}

a.pc-link:hover {
  transform: scale(1.08);
}

a.pc-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* The icons fill most of their disc. */
.pc-link svg {
  width: 4.86cqw;
  height: 4.86cqw;
}

.pc-link-instagram {
  color: #d6249f;
}

/* Each disc's rim in its site's logo colour (user, 2026-10-30 — they were
   all the same light red): Instagram's pink, Moxfield's purple (its logo's
   #302060 a few steps lighter, to show on the card's dark glass),
   Archidekt's blue, endstep's gold (below). */
.pc-link-instagram {
  border-color: #d6249f;
}

.pc-link-moxfield {
  border-color: #6a4bc4;
}

.pc-link-archidekt {
  border-color: #1b6ec2;
}

.pc-link img {
  width: 4.99cqw;
  height: 4.99cqw;
  object-fit: contain;
}

.pc-link-letter {
  color: #1b6ec2;
  font-size: 4.48cqw;
  font-weight: 900;
  line-height: 1;
}

/* endstep.cc: its logo (js/player-card.js) in its own colours, as on its
   site (read off endstep.cc's header, 2026-10-30): gold on its near-black
   — the gold too light to read on a white disc; a size down — it's taller
   than wide and its ring reaches its box's edges. */
.pc-link-endstep {
  border-color: oklch(0.8 0.135 80);
  background: oklch(0.175 0.014 82);
  color: oklch(0.8 0.135 80);
}

.pc-link .pc-link-endstep-logo {
  width: 4.1cqw;
  height: 4.1cqw;
}

.pc-links-edit {
  padding-top: 1.92cqw;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.pc-link-field {
  display: flex;
  align-items: center;
  gap: 1.28cqw;
  margin-top: 1.02cqw;
}

.pc-link-field input {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  padding: 0.9cqw 1.54cqw;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 1.54cqw;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.95);
  font: inherit;
  font-size: 2.18cqw;
}

.pc-link-field input:focus {
  outline: none;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.65);
}

.pc-link-field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Touch screens: finger-sized, 16px so iOS doesn't zoom (like the other
   edit-mode fields). */
html.nav-mobile .pc-link-field input {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 16px;
}

html.nav-mobile .pc-link-field .pc-link {
  width: 34px;
  height: 34px;
}

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

/* ---- ✎ / ✓ (save) and ✕ (cancel), on the card's top-right corner ---- */

/* Brand red, like the site's other small floating controls; ✎ outside edit
   mode, ✓ in it. */
/* account.html: "?" on the card's top-left corner (the effects'
   explanation, js/card-cosmetics.js) — the site's red foil help button (its
   colours with .help-toggle-btn's), a white ring so it reads on the dark
   hero. In and out of edit mode (✎, or ✓ and ✕, on the other corner), once
   linked. */
.pc-help-btn {
  position: absolute;
  top: -10px;
  left: -10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.pc-help-btn:hover {
  transform: scale(1.08);
}

.pc-help-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.6);
  outline-offset: 2px;
}

.pc-edit-btn {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand-red) 40%, transparent);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.pc-edit-btn:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 12px 24px color-mix(in srgb, var(--brand-red) 50%, transparent);
}

.pc-edit-btn:focus-visible,
.pc-cancel-btn:focus-visible {
  outline: 3px solid rgba(220, 24, 28, 0.45);
  outline-offset: 3px;
}

.pc-edit-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ---------------------------------------------------------------------------
   player.html's league recap (js/player-league-recap.js), right after the
   hero: one card, a link to the league as a whole (like the sub-cards), in
   three levels — the league's name with a chevron; the position big in the
   page's accent (--brand-red is the hero's colour there) with its movement
   pill (.pos-move, js/history-list.js positionMoveHtml), then the points
   over the record and winrate, small, after a hairline; the stages as a row
   of discs at the right end (its position in each; solid for a win, dashed
   when missed, faint still to play). Narrow (a size container, under
   600px): the stages under the rest. */
.league-recap {
  margin: 0 0 26px;
  container-type: inline-size;
}

.league-recap-card {
  display: block;
  padding: 16px 20px 18px;
  border: 1px solid rgba(120, 100, 104, 0.2);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(40, 20, 22, 0.06);
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

a.league-recap-card:hover {
  border-color: color-mix(in srgb, var(--brand-red) 34%, transparent);
  background: color-mix(in srgb, var(--brand-red) 4%, #fff);
  color: inherit;
  text-decoration: none;
}

a.league-recap-card:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

:root[data-theme="dark"] .league-recap-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] a.league-recap-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: color-mix(in srgb, var(--brand-red) 10%, rgba(255, 255, 255, 0.05));
}

.league-recap-card.is-loading {
  animation: none;
}

.league-recap-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.league-recap-name {
  min-width: 0;
  overflow: hidden;
  color: var(--text-title);
  font-size: 0.95rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-recap-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 150ms ease, color 150ms ease;
}

a.league-recap-card:hover .league-recap-chevron {
  color: var(--brand-red-deep);
  transform: translateX(2px);
}

.league-recap-main {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 14px 20px;
  margin-top: 12px;
}

.league-recap-pos {
  display: flex;
  align-items: center;
  gap: 10px;
}

.league-recap-pos b {
  color: var(--brand-red-deep);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.league-recap-points {
  display: grid;
  gap: 3px;
  padding-left: 20px;
  border-left: 1px solid rgba(120, 100, 104, 0.22);
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

:root[data-theme="dark"] .league-recap-points {
  border-left-color: rgba(255, 255, 255, 0.14);
}

.league-recap-points b {
  color: var(--text-title);
  font-size: 1.35rem;
  line-height: 1;
}

.league-recap-record {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* The movement since the latest event, beside the big number: a tinted
   pill with the trend arrows' icons (js/history-list.js positionMoveHtml).
   Fixed green / red, never the hero's colour. */
.pos-move {
  --trend: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px 3px 6px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--trend) 14%, transparent);
  color: var(--trend);
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pos-move svg {
  width: 12px;
  height: 12px;
}

.pos-move:is(.is-same, .is-new) {
  padding: 3px 6px;
}

.pos-move.is-up {
  --trend: #148a50;
}

.pos-move.is-down {
  --trend: #c8161b;
}

:root[data-theme="dark"] .pos-move.is-up {
  --trend: #4cd38f;
}

:root[data-theme="dark"] .pos-move.is-down {
  --trend: #ff6b6e;
}

/* The stages: a disc each, in order — its position; a win solid in the
   accent; a missed one dashed and empty, one still to play faint. Wrapping
   (never scrolling) when they don't fit. */
.league-recap-stages {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.league-recap-stage {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-red) 11%, transparent);
  color: var(--text-title);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.league-recap-stage.is-first {
  background: var(--brand-red);
  color: #fff;
}

.league-recap-stage.is-missed {
  background: none;
  border: 1.5px dashed rgba(120, 100, 104, 0.4);
}

.league-recap-stage.is-future {
  background: rgba(120, 100, 104, 0.1);
}

:root[data-theme="dark"] .league-recap-stage.is-missed {
  border-color: rgba(255, 255, 255, 0.25);
}

:root[data-theme="dark"] .league-recap-stage.is-future {
  background: rgba(255, 255, 255, 0.07);
}

@container (max-width: 600px) {
  .league-recap-card {
    padding: 14px 16px 16px;
  }

  .league-recap-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .league-recap-stages {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* ---------------------------------------------------------------------------
   player.html's rivals (js/player-rivals.js), under the league recap: up to
   three cards side by side, the recap card's look — each a link to
   Confronto: an icon disc, the funny label over the opponent's name and the
   head-to-head record, the number big on the right. Each kind its own fixed
   colour (--rival), never the hero's: Bestia nera red, Vittima preferita green
   (.pos-move's), Vecchia conoscenza amber. Equal columns, as many as there
   are cards; up to 900px one under the other. */
.rivals {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  margin: 0 0 26px;
}

/* display: grid above would beat the hidden attribute. */
.rivals[hidden] {
  display: none;
}

.rival-card {
  --rival: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(120, 100, 104, 0.2);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(40, 20, 22, 0.06);
  color: inherit;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease;
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.rival-card:nth-child(2) {
  animation-delay: 60ms;
}

.rival-card:nth-child(3) {
  animation-delay: 120ms;
}

.rival-card.is-nemesis {
  --rival: #c8161b;
}

.rival-card.is-victim {
  --rival: #148a50;
}

.rival-card.is-regular {
  --rival: #b7791f;
}

:root[data-theme="dark"] .rival-card.is-nemesis {
  --rival: #ff6b6e;
}

:root[data-theme="dark"] .rival-card.is-victim {
  --rival: #4cd38f;
}

:root[data-theme="dark"] .rival-card.is-regular {
  --rival: #f0b54a;
}

.rival-card:hover {
  border-color: color-mix(in srgb, var(--rival) 40%, transparent);
  background: color-mix(in srgb, var(--rival) 4%, #fff);
  color: inherit;
  text-decoration: none;
}

.rival-card:focus-visible {
  outline: 2px solid var(--rival);
  outline-offset: 2px;
}

:root[data-theme="dark"] .rival-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .rival-card:hover {
  border-color: color-mix(in srgb, var(--rival) 45%, transparent);
  background: color-mix(in srgb, var(--rival) 10%, rgba(255, 255, 255, 0.05));
}

.rival-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rival) 13%, transparent);
  color: var(--rival);
}

.rival-icon svg {
  width: 22px;
  height: 22px;
}

.rival-text {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}

.rival-label {
  color: var(--rival);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rival-name {
  overflow: hidden;
  color: var(--text-title);
  font-size: 1rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rival-record {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rival-stat {
  display: grid;
  flex: none;
  justify-items: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.rival-stat b {
  color: var(--rival);
  font-size: 1.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.rival-chevron {
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: -6px;
  color: var(--text-muted);
  transition: transform 150ms ease, color 150ms ease;
}

.rival-card:hover .rival-chevron {
  color: var(--rival);
  transform: translateX(2px);
}

@media (max-width: 900px) {
  .rivals {
    grid-auto-flow: row;
    gap: 10px;
  }

  .rival-card {
    padding: 12px 14px;
  }
}

/* player.html on phones (user, 2026-11-18): the first thing in the sheet
   under the hero (css/6 "The hero pages on touch screens": 26px corners,
   22px top padding, --page-pad-x at the sides) with its corners concentric
   with the sheet's — as far from its top edge as from its sides, its radius
   the sheet's less that gap (26 - 6 = 20px). The Dove bar when it's shown
   (a pill: its height twice that radius), else the league recap's card,
   else the rivals. #player-content: these outrank the sheet's and the
   bar's own rules in css/6, loaded later. Tablets keep their spacing (their
   20px side gap would leave a 6px radius). */
@media (max-width: 640px) {
  html.nav-mobile :is(#player-content, #commander-content) .hero-sheet {
    --sheet-first-top: calc(var(--page-pad-x) - 22px);
    --sheet-first-radius: calc(26px - var(--page-pad-x));
  }

  html.nav-mobile :is(#player-content, #commander-content) .hero-sheet > .where-filter:not([hidden]) {
    box-sizing: border-box;
    min-height: calc(2 * var(--sheet-first-radius));
    margin-top: var(--sheet-first-top);
  }

  html.nav-mobile #player-content .hero-sheet > .where-filter[hidden] + .league-recap:not([hidden]),
  html.nav-mobile #player-content .hero-sheet > .where-filter[hidden] + .league-recap[hidden] + .rivals:not([hidden]) {
    margin-top: var(--sheet-first-top);
  }

  html.nav-mobile #player-content .hero-sheet > .where-filter[hidden] + .league-recap .league-recap-card,
  html.nav-mobile #player-content .hero-sheet > .where-filter[hidden] + .league-recap[hidden] + .rivals > .rival-card {
    border-radius: var(--sheet-first-radius);
  }
}

/* commander.html's "Utilizzo" chart (js/commander-detail.js), the first
   thing under the hero: 20px down from it (it was an inline style). On
   phones, the first thing in the sheet: concentric with its corners, as
   player.html's above (user, 2026-11-18) — 6px from its top edge like its
   sides, no .page-loading padding above it, its card's corners 20px —
   unless the Dove bar is shown (a commander played live and online — user,
   2026-11-19): then the bar is the sheet's first element (the rules above,
   with player.html's) and the chart 16px under it. */
#commander-decks-chart {
  margin-top: 20px;
}

html.nav-mobile #commander-content .hero-sheet > .where-filter:not([hidden]) + #commander-decks-chart {
  margin-top: 0;
  padding-top: 0;
}

@media (max-width: 640px) {
  html.nav-mobile #commander-content .hero-sheet > .where-filter[hidden] + #commander-decks-chart {
    margin-top: calc(var(--page-pad-x) - 22px);
    padding-top: 0;
  }

  html.nav-mobile #commander-content .hero-sheet > .where-filter[hidden] + #commander-decks-chart > .pie-chart-wrap {
    border-radius: calc(26px - var(--page-pad-x));
  }
}

/* archetype.html's charts (js/archetype-detail.js — "Utilizzo" and "Contro
   gli altri archetipi" in a chart carousel), the first thing under the
   hero: 20px down from it (an inline style until 2026-11-18). On phones
   concentric with the sheet's corners like commander.html's above (user,
   2026-11-19): 6px from its top edge, no .page-loading padding (the
   carousel's own 8px of shadow room is given back by its -8px margin), the
   cards' 20px corners as they are. */
#archetype-charts {
  margin-top: 20px;
}

@media (max-width: 640px) {
  html.nav-mobile #archetype-content .hero-sheet > #archetype-charts {
    margin-top: calc(var(--page-pad-x) - 22px);
    padding-top: 0;
  }
}

/* event.html's tabs (Classifica / Giocatori / Partite / Meta), the first
   thing in its sheet: on phones concentric with the sheet's corners, like
   the pages above (user, 2026-11-19) — 6px from its top edge, its corners
   the sheet's 26px less that (20px), the current tab's inside them less the
   bar's 1px border and 6px padding (13px). Still sticky (top: 8px) once scrolled. */
@media (max-width: 640px) {
  html.nav-mobile #event-content .hero-sheet > .event-tabs {
    margin-top: calc(var(--page-pad-x) - 22px);
    border-radius: calc(26px - var(--page-pad-x));
  }

  html.nav-mobile #event-content .hero-sheet > .event-tabs .profile-tab {
    border-radius: calc(26px - 2 * var(--page-pad-x) - 1px);
  }
}

/* Touch screens (where the Giocatori / Storico partite tabs are): the tabs
   16px under the chart (user, 2026-11-18 — it was 54: the card's 20px,
   .page-loading's 6px, the tabs' 28px). */
html.app-header #commander-decks-chart {
  padding-bottom: 0;
}

html.app-header #commander-decks-chart > .pie-chart-wrap {
  margin-bottom: 0;
}

html.app-header #commander-content .commander-tabs {
  margin-top: 16px;
}

/* Kryptonite / Portabandiera (js/commander-rivals.js — player.html's rivals'
   cards) between the chart and the lists: on touch screens 16px from both,
   like the tabs from the chart. */
html.app-header #commander-content .commander-rivals {
  margin: 16px 0 0;
}

/* ---------------------------------------------------------------------------
   player.html's Album comandanti in a box (user, 2026-11-18: it felt
   detached from the rest), the league recap's / rivals' card look, in two
   parts: a showcase — the cards on a faint tint of the page's accent (the
   hero's colour), a glow behind the current card — and the details under
   it, the ‹ • › pill sitting across the line between the two; the name,
   then the four numbers as one 2 × 2 table with hairlines (not four boxes in
   the box). Only here (#player-commanders — the carousel's own rules in
   css/2 stay as they are).
   Storico partite beside it, boxless (its sub-cards, like commander.html's),
   each under its plain title on a computer; on touch screens one at a time
   behind tabs (css/3 .player-lists — user, 2026-11-19, after a while as
   two boxes with their titles as bands, option D of
   _mockup-player-titles.html). The box is the album itself (.cmd-carousel),
   not its column: no title in it. */
#player-commanders .cmd-carousel {
  --album-line: rgba(120, 100, 104, 0.18);
  /* The glow's centre: the current card's (desktop: at the left). */
  --album-glow-x: 50%;
  gap: 0;
  overflow: clip;
  border: 1px solid rgba(120, 100, 104, 0.2);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(40, 20, 22, 0.06);
}

:root[data-theme="dark"] #player-commanders .cmd-carousel {
  --album-line: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

#player-commanders .cmd-carousel-main {
  width: auto;
  max-width: none;
  padding-top: 8px;
  border-bottom: 1px solid var(--album-line);
  background:
    radial-gradient(circle at var(--album-glow-x) 42%, color-mix(in srgb, var(--brand-red) 16%, transparent) 0, transparent 62%),
    linear-gradient(to bottom, color-mix(in srgb, var(--brand-red) 7%, transparent), color-mix(in srgb, var(--brand-red) 3%, transparent));
}

/* The current card lifted off the showcase (user): a deeper, wider shadow
   plus a tight one at its edge. The scroller clips at its padding (css/2:
   14px above, 26px below, 20px left on a computer): more room below for it,
   the dots pulled up by as much. */
#player-commanders .cmd-carousel-track {
  padding-bottom: 36px;
}

#player-commanders .cmd-carousel-nav {
  margin-top: -16px;
}

#player-commanders .cmd-carousel-slide.is-active {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.22), 0 14px 26px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] #player-commanders .cmd-carousel-slide.is-active {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), 0 14px 26px rgba(0, 0, 0, 0.55);
}

@media (min-width: 880px) {
  #player-commanders .cmd-carousel-slide.is-active {
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.22), 6px 14px 24px rgba(0, 0, 0, 0.3);
  }

  :root[data-theme="dark"] #player-commanders .cmd-carousel-slide.is-active {
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.45), 6px 14px 24px rgba(0, 0, 0, 0.55);
  }
}

/* Across the line under the showcase: half above it, half below — the pill
   opaque, so the line doesn't show through (dark: the box's tint over the
   page, a step lighter, rather than the usual see-through white). */
#player-commanders .cmd-carousel-nav {
  position: relative;
  z-index: 1;
  margin-bottom: -18px;
}

:root[data-theme="dark"]:not(.nav-mobile) #player-commanders .chart-carousel-nav {
  background: color-mix(in srgb, #fff 11%, var(--bg-cream-1));
}

#player-commanders .cmd-carousel-stats {
  padding: 30px 20px 6px;
}

/* Touch screens: the dots alone, no pill (css/5) — inside the showcase,
   above the line. */
html.nav-mobile #player-commanders .cmd-carousel-nav {
  margin-bottom: 0;
  padding-bottom: 12px;
}

html.nav-mobile #player-commanders .cmd-carousel-stats {
  padding-top: 16px;
}

#player-commanders .cmd-carousel-name {
  margin-bottom: 6px;
}

/* The numbers: one table, no boxes — a hairline between the columns and
   between the rows. */
#player-commanders .cmd-carousel-tiles {
  gap: 0;
}

#player-commanders .cmd-carousel-stats .stat-tile {
  padding: 12px 0 14px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
}

#player-commanders .cmd-carousel-stats .stat-tile:nth-child(even) {
  padding-left: 16px;
  border-left: 1px solid var(--album-line);
}

#player-commanders .cmd-carousel-stats .stat-tile:nth-child(-n + 2) {
  border-bottom: 1px solid var(--album-line);
}

#player-commanders .cmd-carousel-stats .stat-tile-label {
  font-size: 0.72rem;
}

#player-commanders .stat-tile-value.cmd-carousel-stat-value {
  margin-top: 4px;
}

@media (min-width: 880px) {
  #player-commanders .cmd-carousel {
    --album-glow-x: calc(20px + var(--cmd-card-w) / 2);
  }

  #player-commanders .cmd-carousel-main {
    padding-left: 20px;
  }
}
