/* styles — part 6 of 6 (css/6-dark-tabbar-transitions.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. */

/* ==========================================================================
   Dark mode — toggled by the switch in the footer (js/theme.js sets
   <html data-theme="dark">, persisted in localStorage; a tiny inline script
   in every page's <head> applies it before first paint to avoid a flash of
   the wrong theme). The header keeps its exact red gradient in both themes
   — that and the brand red used on solid blocks (buttons, the nav pill,
   badges) are untouched here on purpose. Only the cream/white surfaces and
   their text switch, plus the couple of red *text* colors (never used as a
   background fill) that needed brightening to stay legible once the page
   behind them goes dark. */

:root[data-theme="dark"] {
  /* Lets native controls we don't fully re-style ourselves — checkbox
     ticks, date-picker popups, select dropdowns, scrollbars — draw with
     dark chrome instead of staying light regardless of our own CSS. */
  color-scheme: dark;

  --bg-cream-1: #120d0e;
  --bg-cream-2: #120d0e;
  --bg-cream-3: #120d0e;

  --text-body: #ecdcdf;
  --text-title: #fbf2f3;
  --text-muted: #b0888f;
  --text-muted-2: #9c7981;
  --text-value: #ddc3c8;

  --hairline: rgba(255, 255, 255, 0.1);
  --hairline-hover: rgba(255, 110, 110, 0.32);
  --hairline-hover-strong: rgba(255, 110, 110, 0.42);
  --table-row-line: rgba(255, 255, 255, 0.06);

  --shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 12px 28px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 18px 36px rgba(0, 0, 0, 0.5);

  /* Pure text-role colors (never a solid background fill), so — unlike
     --brand-red itself — safe and necessary to brighten for contrast. */
  --brand-red-deep: #ff7a7e;
  --brand-red-darker: #ff8489;
  --social-blue-text: #7fa0ff;
}

:root[data-theme="dark"] .site-nav {
  background: rgba(20, 14, 16, 0.92);
}

:root[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] footer {
  background: #140f10;
}

/* Cards, tiles, tables, charts: the "white surface on a cream page" pieces
   become a faint light-on-dark surface instead. */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .stat-tile,
:root[data-theme="dark"] .history-panel,
:root[data-theme="dark"] .pie-chart-wrap,
:root[data-theme="dark"] .filter-panel-body {
  background: rgba(255, 255, 255, 0.045);
}

/* A badge's tooltip card (opaque: it floats over the page). */
:root[data-theme="dark"] .floating-tooltip.badge-tip {
  border-color: rgba(255, 255, 255, 0.1);
  background: #241b1d;
}

:root[data-theme="dark"] .badge-tip .floating-tooltip-arrow {
  border-top-color: #241b1d;
}

:root[data-theme="dark"] .badge-tip.is-below .floating-tooltip-arrow {
  border-bottom-color: #241b1d;
}

/* Without this, the generic dark-mode rule above (3 classes) wins on
   specificity over .dashboard-card-commanders .pie-chart-wrap's own
   background: none (2 classes) regardless of source order, giving the
   chart its own faint tinted box distinct from the dashboard card behind
   it — same trap as the nav pill's dark-mode background bug fixed
   earlier this session. */
:root[data-theme="dark"] .dashboard-card-commanders .pie-chart-wrap {
  background: none;
}

/* The Bacheca's top-8 rows, inside the Classifica's card (css/1, option C
   of a mockup, 2026-10-30): a soft fill, no edge, no shadow. */
:root[data-theme="dark"] .home-board .dashboard-standing {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

:root[data-theme="dark"] .home-board a.dashboard-standing:hover {
  background: rgba(255, 110, 110, 0.12);
}

/* badges.html: same faint light-on-dark surface as the other cards, and
   the red tints brightened like the site's other dark-mode reds. */
:root[data-theme="dark"] .badge-card {
  background: rgba(255, 255, 255, 0.045);
}

/* Dark mode keeps a light disc (the icons need it for contrast) — a shade
   below white, so it doesn't glare on the dark page — with the ring in the
   theme's lighter red so it still reads. */
:root[data-theme="dark"] .badge-card-icon,
:root[data-theme="dark"] .badge-disc {
  border-color: rgba(255, 106, 110, 0.6);
  background: #d9d2d2;
}

:root[data-theme="dark"] .badge-holder {
  background: rgba(255, 110, 110, 0.12);
}

:root[data-theme="dark"] .badge-holder:hover {
  background: rgba(255, 110, 110, 0.2);
}

:root[data-theme="dark"] .rank-chip {
  background: rgba(255, 110, 110, 0.2);
}

/* player.html's history sub-cards: a faint light-on-dark surface inside the
   panel's own, the tints brightened like the site's other dark-mode reds. */
:root[data-theme="dark"] .history-item {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] a.history-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 110, 110, 0.1);
}

:root[data-theme="dark"] .history-item.is-top8 {
  background: rgba(255, 110, 110, 0.09);
}

:root[data-theme="dark"] a.history-item.is-top8:hover {
  background: rgba(255, 110, 110, 0.13);
}

:root[data-theme="dark"] .history-item.is-me-row {
  border-color: rgba(255, 110, 110, 0.22);
  background: rgba(255, 110, 110, 0.15);
}

:root[data-theme="dark"] a.history-item.is-me-row:hover {
  border-color: rgba(255, 110, 110, 0.3);
  background: rgba(255, 110, 110, 0.2);
}

:root[data-theme="dark"] .history-pos,
:root[data-theme="dark"] .history-count {
  background: rgba(255, 110, 110, 0.2);
}

:root[data-theme="dark"] .history-pos.is-first {
  background: var(--brand-red);
}

:root[data-theme="dark"] .history-score.is-win {
  color: #5fd394;
}

:root[data-theme="dark"] .history-scroll {
  scrollbar-color: rgba(255, 110, 110, 0.3) transparent;
}
:root[data-theme="dark"] .stat-tile-value,
:root[data-theme="dark"] .cd-day.is-today {
  color: #ff6a6e;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .cs-trigger,
:root[data-theme="dark"] .cd-trigger,
:root[data-theme="dark"] .cd-nav,
:root[data-theme="dark"] .cd-footer-btn,
:root[data-theme="dark"] .ecal-close,
:root[data-theme="dark"] #badges-admin-icon-file,
:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .btn-danger,
:root[data-theme="dark"] .icon-btn-edit,
:root[data-theme="dark"] .section-link {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] #badges-admin-icon-file::file-selector-button,
:root[data-theme="dark"] #badges-admin-icon-file::-webkit-file-upload-button {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .btn-secondary:hover,
:root[data-theme="dark"] .btn-danger:hover,
:root[data-theme="dark"] .icon-btn-edit:hover,
:root[data-theme="dark"] .section-link:hover,
:root[data-theme="dark"] .cd-nav:hover,
:root[data-theme="dark"] .cd-footer-btn:hover,
:root[data-theme="dark"] .ecal-close:hover,
:root[data-theme="dark"] #badges-admin-icon-file:hover::file-selector-button,
:root[data-theme="dark"] #badges-admin-icon-file:hover::-webkit-file-upload-button {
  background: rgba(255, 255, 255, 0.1);
}

/* Without this, :root[data-theme="dark"] .site-nav below (meant for the
   normal sticky top nav bar) wins on specificity over the mobile pill's own
   background: none and reasserts a solid dark bar behind/around the
   floating pill — this re-clears it back to transparent for that state. */
html[data-theme="dark"].nav-mobile .site-nav {
  background: none;
}

/* player.html / account.html with a hero colour (js/player-card.js): the
   touch nav — its pill and the current page's link in its panel — in that
   colour too (the site's red variables redefined on the nav, touch only);
   in dark mode the pill a deep shade of it with a light-shade edge. */
html.nav-mobile .site-nav.has-hero-accent {
  --brand-red: var(--hero-accent);
  --brand-red-deep: var(--hero-accent-deep);
  --brand-red-deep-2: var(--hero-accent-deep-2);
  --brand-red-darker: var(--hero-accent-deep);
}

/* The mobile search field switches to a normal light/dark-aware input
   (see the light-mode rule) rather than staying translucent-on-red — same
   dark background as .field input/.cs-trigger elsewhere. */
html[data-theme="dark"].nav-mobile .site-search-field {
  background: rgba(255, 255, 255, 0.06);
}

/* Not a translucent tint like the rules above — these popups can float over
   arbitrary page content (tables, other cards) behind them, so they need a
   solid color of their own to stay legible regardless of what's underneath.
   .site-search-results is desktop-only here (:not(.nav-mobile)) — on mobile
   it's part of the full-screen overlay's own background (.site-search-box,
   already var(--bg-cream-1)-based and so already dark-mode-aware) rather
   than a floating popup needing its own solid color. */
:root[data-theme="dark"] .cs-menu,
:root[data-theme="dark"] .cd-popup,
:root[data-theme="dark"] .ecal-dialog,
:root[data-theme="dark"] .matchups-dropdown,
html[data-theme="dark"]:not(.nav-mobile) .site-search-results {
  background: #241a1d;
}

:root[data-theme="dark"] .matchups-dropdown-item:hover,
:root[data-theme="dark"] .matchups-dropdown-item:focus {
  background: rgba(255, 255, 255, 0.1);
}

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

/* Solid, not translucent — this sticky column needs to fully mask
   whatever's scrolled underneath it, same reasoning as .cs-menu above. */
:root[data-theme="dark"] .cs-option:hover,
:root[data-theme="dark"] .cs-option:focus,
:root[data-theme="dark"] .cd-day:hover,
:root[data-theme="dark"] .cd-day:focus {
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .btn-danger,
:root[data-theme="dark"] .form-message.is-error {
  color: #ff8a80;
}

/* Theme toggle switch — sits in the footer bar. A plain icon button rather
   than a sliding track: it shows the icon for the theme a click would
   switch *to*, so its own look doesn't need to itself be theme-aware. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-body);
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

/* The footer's right-hand group: the language switch, then the theme. */
.footer-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

/* The language (js/language.js): IT / EN as a small two-part pill, the
   theme button's look; the one on screen in red. */
.lang-toggle {
  display: inline-flex;
  box-sizing: border-box;
  width: 76px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.6);
}

.lang-toggle button {
  flex: 1;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-body);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--brand-red);
  color: #fff;
  cursor: default;
}

.lang-toggle button[aria-pressed="false"]:hover {
  background: rgba(220, 24, 28, 0.08);
}

:root[data-theme="dark"] .lang-toggle {
  background: rgba(255, 255, 255, 0.08);
}

/* Content written out in both languages (privacy.html): only the one of the
   language on screen shows. */
html[lang="en"] [data-lang-only="it"],
html:not([lang="en"]) [data-lang-only="en"] {
  display: none;
}

/* Its icon (js/theme.js): the current choice as a line icon — sun, moon,
   or a screen (following the device). */
.theme-toggle svg {
  width: 22px;
  height: 22px;
}

/* Signed in, the button opens this menu above it (js/theme.js): Chiaro /
   Scuro / Segui il sistema, each with its icon, the current one in red
   with a check. */
.theme-menu {
  position: fixed;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card-hover);
  animation: theme-menu-in 140ms ease both;
}

@keyframes theme-menu-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.theme-menu-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-title);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}

.theme-menu-option:hover,
.theme-menu-option:focus-visible {
  outline: none;
  background: rgba(220, 24, 28, 0.07);
}

.theme-menu-option svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.theme-menu-option.is-current {
  color: var(--brand-red-deep);
}

.theme-menu-check {
  display: inline-flex;
  margin-left: auto;
  visibility: hidden;
}

.theme-menu-option.is-current .theme-menu-check {
  visibility: visible;
}

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

:root[data-theme="dark"] .theme-menu-option:hover,
:root[data-theme="dark"] .theme-menu-option:focus-visible {
  background: rgba(255, 255, 255, 0.07);
}

:root[data-theme="dark"] .theme-menu-option.is-current {
  color: #ff8a8d;
}

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

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--hairline-hover);
}

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

/* The vibration switch (js/haptics-toggle.js, Android phones only): the
   theme button's look in the footer's left corner; off, its icon (struck
   through) faded. */
.haptics-toggle.is-off svg {
  opacity: 0.5;
}

/* "Installa l'app" (js/pwa-install.js): on its own over the page, so solid
   (white; dark mode the popups' near-black), sliding up once the content
   is in. Chrome & co.: a card — the site's icon, the title, a line, "Non
   ora" / "Installa" — on phones above the tab bar, on a computer in the
   bottom-right corner. iPhone / an app's own browser: a sheet from the
   bottom with the steps. */
