/* styles — part 1 of 6 (css/1-base-header-home.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. */

:root {
  --font-main: "Trebuchet MS", "Segoe UI", sans-serif;

  --brand-red: #dc181c;
  --brand-red-dark: rgba(116, 11, 18, 0.9);
  --brand-red-darker: #7f2024;
  --brand-red-deep: #8d1d22;
  --brand-red-deep-2: #9f141b;

  /* The page's background: one colour top to bottom (the three kept for
     the hero pages' tinted gradient, body.has-hero-accent). */
  --bg-cream-1: #fffdf8;
  --bg-cream-2: #fffdf8;
  --bg-cream-3: #fffdf8;

  --text-body: #22181a;
  --text-title: #201214;
  --text-muted: #8b666c;
  --text-muted-2: #6f5a5e;
  --text-value: #4f3c40;

  --hairline: rgba(154, 28, 32, 0.18);
  --hairline-hover: rgba(220, 24, 28, 0.32);
  --hairline-hover-strong: rgba(220, 24, 28, 0.36);
  --table-row-line: rgba(154, 28, 32, 0.08);

  --shadow-soft: 0 18px 42px rgba(69, 29, 34, 0.08);
  --shadow-card: 0 12px 28px rgba(40, 24, 26, 0.08);
  --shadow-card-hover: 0 18px 36px rgba(40, 24, 26, 0.14);

  --radius-card: 22px;
  --radius-card-sm: 20px;
  --radius-pill: 999px;

  --accent-green-2: #14914a;

  --accent-aggro: #dc181c;
  --accent-control: #2f5fdc;
  --accent-combo: #2a2226;
  --accent-tempo: #0aa8bd;
  --accent-midrange: #e0752b;

  /* Same blue family as --accent-control, but its own named variable —
     the nav's Social tab intentionally breaks from the red brand family
     (see .nav-link[data-nav="social"] below) to read as visually distinct
     from the rest of the site's own content, not because it's secretly
     "the control archetype's" color. Split into two, same reasoning as
     --brand-red vs --brand-red-darker: --social-blue is a solid fill (the
     active pill's own background), left untouched in dark mode like
     --brand-red itself is; --social-blue-text is the inactive tab's own
     (much thinner) text color, which does need brightening for contrast
     once the page behind it goes dark — see the dark-theme override below. */
  --social-blue: #2f5fdc;
  --social-blue-text: #2f5fdc;
}

/* Suppresses the browser's default blue-ish tap-highlight flash on mobile
   (WebKit/Chrome on touch devices briefly overlay a translucent color on
   whatever you tapped) — a non-standard, touch-only property with no
   effect at all on desktop, since there's no tap highlight to suppress
   there in the first place. Every element already gets its own deliberate
   :hover/:active feedback, so this flash was only ever redundant noise on
   top of that, not a replacement for it. */
html {
  -webkit-tap-highlight-color: transparent;
}

/* Read by screen readers, not shown (account.html's "Profilo" title, the
   hero being the visible header). */
/* (Also a main page's title, .page-heading.visually-hidden — over the
   heading's own position and margin, later in the stylesheet.) */
.visually-hidden,
.page-heading.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--font-main);
  /* Plain, no red glow at the top (hero pages: their own tint,
     body.has-hero-accent). */
  background: linear-gradient(180deg, var(--bg-cream-1) 0%, var(--bg-cream-2) 24%, var(--bg-cream-3) 100%);
  color: var(--text-body);
}

/* Splash shown until a page's own data has finished loading (see
   js/page-loading.js) — static markup right after .page-heading in every
   public page's <main>, same reasoning as the header/nav in js/layout.js:
   present at first paint so there's nothing to pop in. Deliberately scoped
   to below the title (header, nav and heading stay visible/interactive the
   whole time) rather than covering the whole page — .page-loading-region
   is the positioning parent, with a min-height so the splash still reads
   as a proper "screen" even though its content starts out empty and only
   grows to its natural height once the splash is gone. */
.page-loading-region {
  position: relative;
  min-height: 50vh;
}

/* While loading, at least a whole screen tall, and the footer hidden: the
   footer isn't seen high up and then dropping as the content arrives — it
   shows once loaded, straight in its place (also through an in-app
   navigation, js/router.js, which sets body.is-loading again). */
body.is-loading .page-loading-region {
  min-height: 100vh;
}

body.is-loading footer {
  visibility: hidden;
}

/* The scrollbar's room always kept (desktop): a page growing past the
   window's height as it loads doesn't get narrower — nothing shifts when
   the scrollbar appears. */
html {
  scrollbar-gutter: stable;
}

/* Touch screens: no scrollbars anywhere — the page's and every inner
   scroller's (lists, dialogs, carousels), as in an app; scrolling itself
   unchanged. A computer keeps them (a mouse needs them). */
html.nav-mobile,
html.nav-mobile * {
  scrollbar-width: none;
}

html.nav-mobile::-webkit-scrollbar,
html.nav-mobile *::-webkit-scrollbar {
  display: none;
}

/* The real content underneath (filters, chart, table, each with its own
   small "Caricamento..." placeholder) is hidden outright — see the
   visibility rule below — rather than painted over with a matching color,
   since no fixed color could ever exactly match body's gradient (which
   spans the full, variable document height) at this box's particular
   position. With nothing left to paint over, there's nothing to mismatch:
   the correct bit of body's own background just shows through on its own. */
.page-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  transition: opacity 220ms ease;
}

/* visibility (not display/opacity) so the region still reserves the real
   content's actual layout space while it's hidden — kept in sync with the
   same body.is-loading class that pauses entrance animations, so removing
   it both reveals this content and starts those animations at once. */
body.is-loading .page-loading-region > *:not(.page-loading-overlay) {
  visibility: hidden;
}

/* Touch screens: a detail hero's back pill stays shown while the page loads
   (the hero itself hidden as the rest), so going from one hero page to
   another it can stay in place and just resize to its new label (the page
   transition's "hero-back", "Page transitions" below). */
html.app-header body.is-loading .page-loading-region > .detail-hero-wrap > .detail-hero-back {
  z-index: 6;
  visibility: visible;
}

/* "Caricamento..." only for screen readers — the placeholders below say it
   on screen. */
.page-loading-overlay > p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.page-loading-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Touch screens, the hero pages: while the placeholder fades out, the real
   sheet (.hero-sheet, css/6 — z-index 1, under the overlay's 5) above it.
   Its first element is concentric with its corners on phones (css/4), so
   its top lies under the placeholder's opaque hero and sheet strip; under
   the fading overlay it showed in two parts — the bottom at once, the top
   only as the overlay faded (user, 2026-11-19: event.html's tabs, there
   from the first frame). The two sheets look alike, so the real one just
   takes over; the hero still crossfades. Only during the fade: the overlay
   is removed when it ends, and the sheet goes back to its own z-index. */
html.app-header .page-loading-overlay.is-hidden ~ .hero-sheet {
  z-index: 6;
}

/* Loading too long, or failed (js/page-loading.js watchPageLoading): the
   placeholders give way to the message, with a "Ricarica la pagina" button
   under it. */
.page-loading-overlay.is-stuck {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}

.page-loading-overlay.is-stuck > .sk-page {
  display: none;
}

.page-loading-overlay.is-stuck > p {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: normal;
}

/* The placeholders (.sk-page, static in the overlay of every public page):
   the page's own layout drawn as soft blocks — a hero, the tabs, a chart,
   list rows, tiles — each page its own (a modifier on .sk-page), so the
   content arrives where the eye already is. A brand-red shimmer sweeps
   across them, one wave for the whole screen (fixed: the gradient spans the
   window, not each block); still with reduced motion. */
.sk-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sk-page i {
  display: block;
}

/* In the page's accent (--brand-red: the site's red, or a hero page's
   colour — neutral grey before it arrives), not a fixed red; dark mode
   its light shade (--brand-red-deep there). */
.sk {
  --sk-base: color-mix(in srgb, var(--brand-red) 6%, transparent);
  --sk-shine: color-mix(in srgb, var(--brand-red) 13%, transparent);
  border-radius: 18px;
  background: linear-gradient(100deg, var(--sk-base) 35%, var(--sk-shine) 50%, var(--sk-base) 65%) fixed;
  background-size: 250% 100%;
}

:root[data-theme="dark"] .sk {
  --sk-base: rgba(255, 255, 255, 0.045);
  --sk-shine: color-mix(in srgb, var(--brand-red-deep) 12%, transparent);
}

/* Over the `body.is-loading *` pause (below) — the one animation that
   plays while loading. */
.page-loading-overlay .sk {
  animation: sk-shimmer 1.6s ease-in-out infinite;
}

@keyframes sk-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-loading-overlay .sk {
    animation: none;
  }
}

/* A heading's line, a search field, a segmented control, a list row. */
.sk-title {
  width: 160px;
  height: 26px;
  border-radius: 10px;
}

.sk-search {
  height: 48px;
  border-radius: 16px;
}

.sk-tabs {
  height: 50px;
  border-radius: var(--radius-pill);
}

.sk-row {
  height: 58px;
  border-radius: 16px;
}

/* The touch screens' segmented control only on touch screens. */
html:not(.app-header) .sk-touch-only {
  display: none;
}

/* The hero: like .profile-hero, hanging from the bar on a computer
   (square top, rounded bottom), edge to edge on phones and tablets, under
   the transparent header there (its white logo and buttons on it, as on
   the real one); the title, a line and the stat chips as lighter bars —
   beside the card when the page has one (.has-card, below). */
