/* Layout: l'estadi ocupa tota la pantalla; el marcador, la intro i el panell de contingut hi floten a sobre. */
:root {
  --paper: #f2f5ee;
  --surface: #ffffff;
  --ink: #15261b;
  --muted: #56685b;
  --line: #d3dccf;
  --pitch: #1e6b40;
  --pitch-deep: #123f26;
  --chalk: #f7faf5;
  --yellow: #f0c234;
  --red: #cf3a2c;
  --ok-bg: #e2f1e6;
  --ko-bg: #fbe6e3;
  --night-top: #0a1626; --night-bottom: #133126; --night-good: #8fe0a8; --night-bad: #ff9d90;
  --spot-ink: #123f26; --track: #ffffff40; --track-solid: #56616d; --grana: #8a1c3c; --blau: #1b3f8f; --board-h: 52px;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0d1811; --surface: #14231a; --ink: #e6eee8; --muted: #9db0a2; --line: #26392d;
  --pitch: #2f8a55; --pitch-deep: #174a2d; --chalk: #f2f7f3; --yellow: #f3cb4a; --red: #ec6b5c;
  --ok-bg: #1b3a26; --ko-bg: #3d1f1b; color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #0d1811; --surface: #14231a; --ink: #e6eee8; --muted: #9db0a2; --line: #26392d;
  --pitch: #2f8a55; --pitch-deep: #174a2d; --chalk: #f2f7f3; --yellow: #f3cb4a; --red: #ec6b5c;
  --ok-bg: #1b3a26; --ko-bg: #3d1f1b; color-scheme: dark;
}