.pwa-install-banner {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 2px 12px;
  width: min(340px, calc(100vw - 24px));
  box-sizing: border-box;
  padding: 14px;
  border: 1px solid rgba(154, 28, 32, 0.12);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(40, 6, 9, 0.22), 0 2px 6px rgba(40, 6, 9, 0.12);
  animation: pwa-install-in 520ms cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

html.nav-mobile .pwa-install-banner {
  left: 12px;
  right: 12px;
  bottom: calc(var(--tab-bar-h) + 12px + env(safe-area-inset-bottom));
  width: auto;
}

.pwa-install-banner.is-leaving {
  animation: pwa-install-out 220ms ease both;
}

@keyframes pwa-install-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
}

@keyframes pwa-install-out {
  to {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}

/* The site's icon: the logo in red on a white tile. */
.pwa-install-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--hairline), 0 3px 8px rgba(40, 6, 9, 0.12);
}

.pwa-install-icon span {
  width: 36px;
  height: 36px;
  background: var(--brand-red);
  -webkit-mask: url("../dc_pc.svg") center / contain no-repeat;
  mask: url("../dc_pc.svg") center / contain no-repeat;
}

.pwa-install-title {
  color: var(--text-title);
  font-size: 0.98rem;
  font-weight: 800;
}

.pwa-install-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.pwa-install-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pwa-install-actions button,
.pwa-install-sheet .pwa-install-later {
  flex: 1;
  height: 40px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.pwa-install-later {
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--text-body);
}

.pwa-install-go {
  border: 0;
  background: var(--brand-red);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-red) 40%, transparent);
}

/* The steps' sheet (iPhone, an app's own browser): up from the bottom. */
.pwa-install-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -10px 30px rgba(40, 6, 9, 0.25);
  animation: pwa-sheet-in 480ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.pwa-install-sheet.is-leaving {
  animation: pwa-sheet-out 260ms ease both;
}

@keyframes pwa-sheet-in {
  from {
    transform: translateY(100%);
  }
}

@keyframes pwa-sheet-out {
  to {
    transform: translateY(100%);
  }
}

.pwa-install-grab {
  width: 40px;
  height: 4px;
  margin: -6px auto 14px;
  border-radius: 4px;
  background: var(--hairline-hover);
}

.pwa-install-sheet .pwa-install-text {
  margin: 4px 0 14px;
}

.pwa-install-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pwa-step;
}

.pwa-install-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
  color: var(--text-body);
  font-size: 0.9rem;
  counter-increment: pwa-step;
}

.pwa-install-steps li::before {
  content: counter(pwa-step);
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-red) 12%, transparent);
  color: var(--brand-red-deep);
  font-size: 0.8rem;
  font-weight: 800;
}

.pwa-install-steps svg {
  width: 20px;
  height: 20px;
  margin: 0 2px;
  vertical-align: -4px;
  color: #2f7bf6;
}

.pwa-install-sheet .pwa-install-later {
  flex: none;
  margin-top: 12px;
}

:root[data-theme="dark"] :is(.pwa-install-banner, .pwa-install-sheet) {
  border-color: rgba(255, 255, 255, 0.1);
  background: #241b1d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-banner,
  .pwa-install-sheet,
  .pwa-install-banner.is-leaving,
  .pwa-install-sheet.is-leaving {
    animation: none;
  }
}

/* Phones and tablets (html.app-header) with a hero on the page (player /
   commander / league / event / archetype / account): the red header
   transparent, laid over the page (absolute — out of the flow), and the hero running up to the very top
   behind it: its content pushed down by the header's height
   (--hero-header-h), the back pill too; a dark shade at
   the hero's top keeps the header's logo, title and buttons readable on
   any art. Not while account.html's "Il tuo giocatore" banner sits above
   its hero (the header would lie over the banner). */
html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) {
  --hero-header-h: calc(80px + env(safe-area-inset-top));
}

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-header {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .page-main .profile-hero:first-child,
html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .page-main .detail-hero-wrap:first-child .profile-hero,
html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .page-loading-region > .detail-hero-wrap:nth-child(2) .profile-hero,
html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .page-loading-region > .profile-hero {
  margin-top: -20px;
}

/* The hero's content close under the header: 8px (was 24px, user
   2026-11-06 — like the pages without a hero, 16px less); the loading
   placeholder's sizes (css/1, .sk-hero) moved up the same. */
html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .profile-hero-inner {
  padding-top: calc(var(--hero-header-h) + 8px);
}

/* The detail heroes' back pill: up in the header's own row, where the logo
   is (hidden on those pages) — the app-bar pattern, back on the left, search
   and account on the right — instead of a second row of controls in the
   hero's corners. Still in the hero's wrap (its colour, its label
   from js/router.js), lined up with the header's row: the same top
   (the header's 16px + safe area), the round buttons' 46px, and its left
   edge on the logo's — the header's side padding (20px; 16px up to 480px)
   and centred 1100px row, minus where the wrap starts (.page-main's: 20px;
   --page-pad-x up to 640px; a centred 1100px column). The header box, laid over
   the hero, lets taps through outside its own buttons, so the pill under it
   gets them. */
html.app-header body:has(.page-main .detail-hero-back) {
  --hdr-x: calc(20px + max(0px, (100vw - 1140px) / 2));
  --page-x: calc(20px + max(0px, (100vw - 1100px) / 2));
}

@media (max-width: 640px) {
  html.app-header body:has(.page-main .detail-hero-back) {
    --page-x: var(--page-pad-x, 16px);
  }
}

@media (max-width: 480px) {
  html.app-header body:has(.page-main .detail-hero-back) {
    --hdr-x: 16px;
  }
}

html.app-header body:has(.page-main .detail-hero-back) .detail-hero-back,
html.app-header body:has(.page-main .detail-hero-back) .detail-hero-wrap:has(.is-no-card) .detail-hero-back {
  top: calc(16px + env(safe-area-inset-top));
  left: calc(var(--hdr-x) - var(--page-x));
  max-width: calc(100% - 140px);
  height: 46px;
  transform: none;
}

html.app-header body:has(.page-main .detail-hero-back) .site-header-brand {
  visibility: hidden;
}

html.app-header body:has(.page-main .detail-hero-back) .site-header {
  pointer-events: none;
}

html.app-header body:has(.page-main .detail-hero-back) .site-header :is(.site-search, .site-news, .site-account) {
  pointer-events: auto;
}

/* Every detail hero's name line (player, commander, league; any width):
   the name fitted to it (js/page-title-fit.js). Left-aligned like the
   hero's text on a computer, centred from 820px down. */
.detail-hero-title-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
}

@media (max-width: 820px) {
  .detail-hero-title-row {
    justify-content: center;
  }
}

.detail-hero-title-row > .profile-hero-name {
  flex: 0 1 auto;
  min-width: 0;
}

/* player.html: that line and the player's badges after it
   (#player-title-badges) — beside it while there's room, else all together
   on the next line (the group never splits, .badge-group). The line fits
   its name into the whole width first; the badges never shrink it. Font
   size: the name's own, which the badges are sized from (em). */
.detail-hero-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
}

@media (max-width: 820px) {
  .detail-hero-title-wrap {
    justify-content: center;
  }
}

.detail-hero-title-wrap > .detail-hero-title-row {
  flex: 0 1 auto;
  min-width: 0;
}

.detail-hero-title-badges {
  flex: 0 0 auto;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.05;
}

.detail-hero-title-badges:empty {
  display: none;
}

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .profile-hero::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  
  pointer-events: none;
}

/* Tablets (html.app-header wider than a phone): the hero edge to edge as
   on phones — out of the page's centred column (.page-main: up to 1100px,
   20px side padding; --hero-bleed is how far the column's edge is from the
   screen's), its content still lined up with the column, no rounded
   corners or shadow; pulled up by the page's 28px top padding (phones:
   20px, above); the back pill inside its top-left corner as up to 820px
   (desktop: on its top edge), lined up with the content. */
@media (min-width: 641px) {
  html.app-header .page-main {
    --hero-bleed: calc(max(0px, (100vw - 1100px) / 2) + 20px);
  }

  html.app-header .profile-hero {
    margin-inline: calc(-1 * var(--hero-bleed));
    border-radius: 0;
    box-shadow: none;
  }

  html.app-header .profile-hero-inner {
    padding-inline: var(--hero-bleed);
  }

  /* Every hero, as phones' .profile-hero rule does — account's comes after
     the (hidden) "Il tuo giocatore" card, not first. */
  html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .page-main .profile-hero {
    margin-top: -28px;
  }

  html.app-header .detail-hero-back,
  html.app-header .detail-hero-wrap:has(.is-no-card) .detail-hero-back {
    left: 0;
    transform: none;
  }
}

/* Phones and tablets (html.app-header — any touch screen, or a window as
   narrow as a phone): the red header always transparent — over a hero
   (above) its white logo, title and buttons sit on the hero's art; on every other page (or
   above account's "Il tuo giocatore" banner) it lies on the page itself,
   so its title turns dark and the account button white with a red icon
   (like the search one beside it), both lifted by a soft shadow. */
html.app-header .site-header {
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-header-brand {
  color: var(--text-title);
}

html.app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-account {
  border-color: rgba(154, 28, 32, 0.22);
  background: #fff;
  color: var(--brand-red);
  box-shadow: 0 2px 8px rgba(80, 10, 14, 0.1);
}

html.app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-search-trigger {
  border: 1px solid rgba(154, 28, 32, 0.22);
  box-shadow: 0 2px 8px rgba(80, 10, 14, 0.1);
}

:root[data-theme="dark"].app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-account {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* …and the search and the bell beside it the same (not white discs on the
   dark page). Over a hero all three stay white. */
:root[data-theme="dark"].app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) :is(.site-search-trigger, .site-news) {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: #fff;
}

/* Phones and tablets, every page: the logo in brand red — the logo as a
   mask over a red fill, its own pixels pushed out of view (object-fit:
   none, or the image would just fill the box and stay put); the signed-in
   picture ringed in red. Over a hero: a deeper shade at the top, a soft
   shadow under the title and the round buttons, so the header reads on any
   art. */
html.app-header .site-header .site-logo-sm {
  /* Off: the desktop's filter (brightness(0) invert(1), the logo white on
     the red header) would turn the red fill white too. */
  filter: none;
  background: var(--brand-red);
  object-fit: none;
  object-position: -9999px 0;
  -webkit-mask: url("../dc_pc.svg") center / contain no-repeat;
  mask: url("../dc_pc.svg") center / contain no-repeat;
}

/* The signed-in picture: no white edge or fill of its own, just a red
   ring a little apart from it (an outline with a gap). */
html.app-header body .site-header .site-account.is-signed-in,
:root[data-theme].app-header body .site-header .site-account.is-signed-in.is-signed-in {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  outline: 3px solid var(--brand-red);
  outline-offset: 2px;
}

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .profile-hero::before {
  height: calc(var(--hero-header-h) + 56px);
  background: linear-gradient(rgba(10, 5, 6, 0.72), rgba(10, 5, 6, 0.35) 60%, rgba(10, 5, 6, 0));
}

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-header-brand {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

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

html.app-header body:has(.page-main .profile-hero):not(:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .site-account.is-signed-in {
  box-shadow: none;
}

/* Phones and tablets: the header a bit taller, its logo, title and round
   buttons a size up (the hero pages' --hero-header-h, above, follows its
   80px). */
html.app-header .site-header {
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-bottom: 16px;
}

/* Pages without a hero: the first thing on the page closer to the header
   (user, 2026-11-06) — 16px of header + 4px, was + 20px (phones) / 28px.
   Not the hero pages: their hero is pulled up by exactly .page-main's own
   padding to run behind the header — but account.html signed out (its
   hero in the page, hidden) and with the claim banner are pages without
   one here, as in every header rule above. The loading placeholder sits inside
   .page-main, so it follows. */
html.app-header :is(body:not(:has(.page-main .profile-hero)), body:has(:is(.profile-claim, [data-view="login"]):not([hidden]))) .page-main {
  padding-top: 4px;
}

/* The logo a size bigger than the round buttons (52px) without making the
   header any taller: 3px of it reach into the header's own padding above
   and below, so its row stays the buttons' 46px. */
html.app-header .site-header .site-logo-sm {
  width: 52px;
  height: 52px;
  margin-block: -3px;
}

html.app-header .site-header-brand {
  gap: 10px;
  font-size: clamp(0.95rem, 4.3vw, 1.22rem);
}

html.app-header .site-search-trigger,
html.app-header .site-account {
  width: 46px;
  height: 46px;
}

html.app-header .site-search-trigger svg,
html.app-header .site-account-icon {
  width: 22px;
  height: 22px;
}

/* Phones and tablets: just the logo in the header — the site's name hidden
   from view but kept for screen readers (the logo link's only text). */
html.app-header .site-header-brand > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Phones and tablets, a page with a hero (js/player-card.js applyHeroTone
   marks the header .has-hero-accent once the art's colour is known): the
   logo and the signed-in picture's ring in the colour's light shade, the
   search icon (on its white circle) in its deep shade; each fading over
   from red as the hero loads. */
html.app-header .site-header .site-logo-sm {
  transition: background-color 700ms ease;
}

html.app-header .site-header .site-account {
  transition: outline-color 700ms ease, background 150ms ease, border-color 150ms ease;
}

html.app-header .site-header .site-search-trigger {
  transition: color 700ms ease, background 150ms ease;
}

html.app-header .site-header.has-hero-accent .site-logo-sm {
  background-color: var(--hero-accent-light);
}

html.app-header body .site-header.has-hero-accent .site-account.is-signed-in,
:root[data-theme].app-header body .site-header.has-hero-accent .site-account.is-signed-in.is-signed-in {
  outline-color: var(--hero-accent-light);
}

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

/* ---------------------------------------------------------------------------
   Tab bar (js/tab-bar.js) — touch screens: the navigation at the bottom of
   the screen (the old pill and its list are gone; a computer keeps its tabs
   in the top bar, .site-nav-inner — hidden here). A bar docked to the
   screen's bottom edge, the whole width, in iOS's "liquid glass"
   (since 2026-11-06, user — before, a solid capsule floating 16px up):
   the page shows through, blurred and saturated, under a light tint
   (dark mode a near-black one), a bright top edge and a soft sheen. Five
   sections — Bacheca, Leghe, Meta, Giocatori, Social — each its icon over its name;
   the current one's icon in a red pill, filled, its name red, Google's
   apps' way (since 2026-10-30, from a fixed-bar test — before, the current
   one in a wide red chip with its name beside the icon, the others icon
   only; the hero's colour on hero pages: .site-nav.has-hero-accent
   redefines the red). It slides away scrolling down with the whole
   .site-nav (.is-scrolled-away, above).
   --------------------------------------------------------------------------- */
html.nav-mobile .site-nav-inner {
  display: none;
}

html.nav-mobile .tab-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  /* 4px + the 56px tabs + 4px = --tab-bar-h, then the home indicator's
     room; sideways the tabs keep to a centred 520px (a tablet's width
     would spread them apart), clear of a landscape notch. */
  padding: 4px max(calc(6px + env(safe-area-inset-right)), calc((100% - 520px) / 2))
    calc(4px + env(safe-area-inset-bottom)) max(calc(6px + env(safe-area-inset-left)), calc((100% - 520px) / 2));
  border: 0;
  border-radius: 0;
  /* Liquid glass: a light tint over the page blurred and saturated (its
     colours read through, livelier), lighter towards the top. */
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.62), rgba(255, 253, 248, 0.5));
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  /* The glass's lit top edge (inset), a hairline under it against a light
     page, and a faint lift. */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 -0.5px 0 rgba(40, 6, 9, 0.14), 0 -6px 20px rgba(40, 6, 9, 0.06);
}

/* The glass's sheen: light gathered along its top, fading down. Under the
   tabs (.tab-bar-link z-index 1). */
html.nav-mobile .tab-bar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* No backdrop blur (older browsers): nearly solid, so the page under it
   doesn't muddle the names. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html.nav-mobile .tab-bar {
    background: rgba(255, 253, 248, 0.96);
  }
}