.sk-hero {
  --sk-base: rgba(255, 255, 255, 0);
  --sk-shine: rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-height: 236px;
  margin-bottom: 8px;
  padding: 36px 32px;
  border-radius: 0 0 28px 28px;
  background:
    linear-gradient(100deg, var(--sk-base) 35%, var(--sk-shine) 50%, var(--sk-base) 65%) fixed,
    linear-gradient(135deg, #6f6a67, #3b3735);
  background-size: 250% 100%, auto;
}

:root[data-theme="dark"] .sk-hero {
  --sk-base: rgba(255, 255, 255, 0);
  --sk-shine: rgba(255, 255, 255, 0.07);
  background-color: #2a2726;
  background-image:
    linear-gradient(100deg, var(--sk-base) 35%, var(--sk-shine) 50%, var(--sk-base) 65%),
    linear-gradient(135deg, #3b3735, #1c1a19);
}

.sk-hero i {
  height: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.sk-hero .sk-hero-title {
  width: min(320px, 70%);
  height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.24);
}

.sk-hero-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

/* The line under the name (league's status and dates, event's details),
   above it on account (its "Il tuo profilo") — not on the heroes with only
   the name. */
.sk-hero-text > .sk-hero-line {
  width: min(200px, 45%);
}

.sk-hero-chips {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.sk-hero-chips i {
  width: 84px;
  height: 52px;
  border-radius: 16px;
}

@media (max-width: 640px) {
  .sk-hero {
    margin-inline: calc(-1 * var(--page-pad-x, 16px));
    padding-inline: var(--page-pad-x, 16px);
    border-radius: 0;
  }
}

html.app-header .sk-hero {
  min-height: 260px;
  padding-top: calc(var(--hero-header-h, 80px) + 14px);
  border-radius: 0;
}

/* …and ending like the real hero does, under the content's sheet
   (.hero-sheet, styles.css "The hero pages on touch screens": its rounded
   top corners lapping 26px over the hero, a soft shadow above): a strip in
   the sheet's colour with those corners at the sketch's bottom, the content
   sketched under it where the sheet's own content starts — not a straight
   edge that the loaded page then rounds (every hero page: player,
   commander, event, league, archetype, account). The sizes are the real
   hero's on a phone (measured, 2026-10-28): the name 14px under the
   header, the numbers' row 39px tall, 50px under it (the hero's padding
   for the sheet), the sheet's content 4px under the hero's end (it laps
   26px over it, then pads 22px) — so nothing moves when the page arrives. */
html.app-header .sk-hero {
  position: relative;
  margin-bottom: -4px;
  padding-bottom: 50px;
}

@media (max-width: 640px) {
  html.app-header .sk-hero-chips i {
    height: 39px;
  }
}

/* Tablets (touch, wider than a phone): the name's line 38px, the numbers'
   row 58px — the real hero's there. */
@media (min-width: 641px) {
  html.app-header .sk-hero .sk-hero-title {
    height: 38px;
  }

  html.app-header .sk-hero-chips i {
    height: 58px;
  }
}

/* The name a little further from the card than the card from the numbers,
   as in the real hero. */
@media (max-width: 820px) {
  html.app-header .sk-hero.has-card .sk-hero-title {
    margin-bottom: 6px;
  }
}

html.app-header .sk-hero::after {
  content: "";
  position: absolute;
  right: 0;
  /* 2px past the hero's own bottom edge: at a fractional pixel ratio (most
     phones) the two edges rounded apart and a hair of the dark hero showed
     under the strip — a thin line across the screen. */
  bottom: -2px;
  left: 0;
  height: 28px;
  border-radius: 26px 26px 0 0;
  background: var(--bg-cream-1);
  box-shadow: 0 -6px 16px rgba(20, 8, 10, 0.14);
  /* Only the shadow's part above the strip: its blur also spread under the
     strip's lower edge, a faint line there (the real sheet goes on
     downward, so its own never shows). Cut 1px inside the strip's bottom
     (still 1px past the hero's): cut exactly at it, a part of the shadow
     bled into the edge pixel at fractional pixel ratios. */
  clip-path: inset(-40px 0 1px 0);
}

html.app-header[data-theme="dark"] .sk-hero::after {
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.45);
}

/* With the card (commander.html and account.html always; player.html once
   its card request says the player shows one — js/player-detail.js): laid
   out like .profile-hero-inner — the card's 280px column beside the text;
   from 820px down the card first, centred (240px wide on phones, account's
   260px), the text centred under it. */
/* (.sk-page .sk-hero-card: over .sk-page i's display: block.) */
.sk-page .sk-hero-card {
  display: none;
}

.sk-hero.has-card {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: center;
  gap: 40px;
  padding-block: 32px;
}

.sk-hero.has-card .sk-hero-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 488 / 680;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
}

.sk-hero.has-card .sk-hero-text {
  align-self: stretch;
  justify-content: center;
}

/* A player card's placeholder (account.html's; player.html's,
   .has-player-card from js/player-detail.js): landscape, 2:1, in the wider
   400px column, up to 440px wide in one column (the real card's,
   css/4-profile-card.css). commander.html's Magic card keeps the above. */
.sk-hero.has-player-card,
.sk-page.is-account .sk-hero.has-card {
  grid-template-columns: 400px minmax(0, 1fr);
}

.sk-hero.has-player-card .sk-hero-card,
.sk-page.is-account .sk-hero.has-card .sk-hero-card {
  aspect-ratio: 2 / 1;
}

.sk-hero.has-card .sk-hero-chips {
  margin-top: 12px;
}

@media (max-width: 820px) {
  .sk-hero.has-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 24px 20px;
  }

  .sk-hero.has-card .sk-hero-card {
    max-width: 280px;
    margin: 0 auto;
  }

  /* As the real one: the name above the card, the numbers under it (the
     text's bars join the hero's grid); account's line too. */
  .sk-hero.has-card .sk-hero-text {
    display: contents;
  }

  .sk-hero.has-card .sk-hero-title {
    order: -1;
    justify-self: center;
  }

  .sk-hero.has-card .sk-hero-line {
    order: -1;
    justify-self: center;
  }

  .sk-hero.has-card .sk-hero-chips {
    justify-content: center;
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  .sk-hero.has-card {
    padding-inline: 16px;
  }

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

  .sk-page.is-account .sk-hero.has-card .sk-hero-card {
    max-width: 260px;
  }
}

@media (max-width: 820px) {
  .sk-hero.has-player-card,
  .sk-page.is-account .sk-hero.has-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .sk-hero.has-player-card .sk-hero-card,
  .sk-page.is-account .sk-hero.has-card .sk-hero-card {
    max-width: 440px;
  }
}

html.app-header .sk-hero.has-card {
  padding-top: calc(var(--hero-header-h, 80px) + 14px);
}

@media (min-width: 641px) {
  html.app-header .sk-hero,
  html.app-header .sk-hero.has-card {
    margin-inline: calc(-1 * var(--hero-bleed));
    padding-inline: var(--hero-bleed);
  }
}

/* ---- The detail heroes' placeholder at the real hero's sizes (player,
   commander, event, league, archetype — not account's, .is-account: its
   own layout, above). Measured against the loaded pages (2026-10-28) so the
   page doesn't move when it arrives: the name's line, the info line under
   it (event, league), the numbers' row, the hero's padding — and, on event
   and league, the buttons' row ("Recap", "Liste", "Regolamento"; the
   placeholder's .sk-hero-actions, in the numbers' row): on a computer at
   its right end, on touch screens above the numbers, centred. No forced
   minimum height any more: the parts make the height, as in the real hero.
   The card layouts (.has-card) keep their own rules above, already exact on
   touch screens. */
.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-text {
  gap: 0;
}

.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-line {
  height: 19px;
  margin-top: 12px;
}

/* event.html's info line sits a little lower (its title's own row). */
.sk-page.is-hero:not(.is-account) .sk-hero.is-event .sk-hero-line {
  margin-top: 18px;
}

.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-chips {
  flex-wrap: wrap;
}

.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions {
  display: flex;
  gap: 10px;
}

.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions i {
  width: 104px;
  height: 42px;
  border-radius: 99px;
}

.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions i + i {
  width: 92px;
}

/* league.html: "Regolamento" (a "Recap" beside it only once the league is
   over). */
.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions i.is-wide {
  width: 152px;
}

/* event.html / league.html: the round share button at the row's end
   (js/share.js). */
.sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions i.is-round {
  width: 42px;
}

/* From 820px down the real hero's text is centred (the name, its line, the
   buttons; the numbers spread over the width): so are the bars. */
@media (max-width: 820px) {
  .sk-page.is-hero:not(.is-account) .sk-hero:not(.has-card) .sk-hero-text {
    align-items: center;
  }

  .sk-page.is-hero:not(.is-account) .sk-hero:not(.has-card) .sk-hero-chips {
    justify-content: space-around;
    align-self: stretch;
  }
}

/* A computer: the name 50px tall, 38px under the hero's top (32px with a
   card), the numbers 59px tall, 30px under the name (24px under the info
   line), 32px of hero under them; the buttons at the row's right end. */
html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero:not(.has-card) {
  min-height: 0;
  padding-top: 38px;
  padding-bottom: 32px;
}

html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-title {
  height: 50px;
}

html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-chips {
  margin-top: 30px;
}

html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-line + .sk-hero-chips {
  margin-top: 24px;
}

html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-chips > i {
  height: 59px;
}

html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions {
  align-self: flex-start;
  margin-top: -3px;
  margin-left: auto;
}

/* Beside a card (player, commander), the real text block sits 3px lower
   than plainly centred. */
@media (min-width: 821px) {
  html:not(.app-header) .sk-page.is-hero:not(.is-account) .sk-hero.has-card .sk-hero-text {
    padding-top: 6px;
  }
}

/* Touch screens: the name 14px under the header (the rules above — 30px
   until 2026-11-06, the hero's top padding 16px less since), the
   numbers 28px under it — or, with an info line, the buttons 22px under
   that and the numbers 16px under the buttons; 50px of hero under them. */
html.app-header .sk-page.is-hero:not(.is-account) .sk-hero:not(.has-card) {
  min-height: 0;
}

html.app-header .sk-page.is-hero:not(.is-account) .sk-hero:not(.has-card) .sk-hero-chips {
  margin-top: 28px;
}

html.app-header .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-line + .sk-hero-chips {
  margin-top: 22px;
  row-gap: 0;
}

html.app-header .sk-page.is-hero:not(.is-account) .sk-hero .sk-hero-actions {
  flex-basis: 100%;
  order: -1;
  justify-content: center;
  margin-bottom: 16px;
}

/* Account: its hero sits in the signed-in view, hidden (display: none)
   while loading, so its pull-up doesn't move the region — the placeholder
   pulls itself up the same (28px; 20px on phone widths); its tabs a pill
   bar on a computer, the full-width segmented control on phones. */
.sk-page.is-account .sk-hero {
  margin-top: -28px;
}

@media (max-width: 640px) {
  .sk-page.is-account .sk-hero {
    margin-top: -20px;
  }
}

/* Once the real profile shows (the placeholder fading out over it), its
   hero's own pull-up has moved the whole region up (its margin through the
   region's top): the placeholder's would then count twice — it jumped
   20–28px up for its fade-out, the tabs and the section with it. */
.page-loading-region:has(> .profile[data-view="signed-in"]:not([hidden])) .sk-page.is-account .sk-hero {
  margin-top: 0;
}

@media (min-width: 641px) {
  html:not(.app-header) .sk-page.is-account .sk-tabs {
    width: 298px;
  }
}

/* Account at the real Profilo's sizes, measured against the loaded page
   (signed in, linked — 2026-10-30) so the tabs and the section under the
   hero don't move when it arrives: the card 4px taller than 2:1 (its
   frame), the numbers' row, the buttons' row under it (Invia la tua
   decklist / Pagina giocatore — .sk-hero-actions), the tabs' own height
   (51px pill bar; 69px segmented control on touch screens, laid 4px into
   the hero's sheet) and 18px down to the section. Touch screens: "Il tuo
   profilo" 23px under the header, 6px above the name (34px; 36px on
   tablets), then 28 / 22 / 22px between the name, the card, the numbers
   (50px; 59px on tablets) and the buttons (42px), 50px of hero under them. */
.sk-page.is-account .sk-hero.has-card .sk-hero-card {
  box-sizing: content-box;
  padding-bottom: 4px;
}

.sk-page.is-account .sk-hero-actions {
  display: flex;
  gap: 10px;
}

.sk-page.is-account .sk-hero-actions i {
  width: 150px;
  height: 42px;
  border-radius: 99px;
}

.sk-page.is-account .sk-tabs {
  height: 51px;
}

.sk-page.is-account .sk-card {
  margin-top: 4px;
}

html.app-header .sk-page.is-account .sk-hero.has-card {
  padding-top: calc(var(--hero-header-h, 80px) + 7px);
}

@media (max-width: 820px) {
  .sk-page.is-account .sk-hero.has-card .sk-hero-line {
    height: 15px;
    margin-bottom: -16px;
  }

  .sk-page.is-account .sk-hero-actions {
    justify-content: center;
  }

  .sk-page.is-account .sk-hero-actions i {
    width: min(174px, calc(50% - 5px));
  }
}

html.app-header .sk-page.is-account .sk-hero-chips i {
  height: 50px;
}

/* (Above the hero's sheet strip, which it laps into.) */
html.app-header .sk-page.is-account .sk-tabs {
  position: relative;
  z-index: 1;
  height: 69px;
  margin-top: -14px;
  border-radius: 18px;
}

@media (min-width: 641px) {
  html.app-header .sk-page.is-account .sk-hero .sk-hero-title {
    height: 36px;
  }

  html.app-header .sk-page.is-account .sk-hero-chips i {
    height: 59px;
  }
}

/* Two columns on a computer (a hero page's lists, the Bacheca), one on
   phones and touch screens. */
.sk-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px 28px;
}

.sk-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 860px) {
  .sk-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .sk-cols > .sk-col + .sk-col {
    display: none;
  }
}

html.app-header .sk-cols {
  grid-template-columns: minmax(0, 1fr);
}

html.app-header .sk-cols > .sk-col + .sk-col {
  display: none;
}

/* Bacheca: the timeline (a dot and a card per event) beside Classifica,
   the charts' card under both. On a computer laid out like the loaded
   board (measured 2026-11-03): the panel's padding, the 48px headings,
   the lists 60px under their top, the link pills under them, the charts'
   card below. */
@media (min-width: 861px) {
  html:not(.app-header) .sk-page.is-home .sk-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 64px;
    padding: 22px 26px 24px;
  }

  html:not(.app-header) .sk-page.is-home .sk-title {
    margin-block: 11px;
  }

  html:not(.app-header) .sk-page.is-home .sk-standings {
    height: 494px;
    margin-top: 60px;
  }

  /* The charts' card as tall as it is with its own loading block. */
  html:not(.app-header) .sk-page.is-home .sk-chart {
    height: 386px;
  }
}

/* "Tutti gli eventi" / "Classifica completa": a pill under each list. */
.sk-page.is-home .sk-more {
  align-self: center;
  width: 170px;
  height: 44px;
  margin-top: 4px;
  border-radius: var(--radius-pill);
}

/* Like the loaded timeline: the date's 56px circle, the card 14px on,
   12px apart, "Oggi" (.sk-tl-today, empty) 42px between the played and
   the upcoming ones. */
.sk-tl {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px 14px;
}

.sk-tl .sk-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

.sk-tl .sk-tl-today {
  grid-column: 1 / -1;
  height: 18px;
}

.sk-tl .sk-row {
  height: 56px;
}

.sk-standings {
  height: 420px;
  margin-top: 38px;
}

.sk-page.is-home .sk-chart {
  height: 330px;
  margin-top: 16px;
}

/* The stories' place (js/home.js recapLikely — only when some are
   likely): the bubbles' row, full width, above everything. */