html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: var(--night-top); color: var(--ink); font: 17px/1.6 var(--body); }
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); line-height: 1.02; text-wrap: balance; margin: 0; letter-spacing: .01em; }
h2 { font-size: clamp(2.2rem, 7vw, 3.2rem); font-weight: 900; text-transform: uppercase; }
h3 { font-size: 1.6rem; font-weight: 700; margin-top: 8px; }
p { margin: 0; }
a { color: var(--pitch); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* Marcador */
.board {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; min-height: var(--board-h); box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  background: var(--pitch-deep); color: var(--chalk); border-bottom: 3px solid var(--yellow);
}
.score { grid-column: 2; font-family: var(--display); font-weight: 900; font-size: clamp(1rem, 4.2vw, 1.5rem); letter-spacing: .04em; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score .n { background: var(--chalk); color: var(--pitch-deep); min-width: 1.6em; text-align: center; border-radius: 3px; padding: 0 4px; }
.minute { grid-column: 1; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--yellow); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-btn { grid-column: 3; justify-self: end; border: 1.5px solid var(--chalk); background: none; color: var(--chalk); border-radius: 999px; padding: 3px 14px; font-weight: 700; font-size: .9rem; }
.board-btn:hover { background: var(--chalk); color: var(--pitch-deep); }
/* A la dreta del marcador: la trucada d'emergència i la llista */
.board-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 8px; }
.board-right .board-btn { grid-column: auto; justify-self: auto; }
.xu-btn { display: inline-flex; align-items: center; gap: 6px; border-color: #ff5a4f; background: #e5412d; color: #fff; animation: xu-pulse 1.8s infinite; }
.xu-btn > span:first-child { display: inline-block; }
.xu-btn:hover > span:first-child, .xu-btn:focus-visible > span:first-child { animation: xu-wobble .6s infinite, xu-flash .3s infinite alternate; } /* en passar-hi per sobre, la sirena gira i llampega */
@keyframes xu-pulse { 0% { box-shadow: 0 0 0 0 #ff5a4fb0; } 70% { box-shadow: 0 0 0 10px #ff5a4f00; } 100% { box-shadow: 0 0 0 0 #ff5a4f00; } }
@keyframes xu-wobble { 0%, 100% { transform: rotate(-14deg) scale(1.15); } 50% { transform: rotate(14deg) scale(1.15); } }
@keyframes xu-flash { from { filter: drop-shadow(0 0 0 #ff3b30); } to { filter: drop-shadow(0 0 6px #ff3b30) drop-shadow(0 0 12px #ff3b30); } }
.xu-btn:hover, .xu-btn:focus-visible { background: #ff5a4f; color: #fff; }
@media (max-width: 760px) { .xu-btn .xu-lbl { display: none; } .xu-btn { padding: 3px 10px; } }
@media (max-width: 420px) { .minute { display: none; } }

/* Portada: el cartell del partit a pantalla completa, amb l'estadi desenfocat al darrere */
.landing {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; overflow-x: hidden; box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; text-align: center; color: var(--chalk);
  background: linear-gradient(color-mix(in srgb, var(--night-top) 80%, transparent), color-mix(in srgb, var(--night-bottom) 88%, transparent));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.landing > :not(.ld-light) { position: relative; animation: ld-up .7s calc(.5s + var(--d, 0) * 120ms) cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ld-up { from { opacity: 0; transform: translateY(24px); } }
/* Dos focus que s'encenen fent pampallugues */
.ld-light { position: fixed; top: -20vh; width: 70vw; height: 90vh; pointer-events: none; mix-blend-mode: screen; background: radial-gradient(closest-side, #fff5 0, #fff1 45%, transparent 70%); animation: ld-on 1.4s steps(1) both; }
.ld-light.l { left: -20vw; } .ld-light.r { right: -20vw; animation-delay: .35s; }
@keyframes ld-on { 0%, 20%, 40% { opacity: 0; } 10%, 30% { opacity: .6; } 50% { opacity: 1; } }
.ld-vs { --d: 0; display: flex; align-items: center; gap: clamp(10px, 3vw, 24px); }
.ld-vs img { height: clamp(48px, 10vw, 78px); filter: drop-shadow(0 6px 14px #000a); }
.ld-score { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--pitch-deep); border: 2px solid var(--yellow); border-radius: 6px; font: 900 clamp(1.1rem, 4vw, 1.6rem) var(--display); letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.ld-score .n { background: var(--chalk); color: var(--pitch-deep); min-width: 1.5em; border-radius: 3px; }
.landing h1 { --d: 1; font-weight: 900; text-transform: uppercase; line-height: .82; margin: 28px 0 14px; font-size: clamp(4.2rem, 17vw, 10rem); letter-spacing: -.01em; text-shadow: 0 10px 40px #000c; }
.landing h1 span { display: block; color: var(--yellow); }
.ld-lead { --d: 2; max-width: min(34ch, 100%); font-size: clamp(1rem, 2.6vw, 1.2rem); line-height: 1.5; color: #b9c8bd; }
.ld-lead b { color: var(--chalk); }
.ld-steps { --d: 3; list-style: none; padding: 0; margin: 30px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 12px; text-align: left; }
.ld-steps li { background: #ffffff10; border: 1px solid #ffffff22; border-radius: 10px; padding: 14px 16px; font-size: .9rem; line-height: 1.35; color: #b9c8bd; }
.ld-steps .n { font: 900 2rem/1 var(--display); color: var(--yellow); display: block; }
.ld-steps b { display: block; color: var(--chalk); font-size: 1rem; margin: 4px 0 2px; }
.ld-cta { --d: 4; margin-top: 30px; display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 15px 32px; background: var(--yellow); color: var(--pitch-deep); font: 900 1.4rem var(--display); text-transform: uppercase; letter-spacing: .04em; transition: transform .15s; }
.landing > .ld-cta { animation: ld-up .7s calc(.5s + 4 * 120ms) cubic-bezier(.2, .8, .2, 1) both, ld-glow 2.2s 2s infinite; }
@keyframes ld-glow { 0% { box-shadow: 0 0 0 0 #f0c23480; } 70% { box-shadow: 0 0 0 16px #f0c23400; } 100% { box-shadow: 0 0 0 0 #f0c23400; } }
.ld-cta:hover { transform: scale(1.04); }
.ld-cta:focus-visible { outline: 3px solid var(--chalk); outline-offset: 3px; }
.ld-hint { --d: 5; margin-top: 14px; font-size: .85rem; color: #b9c8bd; }
/* Sortida: tot s'apropa i s'esvaeix, com si la càmera baixés cap al camp */
.landing.out { transition: opacity .7s, transform .9s cubic-bezier(.6, 0, .4, 1), filter .7s; opacity: 0; transform: scale(1.15); filter: blur(6px); pointer-events: none; }
/* Mòbil: tot ha de cabre en una pantalla, sense scroll */
@media (max-width: 720px) {
  .ld-vs img { height: 40px; }
  .ld-score { padding: 4px 10px; gap: 6px; font-size: 1.05rem; }
  .landing h1 { font-size: clamp(3.2rem, 17vw, 5rem); margin: 16px 0 10px; }
  .ld-lead { font-size: .95rem; line-height: 1.4; }
  .ld-steps { grid-template-columns: 1fr; width: 100%; max-width: 360px; gap: 8px; margin-top: 18px; }
  .ld-steps li { display: grid; grid-template-columns: 30px 1fr; align-items: center; column-gap: 8px; padding: 8px 12px; font-size: .82rem; line-height: 1.3; }
  .ld-steps .n { grid-row: span 2; font-size: 1.6rem; }
  .ld-steps b { margin: 0; font-size: .95rem; }
  .ld-cta { width: 100%; max-width: 360px; justify-content: center; margin-top: 18px; padding: 13px 24px; font-size: 1.25rem; }
  .ld-hint { font-size: .78rem; margin-top: 10px; }
}
/* Mòbils baixets: s'amaga el detall dels passos */
@media (max-width: 720px) and (max-height: 700px) {
  .landing h1 { font-size: clamp(2.8rem, 14vw, 4rem); margin: 12px 0 8px; }
  .ld-steps li { font-size: 0; padding: 7px 12px; }
  .ld-steps li b { font-size: .95rem; }
  .ld-steps .n { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .landing > *, .landing > .ld-cta, .ld-light { animation: none; } .landing.out { transition-duration: .01s; } }

/* Estadi 3D: un sol aspecte (partit de nit) en tots dos temes */
.stadium { position: fixed; inset: 0; background: linear-gradient(var(--night-top), var(--night-bottom)); color: var(--chalk); }
.st-view { position: absolute; inset: 0; overflow: hidden; }
.st-view canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.st-view canvas:active { cursor: grabbing; }
.st-flat { position: absolute; inset: var(--board-h) 0 0; width: 100%; height: calc(100% - var(--board-h)); }
.st-view.flat canvas, .st-view.flat .st-tools, .st-view.flat .edge { display: none; }
.spots { position: absolute; inset: 0; pointer-events: none; transition: opacity .25s; }
.spots.away { opacity: 0; }
.spots.away .spot { pointer-events: none; }

/* Botons de zona, com els rètols d'una retransmissió: .sp-body (dorsal + nom), .sp-sub (el detall que surt
   en passar-hi per sobre) i .sp-ring (l'anella que marca el punt al camp). */
.spot { --p: 100; --rw: 34px; --rh: 13px; position: absolute; left: 0; top: 0; pointer-events: auto; border: 0; padding: 0; background: none; color: var(--chalk); border-radius: 4px; }
.spot:hover, .spot:focus-visible, .spot.open, .spot.hot { z-index: 2; }
.spot::after { content: ""; position: absolute; left: calc(var(--ax, 50%) - 1px); top: 100%; width: 2px; height: var(--stem, 12px); background: var(--chalk); opacity: .85; pointer-events: none; }
.sp-body { position: relative; display: flex; align-items: stretch; filter: drop-shadow(0 2px 0 var(--night-top)); transition: transform .15s; transform-origin: 50% 100%; }
.spot:active .sp-body { transform: scale(.93); }
.spots.entering .sp-body { animation: spot-in .45s calc(.6s + var(--i) * 70ms) both; }
@keyframes spot-in { from { opacity: 0; transform: translateY(10px) scale(.85); } }
.sp-num {
  display: grid; place-items: center; min-width: 30px; height: 30px; box-sizing: border-box; padding: 0 6px;
  background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 900; font-size: 1.15rem; line-height: 1; border-radius: 4px 0 0 4px;
}
.sp-num svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sp-num svg.fill { fill: currentColor; stroke: none; }
.sp-name {
  position: relative; display: flex; align-items: center; padding: 0 10px; background: var(--night-top);
  font-family: var(--display); font-weight: 700; font-size: 1rem; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; border-radius: 0 4px 4px 0;
}
/* El filet de sota del nom és la barra de progrés del mòdul */
.sp-name::before, .sp-name::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; }
.sp-name::before { right: 0; background: var(--track); }
.sp-name::after { width: calc(var(--p) * 1%); background: var(--yellow); }
.sp-sub {
  position: absolute; left: 50%; bottom: calc(100% + 5px); padding: 3px 8px; border-radius: 3px; background: var(--chalk); color: var(--spot-ink);
  font-size: .75rem; font-weight: 700; line-height: 1.3; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.spot:hover .sp-sub, .spot:focus-visible .sp-sub, .spot.open .sp-sub, .spot.hot .sp-sub { opacity: 1; transform: translateX(-50%); }
.spot:hover .sp-num, .spot:focus-visible .sp-num { filter: brightness(1.15); }
.spot.done .sp-num { background: var(--night-good); }
.spot.locked .sp-num { background: var(--track-solid); color: var(--chalk); }
/* L'anella marca el punt exacte del camp. Batega a la zona que et toca ara. */
.sp-ring {
  position: absolute; left: var(--rx, 50%); top: var(--ry, 100%); width: 34px; height: 13px; margin: -6.5px 0 0 -17px; box-sizing: border-box;
  border: 2px solid var(--yellow); border-radius: 50%; pointer-events: none; transition: box-shadow .15s, background .15s;
}
.st-view:not(.flat) .sp-ring { display: none; } /* a l'estadi 3D l'anella és una malla a la gespa, amb la perspectiva de debò */
.spot.hot .sp-ring, .spot.open .sp-ring { background: color-mix(in srgb, var(--yellow) 35%, transparent); box-shadow: 0 0 10px var(--yellow); }
.spot.next .sp-ring::after { content: ""; position: absolute; inset: -2px; border: 2px solid var(--yellow); border-radius: 50%; animation: ring-pulse 1.6s ease-out infinite; }
.spot.next .sp-num { animation: num-pulse 1.6s ease-in-out infinite; }
@keyframes ring-pulse { to { transform: scale(2.6); opacity: 0; } }
@keyframes num-pulse { 50% { filter: brightness(1.3); } }
/* En passar-hi per sobre: el rètol salta, el dorsal gira com una samarreta i un reflex creua el nom */
@media (hover: hover) {
  :is(.spot:hover, .spot.hot):not(:active) .sp-body { transform: translateY(-6px) scale(1.08); transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
  :is(.spot:hover, .spot.hot) .sp-num { animation: sp-flip .5s cubic-bezier(.4, 0, .2, 1); }
  :is(.spot:hover, .spot.hot) .sp-name { background: linear-gradient(100deg, transparent 35%, #ffffff45 50%, transparent 65%) 100% 0 / 250% 100% no-repeat var(--night-top); animation: sp-shine .7s .1s ease-out both; }
}
@keyframes sp-flip { from { transform: perspective(200px) rotateY(0); } to { transform: perspective(200px) rotateY(360deg); } }
@keyframes sp-shine { to { background-position: 0 0; } }

/* En pantalles estretes: només el dorsal rodó, amb un arc de progrés; el nom surt en tocar-lo */
.spots.compact .sp-num {
  width: 38px; height: 38px; min-width: 0; padding: 0; border-radius: 50%; color: var(--chalk);
  background: radial-gradient(closest-side, var(--night-top) 78%, transparent 80%), conic-gradient(var(--yellow) calc(var(--p) * 1%), var(--track-solid) 0);
}
.spots.compact .spot.done .sp-num { background: radial-gradient(closest-side, var(--night-good) 78%, transparent 80%), var(--yellow); color: var(--spot-ink); }
.spots.compact .spot.locked .sp-num { background: radial-gradient(closest-side, var(--night-top) 78%, transparent 80%), var(--track-solid); }
.spots.compact .sp-name { position: absolute; left: calc(100% + 6px); top: 50%; height: 28px; margin-top: -14px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.spots.compact .sp-name::before, .spots.compact .sp-name::after { display: none; }
.spots.compact :is(.spot:hover, .spot:focus-visible, .spot.open) .sp-name { opacity: 1; }

/* Rètols penjats dels jugadors i punts per tocar, durant un guió */
.tags { position: absolute; inset: 0; pointer-events: none; }
/* Finestreta amb una segona càmera (el linier al fora de joc); la imatge la pinta el canvas, aquí només el marc */
.pip { position: absolute; right: 12px; box-sizing: border-box; border: 2px solid var(--yellow); border-radius: 6px; pointer-events: none; }
.pip span { position: absolute; left: 0; top: 0; padding: 2px 6px; background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 700; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.tag { pointer-events: none; --stem: 6px; }
.tag .sp-sub { white-space: nowrap; }
.tag .sp-sub { opacity: 1; transform: translateX(-50%); }
.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lines line { stroke: var(--chalk); stroke-width: 1.5; opacity: .85; }
.lines circle { fill: var(--chalk); }
.tag.group::after { display: none; } /* el rètol de grup no té pal: les línies ja surten d'ell */
.tag.group .sp-num { background: var(--night-top); color: var(--yellow); border-right: 1px solid var(--track-solid); }
.tag.band .sp-num { font-size: .9rem; background: var(--night-top); color: var(--chalk); }
.tag.band.ok .sp-num { background: var(--night-good); color: var(--spot-ink); }
.tag.band .sp-name { border-bottom: 2px solid var(--yellow); }
.pick {
  position: absolute; left: 0; top: 0; pointer-events: auto; width: 46px; height: 46px; padding: 0; border-radius: 50%; box-sizing: border-box;
  border: 2px dashed var(--chalk); background: color-mix(in srgb, var(--night-top) 25%, transparent); cursor: pointer; transition: border-color .15s, background .15s;
}
.pick:hover, .pick:focus-visible { border-style: solid; border-color: var(--yellow); }
.pick.drag { cursor: grab; border-style: solid; width: 40px; height: 40px; touch-action: none; }
.pick.drag.held { cursor: grabbing; border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 35%, transparent); }

/* La franja del comentarista: el guió d'un mòdul, sobre el camp */
.strip {
  position: fixed; z-index: 4; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 640px; margin-inline: auto; box-sizing: border-box;
  padding: 10px 16px 14px; display: grid; gap: 8px; border: 2px solid var(--yellow); border-radius: 8px; background: var(--night-top); color: var(--chalk);
}
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
/* Un exercici es veu diferent: banda groga a dalt i etiqueta destacada */
.strip.ex { border-top-width: 10px; background: color-mix(in srgb, var(--night-top) 88%, var(--yellow)); }
.strip.ex .kicker { background: var(--yellow); color: var(--spot-ink); padding: 2px 8px; border-radius: 3px; }
.strip-live { display: block; margin-top: 4px; font-family: var(--display); font-size: 1.2rem; letter-spacing: .04em; color: var(--yellow); }
.strip-tools { display: flex; gap: 14px; }
.strip .linkbtn { color: var(--chalk); font-size: .85rem; }
.strip-text { font-size: 1.05rem; line-height: 1.45; min-height: 3em; }
.strip-text b { color: var(--yellow); }
.strip-nav { display: flex; align-items: center; gap: 12px; }
.strip-nav .cta { margin: 0 0 0 auto; padding: 9px 18px; }
#strip-retry, #strip-again { margin-left: auto; }
#strip-again + #strip-retry { margin-left: 0; }
/* El simulador del fora de joc, dins la franja */
.strip-sim { display: grid; gap: 4px; margin-top: 10px; }
.strip-sim input { width: 100%; accent-color: var(--yellow); margin: 0; }
.strip-sim .good { color: var(--night-good); }
.strip-sim .bad { color: var(--night-bad); }
/* Exemples de punts a la franja (Allò bàsic) */
.pts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pts > span { display: grid; gap: 1px; padding: 5px 10px; border-radius: 8px; background: #ffffff14; font-size: .82rem; line-height: 1.3; }
.pts b { color: var(--yellow); font-family: var(--display); font-weight: 700; letter-spacing: .02em; }
/* El reproductor de la jugada */
.strip-player { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: #ffffff12; }
.strip-player button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--chalk); }
.strip-player button svg { width: 16px; height: 16px; }
.strip-player svg.fill { fill: currentColor; stroke: none; }
.strip-player button:hover, .strip-player button:focus-visible { background: #ffffff22; }
.strip-player .pl-main { width: 36px; height: 36px; background: var(--yellow); color: var(--spot-ink); }
.strip-player .pl-main:hover, .strip-player .pl-main:focus-visible { background: #ffe58a; }
.strip-player input { flex: 1; min-width: 60px; accent-color: var(--yellow); margin: 0 4px; }
.strip-player .pl-speed { width: auto; min-width: 44px; padding: 0 8px; border-radius: 999px; border: 1.5px solid var(--chalk); font-weight: 700; font-size: .8rem; }
/* Exercicis de botons a la franja (triar targeta) */
.strip-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.strip-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 6px; border: 1.5px solid var(--chalk); background: none; color: var(--chalk); font-weight: 700; font-size: .95rem; }
.strip-opt:hover, .strip-opt:focus-visible { background: var(--chalk); color: var(--spot-ink); }
.strip-opt i { width: 14px; height: 19px; border-radius: 2px; transform: rotate(-8deg); }
.strip-opt i.y { background: var(--yellow); }
.strip-opt i.r { background: var(--red); }
.strip-opt i.n { border: 1.5px dashed currentColor; box-sizing: border-box; }
/* Rètols sense número (l'àrbitre, les mesures, les zones del camp) */
.tag .sp-num:empty { display: none; }
.tag .sp-num:empty + .sp-name { border-radius: 4px; }
.tag.measure .sp-name { background: var(--yellow); color: var(--spot-ink); }
#strip-retry + .cta { margin-left: 0; }
.strip-nav .cta:disabled { opacity: .35; cursor: default; }
#strip-prev { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--chalk); background: none; color: var(--chalk); display: grid; place-items: center; padding: 0; }
#strip-prev:disabled { opacity: .3; cursor: default; }
#strip-prev svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.strip-dots { display: flex; gap: 5px; }
.strip-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--track-solid); }
.strip-dots i.past { background: var(--chalk); }
.strip-dots i.on { background: var(--yellow); }
@media (max-width: 640px) { .strip-text { font-size: .95rem; } .strip { padding-inline: 12px; } }

/* Zones que queden fora de la vista: xips a la vora cap on has de girar el cap */
.edge { position: absolute; top: calc(var(--board-h) + 8px); bottom: 24%; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; pointer-events: none; transition: opacity .25s; }
.edge-l { left: 0; align-items: flex-start; }
.edge-r { right: 0; align-items: flex-end; }
.spots.away ~ .edge { opacity: 0; }
.spots.away ~ .edge .chip { pointer-events: none; }
.chip {
  pointer-events: auto; border: 0; border-bottom: 2px solid var(--yellow); background: var(--night-top); color: var(--chalk);
  font-family: var(--display); font-weight: 700; font-size: .9rem; letter-spacing: .05em; text-transform: uppercase; line-height: 1; padding: 7px 10px; white-space: nowrap;
}
.chip:hover { background: var(--yellow); color: var(--spot-ink); }
.chip.done span::after { content: " ✓"; }
.edge-l .chip { border-radius: 0 999px 999px 0; }
.edge-l .chip::before { content: "‹ "; }
.edge-r .chip { border-radius: 999px 0 0 999px; }
.edge-r .chip::after { content: " ›"; }
.st-tools { position: absolute; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 8px; transition: opacity .25s; }
.spots.away ~ .st-tools { opacity: 0; pointer-events: none; }
.st-tools button { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--chalk); background: var(--night-top); color: var(--chalk); display: grid; place-items: center; padding: 0; }
.st-tools svg, .panel-size svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.st-sim {
  position: fixed; z-index: 4; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); max-width: 520px; margin-inline: auto; box-sizing: border-box;
  padding: 14px 16px 16px; display: grid; gap: 8px; border: 2px solid var(--yellow); border-radius: 8px; background: var(--night-top); color: var(--chalk);
}
.st-sim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-family: var(--display); font-size: 1.4rem; }
.st-sim label { font-size: .9rem; }
.st-sim input { width: 100%; accent-color: var(--yellow); margin: 0; }
.st-sim .linkbtn { color: var(--chalk); font-family: var(--body); font-size: .9rem; }
.st-sim .cta { margin-top: 4px; justify-self: start; }
.st-sim .good { color: var(--night-good); }
.st-sim .bad { color: var(--night-bad); }
.fl-stand rect { fill: var(--blau); }
.fl-grass { fill: var(--pitch); }
.fl-chalk * { fill: none; stroke: var(--chalk); stroke-width: .5; }
.fl-off { stroke: var(--yellow); stroke-width: .8; stroke-dasharray: 2 1.5; }
.fl-home circle, #fl-att { fill: var(--grana); stroke: var(--chalk); stroke-width: .4; }
.fl-away circle { fill: var(--blau); stroke: var(--chalk); stroke-width: .4; }
.fl-ref { fill: var(--night-top); stroke: var(--yellow); stroke-width: .5; }
.fl-lin circle { fill: var(--yellow); }
.fl-lin rect { fill: var(--night-top); }
.fl-lin.up rect { fill: var(--red); }
.fl-board { fill: var(--night-top); stroke: var(--yellow); stroke-width: .5; }

/* Panell de contingut: columna a la dreta en pantalles amples, full inferior al mòbil */
.panel {
  position: fixed; z-index: 4; right: 0; bottom: 0; top: calc(var(--board-h) + env(safe-area-inset-top, 0px));
  width: min(480px, 44vw); display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); border-left: 3px solid var(--yellow);
}
.panel-head { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.panel-size { display: none; width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 6px; background: none; place-items: center; padding: 0; }
.panel.tall .panel-size svg { transform: rotate(180deg); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px calc(56px + env(safe-area-inset-bottom, 0px)); }
.panel h2 { font-size: 2.2rem; }
@media (max-width: 899px) {
  .panel { left: 0; top: auto; width: auto; height: 62%; border-left: 0; border-top: 3px solid var(--yellow); border-radius: 12px 12px 0 0; overflow: hidden; }
  .panel.tall { height: calc(100% - var(--board-h) - env(safe-area-inset-top, 0px)); border-radius: 0; }
  .panel-size { display: grid; }
}
.cta { display: inline-block; margin-top: 24px; background: var(--yellow); color: #1a1a0f; border: 0; border-radius: 4px; padding: 12px 22px; font-weight: 700; font-size: 1.05rem; }
.cta.alt { background: var(--pitch); color: var(--chalk); }

.album-head { margin-top: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.album-head p { color: var(--muted); font-size: .95rem; }
.exam-card {
  margin-top: 12px; width: 100%; text-align: left; background: var(--surface); border: 2px solid var(--ink);
  border-radius: 6px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.exam-card b { font-family: var(--display); font-size: 1.6rem; text-transform: uppercase; }

/* Mòduls */
.mod { display: grid; gap: 18px; padding-top: 8px; }
.kicker { font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--pitch); }
.lead { font-size: 1.15rem; color: var(--muted); }
.mod ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.mod li::marker { color: var(--pitch); }
.note {
  border: 1px solid var(--line); background: var(--surface); padding: 12px 16px; border-radius: 6px;
}
.note .lbl { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; background: var(--yellow); color: #1a1a0f; padding: 1px 8px; border-radius: 3px; margin-bottom: 6px; }
.note.red .lbl { background: var(--red); color: var(--chalk); }
.note.green .lbl { background: var(--pitch); color: var(--chalk); }
.cards { display: flex; gap: 12px; flex-wrap: wrap; }
.card-ref { flex: 1 1 220px; display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px; min-width: 0; }
.card-ref i { flex: none; width: 26px; height: 36px; border-radius: 3px; display: block; transform: rotate(-6deg); }
.card-ref i.y { background: var(--yellow); }
.card-ref i.r { background: var(--red); }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.shirt { font-family: var(--display); font-weight: 900; font-size: 1.3rem; color: var(--pitch); font-variant-numeric: tabular-nums; }

.diagrams { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 10px; min-width: 0; }
figure svg { width: 100%; height: auto; display: block; }
figcaption { font-size: .9rem; margin-top: 6px; }
figcaption b.good { color: var(--pitch); }
figcaption b.bad { color: var(--red); }
.f-grass { fill: var(--pitch); }
.f-chalk { stroke: var(--chalk); fill: none; }
.f-att { fill: var(--yellow); stroke: var(--pitch-deep); }
.f-def { fill: var(--chalk); stroke: var(--pitch-deep); }
.f-gk { fill: var(--red); stroke: var(--pitch-deep); }
.f-txt { fill: var(--pitch-deep); font: 700 11px var(--body); }
.f-lbl { fill: var(--chalk); font: 700 11px var(--body); }
.f-offline { stroke: var(--yellow); stroke-dasharray: 5 4; stroke-width: 2; }
.f-pass { stroke: var(--chalk); stroke-dasharray: 3 3; stroke-width: 1.5; fill: none; }

/* Preguntes */
.quiz { display: grid; gap: 14px; }
.quiz-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 3px solid var(--ink); padding-top: 14px; }
.quiz-head h3 { margin: 0; }
.quiz-head p { color: var(--muted); font-size: .9rem; }
fieldset.q { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 14px 16px 16px; margin: 0; min-width: 0; }
fieldset.q legend { padding: 0; font-weight: 700; display: flex; gap: 10px; float: left; width: 100%; margin-bottom: 10px; }
.qn { font-family: var(--display); font-weight: 900; color: var(--pitch); font-size: 1.3rem; line-height: 1.2; font-variant-numeric: tabular-nums; min-width: 1.4em; }
.opts { clear: both; display: grid; gap: 8px; }
.opt {
  text-align: left; background: var(--paper); border: 1.5px solid var(--line); border-radius: 5px; padding: 9px 12px;
  transition: border-color .15s, background .15s;
}
.opt:hover:not(:disabled) { border-color: var(--pitch); }
.opt[aria-pressed="true"] { border-color: var(--pitch); background: var(--ok-bg); font-weight: 700; }
.opt:disabled { cursor: default; opacity: .75; }
.opt.ok { border-color: var(--pitch); background: var(--ok-bg); opacity: 1; }
.opt.ok::before { content: "✓ "; color: var(--pitch); font-weight: 700; }
.opt.ko { border-color: var(--red); background: var(--ko-bg); opacity: 1; font-weight: 400; }
.opt.ko::before { content: "✗ "; color: var(--red); font-weight: 700; }
.why { margin-top: 10px; font-size: .95rem; }
.next { justify-self: start; }
.status { color: var(--red); font-weight: 700; }

/* Resultat i diploma */
.result { display: grid; gap: 16px; }
.big-score { font-family: var(--display); font-weight: 900; font-size: clamp(4rem, 18vw, 7rem); line-height: .9; color: var(--pitch); font-variant-numeric: tabular-nums; }
.big-score small { font-size: .4em; color: var(--muted); }
.field { display: grid; gap: 4px; max-width: 360px; }
.field label { font-weight: 700; font-size: .9rem; }
.field input { font: inherit; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); }
.diploma {
  background: var(--pitch); color: var(--chalk); border-radius: 6px; padding: 10px;
}
.diploma-in {
  border: 2px solid var(--chalk); border-radius: 3px; padding: 28px 20px; text-align: center; display: grid; gap: 10px;
}
.diploma .eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; color: var(--yellow); font-weight: 700; }
.diploma .who { font-family: var(--display); font-weight: 900; font-size: clamp(2.2rem, 9vw, 3.4rem); text-transform: uppercase; line-height: 1; overflow-wrap: anywhere; }
.diploma .rank { font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--yellow); }
.diploma .sig { display: flex; justify-content: space-between; gap: 12px; font-size: .8rem; margin-top: 10px; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: .9rem; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }


/* Exercicis */
.ex { display: grid; gap: 12px; margin-top: 8px; }
.kind { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--pitch); }
.ex-head h3 { margin: 2px 0 4px; }
.ex-head p { color: var(--muted); font-size: .95rem; }
.ex-body { display: grid; gap: 10px; }
fieldset.q.row-q .opts { display: flex; flex-wrap: wrap; gap: 6px; }
fieldset.q.row-q .opt { padding: 6px 12px; }
figure.mini { margin: 0 0 10px; padding: 0; border: 0; clear: both; max-width: 420px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.picked { margin: 0; padding-left: 1.6em; display: grid; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; }
.linkbtn { background: none; border: 0; color: var(--pitch); text-decoration: underline; padding: 0; justify-self: start; font-weight: 700; }
.tv { justify-self: start; display: inline-flex; align-items: center; gap: 12px; background: var(--pitch-deep); color: var(--chalk); font-family: var(--display); font-weight: 900; font-size: 1.6rem; padding: 6px 14px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.tv em { color: var(--yellow); font-style: normal; font-size: 1.1rem; }
.sim { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.sim h3 { margin: 0; }
.sim input { width: 100%; accent-color: var(--pitch); }
.sim #sim-pitch svg { width: 100%; max-width: 480px; height: auto; display: block; }
.good { color: var(--pitch); }
.bad { color: var(--red); }
.lock { background: var(--surface); border: 2px dashed var(--muted); border-radius: 6px; padding: 16px; display: grid; gap: 8px; }
.lock ul { margin: 0; padding-left: 1.2em; }

/* Zona bonus */
.bonus-card { border-style: dashed; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.player { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; min-width: 0; }
.player img { width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: 50% 15%; display: block; background: var(--line); }
.player > div { padding: 12px 14px 14px; display: grid; gap: 4px; align-content: start; }
.player b { font-family: var(--display); font-size: 1.5rem; line-height: 1.05; text-transform: uppercase; }
.player p { font-size: .95rem; }
.credit { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.qimg { display: block; clear: both; width: 160px; max-width: 100%; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: 50% 15%; border-radius: 5px; margin-bottom: 10px; }
.gossip { display: grid; gap: 12px; }
.story { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: grid; gap: 8px; }
.story-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.story-head h3 { margin: 0; font-size: 1.4rem; }
.drama { display: inline-flex; gap: 3px; flex: none; }
.drama::before { content: "Drama"; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-right: 4px; align-self: center; }
.drama i { width: 10px; height: 14px; border-radius: 2px; background: var(--red); display: block; }
.drama i.off { background: var(--line); }
.dict { margin: 0; display: grid; gap: 0; }
.dict > div { display: grid; grid-template-columns: minmax(120px, 11em) 1fr; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dict dt { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.dict dd { margin: 0; min-width: 0; }
@media (max-width: 520px) { .dict > div { grid-template-columns: 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 4.2em 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline .yr { font-family: var(--display); font-weight: 900; font-size: 1.7rem; color: var(--pitch); line-height: 1; font-variant-numeric: tabular-nums; }
.timeline li > div { min-width: 0; }
.pers-res { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; background: var(--pitch); color: var(--chalk); border-radius: 6px; padding: 16px; }
.pers-res img { width: 140px; aspect-ratio: 4 / 5; height: auto; object-fit: cover; object-position: 50% 15%; border-radius: 4px; border: 3px solid var(--chalk); }
.pers-res > div { flex: 1 1 220px; display: grid; gap: 6px; min-width: 0; }
.pers-res .kind, .pers-res .hint { color: var(--yellow); }
.pers-res h3 { font-size: 2.2rem; text-transform: uppercase; margin: 0; }

.match { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.match > div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.face { position: relative; display: grid; gap: 4px; padding: 4px; background: var(--surface); border: 2px solid var(--line); border-radius: 6px; font-size: .8rem; font-weight: 700; line-height: 1.2; text-align: center; }
.face img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; object-position: 50% 20%; border-radius: 4px; display: block; }
.face[aria-pressed="true"] { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow); }
.face.done { border-color: var(--pitch); cursor: default; }
.face.done img { opacity: .55; }
.face .pair { position: absolute; top: 6px; right: 6px; background: var(--pitch); color: var(--chalk); font-family: var(--display); font-weight: 900; font-size: .95rem; padding: 0 6px; border-radius: 3px; }
.face.wrong { border-color: var(--red); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.credits { font-size: .8rem; color: var(--muted); }
.credits ul { margin: 6px 0 0; padding-left: 1.2em; }
.credits a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* Carrusel de vídeo (VAR) */
.reel { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.reel-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.reel-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.reel-body h3 { margin: 0; }
.reel-nav { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.reel-nav > button { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--ink); background: none; display: grid; place-items: center; padding: 0; }
.reel-nav > button:disabled { opacity: .3; cursor: default; }
.reel-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.reel-dots { display: flex; gap: 6px; }
.reel-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--line); }
.reel-dots button.on { background: var(--pitch); }

/* Rètols amb foto al camp */
.tags.mini .sp-num { min-width: 20px; height: 20px; padding: 0 4px; font-size: .8rem; }
.tags.mini .sp-name { padding: 0 6px; font-size: .72rem; }
.tags.mini .tag { --stem: 3px; opacity: .92; }
/* Targetes d'alineació a l'estil de LaLiga (Veure'ls al camp) */
.lcard { position: absolute; left: 0; top: 0; width: 78px; height: 108px; transform-origin: 0 0; pointer-events: none; color: #fff;
  background: linear-gradient(170deg, #241018 0%, #0f0609 55%, var(--team) 100%); clip-path: polygon(0 6%, 6% 0, 94% 0, 100% 6%, 100% 86%, 50% 100%, 0 86%); filter: drop-shadow(0 3px 6px rgb(0 0 0 / .5)); }
.lcard.nastic { --team: #8c1d35; } .lcard.barca { --team: #1b3f8f; }
.lc-img { position: absolute; left: 0; top: 4px; width: 100%; height: 66px; object-fit: cover; object-position: 50% 12%; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.lc-n { position: absolute; left: 6px; top: 4px; z-index: 1; font-family: var(--display); font-weight: 900; font-size: 1.15rem; line-height: 1; text-shadow: 0 1px 3px #000; }
.lc-c { position: absolute; right: 6px; top: 5px; z-index: 1; padding: 0 4px; border-radius: 3px; background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 900; font-size: .7rem; }
.lc-name { position: absolute; left: 3px; right: 3px; top: 68px; text-align: center; font-family: var(--display); font-weight: 700; font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-foot { position: absolute; left: 0; right: 0; top: 84px; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: .75rem; line-height: 1; }
.lc-foot img { width: 13px; height: 13px; object-fit: contain; }
.tag .sp-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 2px solid var(--yellow); margin-right: 4px; align-self: center; background: var(--night-top); }

/* La pantalla gegant del videomarcador (Alineacions) */
.stage { position: fixed; z-index: 4; inset: calc(var(--board-h) + env(safe-area-inset-top, 0px) + 10px) 10px calc(10px + env(safe-area-inset-bottom, 0px)); display: grid; place-items: center; pointer-events: none; }
.lib {
  pointer-events: auto; position: relative; width: min(1100px, 100%); max-height: 100%; overflow-y: auto; box-sizing: border-box;
  padding: 16px 18px 20px; border-radius: 10px; color: var(--chalk);
  background: radial-gradient(circle at 50% 0, #14301f 0, #08130d 70%); border: 3px solid #2b333b; box-shadow: 0 0 0 2px var(--yellow), 0 20px 60px #000a;
  animation: lib-in .5s .45s both;
}
@keyframes lib-in { from { opacity: 0; transform: scale(.96); } }
.lib-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lib-head h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--chalk); }
.lib .kicker { color: var(--yellow); }
.lib .linkbtn { color: var(--chalk); }
.lib-tabs, .lib-teams { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.lib-tabs button, .lib-teams button { border: 1.5px solid var(--chalk); background: none; color: var(--chalk); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; }
.lib-teams button { display: inline-flex; align-items: center; gap: 6px; }
.lib-teams button img { width: 20px; height: 20px; object-fit: contain; }
.lib-tabs button[aria-pressed="true"], .lib-teams button[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--spot-ink); }
.lib-bar .lib-cta { margin: 0 0 0 auto; padding: 7px 16px; font-size: .9rem; }
.lib-tabs .lib-camp { margin-left: auto; border-style: dashed; }
.lib-right { display: grid; justify-items: end; gap: 4px; }
.lib-score { font-family: var(--display); font-size: 1.1rem; color: var(--yellow); }
.lib-sub { margin: 12px 0; color: #cfd9d2; }
.lib h4 { font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 8px; color: var(--yellow); }
.pitch { display: grid; gap: 14px; padding: 16px 8px; border-radius: 8px; background: repeating-linear-gradient(0deg, #1f6b40 0 40px, #236f44 40px 80px); border: 2px solid #f7faf555; }
.prow { display: flex; justify-content: space-evenly; gap: 6px; }
.pcard { position: relative; display: grid; justify-items: center; gap: 2px; width: 92px; padding: 0; border: 0; background: none; color: var(--chalk); }
.pcard img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 3px solid var(--chalk); background: #222; transition: transform .15s, border-color .15s; }
.pcard:hover img, .pcard:focus-visible img { transform: scale(1.08); border-color: var(--yellow); }
.pcard .pnum { position: absolute; top: 48px; left: calc(50% + 18px); min-width: 22px; padding: 0 4px; border-radius: 4px; background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 900; font-size: .95rem; }
.pcard .pname { font-weight: 700; font-size: .78rem; line-height: 1.15; text-align: center; text-shadow: 0 1px 3px #000; }
.pcard.xi::after { content: "★"; position: absolute; top: -2px; left: calc(50% - 38px); color: var(--yellow); font-size: 1rem; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.lib-card {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(460px, 92%); display: flex; gap: 16px; align-items: center;
  padding: 16px; border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 0 0 3px var(--yellow), 0 20px 60px #000c;
}
.lib-card img { width: 150px; height: 150px; border-radius: 8px; object-fit: cover; object-position: 50% 12%; flex: none; }
.lib-card h3 { margin: 2px 0; font-size: 1.8rem; }
.lib-card .kicker { color: var(--pitch); }
.lib-card .linkbtn { color: var(--pitch); margin-top: 8px; }
.fitxa-n { color: var(--muted); }
@media (max-width: 520px) { .lib-card { flex-direction: column; text-align: center; } }
/* Jocs de cares */
.faces-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.face-slot { position: relative; display: grid; justify-items: center; gap: 4px; width: 120px; padding: 8px; border-radius: 10px; border: 2px dashed #f7faf588; cursor: pointer; }
.face-slot img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; }
.face-slot .pnum { position: absolute; top: 76px; right: 18px; padding: 0 5px; border-radius: 4px; background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 900; }
.face-slot .pname { font-weight: 700; min-height: 1.3em; }
.face-slot.ok { border-style: solid; border-color: var(--night-good); background: #8fe0a822; cursor: default; }
.face-slot.ok .pname { color: var(--night-good); }
.face-slot.ko { animation: shake .35s; border-color: var(--night-bad); }
.chips-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.name-chip { border: 2px solid var(--chalk); background: var(--night-top); color: var(--chalk); border-radius: 6px; padding: 8px 14px; font-weight: 700; touch-action: none; cursor: grab; }
.name-chip.on { background: var(--yellow); color: var(--spot-ink); border-color: var(--yellow); }
.name-chip.lift { opacity: .35; }
.name-chip.ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; background: var(--yellow); color: var(--spot-ink); }
.name-chip.right { background: var(--night-good); color: var(--spot-ink); border-color: var(--night-good); }
.name-chip.wrong { background: var(--night-bad); color: var(--spot-ink); border-color: var(--night-bad); }
.name-chip:disabled { cursor: default; }
.quiz-face { position: relative; width: 170px; margin: 0 auto; }
.quiz-face img { width: 170px; height: 170px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 4px solid var(--chalk); }
.quiz-face .pnum { position: absolute; right: 8px; bottom: 10px; padding: 0 6px; border-radius: 4px; background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 900; font-size: 1.2rem; }
.lib-foot { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.lib-foot .cta { margin: 0; }

/* L'onze ha de cabre sense scroll: tot es dimensiona amb l'alçada de la finestra */
.lib { display: flex; flex-direction: column; }
.lib-head h2 { font-size: clamp(1.4rem, 3.6vh, 2.4rem); }
.lib-bar { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 8px; }
.lib-bar .lib-tabs, .lib-bar .lib-teams { margin-top: 0; }
.lib-bar .lib-tabs { flex: 1 1 auto; }
.lib-sub { margin: clamp(4px, 1.2vh, 12px) 0; }
.pitch { gap: clamp(2px, 1vh, 14px); padding: clamp(6px, 1.4vh, 16px) 8px; }
.pitch .pcard img { width: clamp(40px, 7.2vh, 70px); height: clamp(40px, 7.2vh, 70px); }
.pitch .pcard .pnum { top: calc(clamp(40px, 7.2vh, 70px) - 22px); }
.pitch .pcard .pname { font-size: clamp(.68rem, 1.35vh, .78rem); }
.pcard .pcap { position: absolute; top: 0; left: calc(50% + 14px); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--chalk); color: var(--spot-ink); font-family: var(--display); font-weight: 900; font-size: .85rem; box-shadow: 0 0 0 2px var(--yellow); }
.strip-ord { margin: 8px 0 0; padding-left: 1.6em; display: grid; gap: 2px; font-weight: 700; color: var(--chalk); }
.strip-ord:empty { display: none; }
.draw-pad { position: absolute; inset: 0; pointer-events: auto; cursor: crosshair; touch-action: none; }

/* Banqueta flotant de l'exercici del 4-4-2 */
.tray { position: absolute; top: calc(var(--board-h) + env(safe-area-inset-top, 0px) + 10px); right: 12px; max-width: min(360px, calc(100% - 24px)); pointer-events: auto;
  padding: 10px 12px 12px; border-radius: 10px; background: color-mix(in srgb, var(--night-top) 90%, transparent); border: 2px solid var(--yellow); box-shadow: 0 10px 30px #0008; }
.tray .kicker { color: var(--yellow); }
.tray-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tray-chip { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--chalk); background: #a3213f; color: var(--chalk); font-family: var(--display); font-weight: 900; font-size: 1.15rem; cursor: grab; touch-action: none; padding: 0; }
.tray-chip:hover { border-color: var(--yellow); }
.tray-chip.held { opacity: .35; cursor: grabbing; }
.tray .hint { color: var(--night-good); font-weight: 700; }

/* Felicitació en acabar un mòdul */
.confetti { position: fixed; inset: 0; z-index: 7; pointer-events: none; width: 100%; height: 100%; }
.party { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: #0009; padding: 16px; }
.party-card { width: min(420px, 100%); box-sizing: border-box; text-align: center; padding: 22px 22px 18px; border-radius: 12px; background: var(--night-top); color: var(--chalk); border: 3px solid var(--yellow); box-shadow: 0 20px 60px #000c; animation: party-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes party-in { from { transform: scale(.7); opacity: 0; } }
.party-card .kicker { color: var(--yellow); }
.party-card h2 { color: var(--chalk); font-size: clamp(2.2rem, 7vw, 3rem); margin: 6px 0 8px; }
.party-card b { color: var(--yellow); }
.party-sub { color: #cfd9d2; font-size: .9rem; margin-top: 6px; }
.party-btns { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.party-btns .cta { margin: 0; }
.party-btns .linkbtn { color: var(--chalk); }

/* Exercicis: fila de números amb l'estat de cadascun */
.strip-pills { gap: 6px; }
.pill { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid var(--track-solid); background: none; color: var(--chalk); font-family: var(--display); font-weight: 900; font-size: .95rem; line-height: 1; }
.pill.ok { background: var(--night-good); border-color: var(--night-good); color: var(--spot-ink); }
.pill.ko { background: var(--night-bad); border-color: var(--night-bad); color: var(--spot-ink); }
.pill.on { box-shadow: 0 0 0 3px var(--yellow); }

/* Llista d'exercicis als apunts */
.camp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.camp-list li { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "num q go" "num st go"; gap: 2px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.cl-num { grid-area: num; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 900; border: 2px solid var(--line); }
.cl-q { grid-area: q; font-weight: 700; font-size: .92rem; line-height: 1.3; }
.cl-st { grid-area: st; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.cl-go { grid-area: go; margin: 0; padding: 7px 14px; font-size: .9rem; }
.camp-list li.ok .cl-num { background: var(--pitch); border-color: var(--pitch); color: var(--chalk); }
.camp-list li.ok .cl-st { color: var(--pitch); }
.camp-list li.ko .cl-num { background: var(--red); border-color: var(--red); color: var(--chalk); }
.camp-list li.ko .cl-st { color: var(--red); }
.cutie-name { text-align: center; font-family: var(--display); font-size: 1.5rem; margin-top: 8px; }
.quiz-face { overflow: visible; }
.heart { position: absolute; bottom: 30%; pointer-events: none; animation: heart-up 1.8s ease-out both; }
@keyframes heart-up { from { transform: translate(0, 0) scale(.4); opacity: 0; } 15% { opacity: 1; } to { transform: translate(var(--dx), -220px) scale(1.1); opacity: 0; } }

/* Cultura general: targetes que es giren */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.fact { position: relative; min-height: 150px; padding: 0; border: 0; background: none; perspective: 800px; color: var(--chalk); text-align: center; }
.fact-front, .fact-back { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; padding: 12px; border-radius: 10px; backface-visibility: hidden; transition: transform .5s; box-sizing: border-box; }
.fact-front { background: linear-gradient(160deg, #1f6b40, #123f26); border: 2px solid #f7faf555; }
.fact-front b { font-family: var(--display); font-weight: 900; font-size: 2.1rem; line-height: 1; color: var(--yellow); }
.fact-front span { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.fact-back { background: var(--paper); color: var(--ink); transform: rotateY(180deg); font-size: .88rem; line-height: 1.35; border: 2px solid var(--yellow); }
.fact.flipped .fact-front { transform: rotateY(180deg); }
.fact.flipped .fact-back { transform: none; }
.cult-q { text-align: center; color: var(--chalk); font-size: 1.6rem; margin: 10px 0; }

/* Cultura general: el text per llegir, dins la pantalla */
.article { max-width: 760px; margin: 10px auto 18px; padding: 18px 20px; border-radius: 10px; background: var(--paper); color: var(--ink); line-height: 1.55; }
.article h3 { margin: 16px 0 4px; color: var(--pitch-deep); }
.article p { margin: 0 0 6px; }
.article .lead { color: var(--muted); }
.article ul { padding-left: 1.2em; display: grid; gap: 4px; }
.article .tbl { margin: 8px 0; }
.pyramid { list-style: none; margin: 8px auto; padding: 0; display: grid; gap: 4px; justify-items: center; max-width: 520px; }
.pyramid li { padding: 6px 12px; border-radius: 4px; background: var(--pitch); color: var(--chalk); text-align: center; box-sizing: border-box; }
.pyramid li:nth-child(1) { width: 40%; } .pyramid li:nth-child(2) { width: 55%; } .pyramid li:nth-child(3) { width: 70%; background: #a3213f; } .pyramid li:nth-child(4) { width: 85%; } .pyramid li:nth-child(5) { width: 100%; }
#cult h4 { max-width: 760px; margin: 14px auto 8px; }
#cult .facts { max-width: 760px; margin: 0 auto; }

/* Cares conegudes: el photocall (àlbum de siluetes i veritat o mentida) */
.vip-bar { position: relative; height: 22px; border-radius: 999px; background: #ffffff1a; overflow: hidden; margin-bottom: 14px; }
.vip-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--yellow), #ffe58a); transition: width .6s; }
.vip-bar span { position: relative; display: block; text-align: center; font-family: var(--display); font-weight: 700; font-size: .85rem; line-height: 22px; color: var(--chalk); text-shadow: 0 1px 2px #000; }
.vip-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.vcromo { position: relative; aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; color: var(--chalk); perspective: 900px; cursor: pointer; }
.vc-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s; }
.vcromo.flip .vc-in { transform: rotateY(180deg); }
.vc-face, .vc-back { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; backface-visibility: hidden; box-sizing: border-box; }
.vc-face { border: 3px solid #f7faf533; background: radial-gradient(circle at 50% 30%, #2d6a48, #0d2418); }
.vc-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; transition: filter .9s; }
img.sil { filter: blur(3px) grayscale(1) brightness(.85); transform: scale(1.08); } /* la cara, desenfocada (el scale amaga la vora borrosa) */
.vg-photo img.sil { filter: blur(5px) grayscale(1) brightness(.85); }
.vc-face img, .vg-photo img { transition: filter .9s, transform .9s; }
.vcromo:not(.stuck) .vc-face { border-style: dashed; }
.vcromo:not(.stuck):hover .vc-face, .vcromo:not(.stuck):focus-visible .vc-face { border-color: var(--yellow); transform: rotate(-2deg) scale(1.03); }
.vc-face { transition: transform .15s, border-color .15s; }
.vc-q { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 3rem; color: var(--yellow); text-shadow: 0 2px 8px #000; }
.vc-num { position: absolute; left: 6px; top: 6px; min-width: 22px; padding: 0 5px; border-radius: 4px; background: var(--yellow); color: var(--spot-ink); font-family: var(--display); font-weight: 900; font-size: .85rem; text-align: center; }
.vc-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 6px; background: linear-gradient(transparent, #000d 55%); font-family: var(--display); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; text-align: center; }
.vcromo.stuck .vc-face { border: 3px solid var(--yellow); box-shadow: 0 6px 16px #0008; }
.vcromo.miss .vc-face { border-color: #f7faf588; }
.vcromo.just .vc-in { animation: stick .7s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes stick { 0% { transform: scale(1.35) rotate(-8deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.vc-back { display: grid; align-content: start; gap: 4px; padding: 10px; background: var(--paper); color: var(--ink); border: 3px solid var(--yellow); transform: rotateY(180deg); text-align: left; overflow-y: auto; }
.vc-back b { font-family: var(--display); font-size: 1rem; line-height: 1.1; }
.vc-t { font-size: .7rem; font-weight: 700; color: var(--pitch); text-transform: uppercase; letter-spacing: .04em; }
.vc-d { font-size: .78rem; line-height: 1.3; }
.vc-back a { font-size: .62rem; color: var(--muted); }
.vguess { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px; background: #000b; animation: lib-in .25s both; }
.vg-card { width: min(420px, 100%); box-sizing: border-box; padding: 18px; border-radius: 12px; background: var(--night-top); border: 3px solid var(--yellow); text-align: center; box-shadow: 0 20px 60px #000c; }
.vg-card h3 { color: var(--chalk); font-size: 1.5rem; margin: 10px 0 0; }
.vg-card p { color: #cfd9d2; }
.vg-photo { position: relative; width: 160px; height: 240px; margin: 0 auto; border-radius: 10px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #2d6a48, #0d2418); border: 3px solid #f7faf555; }
.vg-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transition: filter .9s; }
.vg-stamp { position: absolute; left: 50%; top: 55%; padding: 4px 12px; border: 3px solid currentColor; border-radius: 6px; font-family: var(--display); font-weight: 900; font-size: 1.4rem; text-transform: uppercase; transform: translate(-50%, -50%) rotate(-12deg) scale(0); opacity: 0; background: #000a; }
.vg-photo.ok { border-color: var(--night-good); } .vg-photo.ok .vg-stamp { color: var(--night-good); }
.vg-photo.ko { border-color: var(--night-bad); } .vg-photo.ko .vg-stamp { color: var(--night-bad); }
.vg-photo.ok .vg-stamp, .vg-photo.ko .vg-stamp { animation: stamp .5s .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes stamp { to { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; } }
.vm { width: min(560px, 100%); margin: 8px auto 0; }
.vm-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: #cfd9d2; }
.vm-streak { color: var(--yellow); font-weight: 700; }
.vm-card { display: grid; justify-items: center; gap: 12px; margin-top: 10px; padding: 18px; border-radius: 12px; background: #ffffff10; border: 3px solid #f7faf533; transition: border-color .3s, background .3s; }
.vm-card img { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; border: 3px solid var(--chalk); }
.vm-s { margin: 0; font-family: var(--display); font-size: clamp(1.15rem, 3vw, 1.5rem); line-height: 1.25; text-align: center; color: var(--chalk); }
.vm-card.ok { border-color: var(--night-good); background: #8fe0a81a; }
.vm-card.ko { border-color: var(--night-bad); background: #ff9d901a; animation: shake .35s; }
.vm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.vm-card { position: relative; overflow: hidden; }
/* Error: una targeta vermella entra girant per sobre de la frase */
.vm-red { position: absolute; right: 18px; top: 14px; width: 54px; height: 76px; border-radius: 6px; background: #d23a2c; box-shadow: 0 6px 16px #000a, inset 0 0 0 2px #ffffff40; transform-origin: 50% 120%; animation: red-card .6s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes red-card { from { transform: translate(60px, -90px) rotate(70deg) scale(.4); opacity: 0; } to { transform: rotate(12deg); opacity: 1; } }
.vm-card.ko { animation: shake .35s 2, ko-flash .7s; }
@keyframes ko-flash { 0%, 40% { background: #d23a2c55; } }
.vm-b { padding: 14px; border-radius: 10px; border: 0; font-family: var(--display); font-weight: 900; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .04em; color: var(--spot-ink); transition: transform .1s; }
.vm-b:active { transform: scale(.96); }
.vm-b.v { background: var(--night-good); } .vm-b.m { background: var(--night-bad); }
.vm-why { margin: 14px 0 0; text-align: center; color: #cfd9d2; }
.vm-why b { color: var(--yellow); }
.vm-end { text-align: center; padding: 20px 0; }
.vm-big { font-family: var(--display); font-weight: 900; font-size: 3rem; color: var(--yellow); margin: 0; }
@media (prefers-reduced-motion: reduce) { .vcromo.just .vc-in, .vg-stamp, .vm-card.ko, .vm-red { animation: none !important; } .vm-red { transform: rotate(12deg); } .vg-photo.ok .vg-stamp, .vg-photo.ko .vg-stamp { transform: translate(-50%, -50%) rotate(-12deg); opacity: 1; } .vc-in { transition: none; } }

/* El Jaume virtual: botó flotant a baix a l'esquerra (a la dreta hi ha el zoom) i el xat */
.jx-fab { position: fixed; z-index: 5; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border: 2px solid var(--yellow); border-radius: 999px; background: var(--night-top); color: var(--chalk); font-weight: 700; font-size: .9rem; box-shadow: 0 6px 18px #0009; }
.jx-fab:hover, .jx-fab:focus-visible { background: #1f2a33; }
.jx-av { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--blau), var(--grana)); color: #fff; font-family: var(--display); font-weight: 900; font-size: 1.15rem; }
.jx-ia { padding: 1px 6px; border-radius: 4px; background: var(--yellow); color: var(--spot-ink); font-size: .7rem; font-weight: 900; letter-spacing: .04em; }
@media (max-width: 900px) {
  .jx-fab .jx-lbl { display: none; }
  .jx-fab { padding-right: 8px; }
  body:has(#strip:not([hidden])) .jx-fab { bottom: auto; top: calc(var(--board-h) + env(safe-area-inset-top, 0px) + 10px); } /* amb la franja d'un guió, a dalt */
}
.jx { position: fixed; z-index: 8; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100vw - 24px)); height: min(580px, calc(100dvh - var(--board-h) - 36px)); display: flex; flex-direction: column; box-sizing: border-box; border: 3px solid var(--yellow); border-radius: 12px; background: var(--night-top); color: var(--chalk); box-shadow: 0 20px 60px #000c; animation: lib-in .25s both; }
.jx-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #ffffff22; }
.jx-who { flex: 1; min-width: 0; }
.jx-who h2 { margin: 0; font-size: 1.2rem; color: var(--chalk); }
.jx-who p { margin: 0; font-size: .72rem; color: #cfd9d2; }
.jx-head .linkbtn { color: #cfd9d2; font-size: .8rem; }
.jx-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--chalk); font-size: 1.4rem; line-height: 1; }
.jx-x:hover, .jx-x:focus-visible { background: #ffffff22; }
.jx-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.jx-msg { max-width: 85%; margin: 0; padding: 8px 12px; border-radius: 14px; font-size: .95rem; line-height: 1.4; }
.jx-msg.j { align-self: flex-start; background: #ffffff14; border-bottom-left-radius: 4px; }
.jx-msg.me { align-self: flex-end; background: var(--yellow); color: var(--spot-ink); border-bottom-right-radius: 4px; }
.jx-msg b { color: var(--yellow); } .jx-msg.me b { color: inherit; }
.jx-typing { display: flex; gap: 4px; padding: 12px 14px; }
.jx-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--chalk); animation: jx-dot 1s infinite; }
.jx-typing i:nth-child(2) { animation-delay: .15s; } .jx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes jx-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.jx-err { margin: 0; padding: 8px 12px; border-radius: 10px; background: #ff9d901f; color: #ffd2cb; font-size: .88rem; }
.jx-err .linkbtn { color: var(--yellow); }
.jx-sugg { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; }
.jx-sugg:empty { display: none; }
.jx-chip { padding: 6px 12px; border: 1.5px solid var(--chalk); border-radius: 999px; background: none; color: var(--chalk); font-size: .82rem; font-weight: 700; }
.jx-chip:hover, .jx-chip:focus-visible { background: var(--chalk); color: var(--spot-ink); }
.jx-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; }
.jx-form textarea { flex: 1; resize: none; padding: 8px 10px; border: 1.5px solid #ffffff44; border-radius: 10px; background: #0003; color: var(--chalk); font: inherit; font-size: .95rem; }
.jx-form textarea:focus { outline: 2px solid var(--yellow); border-color: transparent; }
.jx-form .cta { margin: 0; padding: 9px 14px; }
@media (prefers-reduced-motion: reduce) { .jx, .jx-typing i { animation: none; } }


/* EL BAR (zona bonus) a la pantalla gegant */
.bar-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.bar-tile { position: relative; display: grid; gap: 6px; align-content: start; justify-items: start; min-height: 170px; padding: 16px; border: 2px solid #f7faf533; border-radius: 14px; background: linear-gradient(160deg, #1f6b40, #0e2a1a); color: var(--chalk); text-align: left; transition: transform .15s, border-color .15s; }
.bar-tile:hover, .bar-tile:focus-visible { transform: translateY(-3px) rotate(-1deg); border-color: var(--yellow); }
.bar-tile .bt-e { font-size: 2.6rem; line-height: 1; }
.bar-tile b { font-family: var(--display); font-size: 1.25rem; }
.bar-tile span { font-size: .85rem; color: #cfd9d2; }
.bar-tile i { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #ffffff22; }
.bar-tile.done { border-color: var(--night-good); }
.bar-tile.done i { background: var(--night-good); color: var(--spot-ink); }
/* 🍿 Culebrons: un WhatsApp */
.wa { max-width: 560px; margin: 4px auto 0; border-radius: 14px; overflow: hidden; background: #0b141a; box-shadow: 0 10px 30px #0008; }
.wa-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #1f2c34; color: #e9edef; }
.wa-head > div { display: grid; min-width: 0; }
.wa-head b { font-size: 1rem; }
.wa-head span { font-size: .78rem; color: #8696a0; }
.wa-gav { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--blau), var(--grana)); color: #fff; font-family: var(--display); font-weight: 900; font-size: 1.2rem; }
.wa-back { width: 32px; height: 40px; border: 0; background: none; color: #e9edef; font-size: 2rem; line-height: 1; }
.wa-av { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; overflow: hidden; background: #2a3942; font-size: 1.5rem; }
.wa-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.wa-list { display: grid; }
.wa-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-bottom: 1px solid #222d34; background: #111b21; color: #e9edef; text-align: left; }
.wa-row:hover, .wa-row:focus-visible { background: #202c33; }
.wa-mid { flex: 1; display: grid; min-width: 0; }
.wa-mid b { font-size: .95rem; }
.wa-mid span { font-size: .82rem; color: #8696a0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-side { display: grid; justify-items: end; gap: 4px; font-size: .7rem; }
.wa-new { padding: 1px 7px; border-radius: 999px; background: #25d366; color: #0b141a; font-style: normal; font-weight: 800; font-size: .7rem; }
.wa-credits { padding: 6px 12px; background: #111b21; color: #8696a0; font-size: .75rem; }
.wa-credits a { color: #8696a0; }
.wa-log { display: flex; flex-direction: column; gap: 6px; min-height: 340px; max-height: min(60vh, 520px); overflow-y: auto; padding: 14px 12px; background: #0b141a radial-gradient(circle at 20% 20%, #ffffff06 0 2px, transparent 3px) 0 0 / 26px 26px; }
.wa-m { position: relative; max-width: 80%; padding: 6px 10px 8px; border-radius: 8px; background: #202c33; color: #e9edef; font-size: .95rem; line-height: 1.4; animation: wa-in .25s ease-out; }
.wa-m b { display: block; font-size: .78rem; }
.wa-m.J { align-self: flex-start; border-top-left-radius: 0; }
.wa-m.me { align-self: flex-end; background: #005c4b; border-top-right-radius: 0; padding-right: 34px; }
.wa-m.me i { position: absolute; right: 8px; bottom: 5px; font-style: normal; font-size: .7rem; color: #53bdeb; }
.wa-img { display: block; width: 180px; max-width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 15%; border-radius: 6px; margin-top: 4px; }
@keyframes wa-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.wa-sticker { align-self: flex-start; font-size: 5rem; line-height: 1; animation: wa-sticker .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes wa-sticker { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.wa-typing { display: flex; gap: 4px; padding: 12px 14px; }
.wa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: jx-dot 1s infinite; }
.wa-typing i:nth-child(2) { animation-delay: .15s; } .wa-typing i:nth-child(3) { animation-delay: .3s; }
.wa-q { align-self: stretch; margin-top: 6px; padding: 10px; border-radius: 10px; background: #1f2c34; text-align: center; }
.wa-q p { margin: 0 0 8px; color: #e9edef; font-weight: 700; }
.wa-o { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; border: 1.5px solid #00a884; border-radius: 999px; background: none; color: #e9edef; font-size: .9rem; font-weight: 700; }
.wa-o:hover, .wa-o:focus-visible { background: #00a884; color: #0b141a; }
.wa-end { align-self: center; margin-top: 8px; }
.wa-end .linkbtn { color: #8696a0; }
@media (prefers-reduced-motion: reduce) { .wa-m, .wa-typing i { animation: none; } }
/* Parla com una nativa */
.nat-q { margin: 8px auto 0; max-width: 560px; padding: 16px; border-radius: 12px; background: #ffffff10; text-align: center; }
.nat-term { margin: 4px 0; font-family: var(--display); font-weight: 900; font-size: 2rem; color: var(--yellow); }
.nat-opts { display: grid; gap: 8px; margin-top: 8px; }
.nat-o { padding: 10px 12px; border: 1.5px solid var(--chalk); border-radius: 8px; background: none; color: var(--chalk); font-size: .9rem; text-align: left; }
.nat-o:hover:not(:disabled), .nat-o:focus-visible { background: #ffffff1a; }
.nat-o.right { background: var(--night-good); border-color: var(--night-good); color: var(--spot-ink); }
.nat-o.wrong { background: var(--night-bad); border-color: var(--night-bad); color: var(--spot-ink); }
.nat-search { width: 100%; max-width: 320px; margin-bottom: 10px; padding: 8px 12px; border: 1.5px solid #ffffff44; border-radius: 999px; background: #0003; color: var(--chalk); font: inherit; }
.nat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ncard { position: relative; height: 120px; padding: 0; border: 0; background: none; perspective: 700px; color: var(--chalk); }
.nc-f, .nc-b { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; border-radius: 10px; backface-visibility: hidden; transition: transform .5s; box-sizing: border-box; }
.nc-f { background: linear-gradient(160deg, #1b3f8f, #8a1c3c); font-family: var(--display); font-weight: 900; font-size: 1.15rem; }
.nc-b { background: var(--paper); color: var(--ink); font-size: .78rem; line-height: 1.3; transform: rotateY(180deg); overflow-y: auto; }
.ncard.flip .nc-f { transform: rotateY(180deg); } .ncard.flip .nc-b { transform: rotateY(360deg); }
/* La màquina del temps */
/* Bingo */
.bingo-st { text-align: center; font-family: var(--display); font-size: 1.1rem; margin-bottom: 10px; }
.bingo-st b { color: var(--yellow); font-size: 1.4rem; }
.bingo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 640px; margin: 0 auto; }
.bcell { position: relative; aspect-ratio: 1.25; padding: 6px; border: 2px solid #f7faf544; border-radius: 10px; background: #fff6e9; color: #2a1810; font-size: clamp(.66rem, 1.6vw, .85rem); font-weight: 700; line-height: 1.2; }
.bcell.on { background: #fff6e9; }
.bcell.on::after { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: #e5412dcc; mix-blend-mode: multiply; animation: dab .3s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes dab { from { transform: scale(0); } }
/* Quin crac ets? */
/* Capçalera de cada joc del bar: tornar a la portada */
.bar-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.bar-top h3 { margin: 0; color: var(--chalk); font-size: 1.3rem; }
.bar-back { padding: 6px 12px; border: 1.5px solid var(--chalk); border-radius: 999px; background: none; color: var(--chalk); font-weight: 700; font-size: .85rem; }
.bar-back:hover, .bar-back:focus-visible { background: var(--chalk); color: var(--spot-ink); }
/* ⏳ La màquina del temps: línia del temps per llegir, amb un color per categoria */
.tm-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tm-filter button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1.5px solid var(--chalk); border-radius: 999px; background: none; color: var(--chalk); font-weight: 700; font-size: .9rem; }
.tm-filter button img { width: 18px; height: 18px; object-fit: contain; }
.tm-filter button[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--spot-ink); }
.tl { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.tl::before { content: ""; position: absolute; left: 67px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: #ffffff26; }
.tl-i { position: relative; display: grid; grid-template-columns: 52px 1fr; gap: 26px; margin-bottom: 12px; }
.tl-i::before { content: ""; position: absolute; left: 58.5px; top: 14px; width: 13px; height: 13px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 0 3px var(--night-top); }
.tl-i.nastic { --cat: #c43a5c; } .tl-i.barca { --cat: #3d6be0; } .tl-i.futbol { --cat: var(--yellow); }
.tl-y { padding-top: 9px; text-align: right; font-family: var(--display); font-weight: 900; font-size: 1.1rem; color: var(--chalk); }
.tl-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #fff6e9; color: #2a1810; border-left: 6px solid var(--cat); }
.tl-pic { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: #2a181012; font-size: 1.8rem; }
.tl-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.tl-pic img.crest { width: 70%; height: 70%; object-fit: contain; }
.tl-c { display: block; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--cat); filter: brightness(.8); }
.tl-card b { display: block; font-family: var(--display); font-size: 1.15rem; line-height: 1.2; }
.tl-card p { margin: 3px 0 0; font-size: .95rem; line-height: 1.45; }
@media (max-width: 520px) { .tl::before { left: 51px; } .tl-i { grid-template-columns: 40px 1fr; gap: 18px; } .tl-i::before { left: 42.5px; } .tl-y { font-size: .9rem; } }
/* 🗣️ El botó dels exercicis, al costat del títol dels vídeos */
.nat-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nat-bar h4 { margin: 14px 0 8px; }
.nat-bar .lib-cta { margin: 0; }
/* ⭐ Quin crac ets?: una pregunta cada cop */
.crac-q { max-width: 620px; margin: 6px auto 0; text-align: center; }
.crac-prog { display: flex; justify-content: center; gap: 6px; margin-bottom: 10px; }
.crac-prog i { width: 34px; height: 6px; border-radius: 999px; background: #ffffff22; }
.crac-prog i.done { background: var(--night-good); } .crac-prog i.on { background: var(--yellow); }
.crac-ask { margin: 6px 0 14px; font-family: var(--display); font-weight: 900; font-size: clamp(1.4rem, 3.5vw, 2rem); line-height: 1.15; color: var(--chalk); }
.crac-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; text-align: left; }
.crac-o { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid #f7faf544; border-radius: 12px; background: #ffffff10; color: var(--chalk); font-size: 1rem; font-weight: 700; line-height: 1.3; transition: transform .12s, background .12s, border-color .12s; }
.crac-o span { font-size: 1.8rem; }
.crac-o:hover, .crac-o:focus-visible { background: var(--yellow); border-color: var(--yellow); color: var(--spot-ink); transform: scale(1.02); }
.crac-q .linkbtn { margin-top: 12px; color: #cfd9d2; }
.crac-res { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 20px 28px; margin-top: 14px; }
.crac-card { position: relative; width: min(280px, 100%); box-sizing: border-box; padding: 16px 14px 12px; border-radius: 16px; background: linear-gradient(160deg, #ffe58a, #f0c234 45%, #b8860b); color: #2a1810; text-align: center; box-shadow: 0 0 0 4px #fff6e9, 0 14px 40px #000a; }
.crac-card.reveal { animation: crac-in 1s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes crac-in { 0% { transform: perspective(800px) rotateY(180deg) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.crac-card img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 15%; border-radius: 10px; border: 3px solid #2a1810; }
.crac-card h3 { margin: 10px 0 4px; font-size: 1.7rem; color: #2a1810; }
.crac-card p { margin: 0; font-size: .9rem; line-height: 1.4; }
.cc-tag { position: absolute; left: 50%; top: -13px; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; background: #2a1810; color: var(--yellow); font-family: var(--display); font-weight: 900; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.cc-foot { display: block; margin-top: 8px; font-size: .7rem; font-weight: 700; opacity: .75; }
.crac-side { max-width: 240px; color: #cfd9d2; text-align: center; }
.crac-side .cta { margin: 6px 0 0; }
/* 🗣️ Vídeos de les paraules */
.vids { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vid-card { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 2px solid #f7faf533; border-radius: 12px; background: linear-gradient(160deg, #1b3f8f, #8a1c3c); color: #fff; transition: transform .15s; }
.vid-card:hover, .vid-card:focus-visible { transform: translateY(-3px); border-color: var(--yellow); }
.vc-e { font-size: 2.2rem; line-height: 1; }
.vid-card b { font-family: var(--display); font-size: 1.15rem; }
.vid-card span:last-child { font-size: .78rem; font-weight: 700; color: var(--yellow); }
.nc-v { display: block; margin-top: 4px; font-style: normal; font-size: .7rem; color: var(--yellow); }
.vid-box { position: relative; width: min(760px, 100%); box-sizing: border-box; padding: 16px 18px; border-radius: 14px; background: var(--night-top); border: 3px solid var(--yellow); color: var(--chalk); box-shadow: 0 20px 60px #000c; }
.vid-box h3 { margin: 0 32px 4px 0; color: var(--yellow); font-size: 1.5rem; }
.vid-box > p { margin: 0 0 10px; color: #cfd9d2; }
.vid-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; }
.vid-frame iframe, .vid-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid-by { margin: 8px 0 0 !important; font-size: .78rem; }
.vid-box .tm-close { position: absolute; right: 8px; top: 8px; }
@media (prefers-reduced-motion: reduce) { .bar-tile, .crac-card.reveal, .bcell.on::after { animation: none; transition: none; } }

/* El bar es veu a darrere: la pantalla del bar, una mica transparent i més estreta */
#bar { width: min(960px, 100%); background: radial-gradient(circle at 50% 0, #14301fd9 0, #08130dcc 70%); }
/* Mentre la càmera entra al bar, el menú espera; després apareix */
.stage.wait > * { visibility: hidden; animation: none !important; } /* en treure el «wait», l'animació d'entrada torna a començar */

/* La xuleta d'emergència: en obrir-la, el fons es fa vermell amb llums de sirena i els apunts surten al mig */
.xu-back { position: fixed; inset: 0; z-index: 9; background: #1a030399; animation: xu-dark .3s both; }
.xu-back::before, .xu-back::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
/* dues llums vermelles que s'alternen: primer fort, uns quants cops, i després un batec suau mentre la xuleta és oberta */
.xu-back::before { background: radial-gradient(circle at 12% 25%, #ff2a2a 0, #ff2a2a00 55%), radial-gradient(circle at 88% 75%, #ff2a2a 0, #ff2a2a00 50%); opacity: 0; animation: xu-siren .45s 4 alternate, xu-soft 1.6s 1.8s infinite alternate; }
.xu-back::after { background: radial-gradient(circle at 88% 25%, #ff2a2a 0, #ff2a2a00 55%), radial-gradient(circle at 12% 75%, #ff2a2a 0, #ff2a2a00 50%); opacity: 0; animation: xu-siren .45s .45s 4 alternate-reverse, xu-soft 1.6s 2.6s infinite alternate; }
@keyframes xu-dark { from { background: #1a030300; } }
@keyframes xu-siren { from { opacity: .75; } to { opacity: 0; } }
@keyframes xu-soft { from { opacity: .08; } to { opacity: .32; } }
.xu { position: fixed; z-index: 9; left: 50%; top: 50%; width: min(560px, calc(100vw - 24px)); height: min(720px, calc(100dvh - var(--board-h) - 40px)); transform: translate(-50%, -50%); margin-top: calc(var(--board-h) / 2); display: flex; flex-direction: column; box-sizing: border-box; padding: 14px 16px 14px; border-radius: 16px; background: var(--night-top); color: var(--chalk); border: 3px solid #e5412d; box-shadow: 0 0 0 6px #e5412d33, 0 30px 80px #000c; animation: xu-in .45s .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes xu-in { from { transform: translate(-50%, -50%) scale(.8); opacity: 0; } }
.xu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.xu-head .kicker { color: #ff8a80; }
.xu-tools { display: flex; gap: 4px; }
.xu-mute { font-size: 1.1rem; }
.xu-head h2 { margin: 0; color: var(--chalk); font-size: 1.6rem; }
.xu-song { margin-top: 8px; border-radius: 12px; overflow: hidden; }
.xu-song:empty { display: none; }
.xu-song iframe { display: block; border: 0; }
.xu-search { margin-top: 10px; padding: 10px 14px; border: 2px solid var(--yellow); border-radius: 999px; background: #0004; color: var(--chalk); font: inherit; font-size: 1rem; }
.xu-tabs { display: flex; gap: 6px; margin: 10px 0 8px; flex-wrap: wrap; }
.xu-tabs button { padding: 5px 12px; border: 1.5px solid var(--chalk); border-radius: 999px; background: none; color: var(--chalk); font-weight: 700; font-size: .85rem; }
.xu-tabs button[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--spot-ink); }
.xu-body { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 8px; padding-right: 2px; }
.xu-body h3 { margin: 8px 0 0; color: var(--yellow); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.xu-card { padding: 10px 12px; border-radius: 10px; background: #ffffff10; }
.xu-card > b { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.xu-card p { margin: 4px 0 2px; line-height: 1.4; font-size: .92rem; color: #dfe7e1; }
.xu-card .linkbtn { color: var(--yellow); font-size: .8rem; padding: 0; }
.xu-frase { margin-top: 6px; padding-left: 10px; border-left: 2px solid #ffffff2a; font-size: .92rem; line-height: 1.4; }
.xu-word { display: grid; gap: 2px; padding: 8px 10px; border-bottom: 1px solid #ffffff14; }
.xu-word span { font-size: .88rem; color: #cfd9d2; line-height: 1.35; }
.xu-word .linkbtn { color: var(--yellow); font-size: .75rem; font-weight: 700; }
.xu-team img { width: 26px; height: 26px; object-fit: contain; }
.xu-team dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; font-size: .88rem; }
.xu-team dt { color: #8fa69a; } .xu-team dd { margin: 0; }
.xu-foot { padding-top: 10px; }
.xu-foot .cta { width: 100%; margin: 0; }
@media (prefers-reduced-motion: reduce) { .xu, .xu-back, .xu-back::before, .xu-back::after, .xu-btn, .xu-btn > span:first-child { animation: none; } }


/* El test final: una pregunta cada cop, amb la barra de progrés */
.exam-top { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.exam-bar { display: flex; gap: 4px; margin: 6px 0 14px; }
.exam-bar i { flex: 1; height: 8px; border-radius: 999px; background: #0001; }
.exam-bar i.on { background: var(--yellow); } .exam-bar i.ok { background: #2f9d66; } .exam-bar i.ko { background: #d23a2c; }
.exam-q { padding: 16px; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px #0001; }
.exam-ask { margin: 0 0 12px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.25; }
.exam-opts { display: grid; gap: 8px; }
.exam-opts .opt { text-align: left; }
.exam-q .why { margin-top: 12px; }
#exam-body.finished .lead { display: none; }
.exam-best { margin: 0; font-weight: 700; color: var(--pitch); }
.exam-end { display: flex; flex-wrap: wrap; gap: 8px; }
.exam-end .cta { margin: 0; }
/* El test final, a la pantalla gegant (fons fosc) */
#exam { width: min(820px, 100%); }
#exam .exam-run, #exam .result { max-width: 640px; width: 100%; margin: 0 auto; }
#exam .exam-top { color: #cfd9d2; }
#exam .exam-bar i { height: 12px; background: #ffffff1f; transition: background .3s; }
#exam .exam-bar i.on { background: var(--yellow); } #exam .exam-bar i.ok { background: var(--night-good); } #exam .exam-bar i.ko { background: var(--night-bad); }
#exam .exam-q { background: #ffffff10; box-shadow: none; }
#exam .exam-ask { color: var(--chalk); }
#exam .opt { border: 1.5px solid #ffffff55; background: #ffffff08; color: var(--chalk); }
#exam .opt:hover:not(:disabled), #exam .opt:focus-visible { background: #ffffff1f; border-color: var(--chalk); }
#exam .opt.ok { background: var(--night-good); border-color: var(--night-good); color: var(--spot-ink); }
#exam .opt.ko { background: var(--night-bad); border-color: var(--night-bad); color: var(--spot-ink); }
#exam .why { color: #cfd9d2; } #exam .why b { color: var(--yellow); }
#exam .lock { padding: 16px; border-radius: 12px; background: #ffffff10; color: var(--chalk); }
#exam .lock .linkbtn { color: var(--yellow); }
#exam .result { text-align: center; padding: 10px 0; }
#exam .big-score { color: var(--yellow); }
#exam .result h3 { color: var(--chalk); }
#exam .result p { color: #cfd9d2; }
#exam .exam-best { color: var(--yellow); }
#exam .exam-end { justify-content: center; margin-top: 14px; }
#exam-body.finished .exam-lead { display: none; }

/* Test final: el marcador, Gemma contra el futbol */
.exam-board { display: grid; grid-template-columns: 1fr auto auto auto 1fr; align-items: center; gap: 10px; margin: 0 auto 14px; padding: 8px 16px; max-width: 360px; border-radius: 10px; background: #0b1a12; border: 2px solid #ffffff26; box-shadow: inset 0 0 18px #000a; }
.eb-team { font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #cfd9d2; }
.eb-team:first-child { text-align: right; } .eb-team:last-child { text-align: left; }
.eb-n { min-width: 1.6em; padding: 2px 6px; border-radius: 6px; background: #000; color: var(--yellow); font: 800 1.7rem/1 ui-monospace, "SF Mono", Menlo, monospace; text-align: center; text-shadow: 0 0 8px #ffd23f88; }
.eb-dash { color: #cfd9d2; font-weight: 800; }
.eb-n.pop { animation: eb-pop .6s ease; }
@keyframes eb-pop { 0% { transform: scale(1); } 35% { transform: scale(1.45); background: #2f9d66; color: #fff; } 100% { transform: scale(1); } }
.eb-n.pop:nth-of-type(2) { animation-name: eb-pop-ko; }
@keyframes eb-pop-ko { 0% { transform: scale(1); } 35% { transform: scale(1.45); background: #d23a2c; color: #fff; } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .eb-n.pop { animation: none; } }
.xu-lead { margin: 4px 0 0; font-size: .88rem; line-height: 1.4; color: #cfd9d2; }

/* Els apunts: la llista de mòduls (abans, cromos) */
.apunts { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.ap-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; border: 1.5px solid #0002; border-radius: 10px; background: #fff; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.ap-row:hover, .ap-row:focus-visible { border-color: var(--pitch); transform: translateX(3px); }
.ap-row .num { font-family: var(--display); font-weight: 900; font-size: 1.6rem; line-height: 1; color: var(--pitch); min-width: 1.2em; text-align: center; }
.ap-row b { display: block; font-size: 1rem; }
.ap-row .st { font-size: .8rem; color: var(--muted); }
.ap-row.done .st { color: var(--pitch); font-weight: 700; }
.ap-go { font-size: .85rem; font-weight: 700; color: var(--pitch); white-space: nowrap; }
.tag.hl { pointer-events: auto; cursor: pointer; }
.tag.hl .sp-name { transition: background .15s, color .15s; }
.tag.hl.lit .sp-name, .tag.hl:focus-visible .sp-name { background: var(--yellow); color: var(--night-top); }