html.nav-mobile .tab-bar-link {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  height: 56px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  color: var(--text-body);
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* The icon's place: the pill the current one fills (Google's apps' look,
   user 2026-10-30 — the pill on the icon only, the name under it), the
   icon centred in it. The pill is its ::before, so it can grow on its own:
   a section becoming current, its pill opens out from the middle
   (scaleX) as the icon turns white and filled with its own little
   animation (below); the one left, its pill closes back in. Only once
   the bar is up (.tab-bar.is-ready, js/tab-bar.js) — a page's first paint shows it in place, no animation. */
.tab-bar-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 30px;
}

.tab-bar-icon {
  /* The pill's colour — also the "cut-outs" of a filled icon (below). */
  --tab-pill: var(--brand-red);
}

.tab-bar-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-pill);
  background: var(--tab-pill);
  opacity: 0;
  transform: scaleX(0.3);
}

.tab-bar-link svg {
  position: relative;
  width: 22px;
  height: 22px;
  transition: transform 140ms ease;
}

.tab-bar-link:active svg {
  transform: scale(0.88);
}

/* Each section's name under its icon (also its aria-label). */
.tab-bar-name {
  max-width: 100%;
  overflow: hidden;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The current section: its icon white in the red pill, its name red. */
html.nav-mobile .tab-bar-link.is-current .tab-bar-icon {
  color: #fff;
}

html.nav-mobile .tab-bar-link.is-current .tab-bar-icon::before {
  opacity: 1;
  transform: none;
}

html.nav-mobile .tab-bar-link.is-current .tab-bar-name {
  color: var(--brand-red-deep);
  font-weight: 800;
}

/* The change, animated (not on a page's first paint). */
.tab-bar.is-ready .tab-bar-icon {
  transition: color 180ms ease;
}

.tab-bar.is-ready .tab-bar-icon::before {
  transition: transform 160ms ease-in, opacity 120ms ease-in 40ms, background 450ms ease;
}

.tab-bar.is-ready .tab-bar-link.is-current .tab-bar-icon::before {
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 120ms ease, background 450ms ease;
}

.tab-bar.is-ready .tab-bar-name {
  transition: color 180ms ease;
}

/* The current section's icon filled, as Google's apps do (outline →
   solid): its shapes white, its details (the house's door, the play
   triangle) cut out in the pill's colour so they still read. */
.tab-bar-link svg :is(path, circle) {
  fill: currentColor;
  fill-opacity: 0;
}

html.nav-mobile .tab-bar-link.is-current svg :is(path, circle) {
  fill-opacity: 1;
}

html.nav-mobile .tab-bar-link.is-current[data-tab="home"] svg path:nth-child(3),
html.nav-mobile .tab-bar-link.is-current[data-tab="social"] svg path {
  fill: var(--tab-pill);
  stroke: var(--tab-pill);
}

.tab-bar.is-ready .tab-bar-link svg :is(path, circle) {
  transition: fill-opacity 180ms ease;
}

/* …and, becoming current, its own little animation (user, 2026-10-30):
   the house hops, the trophy spins round, the pie turns into place, the
   people wiggle, the play button pulses. */
.tab-bar.is-ready .tab-bar-link.is-current[data-tab="home"] svg {
  animation: tab-icon-hop 460ms cubic-bezier(0.3, 0.7, 0.4, 1);
}

.tab-bar.is-ready .tab-bar-link.is-current[data-tab="events"] svg {
  animation: tab-icon-spin 620ms cubic-bezier(0.25, 0.8, 0.3, 1);
}

.tab-bar.is-ready .tab-bar-link.is-current[data-tab="meta"] svg {
  animation: tab-icon-turn 520ms cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

.tab-bar.is-ready .tab-bar-link.is-current[data-tab="players"] svg {
  animation: tab-icon-wiggle 520ms ease-in-out;
  transform-origin: 50% 90%;
}

.tab-bar.is-ready .tab-bar-link.is-current[data-tab="social"] svg {
  animation: tab-icon-pulse 440ms cubic-bezier(0.2, 0.9, 0.3, 1.5);
}

@keyframes tab-icon-hop {
  35% {
    transform: translateY(-5px) scale(1.06);
  }

  65% {
    transform: translateY(0) scale(1.1, 0.9);
  }

  85% {
    transform: scale(0.97, 1.03);
  }
}

@keyframes tab-icon-spin {
  from {
    transform: perspective(60px) rotateY(-360deg) scale(0.85);
  }
}

@keyframes tab-icon-turn {
  from {
    transform: rotate(-140deg) scale(0.8);
  }
}

@keyframes tab-icon-wiggle {
  20% {
    transform: rotate(-12deg);
  }

  45% {
    transform: rotate(9deg);
  }

  70% {
    transform: rotate(-4deg);
  }
}

@keyframes tab-icon-pulse {
  from {
    transform: scale(0.6);
  }

  55% {
    transform: scale(1.18);
  }
}


/* Dark glass: a near-black tint (the segmented controls' #1e1517), the
   top edge a faint light line, the sheen fainter. */
:root[data-theme="dark"].nav-mobile .tab-bar {
  background: linear-gradient(to bottom, rgba(36, 26, 28, 0.62), rgba(24, 17, 19, 0.7));
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 -0.5px 0 rgba(0, 0, 0, 0.5), 0 -6px 20px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"].nav-mobile .tab-bar::before {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0));
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root[data-theme="dark"].nav-mobile .tab-bar {
    background: rgba(30, 21, 23, 0.96);
  }
}

:root[data-theme="dark"].nav-mobile .tab-bar-link {
  color: rgba(255, 255, 255, 0.88);
}

:root[data-theme="dark"].nav-mobile .tab-bar-link.is-current .tab-bar-name {
  color: #ff8a8d;
}

/* Hero pages in dark mode: the pill a deep shade of the colour (white
   reads on it), the name its light shade. */
:root[data-theme="dark"].nav-mobile .site-nav.has-hero-accent .tab-bar-icon {
  --tab-pill: var(--hero-accent-deep);
}

:root[data-theme="dark"].nav-mobile .site-nav.has-hero-accent .tab-bar-link.is-current .tab-bar-name {
  color: var(--hero-accent-light);
}

/* Social: blue, not red — like its tab in the computer nav (css/1's
   .nav-link[data-nav="social"]), user 2026-11-05. Its own pill (and the
   play triangle cut out in it) and its name, in both themes. */
html.nav-mobile .tab-bar-link[data-tab="social"] .tab-bar-icon {
  --tab-pill: var(--social-blue);
}

:root.nav-mobile .tab-bar-link.is-current[data-tab="social"] .tab-bar-name,
:root[data-theme="dark"].nav-mobile .tab-bar-link.is-current[data-tab="social"] .tab-bar-name {
  color: var(--social-blue-text);
}

@media (prefers-reduced-motion: reduce) {
  .tab-bar.is-ready :is(.tab-bar-icon, .tab-bar-name),
  .tab-bar.is-ready .tab-bar-icon::before {
    transition: none;
  }

  .tab-bar.is-ready .tab-bar-link.is-current[data-tab] svg {
    animation: none;
  }

  .tab-bar.is-ready .tab-bar-link svg :is(path, circle) {
    transition: none;
  }
}

/* The data's freshness note (js/data-updates.js): a small solid capsule at
   the top, centred, like the tab bar's — "Dati aggiornati" with its
   "Aggiorna", or "Offline · dati dell'ultimo accesso" for a moment. */
.data-note {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  left: 50%;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  padding: 6px 6px 6px 16px;
  border: 1px solid rgba(154, 28, 32, 0.12);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text-body);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(40, 6, 9, 0.2), 0 1px 3px rgba(40, 6, 9, 0.16);
  transform: translateX(-50%);
  animation: data-note-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.data-note:not(:has(button)) {
  padding-right: 16px;
}

.data-note button {
  padding: 7px 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-red);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

:root[data-theme="dark"] .data-note {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1e1517;
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.45);
}

@keyframes data-note-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
}

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

/* "Torna all'inizio": above the bar (it filled the screen's width) on the
   right, no longer beside the old pill. */
html.nav-mobile .back-to-top {
  right: 16px;
  left: auto;
  bottom: calc(var(--tab-bar-h) + 12px + env(safe-area-inset-bottom) + var(--back-to-top-lift, 0px));
  z-index: 15;
}

/* The bar slid away (scrolling down, .is-scrolled-away): the button drops
   into its place at the bottom, with the bar's own timing; back up with
   it. */
html.nav-mobile.is-nav-away .back-to-top {
  bottom: calc(16px + env(safe-area-inset-bottom) + var(--back-to-top-lift, 0px));
}

html.nav-mobile .back-to-top {
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s linear 200ms, bottom 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html.nav-mobile .back-to-top.is-visible {
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s, bottom 450ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
  html.nav-mobile .back-to-top,
  html.nav-mobile .back-to-top.is-visible {
    transition: none;
  }
}

/* Comandanti / Matchups / Archetipi's segmented control (the nav's "Meta",
   on every screen — a pill bar on a computer, the sticky segmented control
   on touch screens). Links, not buttons. */
.meta-tabs .profile-tab {
  text-decoration: none;
}

/* The section's head (.meta-head), laid out by CSS alone, so it's the same
   from the first frame on every page of the section. No visible title
   (its .page-heading only holds the <h1>, for screen readers). The
   sub-tabs' row (.meta-row) holds the switcher and the filters' button. A
   computer: one line — the sub-tabs at the left, the filters' button at the
   right end (the row and the heading display: contents, their items placed
   in the grid's columns).
   Touch screens: the wrapper steps aside (display: contents), the row the
   sticky part (the control inside it can't stick past the row's own box),
   the filters' button the switcher's bottom line (below). */
.meta-row > .meta-tabs {
  margin: 0;
}

.meta-head > .page-heading,
.meta-head .page-heading-title-group {
  display: contents;
}

html:not(.nav-mobile) .meta-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
}