.sk-page.is-home .sk-recap {
  display: block;
  width: 100%;
  height: 90px;
  margin-bottom: 10px;
  border-radius: 16px;
}

.sk-page.is-home .sk-recap[hidden] {
  display: none;
}

/* A computer: the stories' bar (css/6 "The Bacheca's recaps"). */
html:not(.app-header) .sk-page.is-home .sk-recap {
  height: 76px;
  margin-bottom: 22px;
  border-radius: var(--radius-card);
}

/* Touch screens: the segmented control, then Eventi alone (no heading of
   its own there). */
html.app-header .sk-page.is-home .sk-tabs {
  height: 69px;
  margin-bottom: 4px;
  border-radius: 18px;
}

/* …and the board's 13px padding round the timeline, its link pill a
   little closer under it (measured against the loaded page, 2026-11-03). */
html.app-header .sk-page.is-home .sk-cols {
  padding: 13px;
}

html.app-header .sk-page.is-home .sk-more {
  margin-top: 2px;
}

html.app-header .sk-page.is-home .sk-title,
html.app-header .sk-page.is-home > .sk-chart {
  display: none;
}

/* A chart (Comandanti, Archetipi, a commander's or archetype's decks). */
.sk-chart {
  height: 300px;
  border-radius: var(--radius-card);
}

/* The Bacheca's Più giocati while its charts still load, after the rest of
   the page is shown (js/home.js): its own shimmering block in the card. */
.home-charts-sk {
  display: block;
  height: 340px;
  animation: sk-shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .home-charts-sk {
    animation: none;
  }
}

@media (max-width: 820px) {
  .sk-chart {
    height: 420px;
  }
}

/* ---- The detail pages' content under the hero, at the loaded page's
   sizes (measured 2026-11-19, after player.html's rivals and boxes,
   commander.html's Kryptonite / Portabandiera and the sheets' first element
   made concentric on phones): player.html's league recap, rivals and two
   boxes; commander.html's chart, two stat cards and lists; archetype.html's
   charts and one list; event.html's tabs and one list. Gaps as the real
   ones less the page's own 14px (.sk-page's gap). */

/* Phones: the sheet's first element concentric with its corners, as on the
   loaded pages (css/4): 6px from the sheet's top edge — 20px over the
   hero's end, the placeholder's content starting 10px under it otherwise —
   its corners 20px; above the hero's sheet strip (.sk-hero::after), which
   would otherwise cover its top. */
@media (max-width: 640px) {
  html.app-header .sk-page.is-hero:is(.is-player, .is-commander, .is-archetype, .is-event) > .sk-hero + * {
    position: relative;
    z-index: 1;
    margin-top: -30px;
    border-radius: 20px;
  }
}

/* Player: the league recap (108px; 150px on phones, its narrow layout), the
   rivals (three side by side, 80px; one under the other up to 900px, 76px);
   on a computer the two columns 28px under them (22px apart), each under its
   title: the album's box (631px) 28px under it, Storico partite's event
   cards (boxless, 225px / 295px) 30px under it; on touch screens the tabs
   (69px, 18px corners) 16px under the rivals, the album's box (642px) 24px
   under them, no titles (the tabs name them). */
.sk-page.is-player .sk-recap {
  height: 108px;
  border-radius: 22px;
}

.sk-page:is(.is-player, .is-commander) .sk-rivals {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  margin-top: 12px;
}

.sk-page:is(.is-player, .is-commander) .sk-rivals .sk {
  height: 80px;
  border-radius: 22px;
}

.sk-page.is-player .sk-cols {
  gap: 14px 22px;
  margin-top: 14px;
}

.sk-page.is-player .sk-box {
  height: 631px;
  margin-top: 16px;
  border-radius: 22px;
}

.sk-page.is-player .sk-group {
  height: 225px;
  border-radius: 14px;
}

.sk-page.is-player .sk-title + .sk-group {
  margin-top: 18px;
}

.sk-page.is-player .sk-group + .sk-group {
  height: 295px;
  margin-top: -4px;
}

html.app-header .sk-page.is-player .sk-tabs {
  height: 69px;
  margin-top: 2px;
  border-radius: 18px;
}

html.app-header .sk-page.is-player .sk-cols {
  margin-top: 10px;
}

html.app-header .sk-page.is-player .sk-title {
  display: none;
}

html.app-header .sk-page.is-player .sk-box {
  height: 642px;
  margin-top: 0;
}

@media (max-width: 900px) {
  .sk-page:is(.is-player, .is-commander) .sk-rivals {
    grid-auto-flow: row;
    gap: 10px;
  }

  .sk-page:is(.is-player, .is-commander) .sk-rivals .sk {
    height: 76px;
  }
}

@media (max-width: 640px) {
  .sk-page.is-player .sk-recap {
    height: 150px;
  }
}

/* Commander: the chart's card (248px; 242px on phones), the two stat cards
   26px under it (16px on touch screens), the lists 28px under them; on
   touch screens the tabs (69px, 18px corners) 16px under the cards and the
   lists 18px under the tabs, without their titles (the tabs name them). */
.sk-page.is-commander .sk-chart {
  height: 248px;
}

.sk-page.is-commander .sk-cols {
  margin-top: 14px;
}

html.app-header .sk-page.is-commander .sk-rivals {
  margin-top: 2px;
}

html.app-header .sk-page.is-commander .sk-tabs {
  height: 69px;
  margin-top: 2px;
  border-radius: 18px;
}

html.app-header .sk-page.is-commander .sk-cols {
  margin-top: 4px;
}

html.app-header .sk-page.is-commander .sk-title {
  display: none;
}

@media (max-width: 640px) {
  .sk-page.is-commander .sk-chart {
    height: 242px;
  }
}

/* Archetype: the charts' card (248px; 254px on phones), the list's title
   50px under it, the rows the whole width. */
.sk-page.is-archetype .sk-chart {
  height: 248px;
}

.sk-page.is-archetype .sk-chart + .sk-title {
  margin-top: 36px;
}

@media (max-width: 640px) {
  .sk-page.is-archetype .sk-chart {
    height: 254px;
  }
}

/* Event: the tabs on every screen — on a computer the 504px pill bar (51px),
   on touch screens the segmented control (69px) — the list's rows 18px
   under them, the whole width, no title. */
.sk-page.is-event > .sk-tabs {
  width: min(504px, 100%);
  height: 51px;
}

.sk-page.is-event > .sk-tabs + .sk-row {
  margin-top: 4px;
}

html.app-header .sk-page.is-event > .sk-tabs {
  width: auto;
  height: 69px;
  border-radius: 18px;
}

/* A part of a page still loading after the page is shown (js/page-loading.js
   sectionLoadingHtml / statTilesLoadingHtml): shimmering rows in a list's
   place, a shimmering bar in a number tile's — on a hero, light on its
   art. */
.sk-section {
  display: grid;
  gap: 10px;
}

.sk-section i {
  display: block;
}

.sk-section .sk,
.sk-stat {
  animation: sk-shimmer 1.6s ease-in-out infinite;
}

.sk-stat {
  display: inline-block;
  width: 2.4em;
  height: 0.8em;
  border-radius: 8px;
  vertical-align: middle;
}

.profile-hero .sk,
:root[data-theme="dark"] .profile-hero .sk {
  --sk-base: rgba(255, 255, 255, 0.12);
  --sk-shine: rgba(255, 255, 255, 0.26);
}

@media (prefers-reduced-motion: reduce) {
  .sk-section .sk,
  .sk-stat {
    animation: none;
  }
}

/* Leghe & Eventi: the league card, the Topdeck series' row under it
   (js/events-page.js, styles.css "Leghe & Eventi"; the tabs themselves are
   shown from the first frame, outside the loading region). */

.sk-ev-board {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sk-ev-board > .sk {
  height: 64px;
  border-radius: 16px;
}

.sk-ev-board > .sk-ev-big {
  height: 110px;
  border-radius: var(--radius-card-sm);
}

@media (max-width: 820px) {
  .sk-ev-board > .sk-ev-big {
    height: 186px;
  }
}

/* Tiles (Badge, Social), and a plain card (Account). */
.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.sk-grid > .sk {
  height: 180px;
  border-radius: var(--radius-card);
}

.sk-card {
  height: 300px;
  border-radius: var(--radius-card);
}

/* Matchups: the selector beside the title, then the matrix. */
.sk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sk-toolbar .sk-search {
  width: 220px;
  height: 40px;
}

.sk-matrix {
  height: 560px;
  border-radius: var(--radius-card);
}

/* Touch screens: no heading line over the matrix (no title; its "Crea
   tabella personalizzata" under the matrix — js/matchups-page.js), so the
   matrix first, then that button, centred. */
html.app-header .sk-page.is-matchups .sk-toolbar {
  display: none;
}

.sk-matrix-button {
  width: 220px;
  height: 40px;
  margin: 0 auto;
  border-radius: var(--radius-pill);
}

/* Content gets built (and its entrance animations technically start
   playing) behind the splash while data is still loading, well before the
   splash itself fades out — without this, everything would already be
   sitting fully settled the moment the splash clears, silently skipping
   the animation entirely. Pausing every animation on the page while
   .is-loading is present holds each one at its very first frame; js/
   page-loading.js removes the class at the same moment it hides the
   splash, so every element's entrance animation starts playing together,
   in sync, right as the page becomes visible. */
body.is-loading * {
  animation-play-state: paused;
}

/* The same pause for entrance animations declared with a selector that
   outranks `body.is-loading *` above (an id, or two classes): their
   `animation` shorthand resets the play state to running, so they'd play —
   and finish — unseen while the page is still loading. Any new one like
   them goes here too. */
body.is-loading input[type="search"]:not(#site-search-input),
body.is-loading .detail-hero .player-card,
body.is-loading .evo-plot > svg,
body.is-loading .evo-colour svg {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .page-loading-overlay {
    transition: none;
  }
}

/* Pushes the footer to the bottom of the viewport on short pages, while
   letting it sit below the content as usual once content overflows it. */
main,
.page-main {
  flex: 1 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Content links (player/commander/event/league references scattered through
   tables and text) read as normal text rather than the browser's blue +
   underline default; classed links (nav, buttons, cards, breadcrumbs) set
   their own color/decoration and so aren't affected by this. */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Compact header, identical markup duplicated at the top of every page (see
   js/layout.js for why it isn't fetched/injected at runtime). Named so a
   cross-document view-transition treats it as one continuous element
   instead of cross-fading it — it's pixel-identical between pages, so this
   makes it stay fully static across a navigation instead of "reloading". */
.site-header {
  /* position + z-index, not just the search dropdown's own z-index: 60 —
     view-transition-name (below) forces this element into its own stacking
     context regardless of position, but without an explicit z-index that
     context still only ranks as z-index: 0 among its siblings. .site-nav
     right below declares an explicit z-index: 20 of its own, which beat
     it (and, with it, the z-index: 60 search dropdown painted inside this
     stacking context — a descendant's z-index only ever competes with its
     OWN stacking context's siblings, never escapes past it) regardless of
     that 60, making the dropdown render as if tucked behind the nav bar.
     25 only needs to clear .site-nav's 20. */
  position: relative;
  z-index: 25;
  background:
    linear-gradient(135deg, var(--brand-red-dark), rgba(220, 24, 28, 0.96)),
    var(--brand-red);
  color: white;
  /* Vertical padding trimmed from 18px to 15px, exactly offsetting the
     logo/text size bump below (.site-logo-sm/.site-header-brand) — the
     header's own total height stays the same, only what's inside it grows. */
  padding: 15px 20px;
  box-shadow: 0 20px 45px rgba(103, 16, 20, 0.22);
  view-transition-name: site-header;
}

/* Centering used to live on .site-header-brand itself (the header's only
   child) — now that the search box sits beside it, this wrapper does the
   centering/max-width instead, with the brand and the search as two flex
   children spaced apart. */
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

.site-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.site-logo-sm {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Site-wide search (js/site-search.js) — one shared markup block for both
   desktop and mobile, styled entirely differently by CSS rather than two
   separate widgets: desktop shows an always-visible translucent pill with
   a live field right in the header; html.nav-mobile (the same touch-only
   gate as the rest of the site's mobile chrome, see the .site-nav comment
   below) collapses that to a round trigger button that opens the same
   field + results as a full-screen overlay instead. Results are a live
   dropdown either way — see js/site-search.js — never a separate results
   page. */
.site-search-trigger {
  display: none;
}

html.nav-mobile .site-search-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--brand-red);
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.site-search-trigger svg {
  width: 19px;
  height: 19px;
}

/* The header's right side: search, then the account button —
   margin-left: auto keeps both together at the right end of
   .site-header-inner's space-between row (a third child would otherwise
   pull search into the middle). */
.site-search {
  margin-left: auto;
}

/* The public pages: the bell (.site-news) first, then the search and the
   account button — the bell takes the push to the right instead (admin's
   header has no bell: its search keeps it). */
.site-news {
  margin-left: auto;
}

.site-news + .site-search {
  margin-left: 0;
}

/* The bell: on a computer always there (the bar's tab row leaving room for
   it); on touch screens on every page but those with a hero (their header
   over the art keeps just the search and the account) — hidden there, the
   search taking the push back; the page transition pops it in / out
   ("Page transitions" below). */
html.app-header body:has(.page-main .profile-hero) .site-news {
  display: none;
}

html.app-header body:has(.page-main .profile-hero) .site-news + .site-search {
  margin-left: auto;
}

html:not(.nav-mobile) {
  --bar-news: calc(38px + var(--bar-gap));
}

/* Account button (js/header-account.js, links to account.html): the same
   round 38px shape as the phone's search button. Desktop: translucent like
   the search pill beside it; touch devices (html.nav-mobile): white with a
   red icon, like the search trigger. Signed in with a Google picture: the
   picture fills the circle inside a white ring. */
.site-account {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  transition: background 150ms ease, border-color 150ms ease;
}

.site-account:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
}

.site-account:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

html.nav-mobile .site-account {
  border: none;
  background: #fff;
  color: var(--brand-red);
  box-shadow: var(--shadow-card);
}

.site-account.is-signed-in:has(.site-account-avatar) {
  border: 2px solid #fff;
}

.site-account-icon {
  width: 19px;
  height: 19px;
}

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

/* "Novità" (js/header-news.js): a bell before the search, the same round
   button as its neighbours — on a computer translucent like the account
   button, on touch screens white with a red icon like the search one (46px
   with the phone header, html.app-header). A red badge on its top-right
   corner counts the announcements not opened yet. */
.site-news {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 700ms ease;
}

.site-news:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.26);
}

