/* ═══ Rosa: pagina di un album di figurine ═══ */
.album { --paper: #f4ecd6; --ink: #2b1a12; --muted: #7a6656; --line: rgba(122, 86, 60, .14);
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 18px; color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, color-mix(in srgb, var(--cat) 14%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 27px, var(--line) 27px 28px),
    var(--paper);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .6), inset 18px 0 30px -18px rgba(90, 50, 20, .35); }
.album::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 8px; border-radius: 18px 0 0 18px;
  background: repeating-linear-gradient(180deg, #c5000f 0 14px, #f5c000 14px 28px); }

.album-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.album-crest { width: 68px; height: 68px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.album-titles { flex: 1 1 220px; min-width: 0; }
.album-eyebrow { display: inline-block; padding: 3px 10px; border-radius: 4px; background: #c5000f; color: #fff; font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; transform: rotate(-1.5deg); }
.album-title { margin-top: 6px; font-size: clamp(28px, 6vw, 44px); font-weight: 900; line-height: 1; letter-spacing: -.02em; text-transform: uppercase; color: var(--ink); text-wrap: balance; }
.album-meta { margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.album-side { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.album-coach { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.album-coach:hover { border-color: #c5000f; }
.album-coach-photo { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; background: #c5000f; color: #f5c000; }
.album-coach small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.album-coach b { font-size: 14px; }
.album-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 900; background: #f5c000; color: #111; border: 0; cursor: pointer; text-decoration: none; box-shadow: 0 3px 0 #b38b00; }
.album-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b38b00; }

.roster-poster { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.roster-poster img { width: min(100%, 420px); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }
.roster-poster-actions { display: flex; gap: 8px; }

.album-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.album-search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.album-search input { flex: 1; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--ink); }
.album-search:focus-within { border-color: #c5000f; box-shadow: 0 0 0 3px rgba(197, 0, 15, .15); }
.album-sort { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(122, 86, 60, .12); }
.album-sort button { padding: 7px 12px; border-radius: 9px; border: 0; background: transparent; font-size: 13px; font-weight: 800; color: var(--muted); cursor: pointer; }
.album-sort button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.album-group { display: flex; flex-direction: column; gap: 12px; }
.album-dept { display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 13px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: #c5000f; }
.album-dept span { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: #c5000f; color: #fff; letter-spacing: 0; }
.album-dept::after { content: ""; flex: 1; border-top: 2px dashed rgba(197, 0, 15, .3); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
.album-empty { padding: 20px; text-align: center; color: var(--muted); font-weight: 600; }
@media (max-width: 480px) {
  .album { padding: 16px 12px 16px 18px; }
  .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  .album-crest { width: 52px; height: 52px; }
}

/* ═══ Figurina ═══ */
.fig { --tilt: 0deg; perspective: 900px; min-width: 0; animation: fig-in .5s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: calc(var(--i, 0) * 30ms); }
.fig[hidden] { display: none; }
.fig-card { position: relative; aspect-ratio: 5 / 7; container-type: inline-size; transform: rotate(var(--tilt)); transform-style: preserve-3d; transition: transform .6s cubic-bezier(.3, .7, .2, 1); }
.fig:hover .fig-card, .fig:focus-within .fig-card { transform: rotate(0) translateY(-4px) scale(1.03); }
.fig.is-flipped .fig-card { transform: rotateY(180deg) scale(1.03); }
.fig-side { all: unset; position: absolute; inset: 0; cursor: pointer; border-radius: 9px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fig-side:focus-visible { outline: 3px solid #c5000f; outline-offset: 3px; }
.fig-face { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 9px; padding: 4.5cqi; background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 8px 18px rgba(60, 30, 10, .28); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
/* Lucido della figurina che passa al passaggio del dito o del mouse */
.fig-front::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 47%, rgba(255, 255, 255, .1) 52%, transparent 62%) no-repeat;
  background-size: 250% 100%; background-position: 140% 0; transition: background-position .9s ease; }
.fig:hover .fig-front::after, .fig-side:focus-visible .fig-front::after { background-position: -40% 0; }

.fig-front > * { position: relative; }
.fig-top { display: flex; align-items: center; justify-content: space-between; gap: 2cqi; padding: 3cqi 3cqi 0; border-radius: 5px 5px 0 0;
  background: linear-gradient(135deg, var(--cat), color-mix(in srgb, var(--cat) 55%, #000)); }
.fig-crest { width: 17cqi; height: 17cqi; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .4)); }
.fig-code { font-size: 7.5cqi; font-weight: 900; letter-spacing: .06em; color: #f5c000; white-space: nowrap; }
.fig-art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, .22), transparent 60%),
    repeating-linear-gradient(-55deg, rgba(255, 255, 255, .05) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, color-mix(in srgb, var(--cat) 55%, #000), #1a0508); }
.fig-art .shirt { width: 86%; height: auto; max-height: 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); }
.fig-art.has-photo img { width: 100%; height: 100%; object-fit: cover; }
.fig-num { position: absolute; left: 3cqi; bottom: 3cqi; min-width: 17cqi; padding: 1cqi 2.5cqi; border-radius: 99px; background: #f5c000; color: #111; font-size: 10cqi; font-weight: 900; text-align: center; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.fig-ribbon { position: absolute; top: 25cqi; right: -1cqi; padding: 1.2cqi 3cqi; background: #fff; color: #c5000f; font-size: 6.2cqi; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 3px 0 0 3px; box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.fig-band { display: flex; flex-direction: column; align-items: center; padding: 3cqi 3cqi 3.5cqi; margin-top: -4cqi; border-radius: 0 0 5px 5px; text-align: center;
  background: linear-gradient(180deg, #ffd21f, #f5c000); clip-path: polygon(0 5cqi, 100% 0, 100% 100%, 0 100%); }
.fig-first { margin-top: 3cqi; font-size: 7.5cqi; font-weight: 700; color: #3b2a00; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fig-last { font-size: 11cqi; font-weight: 900; text-transform: uppercase; color: #111; line-height: 1.05; letter-spacing: -.01em; max-width: 100%; overflow-wrap: anywhere; }
.fig-role { margin-top: 1cqi; font-size: 6.2cqi; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: #a3000c; }

.fig-back { transform: rotateY(180deg); align-items: center; justify-content: center; gap: 4cqi; text-align: center; padding: 8cqi 7cqi;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--cat) 16%, transparent), transparent 65%), #fbf6e9;
  border: 4.5cqi solid #fff; outline: 1.5cqi solid #c5000f; outline-offset: -6cqi; }
.fig-back-crest { width: 24cqi; height: 24cqi; object-fit: contain; }
.fig-back-name { font-size: 8cqi; line-height: 1.15; color: var(--ink, #2b1a12); }
.fig-back-name b { display: block; font-size: 11cqi; text-transform: uppercase; }
.fig-back-facts { display: flex; flex-direction: column; gap: 1.5cqi; width: 100%; }
.fig-back-facts div { display: flex; justify-content: space-between; gap: 3cqi; border-bottom: 1px dashed rgba(122, 86, 60, .3); padding-bottom: 1cqi; }
.fig-back-facts dt { font-size: 6.5cqi; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #7a6656; }
.fig-back-facts dd { font-size: 7cqi; font-weight: 900; color: #2b1a12; text-align: right; }
.fig-back-link { padding: 2.5cqi 5cqi; border-radius: 99px; background: #c5000f; color: #fff; font-size: 7.5cqi; font-weight: 900; text-decoration: none; }
.fig-back-link:focus-visible { outline: 3px solid #f5c000; outline-offset: 2px; }
.fig-back-turn { position: absolute; top: 5cqi; right: 6cqi; width: 13cqi; height: 13cqi; border-radius: 50%; border: 0; background: rgba(122, 86, 60, .12); color: #2b1a12; font-size: 8cqi; cursor: pointer; }

@keyframes fig-in { from { opacity: 0; transform: translateY(14px) rotate(-4deg) scale(.92); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fig { animation: none; }
  .fig-card, .fig-front::after { transition: none; }
}

/* Maglia giallorossa (dentro la figurina senza foto) */
.shirt { width: 100%; max-width: 104px; height: auto; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45)); }
.shirt-surname { font-family: "Inter", Arial, sans-serif; font-weight: 900; letter-spacing: .04em; fill: #fff; stroke: #2a0207; stroke-width: 2.4px; paint-order: stroke; }
.shirt-number { font-family: "Inter", "Arial Black", Arial, sans-serif; font-weight: 900; fill: #fff; stroke: #2a0207; stroke-width: 3.5px; paint-order: stroke; }
.fig-art .shirt { max-width: none; }

/* Scheda del singolo atleta: la figurina grande accanto ai dati */
.player-hero { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 28px; }
.player-hero .fig { flex: 0 0 auto; width: min(260px, 70vw); margin: 0 auto; animation: none; }
.player-hero .fig-card { transform: rotate(-2deg); }
.player-hero-info { flex: 1 1 260px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.player-hero-info .album-title { font-size: clamp(30px, 7vw, 48px); }
.player-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.player-facts div { padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.player-facts dt { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.player-facts dd { font-size: 17px; font-weight: 900; color: var(--ink); }
.player-facts a { color: #c5000f; text-decoration: none; }
