/* Calcio a 7 — sticker album meets arcade scoreboard.
   Cream paper, hard ink outlines and shadows, Jersey 10 pixel font (shirt-number style) for headings and numbers. */

@font-face { font-family: 'Jersey 10'; font-weight: 400; font-display: swap; src: url('fonts/Jersey10-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 400; font-display: swap; src: url('fonts/BarlowSemiCondensed-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url('fonts/BarlowSemiCondensed-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-display: swap; src: url('fonts/BarlowSemiCondensed-700.woff2') format('woff2'); }

:root {
  --paper: #f2e9d0;
  --card: #fffbee;
  --card-2: #efe4c4;
  --k: #1a1a2e;            /* ink */
  --muted: #655d4d;
  --soft: rgba(26, 26, 46, .14);
  --yellow: #ffd23f;
  --red: #e0402f;
  --green: #2f8f46;
  --pix: 'Jersey 10', ui-monospace, Menlo, monospace;
  --body: 'Barlow Semi Condensed', 'Arial Narrow', system-ui, sans-serif;
  --shadow: 4px 4px 0 var(--k);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(26, 26, 46, .1) 1.2px, transparent 1.4px);
  background-size: 16px 16px;
  color: var(--k);
  font: 400 17px/1.4 var(--body);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.num { font-variant-numeric: tabular-nums; }

h1 {
  display: inline-block; margin: .3rem 0 .9rem; padding: .15rem .7rem;
  font: 400 2.38rem/1.15 var(--pix); text-transform: uppercase; letter-spacing: .03em;
  background: var(--yellow); border: 2px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(-1deg);
}
h2 { margin: 1.8rem 0 .7rem; font: 400 1.44rem/1.2 var(--pix); text-transform: uppercase; letter-spacing: .05em; border-bottom: 3px solid var(--k); padding-bottom: .25rem; }
.tagline { margin: -.3rem 0 1rem; color: var(--muted); font-weight: 600; }

/* ---- header: mowed pitch */
.top {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap;
  padding: .6rem 1rem .7rem;
  background: repeating-linear-gradient(90deg, #2f8f46 0 32px, #298140 32px 64px);
  border-bottom: 4px solid var(--k);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 400 1.62rem/1 var(--pix); text-transform: uppercase; color: #fff; text-shadow: 2px 2px 0 var(--k); }
nav { display: flex; flex-wrap: wrap; gap: .45rem; }
nav a {
  padding: .3rem .65rem; font: 400 1.3rem/1.2 var(--pix); text-transform: uppercase; color: var(--k);
  background: var(--card); border: 2px solid var(--k); box-shadow: 2px 2px 0 var(--k);
}
nav a.on { background: var(--yellow); transform: translate(2px, 2px); box-shadow: none; }
@media (max-width: 720px) {
  .top { flex-direction: column; align-items: stretch; }
  /* even menu on a phone: 4 across, the long "Creazione squadre" label takes two cells */
  nav { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  nav a[data-r="builder"] { grid-column: span 2; }
  nav a { flex: 1 1 auto; text-align: center; padding: .3rem .1rem; font-size: 1.1rem; }
}
@media (max-width: 440px) {
  nav { gap: .3rem; }
  nav a { font-size: .98rem; box-shadow: 2px 2px 0 var(--k); }
}
main { max-width: 860px; margin: 0 auto; padding: 1.3rem 1rem 2.5rem; }
footer { text-align: center; padding: .5rem 1rem 2.5rem; font: 400 1.06rem var(--pix); color: var(--muted); }

/* ---- shared "sticker" surfaces */
.panel, .match, .stat, .viz-card, .summary > div { background: var(--card); border: 2px solid var(--k); border-radius: 4px; box-shadow: var(--shadow); }
.panel { padding: .8rem 1rem; }
.panel > h3 {
  margin: -.8rem -1rem .7rem; padding: .45rem 1rem; display: flex; align-items: center; gap: .5rem;
  font: 400 1.25rem/1.2 var(--pix); text-transform: uppercase; letter-spacing: .04em; color: var(--paper); background: var(--k);
}
.panel > h3 .muted { color: #cfc8b0; }
.panel > h3 .dot { border-color: var(--paper); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-top: 1px solid var(--soft); font-weight: 600; }
.panel > h3 + .player-row { border-top: 0; }
.chip { display: inline-flex; align-items: center; gap: .25rem; padding: 0 .45rem; font-size: .85rem; font-weight: 700; background: #fff; border: 2px solid var(--k); }
.chip.og { background: var(--red); color: #fff; }
.chip.ovr { background: var(--yellow); }
.panel > h3 .chip { color: var(--k); }
.note {
  margin: .8rem 0; padding: .55rem .8rem; white-space: pre-line; font-weight: 600;
  background: #fff1a8; border: 2px solid var(--k); box-shadow: 3px 3px 0 var(--k); transform: rotate(-.4deg);
}
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .9rem; }
.stat { padding: .55rem .8rem .65rem; box-shadow: 3px 3px 0 var(--k); }
.stat b { display: block; font: 400 1.75rem/1.1 var(--pix); }
.stat span { color: var(--muted); font-size: .88rem; font-weight: 600; line-height: 1.2; display: block; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin: .4rem 0 1.4rem; }
.summary > div { padding: .5rem .8rem; box-shadow: 3px 3px 0 var(--k); }
.summary b { display: block; font: 400 2rem/1.2 var(--pix); }
.summary span { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ---- fixtures (match list) */
.list { display: grid; gap: 1.1rem; }
.match { display: block; padding: .7rem .9rem .8rem; transition: transform .08s, box-shadow .08s; }
.match:hover, .match:focus-visible { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--k); outline: none; }
.match .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; margin: .5rem 0; }
.score .t { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; }
.score .t:last-child { justify-content: flex-end; }
.score .r {
  padding: .1rem .75rem; font: 400 2.12rem/1.25 var(--pix); letter-spacing: .08em; color: var(--yellow);
  background: #14141f; border: 2px solid var(--k); box-shadow: inset 0 0 0 2px #3a3a52; text-shadow: 0 0 8px rgba(255, 210, 63, .45);
}
.score.sub { margin: 0 0 .35rem; color: var(--muted); font-size: .95rem; font-weight: 600; }
.score.sub > :first-child { text-align: left; }
.score.sub > :nth-child(2) { font: 400 0.88rem var(--pix); text-transform: uppercase; }
.score.sub > :last-child { text-align: right; justify-content: flex-end; }
.dot { display: inline-block; vertical-align: -.12em; margin-right: .35rem; width: .85rem; height: .85rem; border-radius: 50%; border: 2px solid var(--k); flex: none; background: #888; }
.dot.dark { background: #1a1a2e; }
.dot.light { background: #fff; }
.scorers { display: flex; align-items: baseline; gap: .4rem; color: var(--muted); font-size: .95rem; font-weight: 600; }
.back { display: block; width: fit-content; margin-bottom: .8rem; font-weight: 700; text-transform: uppercase; font-size: .9rem; border-bottom: 2px solid var(--k); }

/* ---- pixel icons */
.pix { display: inline-block; flex: none; vertical-align: -.2em; image-rendering: pixelated;
  filter: drop-shadow(1px 0 0 var(--k)) drop-shadow(-1px 0 0 var(--k)) drop-shadow(0 1px 0 var(--k)) drop-shadow(0 -1px 0 var(--k)); }

/* ---- player stickers (Panini style): photo window, name banner across its bottom edge, rating badge, stats strip.
   Tweak the look with the variables on .fcard; photo + name come from the data, nothing is hand-placed per player. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.1rem; }
.fcard {
  --c1: #e5dcc3; --ink: var(--k);
  --pad: .6rem;            /* sticker margin around the photo window */
  --ph-ratio: 1;           /* photo window shape: width / height */
  position: relative; isolation: isolate; display: block; padding: var(--pad) var(--pad) .7rem; text-align: center; color: var(--ink);
  background-color: var(--c1);
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .3) 0 9px, transparent 9px 18px);
  border: 3px solid var(--k); border-radius: 6px; box-shadow: var(--shadow);
}
a.fcard { transition: transform .08s, box-shadow .08s; }
a.fcard:hover, a.fcard:focus-visible { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--k); outline: none; }
.fcard.gold { --c1: #ffcf40; }
.fcard.silver { --c1: #d4dbe2; }
.fcard.bronze { --c1: #e0955a; }
.fcard.platinum { --c1: #7fe3d1; }
.fcard .ph {
  position: relative; z-index: 1; overflow: hidden; display: grid; place-items: center; width: 100%; aspect-ratio: var(--ph-ratio);
  font: 400 4rem/1 var(--pix); background: var(--paper); border: 3px solid var(--k);
}
.fcard .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fcard .nm {
  position: relative; z-index: 3; margin: -1.1rem .35rem .45rem; padding: .2rem .3rem; overflow-wrap: anywhere;
  font: 400 1.5rem/1.1 var(--pix); text-transform: uppercase; letter-spacing: .03em;
  color: var(--paper); background: var(--k); border: 2px solid var(--paper); box-shadow: 2px 2px 0 rgba(26, 26, 46, .45);
}
.fcard .ovr { line-height: 1; }
.fcard .ovr small {   /* rating badge on the photo */
  position: absolute; z-index: 4; top: calc(var(--pad) + .45rem); left: calc(var(--pad) + .45rem); min-width: 2.2rem; padding: .1rem .35rem; display: block;
  font: 400 1.5rem/1.1 var(--pix); color: var(--k); background: var(--yellow); border: 2px solid var(--k); box-shadow: 2px 2px 0 var(--k);
}
.stars { position: relative; z-index: 3; display: inline-block; font-size: 1.2rem; letter-spacing: .05em; color: rgba(26, 26, 46, .25); white-space: nowrap; }
.stars > span { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: var(--ink); }
.fcard .badges {   /* tournament-style symbols down the right side of the photo */
  position: absolute; z-index: 4; top: calc(var(--pad) + .45rem); right: calc(var(--pad) + .45rem);
  display: flex; flex-direction: column; gap: .35rem;
}
.fcard .bdg { position: relative; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; background: var(--card); border: 2px solid var(--k); box-shadow: 2px 2px 0 var(--k); }
.fcard .bdg i { position: absolute; right: -.45rem; bottom: -.45rem; min-width: 1rem; padding: 0 .15rem; font: 400 1rem/1 var(--pix); font-style: normal; text-align: center; color: var(--k); background: var(--yellow); border: 1.5px solid var(--k); }
.badge-line { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; }
.fcard .cs { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: .2rem; margin-top: .5rem; padding-top: .35rem; border-top: 2px solid var(--k); }
.fcard .cs b { display: block; font: 400 1.35rem/1.2 var(--pix); }
.fcard .cs span { font-size: .72rem; font-weight: 700; letter-spacing: .08em; }
.fcard.big { max-width: 260px; margin: .4rem auto 0; --pad: .8rem; }
.fcard.big .ph { font-size: 6rem; }
.fcard.big .nm { font-size: 2rem; margin-top: -1.5rem; }
.fcard.big .stars { font-size: 1.8rem; }
.fcard.big .ovr small { font-size: 2.2rem; }
.fcard.big .cs b { font-size: 1.7rem; }
.fcard.big .bdg { width: 2.4rem; height: 2.4rem; }
.fcard.big .bdg i { font-size: 1.2rem; }

/* ---- pixel-art card frames (docs/cards/<tier>.png): the template for every player.
   The PNG is drawn OVER the photo, so leave a transparent "window" in it where the photo should show.
   If the photo does not line up with your window, tweak the three variables below
   (empty space around the photo, as % of the card width) and --ph-ratio (photo shape). */
.fcard.framed {
  --frame-top: 14%; --frame-side: 12%; --frame-bottom: 12%;
  background-color: transparent; background-image: none; border: 0; border-radius: 0; box-shadow: none;
  padding: var(--frame-top) var(--frame-side) var(--frame-bottom);
  display: flex; flex-direction: column; justify-content: center;
}
.fcard.framed::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--frame) center / 100% 100% no-repeat; image-rendering: pixelated;
}
.fcard.framed .ph { border: 0; }
.fcard.framed .ovr small { top: .5rem; left: .5rem; }
.fcard.framed .badges { top: .5rem; right: .5rem; }
.fcard.framed .nm { border-color: transparent; }
.fcard.big.framed { max-width: 280px; }

/* ---- controls */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin: .8rem 0 1rem; }
input, select, button { font: 600 1rem var(--body); color: var(--k); background: #fff; border: 2px solid var(--k); border-radius: 0; padding: .5rem .7rem; }
select { padding-right: 1.4rem; }
input:focus, select:focus, button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 0; box-shadow: 0 0 0 5px var(--k); }
button { cursor: pointer; background: var(--yellow); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; box-shadow: 3px 3px 0 var(--k); }
button:active { transform: translate(3px, 3px); box-shadow: none; }
.toolbar input[type=search] { flex: 1; min-width: 8rem; background: #fff; }

/* ---- tables: league-table style */
table { width: 100%; border-collapse: collapse; }
th { padding: .4rem .5rem; text-align: left; font: 400 0.98rem/1.2 var(--pix); text-transform: uppercase; letter-spacing: .06em; color: var(--paper); background: var(--k); }
td { padding: .5rem .5rem; text-align: left; border-bottom: 1px solid var(--soft); vertical-align: middle; font-weight: 600; }
tbody tr:nth-child(even) td { background: rgba(26, 26, 46, .045); }
td.r, th.r { text-align: right; }
.table-wrap { overflow-x: auto; }
.rank { width: 2.9rem; text-align: center; font: 400 1.25rem var(--pix); color: var(--k); background: rgba(26, 26, 46, .08) !important; }
tbody tr:first-child .rank { background: var(--yellow) !important; }
td.r b { font: 400 1.31rem var(--pix); }
.res { font-weight: 700; }
.res.W { color: var(--green); } .res.L { color: var(--red); } .res.D { color: var(--muted); }
.hist-day { margin: 1.3rem 0 .4rem; font: 400 1.06rem var(--pix); text-transform: uppercase; letter-spacing: .06em; }
.scroll { max-height: 22rem; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.msg { padding: .6rem .8rem; margin: .6rem 0; border: 2px solid var(--k); font-weight: 600; }
.msg.err { background: #ffd9d3; }
.msg.ok { background: #d6f1d8; }
.msg.warn { background: #fff1a8; }

/* ---- charts (see charts.js) */
.viz-card { padding: .8rem 1rem 1rem; margin-bottom: 1.1rem; }
.viz-card h3 { margin: 0; font: 400 1.31rem/1.2 var(--pix); text-transform: uppercase; letter-spacing: .03em; }
.viz-card .sub { margin: .1rem 0 .6rem; color: var(--muted); font-size: .92rem; font-weight: 600; }
.viz { --viz-grid: rgba(26, 26, 46, .12); --viz-axis: rgba(26, 26, 46, .45); --viz-surface: var(--card); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .5rem; font-size: .95rem; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.key { display: inline-block; flex: none; }
.key.line { width: 16px; height: 3px; }
.key.box { width: 11px; height: 11px; border: 2px solid var(--k); }
.chart { display: flex; align-items: flex-start; }
.chart svg { display: block; flex: none; }
.chart-scroll { flex: 1; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.chart-scroll:focus-visible { outline: 3px solid var(--yellow); box-shadow: 0 0 0 5px var(--k); }
.viz .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .axis { stroke: var(--viz-axis); stroke-width: 2; }
.viz .tick { fill: var(--muted); font: 600 11.5px var(--body); font-variant-numeric: tabular-nums; }
.viz .xl { fill: var(--k); font: 400 16px var(--pix); }
.viz .endlabel { fill: var(--k); font: 400 15px var(--pix); }
.viz .ring { fill: var(--viz-surface); }
.viz .hit { fill: transparent; }
.viz .xh { stroke: var(--viz-axis); stroke-width: 1; opacity: 0; }
.viz .col { outline: none; cursor: default; }
.viz .col:hover .xh, .viz .col:focus .xh { opacity: 1; }
.viz .col:hover .bar, .viz .col:focus .bar { filter: brightness(1.12) saturate(1.1); }
.viz-table { margin-top: .5rem; font-size: .9rem; }
.viz-table summary { cursor: pointer; padding: .5rem 0; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; }
.viz-table table { margin-top: .4rem; }
.viz-tip { position: fixed; z-index: 60; pointer-events: none; min-width: 9rem; max-width: 16rem; padding: .5rem .7rem; background: var(--k); color: var(--paper); box-shadow: 3px 3px 0 rgba(26, 26, 46, .35); font-size: .92rem; font-weight: 600; }
.viz-tip .t-title { color: #cfc8b0; margin-bottom: .2rem; }
.viz-tip .t-row { display: flex; align-items: center; gap: .5rem; }
.viz-tip .t-row b { font: 400 1.31rem var(--pix); }
.viz-tip .t-row span { color: #cfc8b0; }
.viz-tip .t-foot { color: #cfc8b0; margin-top: .2rem; }

/* ---- collapsible sections (big, easy to tap on a phone) */
details.sec { margin-top: 1.8rem; }
details.sec > summary, details.viz-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .8rem; min-height: 3rem; -webkit-tap-highlight-color: transparent; }
details.sec > summary::-webkit-details-marker, details.viz-card > summary::-webkit-details-marker { display: none; }
details.sec > summary::before, details.viz-card > summary::before {
  content: ''; flex: none; width: 2.5rem; height: 2.5rem; transition: transform .15s;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='3.5' stroke-linecap='square'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / 62% no-repeat;
  border: 2px solid var(--k); box-shadow: 2px 2px 0 var(--k);
}
details.sec[open] > summary::before, details.viz-card[open] > summary::before { transform: rotate(90deg); }
details.sec > summary h2 { margin: 0; padding: 0; border: 0; font-size: 1.75rem; }
details.sec[open] > summary { margin-bottom: .9rem; }
details.sec:not([open]) > summary { background: var(--card); border: 2px solid var(--k); box-shadow: var(--shadow); padding: .4rem .9rem .4rem .6rem; }
details.viz-card > summary h3 { font-size: 1.3rem; }
details.viz-card[open] > summary { margin-bottom: .2rem; }
details.viz-card:not([open]) { padding-top: .3rem; padding-bottom: .3rem; }
details.sec > summary:focus-visible, details.viz-card > summary:focus-visible { outline: 3px solid var(--yellow); box-shadow: 0 0 0 5px var(--k); }

/* ---- partnerships */
.pairs { background: var(--card); border: 2px solid var(--k); box-shadow: var(--shadow); }
.pairs-head, .pair > summary { display: grid; grid-template-columns: 2.9rem 1fr auto 3.8rem 1.1rem; gap: .5rem; align-items: center; }
.pairs-head { padding: .4rem .6rem; font: 400 .95rem/1.2 var(--pix); text-transform: uppercase; letter-spacing: .06em; color: var(--paper); background: var(--k); }
.pairs-head .r { text-align: right; }
.pair > summary { list-style: none; cursor: pointer; padding: .5rem .6rem; min-height: 3.1rem; border-bottom: 1px solid var(--soft); -webkit-tap-highlight-color: transparent; }
.pair > summary::-webkit-details-marker { display: none; }
.pair:nth-child(even) > summary { background: rgba(26, 26, 46, .045); }
.pair[open] > summary { background: #fff1a8; }
.pair .rank { width: auto; padding: .2rem 0; }
.pair .rank:empty { background: transparent !important; }
.pair:first-of-type .rank { background: var(--yellow) !important; }
.pair .who { font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.pair .rec { color: var(--muted); font-weight: 600; font-size: .92rem; text-align: right; }
.pair .win { font: 400 1.55rem/1 var(--pix); text-align: right; }
.pair .chev { width: .9rem; height: .9rem; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a2e' stroke-width='4' stroke-linecap='square'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .15s; }
.pair[open] .chev { transform: rotate(90deg); }
.pair-games { padding: .2rem .8rem .5rem 3.6rem; border-bottom: 1px solid var(--soft); background: var(--card); }
.pair-games .player-row:first-child { border-top: 0; }

.pair .syn { display: block; margin-top: .1rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.pair-note { padding: .5rem 0 .2rem; font-size: .92rem; font-weight: 600; color: var(--muted); }
.pair-note b { color: var(--k); }

.howto { margin: .2rem 0 1.4rem; padding: .9rem 1.1rem 1rem; background: #fff1a8; border: 2px solid var(--k); box-shadow: var(--shadow); }
.howto h3 { margin: 0 0 .5rem; font: 400 1.5rem/1.1 var(--pix); text-transform: uppercase; letter-spacing: .04em; }
.howto ul { margin: 0 0 .7rem; padding-left: 1.2rem; }
.howto li { margin: .3rem 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.howto .example { margin: 0 0 .6rem; padding: .5rem .7rem; font-size: 1.05rem; font-weight: 600; line-height: 1.3; background: var(--card); border: 2px solid var(--k); }
.howto .caveat { margin: 0; font-size: .95rem; font-weight: 600; color: var(--muted); }

/* ---- gold PlayStyles: down the LEFT side of the card, overlapping the border */
.pixps { display: block; image-rendering: pixelated; }
.fcard .playstyles { position: absolute; z-index: 5; left: -.85rem; top: calc(var(--pad) + 3.4rem); display: flex; flex-direction: column; gap: .4rem; }
.ps { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; background: var(--k); border: 2px solid #f4b400; box-shadow: 2px 2px 0 rgba(26, 26, 46, .55); }
.fcard.big .playstyles { left: -1.1rem; top: calc(var(--pad) + 4.4rem); gap: .5rem; }
.fcard.big .ps { width: 3.2rem; height: 3.2rem; }
.ps.small { width: 2.4rem; height: 2.4rem; box-shadow: none; flex: none; }

/* an image you supplied (docs/playstyles/<id>.png) is shown as it is: no chip around it */
.ps.custom { width: auto; height: auto; background: none; border: 0; box-shadow: none; filter: drop-shadow(1px 1px 0 rgba(26, 26, 46, .6)); }
.ps.custom.small { filter: none; }
.pixps[src] { object-fit: contain; }

.ps.silver { border-color: #c1cad3; }
.pixps.gray { filter: grayscale(1) brightness(1.3); }

/* ---- patch notes */
.chip.t-platinum { background: #7fe3d1; }
.chip.t-gold { background: #ffcf40; }
.chip.t-silver { background: #d4dbe2; }
.chip.t-bronze { background: #e0955a; }
details.sec > summary .muted { font-weight: 700; font-size: .95rem; margin-left: .1rem; }
details.sec > summary .chip { margin-left: auto; }

/* patch trend arrow next to the name: green up = buffed, red down = nerfed (nothing when unchanged) */
.fcard .nm .trend { display: inline-block; vertical-align: -.1em; margin-left: .4rem; }
.fcard .nm .trend .pix { filter: none; }

.scorers.motm { color: var(--k); margin-top: .15rem; }
.scorers.motm b { font-weight: 800; }

/* the initial is only a placeholder: hide it when there is a photo (cut-outs are transparent, so it would show through) */
.fcard .ph.has-photo .ini { display: none; }

/* ---- head to head */
h3.sub-h { margin: 1.4rem 0 .5rem; font: 400 1.6rem/1.1 var(--pix); text-transform: uppercase; letter-spacing: .03em; }
.h2h-pick { align-items: stretch; }
.h2h-pick select { flex: 1; min-width: 0; }
.h2h-pick button { padding: .4rem .9rem; font-size: 1.2rem; }
.h2h-cards { grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-bottom: .4rem; }   /* two cards side by side, also on a phone */
.h2h-board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .9rem; text-align: center; }
.h2h-board > div { display: flex; flex-direction: column; align-items: center; gap: .4rem; font-weight: 700; line-height: 1.15; }
.led { padding: .1rem .9rem; font: 400 3rem/1.2 var(--pix); color: var(--yellow); background: #14141f; border: 2px solid var(--k); box-shadow: inset 0 0 0 2px #3a3a52; text-shadow: 0 0 8px rgba(255, 210, 63, .45); min-width: 4rem; }
.res { font-weight: 700; }
table.cmp th { text-align: left; }
table.cmp td { font-size: 1.1rem; }
table.cmp .cmp-l { text-align: center; color: var(--muted); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
table.cmp td.win { background: var(--yellow); font-weight: 800; }
.hm-wrap { max-height: 75vh; overflow: auto; border: 2px solid var(--k); background: var(--card); -webkit-overflow-scrolling: touch; }
table.hm { width: auto; border-collapse: separate; border-spacing: 0; }
table.hm th, table.hm td { padding: 0; border: 0; text-align: center; font-weight: 700; }
table.hm thead th { position: sticky; top: 0; z-index: 3; background: var(--k); color: var(--paper); height: 6.2rem; min-width: 2.4rem; vertical-align: bottom; padding: .3rem 0; }
table.hm thead th:first-child { left: 0; z-index: 4; min-width: 7.5rem; }
.vh { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: .95rem; letter-spacing: .02em; }
table.hm th.rh { position: sticky; left: 0; z-index: 2; background: var(--card-2); color: var(--k); text-align: left; padding: 0 .6rem; white-space: nowrap; border-right: 2px solid var(--k); font-size: .95rem; }
table.hm td { min-width: 2.4rem; height: 2.3rem; font: 400 1.15rem var(--pix); border: 1px solid rgba(26, 26, 46, .12); }
table.hm td a { display: grid; place-items: center; width: 100%; height: 100%; min-height: 2.3rem; }
table.hm td.none { color: rgba(26, 26, 46, .3); }
table.hm td.self { background: repeating-linear-gradient(135deg, var(--card-2) 0 4px, transparent 4px 8px); }
.n-p2, table.hm td.n-p2 { background: #2a78d6; color: #fff; }
.n-p1, table.hm td.n-p1 { background: #b4cde6; color: var(--k); }
.n-0, table.hm td.n-0 { background: var(--card-2); color: var(--k); }
.n-m1, table.hm td.n-m1 { background: #f8c8ad; color: var(--k); }
.n-m2, table.hm td.n-m2 { background: #eb6834; color: var(--k); }
.hm-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: .7rem 0 .3rem; font-size: .95rem; font-weight: 600; }
.hm-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.hm-legend i { display: inline-block; width: 1.1rem; height: 1.1rem; border: 2px solid var(--k); }
.hm-legend i.none { background: var(--card); }

table.hm th.rh a { color: var(--k); }

/* ---- squad builder */
.b-date { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; }
.pool { display: grid; gap: .45rem; margin: .4rem 0 1.2rem; }
.pool-head { display: flex; justify-content: space-between; align-items: center; font: 400 1.7rem/1.1 var(--pix); text-transform: uppercase; margin-bottom: .2rem; }
.pool-head .cnt { display: inline-flex; align-items: center; gap: .3rem; }
.pool-row { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto auto; gap: .5rem; align-items: center; padding: .35rem .5rem; background: var(--card); border: 2px solid var(--k); }
.pool-row.in-a { background: color-mix(in srgb, var(--ta) 16%, var(--card)); box-shadow: inset 6px 0 0 var(--ta); }
.pool-row.in-b { background: color-mix(in srgb, var(--tb) 16%, var(--card)); box-shadow: inset 6px 0 0 var(--tb); }
.av { position: relative; overflow: hidden; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 2px solid var(--k); background: var(--paper); font: 400 1.6rem var(--pix); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pn b { display: block; line-height: 1.1; }
.pn small { color: var(--muted); font-weight: 600; }
.tb { min-width: 4.6rem; padding: .35rem .5rem; font-size: 1rem; box-shadow: 2px 2px 0 var(--k); }
.tb.a.on { background: var(--ta); color: #fff; }
.tb.b.on { background: var(--tb); color: var(--k); }
.tb:disabled { opacity: .35; box-shadow: none; cursor: default; }
.export-bar { margin: 1rem 0 1.2rem; }
.export-bar[hidden] { display: none; }
.poster-prev { display: block; width: 100%; max-width: 560px; margin: 1rem auto .4rem; border: 2px solid var(--k); box-shadow: var(--shadow); }
a.btn { display: inline-block; padding: .5rem .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; background: var(--yellow); border: 2px solid var(--k); box-shadow: 3px 3px 0 var(--k); }
.stat b.lbl { display: inline; font: 700 .95rem var(--body); color: var(--k); }

.av.has-photo .ini { display: none; }

footer .linkish { all: unset; cursor: pointer; text-decoration: underline; }