.site-news:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.site-news-icon {
  width: 19px;
  height: 19px;
}

.site-news-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: var(--radius-pill);
  background: #dc181c;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(80, 10, 14, 0.3);
}

.site-news-badge[hidden] {
  display: none;
}

html.nav-mobile .site-news {
  border: none;
  background: #fff;
  color: var(--brand-red);
  box-shadow: var(--shadow-card);
}

html.app-header .site-news {
  width: 46px;
  height: 46px;
}

html.app-header .site-news-icon {
  width: 22px;
  height: 22px;
}

/* Phone header on a page without a hero: a light edge like the search
   button's; over a hero: a deeper shadow, the icon in the hero's colour. */
html.app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-news {
  border: 1px solid rgba(154, 28, 32, 0.22);
  box-shadow: 0 2px 8px rgba(80, 10, 14, 0.1);
}

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-news {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

html.app-header .site-header.has-hero-accent .site-news {
  color: var(--hero-accent-deep);
}

/* Only while something is unread (js/header-news.js .has-news) — until
   then hidden, the search taking the push back (the desktop bar's tab row
   keeps the bell's room, --bar-news, so nothing moves when it comes).
   Arriving (.is-arriving) it grows in and fades, then swings once, its
   count a beat after; leaving (.is-leaving) it shrinks away. */
.site-news:not(.has-news) {
  display: none;
}

.site-news:not(.has-news) + .site-search {
  margin-left: auto;
}

.site-news.is-arriving {
  animation: news-arrive 420ms cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.site-news.is-arriving .site-news-icon {
  transform-origin: 50% 12%;
  animation: news-swing 760ms ease-in-out 360ms both;
}

.site-news.is-arriving .site-news-badge {
  animation: news-arrive 300ms cubic-bezier(0.2, 0.9, 0.3, 1.3) 240ms both;
}

.site-news.is-leaving {
  animation: news-leave 200ms ease-in both;
}

@keyframes news-arrive {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
}

@keyframes news-leave {
  to {
    opacity: 0;
    transform: scale(0.5);
  }
}

@keyframes news-swing {
  20% {
    rotate: 14deg;
  }

  40% {
    rotate: -11deg;
  }

  60% {
    rotate: 7deg;
  }

  80% {
    rotate: -3deg;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-news:is(.is-arriving, .is-leaving),
  .site-news.is-arriving :is(.site-news-icon, .site-news-badge) {
    animation: none;
  }
}

.site-search-box {
  position: relative;
}

.site-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  /* Narrower with the window (240px from 800px wide, 150px from 500px
     down), leaving the site's name room beside it; touch screens size their
     own (html.nav-mobile, the full-screen search). */
  width: clamp(150px, 30vw, 240px);
  transition: background 150ms ease, border-color 150ms ease;
}

.site-search-field:focus-within {
  background: rgba(255, 255, 255, 0.26);
  border-color: rgba(255, 255, 255, 0.5);
}

.site-search-field-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.85);
}

/* A computer: its lines as thick on screen as the bell's beside it (2.2 at
   19px — 2.45 at this 17px). */
html:not(.nav-mobile) .site-search-field-icon {
  stroke-width: 2.45;
}

.site-search-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  /* The placeholder ends with "…" once the pill is too narrow for it. */
  text-overflow: ellipsis;
}

.site-search-input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

/* The browser's own built-in "clear" cross inside type="search" inputs —
   redundant with (and, on mobile, visually crowding) .site-search-close,
   which already serves the same purpose there; on desktop nothing else
   closes the field at all (blur/Escape do that instead), so it's not
   needed there either. */
.site-search-input::-webkit-search-cancel-button {
  display: none;
}

.site-search-close {
  display: none;
}

.site-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  max-height: 70vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card-sm);
  box-shadow: var(--shadow-card-hover);
  padding: 10px;
  z-index: 60;
}

.site-search-box.is-open .site-search-results {
  display: block;
  animation: cs-menu-in 140ms ease both;
}

/* One flat list, no per-type section headings — each row names its own
   type via .site-search-result-type instead (a small pill, not the same
   solid/bold .badge-status pill used for event/league open-closed state
   elsewhere, so it reads as a lighter-weight label rather than a status).
   Same roomy sizing on desktop's dropdown and mobile's full-screen overlay. */
.site-search-result {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 10px;
  border-radius: 10px;
  color: var(--text-body);
  font-size: 1.05rem;
}

/* Mobile's full-screen overlay only (desktop's dropdown has none): a
   hairline between rows — a separate 1px line rather than a border-top,
   which would bend along the row's rounded corners (kept for the hover
   highlight) instead of running straight edge to edge. */
html.nav-mobile .site-search-result + .site-search-result::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--hairline);
}

/* Name (+ an event's league tag) on one line. Both parts truncate, but the
   league's huge flex-shrink makes it give up its width long before the
   name does — the name only ever gets cut once the tag is already gone. */