html:not(.nav-mobile) .meta-head > .meta-row {
  display: contents;
}

html:not(.nav-mobile) .meta-head .meta-tabs {
  grid-column: 1;
  grid-row: 1;
}

html:not(.nav-mobile) .meta-head .filter-toggle-btn {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin-left: 0;
}

/* Touch screens (option A of a mockup, 2026-10-30 — user's choice after
   trying E, a summary line under the switcher): the filters' button is the
   switcher's fourth, narrow segment at its right end — the funnel alone,
   dark, red with a filter set (Giocatori's button's look) — a hairline
   before it; the two one card (.meta-row), sticking together. It opens the
   panel under the card as on Giocatori (css/5 .filter-panel: the same
   collapse). A computer keeps the round button. */
html.nav-mobile .meta-row > .filter-toggle-btn {
  flex: 0 0 54px;
  width: auto;
  height: auto;
  margin: 0;
  border: 1px solid var(--hairline);
  border-left: 0;
  border-radius: 0 18px 18px 0;
  background: #fff;
  box-shadow: none;
  color: var(--text-value);
  animation: none;
}

/* The hairline between the tabs and it. */
html.nav-mobile .meta-row > .filter-toggle-btn::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 1px;
  background: var(--hairline);
}

html.nav-mobile .meta-row > .filter-toggle-btn svg {
  width: 20px;
  height: 20px;
}

html.nav-mobile .meta-row > .filter-toggle-btn.has-active-filters {
  border-color: var(--hairline);
  background: #fff;
  color: var(--brand-red);
}

/* Open: the segment tinted, as a pressed tab. */
html.nav-mobile .meta-row > .filter-toggle-btn.is-open {
  background: #fff1ef;
}

:root[data-theme="dark"].nav-mobile .meta-row > .filter-toggle-btn,
:root[data-theme="dark"].nav-mobile .meta-row > .filter-toggle-btn.has-active-filters {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1e1517;
}

:root[data-theme="dark"].nav-mobile .meta-row > .filter-toggle-btn.has-active-filters {
  color: #ff8a8d;
}

:root[data-theme="dark"].nav-mobile .meta-row > .filter-toggle-btn.is-open {
  background: #2a1f22;
}

:root[data-theme="dark"].nav-mobile .meta-row > .filter-toggle-btn::before {
  background: rgba(255, 255, 255, 0.1);
}

/* The filters' button (every screen): not there while the page loads — it
   fades in with the content (the switcher's row itself shows from the
   first paint). */
.meta-head .filter-toggle-btn {
  transition: opacity 220ms ease, background 150ms ease;
}

body.is-loading .meta-head .filter-toggle-btn {
  opacity: 0;
  visibility: hidden;
  transition: none;
}

/* …but not when coming from another Meta page (js/meta-filters.js): the
   same button, already there, stays. */
html.meta-filter-kept body.is-loading .meta-head .filter-toggle-btn {
  opacity: 1;
  visibility: visible;
}

/* Touch screens: the segment is part of the switcher — there from the
   first paint with it. */
html.nav-mobile body.is-loading .meta-head .filter-toggle-btn {
  opacity: 1;
  visibility: visible;
}

html.nav-mobile .meta-head {
  display: contents;
}