.site-search-result-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.site-search-result-name,
.site-search-result-league {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-search-result-name {
  flex: 0 1 auto;
}

/* The league, in a muted uppercase tag inline after the result's name. */
.site-search-result-league {
  flex: 0 1000 auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* The type tag: opaque (nothing behind it — the overlay's watermark —
   shows through), in the site's small-caps chip style (like "Conclusa",
   the timeline's kickers): a light tint of the red, a hairline edge, the
   deep red; dark mode a deep red-brown with a light red. */
.site-search-result-type {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--brand-red) 9%, #fff);
  color: var(--brand-red-deep);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:root[data-theme="dark"] .site-search-result-type {
  border-color: rgba(255, 110, 110, 0.25);
  background: color-mix(in srgb, var(--brand-red) 22%, #1e1517);
  color: #ffb3b4;
}

.site-search-result:hover {
  background: var(--hairline-hover);
  text-decoration: none;
}

.site-search-hint {
  margin: 0;
  padding: 16px 10px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 1rem;
}

/* Mobile: the round trigger opens this same block as a full-screen overlay
   instead of a dropdown under a small inline pill — position/size/color
   overridden wholesale rather than incrementally, since almost nothing
   about the desktop layout (an absolutely-positioned white card floating
   under a translucent-on-red pill) still applies once this is covering the
   whole viewport. The field switches to a normal light/dark-aware input
   (like .field input elsewhere) instead of translucent-on-red, since its
   background is no longer the red header. */
html.nav-mobile .site-search-field {
  width: auto;
  flex: 1;
  background: #fff;
  border-color: var(--hairline);
}

/* The close button is position: fixed now (see .site-search-close) — no
   longer a flex sibling .site-search-bar itself reserves room for
   automatically, so the field would otherwise stretch to flex: 1's full
   width and run underneath it. Reserved explicitly instead, sized to the
   button's own real width (from its rect) plus a bit of breathing room.
   min-height pins the bar to that same real size too — .site-search-bar's
   own padding-top (../..) only matches its TOP edge to the button's, not
   its center; without a matching height, .site-search-field's own
   padding/line-height can make the bar taller than the 38px button, so
   align-items: center here was centering the field against a row bigger
   than the button, not against the button itself. Only actually visible on
   a touch device wide enough that this is still onscreen at all (iPad) —
   a phone-width viewport has the same mismatch, just usually too subtle to
   notice at that size. */
html.nav-mobile .site-search-bar {
  /* The ✕ sits where the header's search button was — no longer the
     header's last button since the account button came after it, so its
     distance from the screen's right edge (--search-close-right) counts
     too, not just its size: the field stops 10px before it. The overlay's
     own 16px side padding is already part of that distance. */
  padding-right: calc(var(--search-close-right, 16px) + var(--search-close-size, 38px) - 6px);
  min-height: var(--search-close-size, 38px);
}

html.nav-mobile .site-search-field-icon {
  color: var(--text-muted);
}

html.nav-mobile .site-search-input {
  color: var(--text-body);
}

html.nav-mobile .site-search-input::placeholder {
  color: var(--text-muted);
}

/* Pinned to the exact spot/size the trigger button itself occupies
   (js/site-search.js sets these custom properties from the trigger's own
   getBoundingClientRect(), same call already made for the circle-reveal's
   own origin) rather than wherever .site-search-bar's flex layout would
   otherwise put it — reads as "the same button, still there" through the
   whole open animation, not a second, differently-placed close affordance
   that only shows up once the overlay has finished expanding. Taken out of
   .site-search-bar's normal flex flow entirely (position: fixed) — see
   .site-search-bar's own padding-right below for how the field avoids
   running underneath it. */
html.nav-mobile .site-search-close {
  display: grid;
  place-items: center;
  position: fixed;
  top: var(--search-close-top, 12px);
  right: var(--search-close-right, 16px);
  width: var(--search-close-size, 38px);
  height: var(--search-close-size, 38px);
  z-index: 201;
  border: none;
  border-radius: 50%;
  background: var(--brand-red);
  color: #fff;
  cursor: pointer;
}

html.nav-mobile .site-search-close svg {
  width: 18px;
  height: 18px;
}

/* The ✕ turning from the search button: from the trigger's spot (left of
   the account button, --search-close-dx), colours and magnifier to the
   header's right end, red, the ✕ — the magnifier turning away as the ✕
   turns in (stacked); the same backwards while the overlay collapses. */
.site-search-close-glass {
  display: none;
}

html.nav-mobile .site-search-close > svg {
  grid-area: 1 / 1;
}

html.nav-mobile .site-search-close > .site-search-close-glass {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0;
}

html.nav-mobile .site-search-box.is-open .site-search-close {
  animation: search-close-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html.nav-mobile .site-search-box.is-open .site-search-close > svg:not(.site-search-close-glass) {
  animation: search-close-x-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html.nav-mobile .site-search-box.is-open .site-search-close > .site-search-close-glass {
  animation: search-close-glass-out 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

html.nav-mobile .site-search-box.is-closing .site-search-close {
  animation: search-close-in 320ms cubic-bezier(0.4, 0, 1, 1) reverse both;
}

html.nav-mobile .site-search-box.is-closing .site-search-close > svg:not(.site-search-close-glass) {
  animation: search-close-x-in 320ms cubic-bezier(0.4, 0, 1, 1) reverse both;
}

html.nav-mobile .site-search-box.is-closing .site-search-close > .site-search-close-glass {
  animation: search-close-glass-out 320ms cubic-bezier(0.4, 0, 1, 1) reverse both;
}

@keyframes search-close-in {
  from {
    transform: translateX(var(--search-close-dx, 0px));
    background: var(--search-trigger-bg, #fff);
    color: var(--search-trigger-fg, var(--brand-red));
  }
}

@keyframes search-close-x-in {
  from {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
  }
}

@keyframes search-close-glass-out {
  from {
    opacity: 1;
    transform: none;
  }

  to {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
  }
}

html.nav-mobile .site-search-results {
  display: none;
  position: static;
  width: auto;
  max-width: none;
  max-height: none;
  flex: 1;
  margin-top: 16px;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

/* Hidden outright until opened — without this, the box (with no display
   override otherwise) would still render as a normal block sitting next to
   the trigger in the header row instead of staying off-screen. */
html.nav-mobile .site-search-box {
  display: none;
}

html.nav-mobile .site-search-box.is-open,
html.nav-mobile .site-search-box.is-closing {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-cream-1);
  padding: 18px 16px;
  /* --search-close-top (js/site-search.js, same rect the close button
     itself is pinned to) rather than a fixed guess — the bar's top edge
     then lands at exactly the button's own top edge regardless of header
     padding/safe-area-inset on this particular page/device, instead of
     the two only coincidentally lining up. The fallback keeps the old
     fixed value for the brief moment before JS has set it at all. */
  padding-top: var(--search-close-top, calc(18px + env(safe-area-inset-top)));
}

/* Expands from the round trigger button's own position (js/site-search.js
   sets --search-origin-x/-y/-max-radius on open, from the trigger's real
   getBoundingClientRect()) out to cover the whole screen, like a ripple —
   a plain fade read as generic and disconnected from the button that
   triggered it; this reads as that same white circle growing into the
   page. --search-max-radius is the exact distance to the farthest
   viewport corner from that point, not a rough percentage, so the circle
   is guaranteed to fully cover the screen at the end of the animation
   regardless of where the trigger sits. Fallback values (top-right-ish)
   only matter if this somehow plays before the custom properties are set. */
html.nav-mobile .site-search-box.is-open {
  animation: search-circle-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes search-circle-in {
  from {
    clip-path: circle(0px at var(--search-origin-x, calc(100% - 45px)) var(--search-origin-y, 45px));
  }
  to {
    clip-path: circle(var(--search-max-radius, 150%) at var(--search-origin-x, calc(100% - 45px)) var(--search-origin-y, 45px));
  }
}

/* Same ripple, reversed — collapses back down into the trigger instead of
   just vanishing, so opening and closing read as one coherent motion
   rather than two unrelated transitions. js/site-search.js keeps this
   rendered (via .is-closing, since display: none can't itself be
   animated) for exactly as long as this takes, then lets it go. */
html.nav-mobile .site-search-box.is-closing {
  animation: search-circle-out 320ms cubic-bezier(0.4, 0, 1, 1) both;
}

@keyframes search-circle-out {
  from {
    clip-path: circle(var(--search-max-radius, 150%) at var(--search-origin-x, calc(100% - 45px)) var(--search-origin-y, 45px));
  }
  to {
    clip-path: circle(0px at var(--search-origin-x, calc(100% - 45px)) var(--search-origin-y, 45px));
  }
}

/* The circle expands on its own; the field cascades in a beat after it,
   once the ripple has substantially grown. A scale-in (coalescing into
   place), not entrance-fade-up's slide-up-from-below — that's a different
   motion vocabulary with no relation to a circular reveal expanding from a
   point, which read as two unrelated animations glued together rather
   than one coherent gesture. Same easing curve as search-circle-in
   itself, not entrance-fade-up's own, so it reads as a continuation of
   that same motion, not a second, differently-paced one.
   .site-search-field specifically, not the whole .site-search-bar — the
   close button lives in that same bar in markup, but is position: fixed
   now (pinned to the trigger's own real spot, see .site-search-close), and
   an animated `transform` on an ancestor becomes the containing block for
   a position: fixed descendant, which would drag the button along with
   this scale instead of leaving it stationary. Only on the way in —
   .is-closing has nothing analogous, the field just leaves with the rest
   of the circle. */
html.nav-mobile .site-search-box.is-open .site-search-field {
  animation: search-content-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: 140ms;
}

@keyframes search-content-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

html.nav-mobile .site-search-box.is-open .site-search-results,
html.nav-mobile .site-search-box.is-closing .site-search-results {
  display: block;
}

/* The overlay's watermark: the DC Piacenza logo, big and very faint (a
   whisper of the brand red), centred behind the field and the results —
   z-index -1 in the overlay's own stacking context, under its contents,
   revealed and collapsed with it. */
html.nav-mobile .site-search-box::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: min(62vw, 300px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: color-mix(in srgb, var(--brand-red) 3.5%, transparent);
  -webkit-mask: url("../dc_pc.svg") center / contain no-repeat;
  mask: url("../dc_pc.svg") center / contain no-repeat;
  pointer-events: none;
}

:root[data-theme="dark"].nav-mobile .site-search-box::before {
  background: color-mix(in srgb, var(--brand-red) 5%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  html.nav-mobile .site-search-box.is-open,
  html.nav-mobile .site-search-box.is-closing,
  html.nav-mobile .site-search-box.is-open .site-search-field,
  html.nav-mobile .site-search-box:is(.is-open, .is-closing) .site-search-close,
  html.nav-mobile .site-search-box:is(.is-open, .is-closing) .site-search-close > svg {
    animation: none;
  }
}

/* Deliberately no view-transition-name here, unlike the header/footer: this
   bar's content genuinely differs between pages (a different active tab),
   so treating it as a single "continuous" element across a navigation
   isn't right — left as part of the ordinary root crossfade instead. */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 8px 18px rgba(69, 29, 34, 0.05);
}

.site-nav-inner {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Below desktop width, seven tabs wrapping to two uneven lines looks messy —
   a single horizontally-scrollable row (swipe on touch, drag-scroll with a
   mouse) reads much cleaner and still reaches every tab. */
@media (max-width: 900px) {
  .site-nav-inner {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .nav-link {
    flex-shrink: 0;
  }
}

/* Trebuchet MS's own "&" reads as fairly chunky/plain — Arial/Helvetica
   draw the classic, more familiar ampersand shape instead, still upright
   and at the surrounding text's own bold weight (not italic, not
   lightened), just a plain sans-serif swap rather than a stylistic one. */
.amp {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0 2px;
}

/* In the heroes' back pill ("‹ Leghe & Eventi"): the same "&" as the nav's
   tab beside it — its weight, not the pill's heavier text's. */
.detail-hero-back .amp {
  font-weight: 700;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--brand-red-darker);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.nav-link:hover {
  background: #fff7f4;
  border-color: var(--hairline);
  /* A pill, not a text link: no underline from the global a:hover. */
  text-decoration: none;
}

/* Active-tab highlight driven entirely by matching <body data-active-nav>
   (set statically per page, already in every page's HTML) against each
   link's own data-nav — no JS, no separate pill element, no per-navigation
   positioning/animation at all. Social is deliberately excluded from this
   shared red group — see .nav-link[data-nav="social"] below for its own
   blue treatment instead. */
body[data-active-nav="current"] .nav-link[data-nav="current"],
body[data-active-nav="events"] .nav-link[data-nav="events"],
body[data-active-nav="meta"] .nav-link[data-nav="meta"],
body[data-active-nav="players"] .nav-link[data-nav="players"],
body[data-active-nav="account"] .nav-link[data-nav="account"],
body[data-active-nav="current"] .nav-link[data-nav="current"]:hover,
body[data-active-nav="events"] .nav-link[data-nav="events"]:hover,
body[data-active-nav="meta"] .nav-link[data-nav="meta"]:hover,
body[data-active-nav="players"] .nav-link[data-nav="players"]:hover,
body[data-active-nav="account"] .nav-link[data-nav="account"]:hover {
  background: var(--brand-red);
  color: #fff;
  border-color: transparent;
}

/* Social's own tab: pushed to the far right of the row (margin-left: auto,
   the row's only "auto" margin, so everything else keeps its normal
   left-packed flow) and given a blue identity instead of the shared red
   one above — reads as a deliberately distinct, "external link" kind of
   tab rather than one more page among the others. No effect once the row
   becomes the mobile dropdown's vertical list (html.nav-mobile
   .site-nav-inner is flex-direction: column there — margin-left has no
   axis to push along), it just sits last, same as before. */
.nav-link[data-nav="social"] {
  margin-left: auto;
  color: var(--social-blue-text);
}

.nav-link[data-nav="social"]:hover {
  background: rgba(47, 95, 214, 0.08);
  border-color: rgba(47, 95, 214, 0.3);
}

body[data-active-nav="social"] .nav-link[data-nav="social"],
body[data-active-nav="social"] .nav-link[data-nav="social"]:hover {
  background: var(--social-blue);
  color: #fff;
  border-color: transparent;
}

/* Real touch devices only, via html.nav-mobile — set in JS purely from
   navigator.maxTouchPoints > 0 (see every page's inline head script), not
   a CSS media query. That's deliberate: an earlier version gated this
   whole block on `@media (max-width: 640px) and (pointer: coarse) and
   (hover: none)` in addition to the class, on the theory that (pointer:
   coarse) and (hover: none) reliably meant "touch, no mouse" (true for
   phones, false for a resized desktop window or a touch laptop with a
   trackpad, which are naturally pointer: fine/hover: hover instead). In
   practice, some Android OEM browsers — Samsung Internet included —
   misreport those media features on a real touch phone, so the CSS media
   query silently failed to match even once html.nav-mobile was already
   correctly set, and the touch nav's styling just never applied. Every rule
   below is scoped by html.nav-mobile alone now — simpler, and the
   only thing actually gating it. Same inline-head-script pattern as the
   dark/light theme flash-prevention script right above it in every page's
   <head>, so there's no gap where the plain full-width nav flashes on
   screen before collapsing — true no-JS still gets that plain,
   always-visible, working list instead of a hidden/broken nav. Accepted
   trade-off: this now also covers touch laptops and tablets (iPad
   included, if narrow enough — though iPad's own viewport is normally
   well above 640px anyway) rather than excluding them on purpose. */

  /* Fills all the way up behind a translucent iOS status bar (see
     apple-mobile-web-app-status-bar-style in every page's <head>) and
     Android's own edge-to-edge status bar, instead of the red background
     stopping short and leaving a plain white strip above it — env()
     resolves to 0 on anything without a notch/inset, so this is a no-op
     everywhere else. */
  html.nav-mobile .site-header {
    padding-top: calc(9px + env(safe-area-inset-top));
  }

  /* The tab bar docked to the screen's bottom edge, the whole width (css/6
     "Tab bar" — since 2026-11-06; before, a capsule floating 16px up). Its
     own bottom padding keeps the tabs clear of the home-indicator gesture
     bar on notched phones. --tab-bar-h: its height without that safe area,
     for what sits above it ("Torna all'inizio", the install card). */
  html.nav-mobile {
    --tab-bar-h: 64px;
  }

  html.nav-mobile .site-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    background: none;
    backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
    padding: 0;
  }

  /* Out of the way while reading: scrolling down slides the tab bar below the
     screen's bottom edge, scrolling up brings it back (js/nav-dropdown.js
     .is-scrolled-away) — by a transform, its height plus room for its
     shadow. */
  html.nav-mobile .site-nav {
    transition: transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  html.nav-mobile .site-nav.is-scrolled-away {
    transform: translateY(calc(100% + 24px));
  }

  @media (prefers-reduced-motion: reduce) {
    html.nav-mobile .site-nav {
      transition: none;
    }
  }

  /* Rubber-band/pull-to-refresh bounce reads as "a webpage in a browser
     tab" — a real installed app doesn't do this, so it's turned off here
     (touch-scrolling devices only; a mouse wheel on desktop never
     triggered it in the first place, so nothing changes there). */
  html.nav-mobile,
  html.nav-mobile body {
    overscroll-behavior-y: contain;
  }

  /* No footer on touch screens — a web page's, not an app's: its switches
     and small print are in the Profilo page's "Impostazioni"
     (js/settings-panel.js). */
  html.nav-mobile footer {
    display: none;
  }

  /* A page shorter than the screen would leave its bottom under the tab bar
     (which never slides away without scrolling): every page at least a
     screen tall (the large viewport — browser bars hidden — so it never
     peeks in), so it scrolls down to its end, which slides the bar away
     (js/nav-dropdown.js, at the bottom however little the page scrolls). */
  html.nav-mobile .page-main {
    min-height: 100vh;
    min-height: 100lvh;
  }

@media (max-width: 480px) {
  .site-header {
    /* Same trade-off as the desktop rule above — padding trimmed by
       exactly as much as the logo grows, so total header height holds. */
    padding: 9px 16px;
  }

  /* Logo + title + two round buttons (search, account) in one row: the
     title scales with the screen width (14px at 360px, 16px at 412px, up to
     1.1rem) instead of a fixed size, the logo and gaps a touch smaller —
     enough for "Duel Commander Piacenza" to stay on one line on a common
     phone; on a narrower one it wraps to two lines rather than being cut. */
  .site-header-inner {
    gap: 12px;
  }

  .site-header-brand {
    font-size: clamp(0.82rem, 3.9vw, 1.1rem);
    gap: 8px;
  }

  .site-logo-sm {
    width: 34px;
    height: 34px;
  }

  .nav-link {
    padding: 7px 12px;
    font-size: 0.86rem;
  }
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 42px 20px 36px;
}

.card {
  border: 1px solid rgba(154, 28, 32, 0.12);
  padding: 22px;
  margin-bottom: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 42px rgba(69, 29, 34, 0.08);
  backdrop-filter: blur(10px);
  animation: entrance-fade-up 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Same idea as the metagame ring chart's own entrance (pie-ring-in below) —
   applied directly on the class rule rather than toggled by JS, so any
   freshly-rendered card/table just plays it on insertion, everywhere on the
   site (public pages and admin alike) without every call site needing to
   know about it. */
@keyframes entrance-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Repeating list/grid items (event & league cards, dashboard chips/rows) —
   stagger the first few so they cascade in instead of popping as one flat
   block. Capped at 6 steps: a long list re-using the last delay for every
   item past that reads better than a multi-second queued cascade. */
.stat-tile:nth-child(2),
.badge-card:nth-child(2) {
  animation-delay: 45ms;
}

.stat-tile:nth-child(3),
.badge-card:nth-child(3) {
  animation-delay: 90ms;
}

.stat-tile:nth-child(4),
.badge-card:nth-child(4) {
  animation-delay: 135ms;
}

.stat-tile:nth-child(5),
.badge-card:nth-child(5) {
  animation-delay: 180ms;
}

.stat-tile:nth-child(n + 6),
.badge-card:nth-child(n + 6) {
  animation-delay: 225ms;
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .history-panel,
  .admin-form-card,
  .admin-topbar h1,
  input[type="search"],
  .stat-tile,
  .pie-chart-wrap,
  .badge-card,
  .bar-chart-row,
  .player-card,
  .pc-art,
  .league-recap-card,
  .rival-card,
  .ev-tile,
  .matchups-matrix-wrap,
  .evo-plot > svg,
  .evo-colour svg {
    /* !important: most of these declare their own animation later in this
       file, which would otherwise win on source order (equal specificity)
       and keep animating despite the visitor's reduced-motion setting. */
    animation: none !important;
  }
}

.card h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}

/* .card's own margin-bottom (for normal document-flow stacking elsewhere)
   would otherwise stack on top of the flex/grid gaps above. */
.dashboard-card {
  margin-bottom: 0;
}

.home-board .dashboard-standing {
  border-color: rgba(154, 28, 32, 0.2);
  background: #fff;
  box-shadow: 0 2px 8px rgba(80, 10, 14, 0.07);
}

.home-board a.dashboard-standing:hover {
  border-color: rgba(154, 28, 32, 0.34);
  background: color-mix(in srgb, #dc181c 4%, #fff);
}

/* "Classifica completa" under the top 8 (js/home.js), centred, a small
   list icon before it: the rest of the ranking, on league.html (and the
   Eventi's "Tutti gli eventi" under the timeline, a calendar before it). Beside
   it (since 2026-10-30 — it was on the league's name's line, now the
   ring's), "Regolamento" (js/league-rules.js — the scoring rules' pop-up),
   a book before it: the same pill, a button. */
.dashboard-league-more-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 0;
}

.dashboard-league-more,
.dashboard-league-rules {
  gap: 8px;
}

.dashboard-league-rules {
  flex-shrink: 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.dashboard-league-more svg,
.dashboard-league-rules svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

/* The open league's standings preview (js/home.js): the top 8 as compact
   sub-cards like league.html's Classifica (.history-item, each a link to
   the player) — position chip, name + badges, points on the right. */
.dashboard-standings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

/* Two classes: .history-item's own padding comes later in this file. */
.dashboard-standings .dashboard-standing {
  padding: 8px 10px;
  gap: 10px;
}

.dashboard-standing .history-lead {
  gap: 10px;
}

.dashboard-standing .history-pos {
  min-width: 34px;
  height: 34px;
  font-size: 0.85rem;
}

/* The name (+ handle) comes first: always shown whole — cut with an
   ellipsis only if it alone is wider than the column — and the player
   badges get whatever room is left after it, as many *whole* badges as fit:
   their strip is one disc tall with overflow hidden and wraps, so a badge
   that doesn't fit drops onto the hidden second line instead of showing
   half cut off. */
.dashboard-standings-name {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  min-width: 0;
  color: var(--text-title);
  font-weight: 800;
}

.dashboard-standings-name-text {
  flex: 0 0 auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 150ms ease;
}

a.dashboard-standing:hover .dashboard-standings-name-text {
  color: var(--brand-red-deep);
}

.dashboard-standings-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  /* One .badge-disc tall: 1.6em of .icon-badge's 1rem. */
  height: 1.6rem;
  overflow: hidden;
}

.dashboard-standings-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.dashboard-standings-points .history-stat-value {
  color: var(--brand-red-deep);
}

/* ---------------------------------------------------------------------------
   The Bacheca (index.html, js/home.js): no hero (that's for the profile-like
   pages) — the title, then three sections in the site's boxless lists:
   Eventi (league.html's timeline, .league-timeline: the next few events
   above "Oggi", the latest played below), Classifica (the league in
   progress, or the latest finished one's final standings, "Conclusa") and
   Più giocati (the bubble charts). A computer: Eventi and Classifica side by
   side, Più giocati under them (one column below 860px); touch screens: one
   at a time behind the site's segmented control (.profile-tabs, js/tabs.js
   — sticky, like event.html's).
   --------------------------------------------------------------------------- */
.home-board {
  display: grid;
  /* Two equal halves (since 2026-10-30 — was 1.1fr / 1fr): the hairline
     between them, and the stories' bar's above them, in the page's middle. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 30px 32px;
}

.home-panel-meta {
  grid-column: 1 / -1;
}

/* Eventi and Classifica in a card (option C of a mockup, 2026-10-30 —
   everything else on the site is in blocks): on touch screens and narrow
   windows each its own (the tabs above it stay their own control —
   "C2, detached"), on a computer the two one card (below, "A computer").
   Inside, the rows without their own box: a soft fill, no edge, no shadow
   (the timeline's played events and the standings; the upcoming ones keep
   their outline, the next one its red). The timeline's circles filled
   with the card's colour, not the page's (--tl-node-bg). */
.home-board > #home-panel-events,
.home-board > #home-panel-standings {
  --tl-node-bg: #fff;
  box-sizing: border-box;
  padding: 16px 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-card);
}

:root[data-theme="dark"] .home-board > :is(#home-panel-events, #home-panel-standings) {
  --tl-node-bg: #1d1819;
  border-color: rgba(255, 255, 255, 0.1);
  background: #1d1819;
}

html.app-header .home-board > :is(#home-panel-events, #home-panel-standings) {
  padding: 12px 12px 16px;
}

.home-board .home-timeline :is(.is-played, .is-pending) > .league-tl-card,
.home-board .dashboard-standing {
  border-color: transparent;
  background: #fbf6f3;
  box-shadow: none;
}

.home-board .home-timeline :is(.is-played, .is-pending) > a.league-tl-card:hover,
.home-board a.dashboard-standing:hover {
  border-color: transparent;
  background: #f6ece8;
}

/* The timeline's past events a step darker than the Classifica's rows, so
   they stand out from the panel (user's choice 2026-11-03; the endstep /
   external ones: their tints below, 14%). */
.home-board .home-timeline :is(.is-played, .is-pending) > .league-tl-card {
  background: #f5ebe6;
}

.home-board .home-timeline :is(.is-played, .is-pending) > a.league-tl-card:hover {
  background: #efe0da;
}

:root[data-theme="dark"] .home-board .home-timeline :is(.is-played, .is-pending) > .league-tl-card {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

/* (The standings rows' dark look: css/6, with the others' dark rules.) */
:root[data-theme="dark"] .home-board .home-timeline :is(.is-played, .is-pending) > a.league-tl-card:hover {
  background: rgba(255, 110, 110, 0.12);
}

@media (max-width: 860px) {
  .home-board {
    grid-template-columns: minmax(0, 1fr);
  }
}

html:not(.app-header) .home-tabs {
  display: none;
}

html.app-header .home-board {
  grid-template-columns: minmax(0, 1fr);
}

html.app-header .home-board > .home-panel:not(.is-current) {
  display: none;
}

/* A section's heading: its name (Eventi — on a computer only, the tab names
   it on touch screens — or the league's name, a link) and its link on the
   right, on one line (the name cut with "…"). */
.home-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin-bottom: 12px;
}

/* Its icon on a computer (Eventi's calendar, the league's trophy — the
   touch screens' tabs' own), red, before the name. */
.home-head-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-right: -1px;
  color: var(--brand-red);
}

html.app-header .home-head-icon {
  display: none;
}

.home-panel-label {
  flex: 1;
  margin: 0;
  color: var(--text-title);
  font-size: 1.3rem;
}

.home-panel-title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-title);
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-panel-title:hover {
  color: var(--brand-red-deep);
  text-decoration: none;
}

.home-panel-head .section-link {
  flex-shrink: 0;
  min-height: 36px;
  margin: 0 0 0 auto;
  padding: 0 13px;
  gap: 7px;
  font-size: 0.86rem;
  white-space: nowrap;
}

.home-panel-head .section-link svg {
  width: 16px;
  height: 16px;
}

/* "Conclusa": the league's over (between two leagues the Classifica shows
   the latest one's final standings). */
.home-finished-chip {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(123, 100, 102, 0.14);
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:root[data-theme="dark"] .home-finished-chip {
  background: rgba(255, 255, 255, 0.1);
}

/* The ring at the right end of the league's name's line. */
.home-panel-head .league-ring {
  margin-left: auto;
}

.home-board .dashboard-standings {
  margin: 0;
}

/* A size up (user, 2026-10-30 — the rows were squeezed to the timeline's
   height): roomier rows, a bigger position chip, name, points and badges. */
.home-board .dashboard-standings .dashboard-standing {
  padding: 8px 14px 8px 10px;
  gap: 12px;
}

.home-board .dashboard-standing .history-pos {
  min-width: 38px;
  height: 38px;
  font-size: 0.95rem;
}

.home-board .dashboard-standings-name {
  font-size: 1.06rem;
}

.home-board .dashboard-standings-points .history-stat-value {
  font-size: 1.25rem;
}

.home-board .dashboard-standings-points .history-stat-label {
  font-size: 0.68rem;
}

.home-board .dashboard-standings-badges {
  height: 1.76rem;
}

.home-board .dashboard-standings-badges .icon-badge {
  font-size: 1.1rem;
}

/* A finished league's winner: gold, a trophy for its position. */
.home-board .dashboard-standing.is-winner,
:root[data-theme="dark"] .home-board .dashboard-standing.is-winner {
  border-color: rgba(201, 150, 30, 0.55);
  background: linear-gradient(90deg, rgba(240, 190, 60, 0.2), transparent 65%), #fff;
}

:root[data-theme="dark"] .home-board .dashboard-standing.is-winner {
  background: linear-gradient(90deg, rgba(240, 190, 60, 0.2), transparent 65%), rgba(255, 255, 255, 0.08);
}

.home-board .history-pos.is-winner {
  background: linear-gradient(135deg, #f3c74b, #c9961e);
  color: #fff;
  font-size: 0.95rem;
}

/* Eventi: the timeline (its own size container, like league.html's list —
   the full date on the left of the line from 620px). In time order like
   league.html's — the played ones, "Oggi", the upcoming ones — so the base
   timeline's colours apply: red up to the next event, grey after it. The
   kicker (the league) on one line. */
#home-timeline {
  container-type: inline-size;
}

.home-timeline .league-tl-k {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* No room under the last card (it's for the next one): the list ends with
   it — on a computer Classifica beside it ends level. */
.home-timeline > :last-child {
  padding-bottom: 0;
}

/* A played event's links behind one "Liste" button (js/results-link.js
   nestedResultsMenu) — the same on every row — opening a small menu of
   them (.results-menu, on <body>). */
.results-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--brand-red-deep);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}

.results-menu-btn svg {
  width: 14px;
  height: 14px;
}

.results-menu-btn:hover,
.results-menu-btn[aria-expanded="true"] {
  border-color: var(--hairline-hover);
  background: #fff7f4;
}

:root[data-theme="dark"] .results-menu-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  /* A light shade of the page's red — a hero's colour on its page. */
  color: color-mix(in srgb, var(--brand-red) 55%, #fff);
}

:root[data-theme="dark"] .results-menu-btn:hover,
:root[data-theme="dark"] .results-menu-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.results-menu {
  position: fixed;
  z-index: 60;
  display: grid;
  gap: 2px;
  min-width: 210px;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-card-hover);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.results-menu.is-above {
  transform: translateY(4px);
}

.results-menu.is-open {
  opacity: 1;
  transform: none;
}

:root[data-theme="dark"] .results-menu {
  border-color: rgba(255, 255, 255, 0.1);
  background: #241b1d;
}

/* One row per link: its logo in a same-width white box (the mtgtop8
   wordmark is only readable on white), the label. */
.results-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--text-title);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.results-menu-item:hover,
.results-menu-item:focus-visible {
  background: color-mix(in srgb, var(--brand-red) 8%, transparent);
  color: var(--text-title);
  text-decoration: none;
}

.results-menu-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 70px;
  height: 36px;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: #fff;
}

.is-moxfield .results-menu-logo img {
  width: 23px;
  height: 23px;
}

.is-top8 .results-menu-logo img {
  width: auto;
  height: 14px;
}

/* An online event's link to endstep.cc (migration 036): endstep's logo in
   its own colours, gold on its near-black. */
.is-endstep .results-menu-logo {
  border-color: transparent;
  background: var(--endstep-ink);
  color: var(--endstep-gold);
}

.is-endstep .results-menu-logo svg {
  width: 22px;
  height: 22px;
}

/* Every event the same: one row as tall as its date's circle — the circle
   and the card side by side, level top and bottom; the name over the league
   on the left (each shrunk to fit its line — js/home.js fitTimelineNames,
   down to 12px — and only then cut with "…"), the extra on the right,
   centred (the played ones' Moxfield / Top 8 links) — the upcoming ones'
   time alone, down on the league's line. The upcoming cards bare (no
   surface), their names as readable as the played ones'. */
.league-timeline.home-timeline {
  --tl-node: 56px;
}

.home-timeline .league-tl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--tl-node);
  padding: 0 16px;
}

.home-timeline .league-tl-text {
  flex: 1 1 auto;
}

.home-timeline .league-tl-side {
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

/* league.html's list (the same look): a played event's players in its
   line — the 👥 icon at the text's size. */
.league-tl-players {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.league-tl-players svg {
  width: 1.15em;
  height: 1.15em;
}

/* The name first, the league under it — an upcoming event's time on the
   league's line, sharing its baseline: at the card's bottom right. */
.league-tl-k-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.league-tl-k-row .league-tl-k {
  flex: 1 1 auto;
  min-width: 0;
}

/* league.html's upcoming cards: just the name, centred in the card, the
   time on its own at the bottom right — where the line under the name
   would put it. */
.home-timeline .league-tl-time {
  align-self: flex-end;
  margin-bottom: 9px;
}

.home-timeline .is-future .league-tl-t {
  color: var(--text-title);
}

/* The next event's circle: its halo pulsing outwards — 6px at most, the
   phones' page margin (--page-pad-x), so it never reaches the screen's
   edge. A ring behind the circle growing and fading (transform + opacity:
   done by the GPU, nothing repainted per frame — an animated box-shadow
   was, 60 times a second); still where motion is reduced. */
.home-timeline .is-next > .league-tl-node {
  box-shadow: none;
}

.home-timeline .is-next > .league-tl-node::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-red) 55%, transparent);
  animation: home-tl-node-pulse 1.6s ease-out infinite;
}

@keyframes home-tl-node-pulse {
  to {
    opacity: 0;
    transform: scale(1.21);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-timeline .is-next > .league-tl-node::after {
    animation: none;
    opacity: 0.35;
    transform: scale(1.21);
  }
}

/* The upcoming cards outlined like their circles (the same grey). */
.home-timeline .is-future > .league-tl-card {
  border-color: var(--tl-line);
}

/* The upcoming circles: the date as dark as the played ones' (their ring
   grey on league.html, its kind's colour on the Bacheca — below). */
.home-timeline .is-future > .league-tl-node span {
  color: var(--text-muted);
}

/* The Bacheca's three kinds of event (option E2 of a mockup, 2026-11-03 —
   js/home.js): each its own colour and its own big faint logo on the
   card's right (.league-tl-wm, behind the text: the card isolated) — ours
   (.is-local) red with the lotus (dc_pc_lotus.svg, by a mask), online
   endstep's gold and black with its logo (below, .is-online), external
   (played somewhere else, migration 026 — only ever upcoming: deleted the
   night after its day, migration 030) slate blue with the pin: its circle
   and outline, the pin before its Località, the next one slate blue
   instead of red. All the same shape (the externals were a ticket until
   then). Only the Bacheca adds these classes — league.html's timeline
   (.home-timeline too) stays as it was. */
:root {
  --external-blue: oklch(0.52 0.08 245);
}

/* Each kind's colour (--tl-kind) — all three kinds alike (user,
   2026-11-03: ours had been pale upcoming, solid played): the upcoming
   ones' circle in it, solid, their card's outline pale; the played ones' circle ring
   pale, their card's fill tinted with it (ours keep their warm fill on the
   light theme, above — the others' had been ours too; on the dark one all
   three tinted). The next one's circle filled (css/3
   and below). */
.home-timeline .is-local {
  --tl-kind: var(--brand-red);
}

.home-timeline .is-online {
  --tl-kind: var(--endstep-gold);
}

.home-timeline .is-external {
  --tl-kind: var(--external-blue);
}

/* Their "Liste" button in the type's colour too (ours keeps the red of
   .results-menu-btn): darkened to read on its white, lightened on the dark
   theme like the red; its hover tint in it. */
.home-timeline :is(.is-online, .is-external) .results-menu-btn {
  color: color-mix(in oklch, var(--tl-kind) 70%, #000);
}

.home-timeline :is(.is-online, .is-external) .results-menu-btn:is(:hover, [aria-expanded="true"]) {
  background: color-mix(in oklch, var(--tl-kind) 8%, #fff);
}

:root[data-theme="dark"] .home-timeline :is(.is-online, .is-external) .results-menu-btn {
  color: color-mix(in srgb, var(--tl-kind) 55%, #fff);
}

:root[data-theme="dark"] .home-timeline :is(.is-online, .is-external) .results-menu-btn:is(:hover, [aria-expanded="true"]) {
  background: rgba(255, 255, 255, 0.1);
}

.home-timeline :is(.is-local, .is-online, .is-external).is-future > .league-tl-node {
  border-color: var(--tl-kind);
}

.home-timeline :is(.is-local, .is-online, .is-external).is-future > .league-tl-card {
  border-color: color-mix(in oklch, var(--tl-kind) 45%, transparent);
}

/* endstep's gold is much lighter than the red and the blue: at 45% its
   outline all but vanished on the white — stronger on the light theme
   (user, 2026-11-04); the dark one keeps the 45%. */
:root:not([data-theme="dark"]) .home-timeline .is-online.is-future > .league-tl-card {
  border-color: color-mix(in oklch, var(--tl-kind) 85%, transparent);
}

.home-timeline :is(.is-local, .is-online, .is-external).is-played > .league-tl-node {
  border-color: color-mix(in oklch, var(--tl-kind) 40%, transparent);
}

.home-board .home-timeline :is(.is-online, .is-external).is-played > .league-tl-card {
  background: color-mix(in oklch, var(--tl-kind) 14%, #fff);
}

.home-board .home-timeline :is(.is-online, .is-external).is-played > a.league-tl-card:hover {
  background: color-mix(in oklch, var(--tl-kind) 20%, #fff);
}

:root[data-theme="dark"] .home-board .home-timeline :is(.is-local, .is-online, .is-external).is-played > .league-tl-card {
  background: color-mix(in oklch, var(--tl-kind) 8%, rgba(255, 255, 255, 0.05));
}

:root[data-theme="dark"] .home-board .home-timeline :is(.is-local, .is-online, .is-external).is-played > a.league-tl-card:hover {
  background: color-mix(in oklch, var(--tl-kind) 14%, rgba(255, 255, 255, 0.05));
}

.home-timeline :is(.is-local, .is-external) > .league-tl-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.league-tl-wm.is-lotus {
  right: 52px;
  width: 92px;
  height: 92px;
  background: var(--brand-red);
  opacity: 0.1;
  transform: translateY(-50%) rotate(-8deg);
  -webkit-mask: url(../dc_pc_lotus.svg) center / contain no-repeat;
  mask: url(../dc_pc_lotus.svg) center / contain no-repeat;
}

.league-tl-wm.is-pin {
  right: 64px;
  width: 76px;
  height: 76px;
  color: var(--external-blue);
  opacity: 0.13;
  transform: translateY(-50%) rotate(-10deg);
}

/* On a played one's red-tinted fill (dark theme): a lighter red, a little
   stronger, or it sinks into the tint. */
:root[data-theme="dark"] .home-board .is-local.is-played .league-tl-wm.is-lotus {
  background: #ff7a7d;
  opacity: 0.16;
}

/* On the next one's colour: white. */
.is-next .league-tl-wm.is-lotus {
  background: #fff;
  opacity: 0.2;
}

.is-next .league-tl-wm.is-pin {
  color: #fff;
  opacity: 0.2;
}

/* The next one of ours: its red with a lighter glow in the corner, like
   the others' next. */
:root .home-timeline .is-local.is-next > .league-tl-card {
  background: radial-gradient(140% 160% at 100% 0%, #f0484b, var(--brand-red) 65%);
}

.home-timeline .is-external .league-tl-place > svg {
  color: var(--external-blue);
}

:root .home-timeline .is-external.is-next > .league-tl-card {
  border-color: transparent;
  background: radial-gradient(140% 160% at 100% 0%, oklch(0.6 0.09 245), var(--external-blue) 65%);
}

:root .home-timeline .is-external.is-next > .league-tl-node {
  border-color: var(--external-blue);
  background: var(--external-blue);
}

.home-timeline .is-external.is-next > .league-tl-node::after {
  background: color-mix(in oklch, var(--external-blue) 55%, transparent);
}

:root .home-timeline .is-external.is-next .league-tl-place > svg {
  color: #fff;
}

.league-tl-place {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
}

/* Località - Sito on one line, cut with "…" when longer; the Sito (where
   in the town) in the site's red — white on the red "next" card, the
   Località there a little faded instead. */
.league-tl-place-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-tl-venue {
  color: var(--brand-red-deep);
}

:root[data-theme="dark"] .league-tl-venue {
  color: #ff9a9d;
}

.is-next .league-tl-venue,
:root[data-theme="dark"] .is-next .league-tl-venue {
  color: #fff;
}

.is-next .league-tl-place-text {
  color: rgba(255, 255, 255, 0.78);
}

.league-tl-place svg {
  flex-shrink: 0;
  width: 1.15em;
  height: 1.15em;
  /* The pin is drawn from x 5 of its 24-wide box: pulled left by that blank
     (about 5/24 of its width), its ink lines up with the name above. */
  margin-left: -0.2em;
}

/* endstep's own colours (online leagues and events, migration 034 —
   ENDSTEP_PLAN.md): its gold on its near-black, a second dark shade, light
   and muted text for on the dark; --endstep-gold-deep: the gold dark enough
   to read on white (the gold itself on the dark theme). */
:root {
  --endstep-gold: oklch(0.8 0.135 80);
  --endstep-gold-deep: oklch(0.62 0.12 75);
  --endstep-ink: oklch(0.175 0.014 82);
  --endstep-ink-2: oklch(0.24 0.016 82);
  --endstep-text: #f3eee4;
  --endstep-muted: #b9ae9b;
}

:root[data-theme="dark"] {
  --endstep-gold-deep: var(--endstep-gold);
}

/* Played online on endstep (js/ui.js ENDSTEP_MARK): endstep's logo alone,
   no disc (user's choice, 2026-11-03 — it had been gold on a near-black
   disc), the size of the pin before an external's Località, in the gold
   dark enough to read on white (--endstep-gold-deep, the gold itself on the
   dark theme) — before an online event's league on the Bacheca's timeline
   (the gold on the dark "next" card, below), in Leghe & Eventi's labels. */
.endstep-mark {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--endstep-gold-deep);
}

.endstep-mark svg {
  width: 1.05em;
  height: 1.15em;
}

/* Its line (.league-tl-k, clipped for its "…") lets it out — the place's
   text cuts itself (.league-tl-place-text). */
.league-tl-place .endstep-mark {
  margin-right: 2px;
}

.league-tl-place .endstep-mark svg {
  width: 1.05em;
  height: 1.15em;
  margin: 0;
}

.home-timeline .league-tl-k:has(> .league-tl-place > .endstep-mark) {
  overflow: visible;
}

/* An online event on the Bacheca's timeline (option B5 of a mockup, with
   no gold edge — js/home.js; the model for the other kinds' look, above):
   its circle ringed in gold; endstep's logo big and faint in its card, on
   the right (.league-tl-wm, behind the text: the card isolated). The next one endstep's instead of red: the card dark
   (a warm glow in its corner), the league and time gold, the circle black
   with a glowing gold ring, its halo pulsing gold. (The :root on the next one's rules outranks
   css/3's red "next" card, dark theme included.) */
.home-timeline .is-online > .league-tl-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.league-tl-wm {
  position: absolute;
  top: 50%;
  right: 58px;
  z-index: -1;
  width: 84px;
  height: 84px;
  color: var(--endstep-gold);
  opacity: 0.18;
  transform: translateY(-50%) rotate(-12deg);
  pointer-events: none;
}

.league-tl-wm svg {
  display: block;
  width: 100%;
  height: 100%;
}

:root .home-timeline .is-online.is-next > .league-tl-card {
  border-color: transparent;
  background: radial-gradient(140% 160% at 100% 0%, var(--endstep-ink-2), var(--endstep-ink) 65%);
}

:root .home-timeline .is-online.is-next > .league-tl-card :is(.league-tl-k, .league-tl-place-text, .league-tl-side, .endstep-mark) {
  color: var(--endstep-gold);
}

:root .home-timeline .is-online.is-next > .league-tl-card .league-tl-t {
  color: var(--endstep-text);
}

/* Its circle endstep's black with a gold ring and the others' pulsing
   halo in gold (user, 2026-11-03 — it had been solid gold), the date gold. */
:root .home-timeline .is-online.is-next > .league-tl-node {
  border-color: var(--endstep-gold);
  background: var(--endstep-ink);
}

:root .home-timeline .is-online.is-next > .league-tl-node :is(b, span) {
  color: var(--endstep-gold);
}

/* The halo (::after) paints over the circle's inside — a red disc on the
   red circle never showed, on the black one it turned it brown: the black
   again on a layer above it (::before, inside the ring), under the date. */
.home-timeline .is-online.is-next > .league-tl-node::after {
  z-index: -2;
  background: color-mix(in oklch, var(--endstep-gold) 55%, transparent);
}

.home-timeline .is-online.is-next > .league-tl-node::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--endstep-ink);
}

/* "Oggi": a small red dot on the line, the word, a rule to the right. */
.league-tl-today {
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-node) minmax(0, 1fr);
  align-items: center;
  gap: var(--tl-gap);
  padding-bottom: 12px;
}

.league-tl-today::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--tl-node) / 2 - 1px);
  width: 2px;
  background: var(--brand-red);
}

.league-tl-today:first-child::before {
  top: 50%;
}

.league-tl-today:last-child::before {
  bottom: 50%;
}

.league-tl-today-dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 12px;
  height: 12px;
  border: 3px solid var(--tl-node-bg);
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 0 1px var(--brand-red);
}

.league-tl-today-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--brand-red);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.league-tl-today-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: color-mix(in srgb, var(--brand-red) 35%, transparent);
}

@container (min-width: 620px) {
  .league-tl-today {
    padding-left: calc(110px + var(--tl-gap));
  }

  .league-tl-today::before {
    left: calc(110px + var(--tl-gap) + var(--tl-node) / 2 - 1px);
  }
}

/* "Eventi"'s heading: a computer only (on touch screens the tab names it).
   "Tutti gli eventi" under the timeline, on every screen, like the
   Classifica's "Classifica completa" (.dashboard-league-more-row). */
html.app-header .home-events-head {
  display: none;
}

/* Più giocati: the charts' card, its carousel controls under it — and
   event.html's Meta tab, the same card (js/event-detail.js renderMeta). */
:is(.home-board, .event-panels, .league-lists) .dashboard-card-commanders {
  margin-bottom: 0;
}

:is(.home-board, .event-panels, .league-lists) .chart-carousel-nav {
  margin: 14px auto 0;
}

/* event.html's Meta card: its edge in the hero's colour (the Bacheca's
   card has a fixed red one). */
.card.dashboard-card-commanders.event-meta-card {
  border-color: color-mix(in srgb, var(--brand-red) 28%, transparent);
}

/* A computer, the two columns side by side: */
@media (min-width: 861px) {
  /* The two columns as tall as the taller one (the Classifica, its rows at
     their own size since 2026-10-30 — before, squeezed to the timeline's
     height, contain: size), each a column with its link row ("Tutti gli
     eventi" / "Classifica completa" + "Regolamento") at the bottom, so the
     two still end level. */
  html:not(.app-header) .home-board {
    align-items: stretch;
  }

  html:not(.app-header) #home-panel-events,
  html:not(.app-header) #home-panel-standings,
  html:not(.app-header) #dashboard-leagues-content {
    display: flex;
    flex-direction: column;
  }

  html:not(.app-header) #home-panel-standings {
    position: relative;
  }

  html:not(.app-header) #dashboard-leagues-content {
    flex: 1;
  }

  html:not(.app-header) .home-board :is(#home-panel-events, #dashboard-leagues-content) > .dashboard-league-more-row {
    margin-top: auto;
    padding-top: 16px;
  }

  /* The two lists start level (user, 2026-10-30): both headings as tall as
     the Classifica's, its ring (48px) the tallest thing in either. And,
     full, they end level too (user, 2026-11-03): the timeline's 2 played +
     5 upcoming cards (56px, 12px apart) with "Oggi" between them, the
     Classifica's 8 rows (56px, 6px apart) — 490px each with "Oggi" 4px
     shorter (its bottom padding 8px, not 12px). Fewer events or players:
     they don't (the link rows below still do). */
  html:not(.app-header) .home-board .home-panel-head {
    min-height: 48px;
  }

  /* The Classifica's rows spread over the column's height, so the list
     ends level with the timeline (user, 2026-11-03). */
  html:not(.app-header) .home-board .dashboard-standings {
    flex: 1;
    justify-content: space-between;
  }

  /* The two sections as ONE card (option C of a mockup, 2026-10-30 — like
     the stories' bar above): its surface the board's ::before (a grid
     item spanning both columns of the first row, behind them), the two
     sections placed on it — their own card look (below) dropped — a
     hairline down the middle. */
  html:not(.app-header) .home-board {
    column-gap: 0;
  }

  html:not(.app-header) .home-board::before {
    content: "";
    grid-row: 1;
    grid-column: 1 / -1;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow-card);
  }

  html:not(.app-header) .home-board > #home-panel-events,
  html:not(.app-header) .home-board > #home-panel-standings {
    position: relative;
    z-index: 1;
    grid-row: 1;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  html:not(.app-header) .home-board > #home-panel-events {
    grid-column: 1;
    padding: 22px 32px 24px 26px;
  }

  html:not(.app-header) .home-board > #home-panel-standings {
    grid-column: 2;
    padding: 22px 26px 24px 32px;
  }

  html:not(.app-header) .home-board > .home-panel-meta {
    grid-row: 2;
  }

  html:not(.app-header) #home-panel-standings::before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 0;
    width: 1px;
    background: rgba(154, 28, 32, 0.12);
  }

  :root[data-theme="dark"]:not(.app-header) .home-board::before {
    border-color: rgba(255, 255, 255, 0.1);
    background: #1d1819;
  }

  /* (Over the sections' own dark card colour, below.) */
  :root[data-theme="dark"]:not(.app-header) .home-board > :is(#home-panel-events, #home-panel-standings) {
    background: none;
  }

  :root[data-theme="dark"]:not(.app-header) #home-panel-standings::before {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Più giocati (the Bacheca) and event.html's Meta, at every width: each
   bubble chart in an area of the same height (centred, scaled to fit —
   js/metagame-chart.js gives each chart its --bubble-ratio), so the two
   charts' lists start at the same height, swiping from one to the other
   on a phone too. 300px; on a narrow screen 70% of the charts' width
   (cqw: the carousel host, .chart-carousel-host, is a size container). */