html.nav-mobile .meta-row {
  margin: 0 0 18px;
  position: sticky;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 10;
  display: flex;
  align-items: stretch;
  /* The card's shadow, the switcher's and the segment's together. */
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

/* Every sticky segmented control on touch screens (.profile-tabs — Bacheca,
   event, league, commander, profile — and the Meta pages' .meta-row): while
   it's stuck to the top of the screen, a white band (dark mode: the
   control's colour) from the screen's top down to it, fading out beside
   it, so what scrolls beneath doesn't show above it — nothing below it is
   covered. Pure CSS — the control is a scroll-state
   container and its open tab's ::before draws it (placed
   against the control, the tab not being positioned; the open tab — a
   first one can be hidden), fading in / out;
   where scroll-state queries aren't supported (iOS for now) nothing shows.
   The control's own clip off, so they can reach outside it. */
html.nav-mobile .profile-tabs:not(.meta-tabs),
html.nav-mobile .meta-row {
  container-type: scroll-state;
}

html.nav-mobile .profile-tabs {
  overflow: visible;
}

html.nav-mobile :is(.profile-tabs:not(.meta-tabs), .meta-row) .profile-tab.is-active::before {
  content: "";
  position: absolute;
  left: calc(50% - 50vw);
  width: 100vw;
  pointer-events: none;
  opacity: 0;
  
}

/* The band: from the screen's top down to the control's bottom edge, the
   whole width — behind the control (z-index -1: under its tabs, over its
   own background, so the white band and the white control are one), so
   no content shows beside it either and the fade starts on one edge. */
html.nav-mobile :is(.profile-tabs:not(.meta-tabs), .meta-row) .profile-tab.is-active::before {
  top: calc(-8px - env(safe-area-inset-top));
  bottom: 0;
  z-index: -1;
  /* Solid down to the control, fading out beside it (behind it — only
     its sides show), clear at its bottom edge: nothing below is covered. */
  background: linear-gradient(var(--stuck-bg, #fff) calc(100% - 44px), transparent);
  /* Fully opaque at once (no fade-in), so nothing shows above meanwhile. */
  transition: none;
}

:root[data-theme="dark"] {
  --stuck-bg: #1e1517;
}

/* …and a soft shadow under the control itself, so it reads as lifted over
   what scrolls beneath: a box its size and rounding behind it (its open
   tab's ::after), only its shadow showing. */
html.nav-mobile :is(.profile-tabs:not(.meta-tabs), .meta-row) .profile-tab.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 18px;
  box-shadow: 0 8px 18px var(--stuck-occlusion, rgba(40, 6, 9, 0.16)), 0 2px 5px var(--stuck-occlusion-near, rgba(40, 6, 9, 0.08));
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

:root[data-theme="dark"] {
  --stuck-occlusion: rgba(0, 0, 0, 0.55);
  --stuck-occlusion-near: rgba(0, 0, 0, 0.3);
}

@container scroll-state(stuck: top) {
  html.nav-mobile :is(.profile-tabs:not(.meta-tabs), .meta-row) .profile-tab.is-active::before,
  html.nav-mobile :is(.profile-tabs:not(.meta-tabs), .meta-row) .profile-tab.is-active::after {
    opacity: 1;
  }
}

html.nav-mobile .meta-row > .meta-tabs {
  position: static;
  /* (A flex item now: its z-index from the sticky controls' rule would
     apply even unpositioned, lifting it and its band over the segment.) */
  z-index: auto;
  flex: 1;
  min-width: 0;
  /* The card's left part: the filters' segment is its right end. */
  border-right: 0;
  border-radius: 18px 0 0 18px;
  box-shadow: none;
}

/* A row without the filters' segment (none now — Giocatori / Confronto got
   theirs 2026-11-04): the switcher the whole card. */
html.nav-mobile .meta-row > .meta-tabs:only-child {
  border-right: 1px solid var(--hairline);
  border-radius: 18px;
}

/* The page's own <h1>: for screen readers only; Matchups' "?" in the
   matrix panel's top-left corner instead of beside it. */
.meta-head .page-heading h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.meta-head .page-heading .help-toggle-btn {
  display: none;
}

/* The Dove bar (js/where-filter.js — option H2 of a mockup, 2026-11-04):
   Dal vivo · Online · Tutto, a small pill bar in the section's head, on the
   Meta pages and Giocatori / Confronto alike. A computer: in the tabs'
   row, at its right end, before the filters' button where there is one;
   touch screens: a bar of its own, the page's width, under the sticky
   switcher (not sticky itself). The choice tinted like a picked option,
   Online in endstep's colours (its gold on its near-black). Static in each
   page, wired at mount; hidden unless there are both live and online
   events (js/where-filter.js). */
.where-filter {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: #fff;
}

.where-filter[hidden] {
  display: none;
}

:root[data-theme="dark"] .where-filter {
  border-color: rgba(255, 255, 255, 0.1);
  background: #1e1517;
}

.where-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.where-opt:not(.is-active):hover {
  color: var(--text-title);
}

.where-opt.is-active {
  background: color-mix(in srgb, var(--brand-red) 10%, transparent);
  color: var(--brand-red-deep);
}

:root[data-theme="dark"] .where-opt:not(.is-active):hover {
  color: #f3e9ea;
}

:root[data-theme="dark"] .where-opt.is-active {
  background: rgba(255, 110, 110, 0.14);
  color: #ff9a9d;
}

.where-opt[data-where="online"].is-active {
  background: var(--endstep-ink);
  color: var(--endstep-gold);
}

/* The lotus (Dal vivo, dc_pc_lotus.svg by a mask, in the text's colour)
   and endstep's logo (Online, its gold). */
.where-lotus {
  flex-shrink: 0;
  width: 1.25em;
  height: 0.95em;
  background: currentColor;
  -webkit-mask: url(../dc_pc_lotus.svg) center / contain no-repeat;
  mask: url(../dc_pc_lotus.svg) center / contain no-repeat;
}

.where-opt svg {
  flex-shrink: 0;
  width: 1.05em;
  height: 1.05em;
  color: var(--endstep-gold-deep);
}

.where-opt.is-active svg {
  color: var(--endstep-gold);
}

/* A computer: the row's middle column, pushed right — the filters' button
   (the Meta pages) a third column after it. */
html:not(.nav-mobile) .meta-head > .where-filter {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
}

html:not(.nav-mobile) .meta-head:has(.filter-toggle-btn) {
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 12px;
}

html:not(.nav-mobile) .meta-head:has(> .where-filter) .filter-toggle-btn {
  grid-column: 3;
}

/* A narrow window (no touch): the Meta pages' four tabs, the bar and the
   button don't fit one line — the bar a line of its own under them, at
   the right; Giocatori / Confronto's two tabs only when narrower still. */
@media (max-width: 960px) {
  html:not(.nav-mobile) .meta-head:has(.filter-toggle-btn) > .where-filter {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  html:not(.nav-mobile) .meta-head:has(.filter-toggle-btn) {
    row-gap: 14px;
  }
}

@media (max-width: 600px) {
  html:not(.nav-mobile) .meta-head > .where-filter {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  html:not(.nav-mobile) .meta-head {
    row-gap: 14px;
  }
}

/* Touch screens: the page's width, the three equal, under the switcher's
   card (its 18px margin partly taken back). Not when hidden (:not — this
   rule would outrank .where-filter[hidden] above). */
html.nav-mobile .where-filter:not([hidden]) {
  display: flex;
  margin: -6px 0 16px;
}

html.nav-mobile .where-opt {
  flex: 1;
  padding: 8px 6px;
}

/* player.html's Dove bar (js/player-detail.js — user, 2026-11-16): on
   touch screens at the top of the sheet under the hero (.hero-sheet),
   above the league recap, the sheet's width like the Meta pages' (the rule
   above, its top margin given back); elsewhere moved into the hero by the
   script, between the name and the numbers, at the left (a narrow window:
   centred), lifted off the art by a shadow. The hero never changes height
   on a change (holdNumbersHeight), so nothing moves. commander.html's the
   same (user, 2026-11-19): at the top of its sheet / in its hero before the
   numbers. */
main:is([data-page="player"], [data-page="commander"]) .hero-sheet > .where-filter:not([hidden]) {
  margin: 0 0 18px;
}

/* Touch screens: closer to the sheet's top edge (into its 22px padding —
   user, 2026-11-16). */
html.nav-mobile main:is([data-page="player"], [data-page="commander"]) .hero-sheet > .where-filter:not([hidden]) {
  margin: -10px 0 16px;
}

html:not(.nav-mobile) :is(#player-hero, #commander-hero) .profile-hero-stats:has(> .where-filter:not([hidden])) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

html:not(.nav-mobile) :is(#player-hero, #commander-hero) .profile-hero-stats > .where-filter {
  order: -1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

@media (max-width: 820px) {
  html:not(.nav-mobile) :is(#player-hero, #commander-hero) .profile-hero-stats > .where-filter {
    align-self: center;
  }
}

/* The Bacheca's Dove bar (js/home.js renderCommandersSection — user,
   2026-11-16): above Più giocati's card — on a computer at the left, on
   touch screens the page's width like the Meta pages' (the rule above). */
.home-panel-meta > .where-filter:not([hidden]) {
  margin-bottom: 14px;
}

html.nav-mobile .home-panel-meta > .where-filter:not([hidden]) {
  margin: 0 0 14px;
}

/* Its league recap (the live league's) hidden under "Online". */
.league-recap.is-where-hidden {
  display: none;
}

/* Matchups on touch screens: "Crea tabella personalizzata" / "Mostra
   tabella predefinita" centred under the matrix (js/matchups-page.js moves
   it there). */
html.nav-mobile #matchups-matrix + #matchups-custom-btn {
  display: flex;
  width: fit-content;
  margin: 18px auto 0;
}

/* Matchups on touch screens: no "Comandanti più giocati" / "Tabella
   personalizzata" line (its button is under the matrix, above). On every
   screen the "?" is on the matrix panel's top-left corner (below). */
html.nav-mobile .matchups-toolbar {
  display: none;
}

/* On every screen the "?" (how to read the matrix) on the matrix panel's
   top-left corner (over the empty corner cell) — out over it, a white ring. */
.matchups-matrix-wrap > .matchups-help-corner {
  position: absolute;
  top: -5px;
  left: -5px;
  z-index: 2;
  box-shadow: 0 0 0 2px #fff, var(--shadow-card);
}

:root[data-theme="dark"] .matchups-matrix-wrap > .matchups-help-corner {
  box-shadow: 0 0 0 2px #1e1517, var(--shadow-card);
}

/* ---------------------------------------------------------------------------
   Page transitions (js/router.js, in-app navigation): the screen changes
   with Material's fade through, while the header's own controls (the logo,
   the search, the profile picture) and the nav (the touch tab bar) stay still
   on top of it — wider than a phone, the whole red header and the tab row
   stay still instead. The names only during the transition
   (html.is-page-transition — a name changes how an element stacks);
   reduced motion: no transition at all (the router swaps straight away).
   --------------------------------------------------------------------------- */
html.is-page-transition .site-header,
html.is-page-transition footer {
  view-transition-name: none;
}

html.is-page-transition .site-header-brand {
  view-transition-name: hdr-brand;
}

html.is-page-transition .site-search {
  view-transition-name: hdr-search;
}

html.is-page-transition .site-account {
  view-transition-name: hdr-account;
}

html.is-page-transition .site-news {
  view-transition-name: hdr-news;
}

html.is-page-transition .site-nav {
  view-transition-name: site-nav;
}

/* Touch screens: the glass tab bar keeps no name of its own in a
   cross-fade — a named element is snapshotted alone, with nothing behind
   it to blur, so for the transition it lost its blur (just the thin tint,
   user 2026-11-06). Left in the page's own snapshot it's drawn as it is,
   and being the same on both pages (bar the current tab) it reads as
   still. The Profilo slide keeps the name (else it would slide with the
   page): there the blur goes on its group instead, over the sliding
   screens (where the browser applies it). */
html.is-page-transition.nav-mobile:not(.is-slide-in):not(.is-slide-out) .site-nav {
  view-transition-name: none;
}

html.nav-mobile:is(.is-slide-in, .is-slide-out)::view-transition-group(site-nav) {
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
}

html[data-theme="dark"].nav-mobile:is(.is-slide-in, .is-slide-out)::view-transition-group(site-nav) {
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
}

/* The red header (a computer wider than a phone — not html.app-header): it
   stays still whole instead — an opaque bar, its logo kept in its snapshot
   (the "One top bar" rules give it and the back pill their own name); the
   search, the bell and the account button keep theirs, so they can slide /
   pop when the bell comes or goes (below); the page below it moves. */
html.is-page-transition:not(.app-header) .site-header {
  view-transition-name: site-header;
}

html.is-page-transition:not(.app-header) .site-header-brand {
  view-transition-name: none;
}

::view-transition-group(site-header),
::view-transition-old(site-header),
::view-transition-new(site-header) {
  z-index: 10;
  animation-duration: 0s;
}

/* The still controls: on top of the sliding screen, swapped at once. */
::view-transition-group(hdr-brand),
::view-transition-group(hdr-search),
::view-transition-group(hdr-account),
::view-transition-group(hdr-news),
::view-transition-group(site-nav) {
  z-index: 10;
  animation-duration: 0s;
}

::view-transition-old(hdr-brand),
::view-transition-new(hdr-brand),
::view-transition-old(hdr-search),
::view-transition-new(hdr-search),
::view-transition-old(hdr-account),
::view-transition-new(hdr-account),
::view-transition-old(hdr-news),
::view-transition-new(hdr-news) {
  animation-duration: 0s;
}

/* The bell (.site-news) comes and goes on touch screens (not on the hero
   pages): arriving it pops in — scaling up from small with a little bounce
   as it fades in — and leaving it shrinks away; the search and the account
   button (their own names on a computer too, out of the still bar's
   snapshot) slide over to where they now are instead of jumping. */
::view-transition-group(hdr-search),
::view-transition-group(hdr-account) {
  animation-duration: 320ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

::view-transition-new(hdr-news):only-child {
  animation: bell-in 360ms cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

::view-transition-old(hdr-news):only-child {
  animation: bell-out 200ms ease-in both;
}

@keyframes bell-in {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
}

@keyframes bell-out {
  to {
    opacity: 0;
    transform: scale(0.3);
  }
}

/* The nav cross-fades with the screen: its open panel (closed in the swap,
   js/nav-dropdown.js) leaves with the old page, the pill's label / active
   tab change the same way; the pill itself, the same in both, stays as it
   is. */
::view-transition-old(site-nav),
::view-transition-new(site-nav) {
  animation-duration: 220ms;
}

/* The screen itself, on every in-app navigation (between nav sections,
   list ↔ detail, back and forth): a cross-fade — the old screen out while
   the new one comes in, plus-lighter so the screen stays covered all the
   way (the same as the quiet redraw's, below). Since 2026-10-28: it was a
   fade *through* (out 90ms, then in 250ms), which for a moment showed only
   the page's light background — between two dark heroes (player,
   commander, league on a phone) the hero went nearly white, then dark
   again. Opacity only: the snapshot is the whole screen, so any scale /
   slide moved its edges in view — an edge-to-edge hero's corners shrinking
   over the page background. */
::view-transition-old(root) {
  animation: page-fade-out 220ms ease both;
  mix-blend-mode: plus-lighter;
}

::view-transition-new(root) {
  animation: page-fade-through-in 220ms ease both;
  mix-blend-mode: plus-lighter;
}

@keyframes page-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes page-fade-through-in {
  from {
    opacity: 0;
  }
}

/* Profile slide (touch screens only, since 2026-10-30 — user, like
   Google's apps): into the Profilo page (account.html, the header's picture
   button — html.is-slide-in, js/router.js) the new screen comes in from the
   right as a solid page over the old one, which drifts a little to the left
   and dims under it; back out of it (html.is-slide-out: the browser's back)
   the same in reverse — the profile slides away to the right, uncovering
   the page before. The header (logo, bell, search, picture) and the tab bar
   stay still on top: their own names, above. */
/* Nothing of the pages themselves above the sliding profile: the parts
   that keep their own name between some pages (the Meta pages' segmented
   control, meta-tabs below) go with their screen here, like the rest of
   it. */
html.is-page-transition.nav-mobile:is(.is-slide-in, .is-slide-out) main > .meta-head > .meta-row {
  view-transition-name: none;
}

html.nav-mobile.is-slide-in::view-transition-old(root) {
  animation: page-slide-under 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  mix-blend-mode: normal;
}

html.nav-mobile.is-slide-in::view-transition-new(root) {
  animation: page-slide-from-right 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  mix-blend-mode: normal;
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.18);
}

html.nav-mobile.is-slide-out::view-transition-old(root) {
  z-index: 1;
  animation: page-slide-from-right 300ms cubic-bezier(0.4, 0, 0.6, 1) reverse both;
  mix-blend-mode: normal;
  box-shadow: -10px 0 28px rgba(0, 0, 0, 0.18);
}

html.nav-mobile.is-slide-out::view-transition-new(root) {
  animation: page-slide-under 300ms cubic-bezier(0.4, 0, 0.6, 1) reverse both;
  mix-blend-mode: normal;
}

@keyframes page-slide-from-right {
  from {
    transform: translateX(100%);
  }
}

@keyframes page-slide-under {
  to {
    transform: translateX(-25%);
    filter: brightness(0.85);
  }
}

/* ---------------------------------------------------------------------------
   Quiet redraw (js/router.js go's quiet branch, js/data-updates.js): the
   page on screen redrawn with fresh data — the whole screen as one picture
   (no part keeps its own transition name), cross-faded quickly once the new
   one is drawn; meanwhile every animation jumps to its end (the tiles'
   entrance, the timeline's…: nothing plays again — an endless one carries
   on afterwards), and every transition too (the splash's fade-out, an
   art's fade-in: the new screen's picture is taken with them done, not
   half-way). Except the phones' hero parallax (.profile-hero.is-parallax,
   its art and content — scroll-driven animations, css "The hero pages on
   touch screens"): at its "end" it's the hero pushed down by half its
   height and blurred, the light page above it — which every quiet redraw
   on a hero page showed for a moment until 2026-10-28.
   --------------------------------------------------------------------------- */
html.is-quiet-refresh *,
html.is-quiet-refresh *::before,
html.is-quiet-refresh *::after {
  view-transition-name: none !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

html.is-quiet-refresh *:not(.profile-hero.is-parallax, .profile-hero.is-parallax .profile-hero-art, .profile-hero.is-parallax .profile-hero-inner),
html.is-quiet-refresh *::before,
html.is-quiet-refresh *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
}

/* plus-lighter: a true cross-fade, the screen covered all the way through.
   Our own `animation` replaces the browser's, which also set it — without,
   both halves are half see-through midway and the bare page background
   shows through (a light flash over a dark hero). Same for the theme
   switch below. */
html.is-quiet-refresh::view-transition-old(root) {
  animation: page-fade-out 200ms ease both;
  mix-blend-mode: plus-lighter;
}

html.is-quiet-refresh::view-transition-new(root) {
  animation: page-fade-through-in 200ms ease both;
  mix-blend-mode: plus-lighter;
}

/* ---------------------------------------------------------------------------
   Theme switch (js/theme.js switchTheme): light ↔ dark chosen by a tap, the
   old colours fade into the new ones — the whole screen as one picture (no
   part of the page keeps its own transition name meanwhile: the header's
   and footer's, always set), cross-faded.
   --------------------------------------------------------------------------- */
html.is-theme-transition * {
  view-transition-name: none !important;
}

html.is-theme-transition::view-transition-old(root) {
  animation: page-fade-out 320ms ease both;
  mix-blend-mode: plus-lighter;
}

html.is-theme-transition::view-transition-new(root) {
  animation: page-fade-through-in 320ms ease both;
  mix-blend-mode: plus-lighter;
}

/* Comandanti / Matchups / Archetipi — one section, "Meta": moving between
   them, its title line (the filters' button on it) and the segmented
   control stay still, swapped at once, while the rest of the page fades
   through; to or from any other page (only one side has them) they fade
   with the page as usual. The same between sections: Meta, Giocatori /
   Confronto and Leghe (its In corso / Archivio tabs, .ev-tabs — in the same
   place, user's request 2026-11-07) swap their switchers at once too. */
html.is-page-transition:not(.nav-mobile) main > :is(.meta-head, .ev-tabs) {
  view-transition-name: meta-heading;
}

html.is-page-transition.nav-mobile main > :is(.meta-head > .meta-row, .ev-tabs) {
  view-transition-name: meta-tabs;
}

::view-transition-group(meta-heading),
::view-transition-group(meta-tabs),
::view-transition-old(meta-heading),
::view-transition-new(meta-heading),
::view-transition-old(meta-tabs),
::view-transition-new(meta-tabs) {
  animation-duration: 0s;
}

::view-transition-old(meta-heading):only-child,
::view-transition-old(meta-tabs):only-child {
  animation: page-fade-out 220ms ease both;
}

::view-transition-new(meta-heading):only-child,
::view-transition-new(meta-tabs):only-child {
  animation: page-fade-through-in 220ms ease both;
}

/* ---------------------------------------------------------------------------
   One top bar (a computer — html:not(.nav-mobile); touch screens keep their
   transparent header + nav pill): the red header and the white tab row
   become a single sticky bar — the logo (the site's name hidden from view),
   the tabs, the search and the account button. The markup stays two
   elements (duplicated in every page, js/router.js relies on it): the nav
   is laid over the header's middle — pulled up by the bar's height, sticky
   at the same top, letting clicks through except on its own links — with
   its row placed between the logo and the search (the same 1100px centred
   column as .site-header-inner), scrolling sideways when the tabs don't
   fit. On a hero page (every one, the header .has-hero-accent) the bar
   takes a deep shade of the hero's colour, the hero hangs right under it
   (square top, rounded bottom) and the back pill sits in the bar, in the
   logo's place (js/router.js syncBarBackButton copies it there; the
   hero's own one hidden), a thin divider before the tabs.
   --------------------------------------------------------------------------- */
html:not(.nav-mobile) {
  --bar-h: 64px;
  --bar-pad: 20px;
  --bar-gap: 16px;
  /* The logo's size (and where the tabs start after it). */
  --bar-logo: 48px;
  /* The search: a round button (below). */
  --bar-search: 38px;
}

@media (max-width: 480px) {
  html:not(.nav-mobile) {
    --bar-pad: 16px;
    --bar-gap: 12px;
    --bar-logo: 40px;
  }
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-logo-sm {
  width: var(--bar-logo);
  height: var(--bar-logo);
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) {
  position: sticky;
  top: 0;
  box-sizing: border-box;
  height: var(--bar-h);
  padding: 0 var(--bar-pad);
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-header-inner {
  height: 100%;
  gap: var(--bar-gap);
}

/* The name hidden from view, kept for screen readers (the logo link's only
   text) — as on phones. */
html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-header-brand > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

html:not(.nav-mobile) .site-nav,
:root[data-theme="dark"]:not(.nav-mobile) .site-nav {
  position: sticky;
  top: 0;
  z-index: 26;
  box-sizing: border-box;
  height: var(--bar-h);
  margin-top: calc(-1 * var(--bar-h));
  padding: 0 var(--bar-pad);
  border-bottom: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
  /* The active tab's and the back pill's ink: the bar's colour. */
  --bar-ink: var(--brand-red);
}

html:not(.nav-mobile) .site-nav.has-hero-accent {
  --bar-ink: var(--hero-accent-deep);
}

/* Between the logo and the search, in the header row's centred column:
   margins (not padding — a scrolled tab would show under the search). */
html:not(.nav-mobile) .site-nav-inner {
  box-sizing: border-box;
  height: 100%;
  max-width: none;
  margin: 0 calc(max(0px, (100% - 1100px) / 2) + var(--bar-search) + 38px + 2 * var(--bar-gap) + var(--bar-news, 0px)) 0 calc(max(0px, (100% - 1100px) / 2) + var(--bar-logo) + var(--bar-gap));
  padding: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  /* Not smooth: a mouse drag (js/top-bar.js) sets scrollLeft on every
     move. */
  scroll-behavior: auto;
  /* Its own area only (the bar's middle) takes clicks and drags. */
  pointer-events: auto;
  transition: margin-right 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease, visibility 0s;
}

html:not(.nav-mobile) .site-nav-inner::-webkit-scrollbar {
  display: none;
}

html:not(.nav-mobile) .site-nav-inner > * {
  flex-shrink: 0;
}

/* Tabs that don't fit: dragged with the mouse (grab cursor), faded at the
   edge(s) with more that way (js/drag-scroll.js's classes). */
html:not(.nav-mobile) .site-nav-inner.is-scrollable {
  cursor: grab;
}

html:not(.nav-mobile) .site-nav-inner.is-dragging {
  cursor: grabbing;
}

html:not(.nav-mobile) .site-nav-inner.fade-right {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}

html:not(.nav-mobile) .site-nav-inner.fade-left {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px);
  mask-image: linear-gradient(to right, transparent, #000 32px);
}

html:not(.nav-mobile) .site-nav-inner.fade-left.fade-right {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
}

/* The search in the bar: always a round button like the phones' one (the
   field shrunk to a 38px circle, the icon alone, centred), which opens
   into the field over the tabs (hidden meanwhile) when clicked — focused,
   the search is open (js/site-search.js; the click, js/top-bar.js) — and
   closes back into the circle, both animated. */
html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-search-field {
  box-sizing: border-box;
  width: 38px;
  height: 38px;
  padding: 0 0 0 9.5px;
  overflow: hidden;
  cursor: pointer;
  transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1), padding 260ms cubic-bezier(0.2, 0.8, 0.2, 1), background 150ms ease, border-color 150ms ease;
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-search-input {
  opacity: 0;
  transition: opacity 180ms ease;
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-search-box.is-open .site-search-field {
  width: min(280px, 60vw);
  padding: 0 14px;
  cursor: auto;
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) .site-search-box.is-open .site-search-input {
  opacity: 1;
}

html:not(.nav-mobile) body:has(.site-search-box.is-open) .site-nav-inner {
  opacity: 0;
  visibility: hidden;
  transition: margin-right 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease, visibility 0s linear 180ms;
}

/* The tabs on the bar: light text, a glass hover, the current one white
   in the bar's colour (Social's blue too). Social no longer pushed to the
   far right (the search is there). */
html:not(.nav-mobile) .site-nav .nav-link,
html:not(.nav-mobile) .site-nav .nav-link[data-nav="social"] {
  margin-left: 0;
  border-color: transparent;
  color: rgba(255, 255, 255, 0.88);
}

html:not(.nav-mobile) .site-nav .nav-link:hover,
:root[data-theme="dark"]:not(.nav-mobile) .site-nav .nav-link:hover,
html:not(.nav-mobile) .site-nav .nav-link[data-nav="social"]:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

html:not(.nav-mobile) :is(
  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"]
),
html:not(.nav-mobile) :is(
  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"]
):hover {
  background: #fff;
  color: var(--bar-ink);
}

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

/* The bar's colour: its gradient's two ends as registered colours, so it
   blends from one to the other (a gradient itself can't be transitioned) —
   the brand red, or on a hero page a deep shade of the hero's colour
   (js/player-card.js applyHeroTone sets it on the header, --hero-bar the
   darkest). The header stays across in-app navigations, so this plays
   during the page's own transition, with the logo / back pill's morph
   (below), and again when a hero's colour arrives. */
@property --bar-c1 {
  syntax: "<color>";
  inherits: false;
  initial-value: #7e0c13;
}

@property --bar-c2 {
  syntax: "<color>";
  inherits: false;
  initial-value: #dc181c;
}

html:not(.nav-mobile) .site-header:not(.site-header--admin) {
  --bar-c1: #7e0c13;
  --bar-c2: #dc181c;
  background: linear-gradient(135deg, var(--bar-c1), var(--bar-c2));
  transition: --bar-c1 450ms ease, --bar-c2 450ms ease, box-shadow 450ms ease;
}

html:not(.nav-mobile) .site-header.has-hero-accent {
  --bar-c1: var(--hero-bar);
  --bar-c2: var(--hero-accent-deep);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

html:not(.nav-mobile) .site-nav .nav-link {
  transition: background 180ms ease, color 450ms ease;
}

/* The back pill in the bar, in the logo's place (hidden there), a thin
   divider after it; the hero's own one hidden. White, in the bar's colour,
   the label cut with an ellipsis past 220px. */
html:not(.nav-mobile) .page-main .detail-hero-back {
  display: none;
}

html:not(.nav-mobile) body:has(.site-nav .detail-hero-back) .site-header-brand {
  visibility: hidden;
}

html:not(.nav-mobile) body:has(.site-nav .detail-hero-back) .site-nav-inner {
  margin-left: max(0px, (100% - 1100px) / 2);
}

html:not(.nav-mobile) .site-nav .detail-hero-back {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  transform: none;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 38px;
  min-height: 0;
  max-width: 220px;
  margin-right: 14px;
  padding: 0 15px 0 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: none;
  color: var(--bar-ink);
  font-size: 0.88rem;
}

html:not(.nav-mobile) .site-nav .detail-hero-back:hover {
  border: 0;
  background: #fff;
  color: var(--bar-ink);
}

html:not(.nav-mobile) .site-nav .detail-hero-back::after {
  content: "";
  position: absolute;
  top: 7px;
  right: -8px;
  bottom: 7px;
  width: 1px;
  background: rgba(255, 255, 255, 0.3);
}

/* The hero hanging from the bar: pulled up by the page's top padding
   (28px; 20px on phone widths), square top, rounded bottom — account.html's
   too, inside its signed-in section (.profile). Not under its "Il tuo
   giocatore" banner (the hero isn't first there). */
html:not(.nav-mobile) body:not(:has(.profile-claim:not([hidden]))) :is(
  .page-main .profile-hero:first-child,
  .page-main .detail-hero-wrap:first-child .profile-hero,
  .page-loading-region > .detail-hero-wrap:nth-child(2) .profile-hero,
  .page-loading-region > .profile-hero,
  .page-loading-region > .profile > .profile-hero
) {
  margin-top: -28px;
  border-radius: 0 0 28px 28px;
}

@media (max-width: 640px) {
  html:not(.nav-mobile) body:not(:has(.profile-claim:not([hidden]))) :is(
    .page-main .profile-hero:first-child,
    .page-main .detail-hero-wrap:first-child .profile-hero,
    .page-loading-region > .detail-hero-wrap:nth-child(2) .profile-hero,
    .page-loading-region > .profile-hero,
    .page-loading-region > .profile > .profile-hero
  ) {
    margin-top: -20px;
  }
}

/* No pill in the hero's corner any more (up to 820px it pushed the
   content down to make room). */
@media (max-width: 820px) {
  html:not(.nav-mobile) .detail-hero .profile-hero-inner {
    padding-top: 24px;
  }
}

/* Page transitions in the bar (see "Page transitions" above — the bar
   itself stays still): the logo and the back pill share one name, so
   entering a hero page the logo grows into the back pill, leaving it the
   pill shrinks back into the logo, and between two hero pages one pill
   turns into the other; the tab row has its own, so it slides to where it
   now starts (after the pill, or after the logo) instead of jumping. Each
   one only while shown (the logo is hidden when the pill is there); tab to
   tab (no pill on either page, js/router.js html.is-bar-logo-stay) the logo
   gets no name at all — it just stays where it is, no morph into itself. The
   snapshots keep their own height and width, anchored left — stretched to
   the moving box, the logo would have grown as wide as the pill. */
html.is-page-transition:not(.nav-mobile):not(.is-bar-logo-stay) body:not(:has(.site-nav .detail-hero-back)) .site-header:not(.site-header--admin) .site-header-brand,
html.is-page-transition:not(.nav-mobile) .site-nav .detail-hero-back {
  view-transition-name: bar-lead;
}

html.is-page-transition:not(.nav-mobile) .site-nav-inner {
  view-transition-name: bar-tabs;
}

::view-transition-group(bar-lead),
::view-transition-group(bar-tabs) {
  z-index: 11;
  animation-duration: 340ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

::view-transition-old(bar-lead),
::view-transition-new(bar-lead),
::view-transition-old(bar-tabs),
::view-transition-new(bar-tabs) {
  inset-inline-start: 0;
  inline-size: auto;
  block-size: 100%;
  object-fit: none;
  object-position: left center;
  animation-duration: 340ms;
}

/* The logo ↔ back pill: one shape morphing — clipped to the moving box,
   rounded like both (a circle, a capsule), so entering a hero page the
   logo's circle stretches into the pill's capsule, uncovering its label as
   it widens, and leaving it the pill folds back into the circle. The one
   going fades out quickly, the one coming fades in just behind it (no
   additive cross-fade: the white pill would flash brighter). */
/* The clip's rounding follows the way it goes — the logo isn't round, a
   capsule radius on its box cut its corners until the end: towards the
   pill (the new page has one in the bar) square → the pill's 19px, towards
   the logo 19px → square. */
::view-transition-image-pair(bar-lead) {
  overflow: hidden;
  animation: bar-lead-clip-to-logo 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

:root:has(.site-nav .detail-hero-back)::view-transition-image-pair(bar-lead) {
  animation-name: bar-lead-clip-to-pill;
}

@keyframes bar-lead-clip-to-logo {
  from {
    border-radius: 19px;
  }
  to {
    border-radius: 0;
  }
}

@keyframes bar-lead-clip-to-pill {
  from {
    border-radius: 0;
  }
  to {
    border-radius: 19px;
  }
}

::view-transition-old(bar-lead) {
  mix-blend-mode: normal;
  animation: bar-lead-out 150ms ease-out both;
}

::view-transition-new(bar-lead) {
  mix-blend-mode: normal;
  animation: bar-lead-in 220ms ease-out 70ms both;
}

/* Touch screens: a hero's back pill (in the page, up in the header's row)
   has its own name too, so going from one hero page to another — back or
   forward — it stays where it is and just resizes to the new label (clipped
   to its moving capsule, the old label fading out, the new one in, like
   the bar's on a computer); arriving from / leaving for a page without one,
   it fades in / out. */
html.is-page-transition.app-header .page-main .detail-hero-back {
  view-transition-name: hero-back;
}

/* …and the logo shares that name when the other page has a pill and this
   one doesn't: entering a hero page the logo morphs into the back pill,
   leaving it the pill morphs back into the logo (tab to tab — no pill on
   either page, js/router.js html.is-bar-logo-stay — the logo stays still,
   with its own hdr-brand). */
html.is-page-transition.app-header:not(.is-bar-logo-stay) body:not(:has(.page-main .detail-hero-back)) .site-header-brand {
  view-transition-name: hero-back;
}

::view-transition-group(hero-back) {
  z-index: 11;
  animation-duration: 340ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Clipped to the moving box (the label uncovered as it widens), with room
   round it — the pill (46px, its shadow under it) is taller than the logo
   (44px): a clip at the box's own edges cut it; the rounding by direction
   (like the bar's, bar-lead): towards a pill square → capsule, towards the
   logo capsule → square (the logo isn't round — a fixed capsule cut its
   corners). */
::view-transition-image-pair(hero-back) {
  animation: hero-back-clip-to-logo 340ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

:root:has(.page-main .detail-hero-back)::view-transition-image-pair(hero-back) {
  animation-name: hero-back-clip-to-pill;
}

/* The clip ~10px out round the box on every side (4px above): the pill's
   whole shape and its shadow inside it at the end; its corners rounding to
   a capsule's (30px — the pill's own 23px end fits within) towards the
   pill, so its leading edge stays round as it widens; towards the logo
   square all the way (rounded corners still easing off trimmed the logo's
   as it came in — the pill fading out quickly, its straight cut barely
   shows). */
@keyframes hero-back-clip-to-logo {
  from,
  to {
    clip-path: inset(-4px -10px -10px -10px);
  }
}

@keyframes hero-back-clip-to-pill {
  from {
    clip-path: inset(-4px -10px -10px -10px round 0);
  }
  to {
    clip-path: inset(-4px -10px -10px -10px round 30px);
  }
}

::view-transition-old(hero-back),
::view-transition-new(hero-back) {
  inset-inline-start: 0;
  inline-size: auto;
  block-size: auto;
  object-fit: none;
  object-position: left top;
  mix-blend-mode: normal;
}

::view-transition-old(hero-back) {
  animation: bar-lead-out 150ms ease-out both;
}

::view-transition-new(hero-back) {
  animation: bar-lead-in 220ms ease-out 70ms both;
}

@keyframes bar-lead-out {
  to {
    opacity: 0;
  }
}

@keyframes bar-lead-in {
  from {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------------------
   The hero pages on touch screens (player, league, event, commander,
   archetype, account — option C, "Foglio", of a mockup, 2026-10-23): the
   page's content after the hero is one sheet (.hero-sheet, a wrapper in each
   page's markup) in the page's colour with rounded top corners, laid 26px
   over the hero's bottom. The page scrolls, hero and all — but the hero
   (one that fits on the screen, .is-parallax from js/hero-sheet.js) at half
   speed, so the sheet slides up over it, a little like a phone's app
   drawer over the wallpaper: the whole hero — art, name, card, numbers —
   blurring and darkening more and more — a scroll-driven animation over the first --hero-h
   of scroll, after which the sheet covers it wholly (where it isn't
   supported, or with reduced motion, everything just scrolls). The header
   row (back pill, search, account) scrolls normally — it's outside the
   hero. (Tried and dropped: the half speed with the content only fading;
   the hero standing still, blurring; one keeping its header row and name
   on top.) On a computer the wrapper
   is no box at all (display: contents) — the layout as before. */
.hero-sheet {
  display: contents;
}

html.app-header .hero-sheet {
  --sheet-bleed: var(--page-pad-x, 16px);
  position: relative;
  z-index: 1;
  display: flow-root;
  margin: -26px calc(-1 * var(--sheet-bleed)) 0;
  padding: 22px var(--sheet-bleed) 0;
  border-radius: 26px 26px 0 0;
  background: var(--bg-cream-1);
  box-shadow: 0 -6px 16px rgba(20, 8, 10, 0.14);
}

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

@media (min-width: 641px) {
  html.app-header .hero-sheet {
    --sheet-bleed: var(--hero-bleed);
  }
}

/* Phones: down through the page's bottom padding too (.page-main's 36px),
   so no strip of the page's own background shows between it and the
   footer. */
@media (max-width: 640px) {
  html.app-header .hero-sheet {
    margin-bottom: -36px;
    padding-bottom: 36px;
  }
}

/* The hero meets the sheet: no gap under it, and room at its bottom for the
   sheet's rounded edge (26px) so nothing of it ends up under the sheet. */
html.app-header body:has(.hero-sheet) .profile-hero {
  margin-bottom: 0;
}

html.app-header :is(.detail-hero-wrap:has(+ .hero-sheet) .profile-hero, .profile-hero:has(+ .hero-sheet)) .profile-hero-inner {
  padding-bottom: 50px;
}

/* The art a little further out than its usual 40px, for the stronger
   blur's soft edge to stay outside the hero too. */
html.app-header .profile-hero.is-parallax .profile-hero-art {
  inset: -90px;
}

@keyframes hero-parallax {
  to {
    transform: translateY(calc(var(--hero-h, 400px) / 2));
  }
}

@keyframes hero-parallax-blur {
  to {
    filter: blur(64px) saturate(1.3) brightness(0.55);
  }
}

@keyframes hero-parallax-fade {
  to {
    opacity: 0.55;
    filter: blur(14px);
  }
}

@supports (animation-timeline: scroll()) {
  html.app-header .profile-hero.is-parallax {
    animation: hero-parallax linear both;
    animation-timeline: scroll(root);
    animation-range: 0 var(--hero-h, 400px);
  }

  html.app-header .profile-hero.is-parallax .profile-hero-art.is-loaded {
    animation: hero-parallax-blur linear both;
    animation-timeline: scroll(root);
    animation-range: 0 var(--hero-h, 400px);
  }

  /* Blurred faster than the art, already well blurred by the time the
     sheet reaches the text. */
  html.app-header .profile-hero.is-parallax .profile-hero-inner {
    animation: hero-parallax-fade linear both;
    animation-timeline: scroll(root);
    animation-range: 0 calc(var(--hero-h, 400px) * 0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.app-header .profile-hero.is-parallax,
  html.app-header .profile-hero.is-parallax .profile-hero-art.is-loaded,
  html.app-header .profile-hero.is-parallax .profile-hero-inner {
    animation: none;
  }
}

/* The settings on account.html (js/settings-panel.js): in the
   "Impostazioni" tab, and on touch screens in a card under the sign-in.
   The theme as a three-way segmented control, the vibration (Android) as
   a switch in a row, then (touch screens only — there's no footer there)
   the footer's small print. */
.settings-group + .settings-group {
  margin-top: 16px;
}

/* (p.: over .profile-card p's margin, in the tab.) */
p.settings-label {
  margin: 0 0 8px 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* "Account", over the login row in the tab: the next group. */
p.settings-account-label {
  margin-top: 22px;
}

/* The theme: three segments, the chosen one a white pill on the track
   (dark mode: lifted a shade), its icon and label in red. */
.settings-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  max-width: 460px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(154, 28, 32, 0.07);
}

/* The language: two segments, each as wide as one of the theme's three. */
.settings-seg.settings-lang {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  box-sizing: border-box;
  width: calc((min(100%, 460px) - 16px) * 2 / 3 + 12px);
}

.settings-seg button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.settings-seg button svg {
  width: 22px;
  height: 22px;
}

.settings-seg button[aria-checked="true"] {
  background: #fff;
  color: var(--brand-red-deep);
  box-shadow: 0 1px 2px rgba(40, 6, 9, 0.1), 0 3px 10px rgba(40, 6, 9, 0.1);
}

.settings-seg button:focus-visible,
.settings-switch:focus-visible {
  outline: 2px solid var(--brand-red);
  outline-offset: 2px;
}

/* The vibration: a row — its icon, name and a line — and an on / off
   switch (red track when on). */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 460px;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
}

.settings-row-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-red) 10%, transparent);
  color: var(--brand-red-deep);
}

.settings-row-icon svg {
  width: 20px;
  height: 20px;
}

.settings-row-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  color: var(--text-title);
  font-weight: 800;
}

.settings-row-text small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.settings-switch {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: rgba(154, 28, 32, 0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 180ms ease;
}

.settings-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(40, 6, 9, 0.3);
  transition: transform 200ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.settings-switch[aria-checked="true"] {
  background: var(--brand-red);
}

.settings-switch[aria-checked="true"] span {
  transform: translateX(20px);
}

/* The footer's small print, at the card's bottom: centred, faint. */
.settings-about {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
  color: var(--text-muted-2);
  font-size: 0.85rem;
}

.settings-about .footer-center > :first-child {
  font-size: 0.85rem;
}

/* A computer has the footer: no small print here, and no settings card
   for signed-out visitors (the footer's button switches the theme). */
html:not(.nav-mobile) :is(.settings-about, .account-settings) {
  display: none;
}

:root[data-theme="dark"] .settings-row-icon {
  background: rgba(255, 110, 110, 0.14);
  color: #ff9a9d;
}

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

:root[data-theme="dark"] .settings-seg button[aria-checked="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #ff9a9d;
  box-shadow: none;
}

:root[data-theme="dark"] .settings-switch {
  background: rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] .settings-switch[aria-checked="true"] {
  background: var(--brand-red);
}

/* ---------------------------------------------------------------------------
   Event recap (js/event-recap.js): an event's stories, over the page — the
   whole screen on a phone, a phone-sized panel over a dark backdrop on a
   computer. Bars across the top fill as each screen plays; a tap on the
   right goes on, on the left back (invisible .recap-nav halves over it),
   holding pauses. Each screen's [data-in] items rise in, staggered (--d).
   And the Bacheca's story bubbles opening them (.recap-bubble,
   js/home.js), for a week after an event (two after a season): the
   winner's commander art in a turning red-gold ring (grey once watched).
   --------------------------------------------------------------------------- */
html.is-recap-open {
  overflow: hidden;
}

.recap {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.recap::backdrop {
  background: rgba(10, 4, 6, 0.86);
}

.recap[open] {
  display: grid;
  place-items: center;
}

.recap-st {
  position: relative;
  width: min(400px, 100vw);
  height: min(711px, 100dvh);
  overflow: hidden;
  border-radius: 26px;
  background: #2a1215;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  font-family: var(--font-main);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

@media (max-width: 500px) {
  .recap-st {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
}

.recap-progress {
  position: absolute;
  z-index: 6;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
}

.recap-progress i {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
}

.recap-progress b {
  display: block;
  width: 0;
  height: 100%;
  background: #fff;
}

.recap-head {
  position: absolute;
  z-index: 6;
  top: calc(22px + env(safe-area-inset-top));
  right: 10px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.recap-head img {
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
}

.recap-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap-close {
  flex: none;
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  opacity: 0.85;
  cursor: pointer;
}

/* The music's speaker (js/event-recap.js RECAP_TRACKS), beside ×. */
.recap-sound {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  opacity: 0.85;
  cursor: pointer;
}

.recap-sound[hidden] {
  display: none;
}

.recap-sound svg {
  width: 22px;
  height: 22px;
}

.recap-sound.is-muted {
  opacity: 0.6;
}

.recap-sound:not([hidden]) + .recap-close {
  margin-left: 0;
}

.recap-nav {
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  width: 35%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.recap-nav.is-prev {
  left: 0;
}

.recap-nav.is-next {
  right: 0;
  width: 65%;
}

.recap-nav:focus-visible {
  outline: none;
}

.recap-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  padding: calc(76px + env(safe-area-inset-top)) 26px calc(40px + env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.recap-slide.is-on {
  opacity: 1;
}

.recap-slide.is-center {
  text-align: center;
}

.recap-slide > :not(.recap-bg, .recap-confetti) {
  position: relative;
}

.recap-bg {
  position: absolute;
  inset: -30px;
  background-position: center 30%;
  background-size: cover;
  filter: blur(18px) brightness(0.45) saturate(1.2);
  transform: scale(1.1);
}

.recap-bg.is-red {
  background: radial-gradient(120% 90% at 100% 0%, #e0262a, #8a0d14 55%, #3a070b);
  filter: none;
}

.recap-bg.is-dark {
  background: radial-gradient(120% 90% at 0% 100%, #4a1a1f, #1d1416 70%);
  filter: none;
}

.recap-k {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  opacity: 0.8;
  text-transform: uppercase;
}

.recap-big {
  margin: 6px 0 0;
  color: #fff;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.recap-big.is-small {
  font-size: 1.9rem;
}

.recap-mid {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.9;
}

.recap-cap {
  text-transform: capitalize;
}

.recap-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.recap-tiles div {
  padding: 12px 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.recap-tiles b {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
}

.recap-tiles span {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 0.8;
  text-transform: uppercase;
}

.recap-tap {
  margin: 34px 0 0;
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

.recap-slide [data-in] {
  opacity: 0;
  transform: translateY(18px);
}

.recap-slide.is-on [data-in] {
  animation: recap-rise 520ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
  animation-delay: calc(var(--d, 0) * 110ms + 150ms);
}

@keyframes recap-rise {
  to {
    opacity: 1;
    transform: none;
  }
}

/* The winner's (and the day's) commander: its art as a foil card. */
.recap-card-art {
  position: relative;
  width: 78%;
  aspect-ratio: 5 / 3.7;
  margin: 18px auto 0;
  overflow: hidden;
  border-radius: 16px;
  background: #3a3634 center 25% / cover;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(255, 214, 90, 0.9);
}

.recap-card-art::after {
  content: "";
  position: absolute;
  inset: -50%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
  animation: recap-sheen 2.8s ease-in-out infinite;
}

@keyframes recap-sheen {
  from {
    transform: translateX(-60%);
  }

  to {
    transform: translateX(60%);
  }
}

.recap-trophy {
  font-size: 2.2rem;
}

.recap-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  font-weight: 800;
}

.recap-pills span {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
}

/* The confetti fall the screen's whole height (cqh: the slide's, whatever
   the phone — a fixed distance stopped them in a line across a taller one),
   fading out at the bottom. */
.recap-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  container-type: size;
}

.recap-confetti i {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
}

.recap-slide.is-on .recap-confetti i {
  animation: recap-fall 2.6s linear both;
}

@keyframes recap-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }

  85% {
    opacity: 0.9;
  }

  100% {
    opacity: 0;
    transform: translateY(calc(100cqh + 20px)) rotate(540deg);
  }
}

.recap-list {
  display: grid;
  gap: 7px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.recap-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.recap-pos {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
  font-weight: 800;
}

.recap-list li:nth-child(1) .recap-pos {
  background: #f2c14e;
  color: #3a2a00;
}

.recap-list li:nth-child(2) .recap-pos {
  background: #cfd6de;
  color: #2a2f35;
}

.recap-list li:nth-child(3) .recap-pos {
  background: #d9905a;
  color: #3a1d08;
}

.recap-who {
  flex: 1;
  min-width: 0;
}

.recap-who b,
.recap-who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap-who b {
  font-size: 0.92rem;
}

.recap-who small {
  font-size: 0.72rem;
  opacity: 0.7;
}

.recap-pts {
  font-size: 0.85rem;
  font-weight: 800;
  opacity: 0.9;
}

.recap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.recap-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.recap-chip svg {
  width: 18px;
  height: 18px;
  color: #ffd25a;
}

.recap-chip small {
  font-weight: 700;
  opacity: 0.75;
}

.recap-bars {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.recap-bar {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.recap-bar-ic {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
}

.recap-bar-ic svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

/* A light colour (Combo's, js/event-recap.js RECAP_LIGHT): its icon dark. */
.recap-bar.is-light .recap-bar-ic svg {
  color: #2a2226;
}

.recap-bar small {
  display: block;
  font-size: 0.7rem;
  opacity: 0.75;
  text-transform: capitalize;
}

.recap-bar-tr {
  height: 14px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
}

.recap-bar-tr i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--c);
}

.recap-slide.is-on .recap-bar-tr i {
  animation: recap-grow 900ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
  animation-delay: calc(var(--d) * 120ms + 300ms);
}

@keyframes recap-grow {
  to {
    width: var(--w);
  }
}

.recap-bar > b {
  min-width: 34px;
  font-size: 0.9rem;
  text-align: right;
}

/* ---------------------------------------------------------------------------
   Other stories (js/stories.js), in the recap's player and look.
   "Nuovo video": the two commanders face to face (their art in rings, a
   gold VS), then the thumbnail with YouTube's play button and "Guarda su
   YouTube". "Il meta del mese": the top 5 as rows (art, name, winrate,
   share).
   --------------------------------------------------------------------------- */
/* Two rows: the arts with the VS between them, centred on each other; the
   names under them, from the top (a long one doesn't move the circles). */
.story-vs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 8px;
  margin-top: 22px;
}

.story-vs > b {
  align-self: start;
  text-align: center;
}

.story-vs-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #3a3634 center 25% / cover;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 10px 26px rgba(0, 0, 0, 0.5);
}

/* A partner pair (js/stories.js): the circle split down the middle, an art
   each, a white line between. */
.story-vs-art.is-pair {
  display: flex;
  overflow: hidden;
}

.story-vs-art.is-pair > span {
  flex: 1;
  background: #3a3634 center 25% / cover;
}

.story-vs-art.is-pair > span + span {
  border-left: 2px solid rgba(255, 255, 255, 0.85);
}

.story-vs > b {
  font-size: 1rem;
  line-height: 1.2;
}

.story-vs-word {
  color: #ffd25a;
  font-weight: 800;
}

.story-vs > .story-vs-word {
  font-size: 1.6rem;
}

.story-thumb {
  position: relative;
  display: block;
  margin-top: 18px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #000;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.story-thumb-img {
  position: absolute;
  inset: 0;
  background: center / cover;
}

.story-thumb-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.story-thumb-play span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 46px;
  border-radius: 14px;
  background: #f00;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.story-thumb-play svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
  color: #fff;
}

.story-thumb-title {
  margin-top: 14px;
}

.story-yt {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  margin-top: 22px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #c00;
  font-weight: 800;
  text-decoration: none;
  pointer-events: auto;
}

.story-yt:hover {
  text-decoration: none;
}

.story-yt img {
  width: 22px;
  height: 16px;
}

/* A primer's "Apri su Moxfield": the video's button, Moxfield's colours. */
.story-moxfield {
  color: #3a1e5f;
}

.story-moxfield img {
  width: 20px;
  height: 20px;
}

/* The video's link and button above the tap halves, so they're tappable. */
.recap-slide.is-on :is(.story-thumb, .story-yt) {
  z-index: 6;
}

.story-meta-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.story-meta-list li {
  display: grid;
  grid-template-columns: 22px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
}

.story-meta-pos {
  font-weight: 800;
  text-align: center;
  opacity: 0.8;
}

.story-meta-art {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #3a3634 center 25% / cover;
}

.story-meta-who {
  min-width: 0;
}

.story-meta-who b {
  display: block;
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-meta-who small {
  font-size: 0.72rem;
  opacity: 0.75;
}

.story-meta-share {
  display: grid;
  justify-items: end;
  font-weight: 800;
}

.story-meta-share small {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  text-transform: uppercase;
}

.story-meta-note {
  font-size: 0.9rem;
}

/* The season's records: a card each — what, who, the number big. */
.recap-records {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.recap-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "k n" "who n";
  align-items: center;
  gap: 2px 12px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.recap-record .recap-k {
  grid-area: k;
}

.recap-record b {
  grid-area: who;
  overflow: hidden;
  font-size: 1.15rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recap-record-n {
  grid-area: n;
  color: #ffd25a;
  font-size: 2rem;
  font-weight: 800;
}

.recap-next {
  margin-top: 26px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.recap-next b {
  display: block;
  font-size: 1.4rem;
}

.recap-share {
  z-index: 6;
  align-self: center;
  margin-top: 30px;
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #a10f17;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* The event's / league's page, under "Condividi": a quieter outline pill. */
.recap-go {
  z-index: 6;
  align-self: center;
  margin-top: 12px;
  padding: 10px 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-pill);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.recap-slide.is-on .recap-share,
.recap-slide.is-on .recap-go {
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .recap-slide,
  .recap-slide.is-on [data-in],
  .recap-slide.is-on .recap-bar-tr i,
  .recap-card-art::after,
  .recap-slide.is-on .recap-confetti i {
    animation: none;
    transition: none;
  }

  .recap-slide [data-in] {
    opacity: 1;
    transform: none;
  }

  .recap-bar-tr i {
    width: var(--w);
  }

  .recap-confetti {
    display: none;
  }
}

/* The Bacheca's recaps (story bubbles, below). */
.home-recap {
  margin: -6px 0 10px;
}

.recap-ring {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
}

.recap-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(#dc181c, #ff7a45, #ffd25a, #dc181c);
  animation: recap-spin 6s linear infinite;
}

@keyframes recap-spin {
  to {
    transform: rotate(1turn);
  }
}

.recap-ring-art {
  position: relative;
  width: 55px;
  height: 55px;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #3a3634 center 25% / cover;
}

.recap-ring-play {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-red);
  box-shadow: 0 0 0 2px #fff;
  color: #fff;
}

.recap-ring-play svg {
  width: 11px;
  height: 11px;
  margin-left: 1px;
}

:root[data-theme="dark"] .recap-ring-art {
  border-color: #1e1517;
}

:root[data-theme="dark"] .recap-ring-play {
  box-shadow: 0 0 0 2px #1e1517;
}

/* The recaps due (js/home.js recapBubblesHtml), one or several: a row of
   compact bubbles — a social app's stories: the ring with the
   art and its kind under it ("Recap" / "Stagione", one line); scrolling sideways when
   they don't fit. */
.recap-bubbles {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
}

.recap-bubbles::-webkit-scrollbar {
  display: none;
}

.recap-bubble {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 78px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-title);
  font: inherit;
  cursor: pointer;
}

.recap-bubble .recap-ring {
  width: 70px;
  height: 70px;
}

.recap-bubble .recap-ring-art {
  width: 63px;
  height: 63px;
}

/* Its kind ("Recap", "Stagione", "Nuovo video", "Meta"), on one line. */
.recap-bubble small {
  max-width: 100%;
  overflow: hidden;
  color: var(--brand-red);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.recap-bubble.is-seen .recap-ring::before {
  background: rgba(154, 28, 32, 0.22);
  animation: none;
}

.recap-bubble.is-seen small {
  color: var(--text-muted);
}

.recap-bubble:focus-visible {
  outline: 3px solid var(--brand-red);
  outline-offset: 3px;
  border-radius: 12px;
}

:root[data-theme="dark"] .recap-bubble.is-seen .recap-ring::before {
  background: rgba(255, 255, 255, 0.18);
}

/* Its name and line under it: only on a computer (below); touch screens
   keep the bubble with just its kind. */
.recap-bubble-text {
  display: contents;
}

.recap-bubble-name,
.recap-bubble-sub {
  display: none;
}

/* A computer (option A3 of a mockup, 2026-10-30): one white bar the whole
   width, the stories its equal parts (a hairline between them) — the ring
   a size down, its kind, name and line beside it; at 200px each at least,
   scrolling sideways past that (5 and more). */
html:not(.app-header) .home-recap {
  margin: 0 0 22px;
}

html:not(.app-header) .recap-bubbles {
  gap: 0;
  padding: 7px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-card);
}

html:not(.app-header) .recap-bubble {
  position: relative;
  flex: 1 1 0;
  flex-direction: row;
  gap: 12px;
  width: auto;
  min-width: 200px;
  padding: 6px 14px 6px 8px;
  border-radius: 16px;
  text-align: left;
  transition: background 150ms ease;
}

html:not(.app-header) .recap-bubble + .recap-bubble::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 1px;
  background: var(--table-row-line);
}

html:not(.app-header) .recap-bubble:hover {
  background: rgba(220, 24, 28, 0.04);
}

html:not(.app-header) .recap-bubble .recap-ring {
  width: 48px;
  height: 48px;
}

html:not(.app-header) .recap-bubble .recap-ring-art {
  width: 42px;
  height: 42px;
}

html:not(.app-header) .recap-bubble .recap-ring-play {
  width: 18px;
  height: 18px;
}

html:not(.app-header) .recap-bubble .recap-ring-play svg {
  width: 9px;
  height: 9px;
}

html:not(.app-header) .recap-bubble-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

html:not(.app-header) .recap-bubble-name,
html:not(.app-header) .recap-bubble-sub {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html:not(.app-header) .recap-bubble-name {
  font-size: 0.98rem;
  font-weight: 800;
}

html:not(.app-header) .recap-bubble-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

:root[data-theme="dark"]:not(.app-header) .recap-bubbles {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"]:not(.app-header) .recap-bubble:hover {
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"]:not(.app-header) .recap-bubble:not(.is-seen) small {
  color: #ff8a8d;
}

@media (prefers-reduced-motion: reduce) {
  .recap-ring::before {
    animation: none;
  }
}