:is(.home-board, .event-meta-card) .bubble-stage {
  --bubble-stage-h: min(300px, 70cqw);
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--bubble-stage-h);
  margin: 10px 0 4px;
}

:is(.home-board, .event-meta-card) .bubble-stage .bubble-chart {
  width: min(100%, calc(var(--bubble-stage-h) * var(--bubble-ratio, 1)));
  margin: 0;
}

/* Phones: Prossimi eventi, Leghe in corso and Ultimi eventi give their rows
   more of the width — the card's side padding trimmed (22px → 12px), the
   top-8 rows' own a little too. (.card.: over .card's own padding.) */
@media (max-width: 640px) {
  .dashboard-standings .dashboard-standing {
    padding-inline: 8px;
  }
}

/* The pie chart already renders its own card-like frame (border/shadow) —
   redundant nested inside a dashboard card, so it's stripped down to just
   its content here. */
.dashboard-card-commanders .pie-chart-wrap {
  border: none;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  padding: 0;
  margin-bottom: 14px;
}

/* Inside the chart carousel (commanders + archetypes slides), the carousel's
   own card shadow (.chart-grid > .pie-chart-wrap, later in this file, same
   specificity) would otherwise put it back. */
.dashboard-card-commanders .chart-grid > .pie-chart-wrap {
  box-shadow: none;
}

/* Both slides always donut first, list below — left to .pie-chart-body's
   own flex-wrap, the (long) commander legend wrapped under the donut while
   the (short) archetype one fit beside it, so the two slides looked
   different. */
.dashboard-card-commanders .pie-chart-body {
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

/* Each "Più giocati" slide's own "Vedi tutti" (js/home.js) — the slide is a
   flex column (.chart-grid > .pie-chart-wrap), which would otherwise
   stretch the link into a full-width bar; kept its natural size, centred
   (user's choice 2026-11-03 — it was on the left), pinned to the slide's
   bottom so both slides' links line up. */
.dashboard-card-commanders .pie-chart-wrap > .section-link {
  align-self: center;
  margin-top: auto;
}

/* Room between a slide's legend and its "Vedi tutti" below (the donut's
   legend is in .pie-chart-body, the bubbles' right under the chart). */
.dashboard-card-commanders .pie-chart-body,
.dashboard-card-commanders .bubble-legend {
  margin-bottom: 18px;
}

/* A real league's progress as a ring (js/ui.js leagueRingHtml — since
   2026-10-30, it was a bar of segments): events played out of those
   scheduled, in red, "3/7" inside and "Eventi" under it; small (.is-small,
   the Bacheca's, right of the league's name): just "3/7". */
.league-ring {
  --ring: 88px;
  position: relative;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: var(--ring);
  height: var(--ring);
}

.league-ring.is-small {
  --ring: 48px;
}

.league-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.league-ring circle {
  fill: none;
  stroke-width: 10;
}

.league-ring.is-small circle {
  stroke-width: 11;
}

.league-ring-track {
  stroke: rgba(220, 24, 28, 0.12);
}

.league-ring-fill {
  stroke: var(--brand-red);
  stroke-linecap: round;
}

.league-ring-label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-title);
  line-height: 1;
  text-align: center;
}

.league-ring-label b {
  font-size: 1.35rem;
  font-weight: 800;
}

.league-ring.is-small .league-ring-label b {
  font-size: 0.82rem;
}

.league-ring-label small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

:root[data-theme="dark"] .league-ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .league-ring-fill {
  stroke: #ff6a6e;
}

/* Events calendar overlay ("Calendario" button on "Prossimi eventi"), js/
   events-calendar.js. A <dialog> rather than a hand-rolled backdrop div —
   free Escape-to-close, focus trapping, and top-layer stacking, same
   reasoning the site already leans on native <input type="date"> before
   js/custom-date.js reskins it. Reuses .cd-nav/.cd-weekdays/.cd-grid/.cd-day
   from the date-picker popup for a consistent look rather than redefining
   the same grid/button chrome twice. */
.ecal-dialog {
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-card-hover);
  color: var(--text-body);
}

.ecal-dialog::backdrop {
  background: rgba(32, 18, 20, 0.55);
}

.ecal-close {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--brand-red-darker);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.ecal-close:hover {
  background: #fff7f4;
  border-color: var(--hairline-hover);
}

/* A count on its own line below a title, e.g. event.html's "Giocatori" →
   "12 partecipanti", players.html's → "40 totali". Same muted uppercase
   look as the other small meta labels, a fixed size
   whatever the title's own. */
.heading-count {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* No count to show (an event with no entries): no empty line either. */
.heading-count:empty {
  display: none;
}

#deck-filters-slot,
#video-filters-slot {
  min-height: 42px;
  display: flex;
  align-items: center;
}

.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(154, 28, 32, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-red-deep);
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.section-link:hover {
  transform: translateY(-1px);
  border-color: rgba(220, 24, 28, 0.32);
  background: #fff7f4;
}

@media (max-width: 640px) {
  #deck-filters-slot,
  #video-filters-slot {
    min-height: 0;
    min-width: 0;
  }

}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: rgba(245, 241, 240, 0.95);
  color: var(--text-muted-2);
  view-transition-name: site-footer;
}
