/* rot: rules no other view shares. Loads after app.css in the same layer. */
@layer app {
  .rot {
  display: grid; gap: 10px;
  grid-template-columns: var(--pitch-w, minmax(0, 2.1fr)) minmax(250px, 1fr); grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "hint hint" "pitch bench" "pitch feed";
}
  .rot.is-portrait { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "hint" "pitch" "bench"; }
  .rot.is-portrait .subs-feed { display: none; }
  .rot.is-portrait.side-bench { grid-template-columns: var(--pitch-w, minmax(0, 2fr)) minmax(0, 1fr); grid-template-areas: "hint hint" "pitch bench"; grid-template-rows: auto minmax(0, 1fr); }
  .is-portrait.side-bench .bench .grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); overflow-x: hidden; overflow-y: auto; }
  .has-sel .hint { background: var(--sel-bg); border-color: var(--amber); color: var(--amber); box-shadow: var(--glow-a); }
  .has-sel .hint__dot { background: var(--amber); }
  /* A required role with nobody on the field: the strip over the bench, and the tiles that would fix it. */
  .role-gaps { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 8px; padding: 8px 12px; border: 1px solid var(--amber); border-radius: 8px; background: color-mix(in srgb, var(--amber) 12%, var(--panel)); color: var(--amber); font: 600 11px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }
  .role-gaps[hidden] { display: none; }
  .role-gaps b { font: 400 18px/1 var(--f-slate); letter-spacing: .04em; }
  .role-gaps small { font: 500 11px/1.2 var(--f-mono); letter-spacing: .02em; text-transform: none; color: var(--bone); }
  .tile[data-fill] { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), var(--glow-a); }
  .tile[data-fill]::after { content: attr(data-fill); position: absolute; top: -7px; left: 50%; translate: -50% 0; padding: 2px 6px; border-radius: 3px; background: var(--amber); color: var(--on-amber); font: 700 9px/1 var(--f-mono); letter-spacing: .08em; white-space: nowrap; }
  .pitch {
  grid-area: pitch; position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  padding: 10px 12px 12px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--inner), var(--shadow);
}
  .pitch-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
  .turf-wrap { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
  .pitch-h > div:first-child { display: flex; align-items: baseline; gap: 12px; }
  .forms { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .pitch-h > div:first-child { flex: none; }
  .pitch-h { flex-wrap: nowrap; }
  .turf {
  /* up to 15% off true scale either way when the box has room: invisible on the lines, no dead turf bands */
  position: relative; width: min(100cqw, 100cqh * var(--ratio) * 1.15);
  height: min(100cqh, min(100cqw, 100cqh * var(--ratio) * 1.15) / (var(--ratio) * .85));
  border-radius: 8px; overflow: hidden; container-type: inline-size;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, .35) 100%),
    repeating-linear-gradient(90deg, var(--turf) 0 6.25%, var(--turf-2) 6.25% 12.5%);
  box-shadow: inset 0 0 0 1px var(--line-2), inset 0 0 50px rgba(59, 240, 140, .06);
}
  .is-portrait .turf { background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0, 0, 0, .35) 100%), repeating-linear-gradient(0deg, var(--turf) 0 6.25%, var(--turf-2) 6.25% 12.5%); }
  .turf::before, .turf::after { content: ''; position: absolute; width: 18px; height: 18px; border: 0 solid var(--amber); z-index: 3; pointer-events: none; }
  .turf::before { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
  .turf::after { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }
  .field-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--turf-line); stroke-width: 1.6px; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(59, 240, 140, .35)); }
  .field-lines * { vector-effect: non-scaling-stroke; }
  .field-lines .fill { fill: var(--turf-line); }
  .field-lines .thin { opacity: .55; }
  .turf-dir { position: absolute; right: 10px; bottom: 8px; z-index: 2; font: 600 10px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--turf-line); opacity: .8; }
  .is-portrait .turf-dir { top: 8px; bottom: auto; }
  .token, .spot {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  width: clamp(76px, 12.5cqi, 116px);
}
  .token {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num role" "num name" "time time";
  align-items: center; column-gap: 7px; padding: 6px 8px 9px;
  background: color-mix(in srgb, var(--panel) 92%, transparent); color: var(--bone);
  border: 1px solid var(--phos-soft); border-radius: 7px; box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px); overflow: hidden; text-align: left;
  transition: transform .15s ease, border-color .15s, box-shadow .15s;
}
  .token__num { grid-area: num; font: 400 clamp(34px, 5.4cqi, 48px)/.72 var(--f-led); color: var(--phos); min-width: 1.1ch; text-align: center; }
  .token__role { grid-area: role; font: 600 8.5px/1 var(--f-mono); letter-spacing: .18em; color: var(--mute); }
  .token__name { grid-area: name; font: 600 clamp(9.5px, 1.5cqi, 12px)/1.1 var(--f-mono); text-transform: uppercase; letter-spacing: .02em; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
  .token__time { grid-area: time; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 3px; }
  .token__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
  .token__bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--phos); transition: width .3s; }
  .token:active { transform: translate(-50%, -50%) scale(.96); }
  .token.is-sel { z-index: 4; border-color: var(--amber); background: var(--sel-bg); box-shadow: var(--glow-a), 0 0 0 3px color-mix(in srgb, var(--amber) 35%, transparent); transform: translate(-50%, -50%) scale(1.06); }
  .token.is-sel .token__num { color: var(--amber); text-shadow: var(--glow-a); }
  .spot {
  aspect-ratio: 1.5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 1px dashed var(--turf-line); border-radius: 7px; color: var(--turf-line); background: rgba(0, 0, 0, .18);
}
  .spot b { font: 400 30px/.8 var(--f-led); }
  .spot small { font: 600 9px var(--f-mono); letter-spacing: .2em; }
  .has-sel .spot { border-style: solid; border-color: var(--amber); color: var(--amber); animation: breathe 1.1s ease-in-out infinite; }
  .sel-bench .token:not(.is-sel), .sel-field .token:not(.is-sel) { border-color: color-mix(in srgb, var(--amber) 55%, transparent); }
  .sel-field .tile--bench { border-color: var(--amber); }
  .bench { grid-area: bench; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .bench .zone-h { margin-bottom: 8px; }
  .bench .grid { flex: 1; min-height: 0; overflow-y: auto; align-content: start; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .is-portrait .bench .grid { grid-auto-flow: column; grid-auto-columns: 158px; grid-template-columns: none; overflow-x: auto; overflow-y: hidden; }
  .tile {
  position: relative; overflow: hidden; min-height: 88px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num name" "num time" "num rest";
  column-gap: 10px; align-items: center; align-content: center;
  padding: 8px 12px 12px 8px; text-align: left;
  background: var(--panel); color: var(--bone);
  border: 1px solid var(--line-2); border-radius: 8px;
  transition: transform .12s ease, border-color .12s, background .15s;
}
  .tile__num { grid-area: num; min-width: 1.3ch; text-align: center; font: 400 50px/.75 var(--f-led); color: var(--phos-dim); }
  .tile__name { grid-area: name; font: 600 12px/1.15 var(--f-mono); letter-spacing: .02em; text-transform: uppercase; padding-right: 28px; overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
  .tile__pos { position: absolute; top: 7px; right: 8px; font: 600 9px var(--f-mono); letter-spacing: .16em; color: var(--mute); }
  .tile__time { grid-area: time; font: 400 24px/1 var(--f-led); color: var(--amber); }
  .tile__rest { grid-area: rest; font: 500 9.5px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
  .tile__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
  .tile__bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--phos-dim); transition: width .3s; }
  .tile--bench { background: var(--sunk); border-style: dashed; }
  .tile:not(:disabled):active { transform: scale(.96); }
  .tile.is-sel { background: var(--sel-bg); border: 1px solid var(--amber); box-shadow: var(--glow-a); }
  .tile.is-sel .tile__num { color: var(--amber); text-shadow: var(--glow-a); }
  .subs-feed { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 64px; padding: 7px 8px 7px 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); }
  .feed-h { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin: 0; padding-right: 14px; border-right: 1px solid var(--line); font: 600 9.5px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
  .feed-h b { font: 400 26px/.8 var(--f-led); letter-spacing: 0; color: var(--phos); font-weight: 400; }
  .feed-empty { flex: 1; margin: 0; display: flex; align-items: center; min-height: 46px; padding: 0 14px; border: 1px dashed var(--line-2); border-radius: 8px; font-size: 12.5px; color: var(--mute); }
  .feed { flex: 1; min-width: 0; list-style: none; padding: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .feed li {
  position: relative; flex: 0 0 auto; min-width: 210px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 2px; padding: 7px 50px 7px 12px;
  background: var(--panel); border: 1px solid var(--line-2); border-left: 3px solid var(--phos-dim); border-radius: 8px; font-size: 13px;
}
  .feed li.is-away { border-left-color: var(--cyan); }
  .feed li.k-formation, .feed li.k-pos { border-left-color: var(--mute); }
  .feed time { font: 400 18px/1 var(--f-led); color: var(--mute); }
  .feed strong { font: 400 20px/1 var(--f-slate); text-transform: uppercase; letter-spacing: .04em; }
  .feed .x { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); }
  .squad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
  .squad { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-height: 78px; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; text-align: left; }
  .squad b { font: 400 20px/1 var(--f-slate); letter-spacing: .04em; text-transform: uppercase; }
  .squad span { font-size: 12px; }
  .squad small { font-size: 10.5px; color: var(--mute); }
  .squad[aria-pressed="true"] { border-color: var(--phos); background: var(--panel-3); }
  .squad[aria-pressed="true"] b { color: var(--phos); }
  /* ---------- drag & drop ---------- */
  .token, .spot { touch-action: none; }
  .rot:not(.is-portrait) .tile--bench { touch-action: pan-y; }
  .rot.is-portrait .tile--bench { touch-action: pan-x; }
  .drag-ghost { position: fixed; z-index: 85; margin: 0; pointer-events: none; opacity: .92; transition: none !important; animation: none !important; box-shadow: 0 18px 40px rgba(0, 0, 0, .55), var(--glow-a) !important; border-color: var(--amber) !important; }
  .token.drag-ghost { transform-origin: center; translate: 0 0; }
  .drag-src { opacity: .3; }
  .drop-hot { border-color: var(--amber) !important; box-shadow: var(--glow-a), 0 0 0 3px color-mix(in srgb, var(--amber) 40%, transparent) !important; }
  .token.drop-hot, .spot.drop-hot { transform: translate(-50%, -50%) scale(1.1); }
  .tile.drop-hot { transform: scale(1.04); background: var(--sel-bg); }
  /* ---------- convocatoria ---------- */
  .bench-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border: 1px dashed var(--line-2); border-radius: 8px; }
  .squad-bar { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding: 10px 14px; background: var(--sunk); border: 1px solid var(--line-2); border-radius: 8px; }
  .squad-bar .btn-row { margin-left: auto; }
  .squad-bar .btn { min-height: 44px; padding: 0 14px; }
  .squad-count { display: flex; align-items: baseline; gap: 4px; }
  .squad-count b { font: 400 42px/.8 var(--f-led); color: var(--phos); font-weight: 400; }
  .squad-count small { font-size: 11px; color: var(--mute); letter-spacing: .06em; }
  .squad-count.is-over b { color: var(--tally); text-shadow: var(--glow-t); }
  .squad-pick { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; align-content: start; }
  .pick { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num name" "num st"; column-gap: 12px; align-items: center; min-height: 64px; padding: 8px 12px; text-align: left; background: var(--sunk); border: 1px dashed var(--line-2); border-radius: 8px; transition: background .12s, border-color .12s; }
  .pick b { grid-area: num; font: 400 40px/.8 var(--f-led); color: var(--mute); min-width: 1.4ch; text-align: center; font-weight: 400; }
  .pick span { grid-area: name; font: 600 12px/1.15 var(--f-mono); text-transform: uppercase; color: var(--mute); overflow-wrap: break-word; hyphens: manual; text-wrap: balance; }
  .pick small { grid-area: st; font: 600 9.5px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
  .pick--called { background: var(--panel-3); border: 1px solid var(--phos-soft); }
  .pick--called b { color: var(--phos); }
  .pick--called span { color: var(--bone); }
  .pick--called small { color: var(--phos); }
  .pick--starter { background: var(--sel-bg); border: 1px solid var(--amber); }
  .pick--starter b, .pick--starter small { color: var(--amber); }
  .pick--starter span { color: var(--bone); }
  .pick:not(:disabled):active { transform: scale(.96); }
  /* ---------- time on field + position groups ---------- */
  .token__time b { font: 400 clamp(18px, 2.7cqi, 23px)/.9 var(--f-led); color: var(--amber); font-weight: 400; }
  .token__time small { font: 400 clamp(13px, 1.9cqi, 16px)/.9 var(--f-led); color: var(--mute); }
  .token__time small::before { content: 'Σ'; margin-right: 2px; font-family: var(--f-mono); font-size: .75em; opacity: .8; }
  .token.is-sel .token__time small { color: var(--amber); }
  .token.has-group { border-left: 4px solid var(--gc); padding-left: 6px; }
  .tile.has-group { box-shadow: inset 4px 0 0 var(--gc); }
  .pick.has-group { box-shadow: inset 4px 0 0 var(--gc); }
  .gfilter { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px 0 8px; flex: none; }
  .gfilter button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--sunk); font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
  .gfilter button i { width: 9px; height: 9px; border-radius: 2px; background: var(--gc); }
  .gfilter button b { font: 400 17px/1 var(--f-led); letter-spacing: 0; color: var(--bone); font-weight: 400; }
  .gfilter button[aria-pressed="true"] { border-color: var(--gc, var(--phos)); color: var(--bone); background: var(--panel-3); box-shadow: inset 0 -2px 0 var(--gc, var(--phos)); }
  /* ---------- time-on-field alerts ---------- */
  .token[data-alert="warn"], .tile[data-alert="warn"] { box-shadow: 0 0 0 3px var(--warn), 0 0 14px color-mix(in srgb, var(--warn) 55%, transparent), inset 0 0 0 200px color-mix(in srgb, var(--warn) 22%, transparent); }
  .token[data-alert="over"], .tile[data-alert="over"] { animation: over-blink 1s steps(2, jump-none) infinite; }
  @media (prefers-reduced-motion: reduce) {
    .token[data-alert="over"], .tile[data-alert="over"] { animation: none; box-shadow: 0 0 0 3px var(--tally), inset 0 0 0 200px color-mix(in srgb, var(--tally) 45%, transparent); }
  }
  .is-portrait .bench .grid { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; }
  .is-portrait .bench .grid .tile { flex: 0 0 158px; }
  .is-portrait .gdiv { flex: 0 0 22px; flex-direction: column; justify-content: center; margin: 0; padding: 6px 0; border-left: 2px solid var(--gc); writing-mode: vertical-rl; transform: rotate(180deg); }
  .is-portrait .gdiv::after, .is-portrait .gdiv i { display: none; }
  /* full player names: cards grow instead of cutting the name */
  .tile { align-items: start; min-height: 88px; height: auto; }
  .tile__num { align-self: center; }
  .token { padding-bottom: 8px; }
  /* pitch token: number + role on top, the surname gets the full card width */
  .token { grid-template-columns: auto 1fr; grid-template-areas: "num role" "name name" "time time"; row-gap: 3px; }
  .token__role { justify-self: end; align-self: start; }
  .token__name { font-size: clamp(9.5px, 1.45cqi, 11.5px); letter-spacing: 0; line-height: 1.1; }
  /* ---------- suspensions ---------- */
  .spot.is-susp { gap: 1px; border: 1px solid var(--amber); border-style: solid; background: color-mix(in srgb, var(--amber) 14%, rgba(0, 0, 0, .35)); color: var(--amber); cursor: not-allowed; }
  .spot.is-susp small { font: 700 8.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; }
  .spot.is-susp b { font: 400 24px/.9 var(--f-led); }
  .spot.is-susp i { font: 400 22px/.9 var(--f-led); font-style: normal; text-shadow: var(--glow-a); }
  .spot.is-susp.is-out { border-color: var(--tally); color: var(--tally); background: color-mix(in srgb, var(--tally) 14%, rgba(0, 0, 0, .35)); }
  .has-sel .spot.is-susp { animation: none; }
  .tile.is-susp { opacity: .75; border-color: var(--amber); border-style: solid; }
  .tile.is-susp.is-out { border-color: var(--tally); opacity: .55; }
  .tile__susp { position: absolute; left: 8px; right: 8px; bottom: 7px; z-index: 1; font: 700 9px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); text-align: right; }
  .tile.is-out .tile__susp { color: var(--tally); }
  .tile__susp i { font: 400 16px/1 var(--f-led); font-style: normal; letter-spacing: 0; margin-left: 4px; }
  .feed li.is-susp { border-left-color: var(--amber); color: var(--amber); }
  /* tablet portrait and narrow landscape: brand + score, then clock + controls */
  @media (max-width: 1020px) {
    .token, .spot { width: clamp(64px, 17cqi, 104px); }
  }
  @media (max-width: 600px) {
    .rot, .rot.is-portrait { display: flex; flex-direction: column; gap: 12px; }
    .pitch { padding: 10px; }
    .pitch-h { flex-wrap: wrap; }
    .forms { width: 100%; }
    .turf-wrap { container-type: inline-size; display: block; }
    .turf { width: 100%; }
    .token, .spot { width: clamp(56px, 19cqi, 84px); }
    .token { padding: 4px 5px 7px; }
    .token__num { font-size: 26px; }
    .token__role { display: none; }
    .token__name { font-size: 9px; }
    .token__time b { font-size: 16px; }
    .rot.is-portrait .bench .grid, .bench .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .rot.is-portrait .bench .grid .tile { flex: none; }
    .rot.is-portrait .tile--bench { touch-action: pan-y; }
    .rot.is-portrait .gdiv { writing-mode: horizontal-tb; transform: none; flex-direction: row; border-left: 0; padding: 0; margin-top: 6px; }
    .rot.is-portrait .gdiv::after, .rot.is-portrait .gdiv i { display: block; }
    .rot.is-portrait .subs-feed, .subs-feed { display: flex; flex-direction: column; align-items: stretch; }
    .feed-h { flex-direction: row; align-items: baseline; border-right: 0; padding: 0; }
  }
  /* narrow pitches (portrait tablet, phone): stint over total so both fit, names never split mid-word */
  @container (max-width: 480px) {
    .token { width: 72px; padding: 5px 6px 8px; }
    .token__num { font-size: 26px; }
    .token__name { font-size: 9px; overflow-wrap: normal; }
    .token__time { flex-direction: column; align-items: flex-start; gap: 1px; }
    .token__time b { font-size: 17px; }
    .token__time small { font-size: 13px; }
    .spot { width: 60px; }
  }
  @container (max-width: 380px) {
    .token { width: 64px; }
    .token__role { display: none; }
  }
  .tile__name { font-size: 11px; padding-right: 24px; overflow-wrap: normal; }
  .pitch-h { margin-bottom: 6px; gap: 10px; }
  .pitch-h .count-led { font-size: 28px; }
  .gfilter { margin: 0 0 6px; gap: 5px; }
  .gfilter button { min-height: 30px; padding: 0 8px; gap: 5px; font-size: 9.5px; }
  .gfilter button b { font-size: 15px; }
  .bench .zone-h { margin-bottom: 6px; align-items: center; }
  .bench .zone-h h2 { font-size: 22px; }
  /* portrait: bench wraps into rows instead of a sideways-scrolling strip */
  .rot.is-portrait .bench .grid { display: grid; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); overflow: hidden; }
  .rot.is-portrait .bench .grid .tile { flex: none; }
  .rot.is-portrait .gdiv { display: none; }
  /* bench density levels (fitBench) */
  .tile__short { display: none; }
  .rot.bench-d1 .bench .grid { gap: 6px; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .bench-d1 .bench .tile { min-height: 58px; padding: 5px 9px 8px 5px; column-gap: 7px; }
  .bench-d1 .bench .tile__num { font-size: 34px; }
  .bench-d1 .bench .tile__name { display: none; }
  .bench-d1 .bench .tile__short { display: block; grid-area: name; padding-right: 22px; font: 600 11px/1.1 var(--f-mono); letter-spacing: .02em; text-transform: uppercase; }
  .bench-d1 .bench .tile__time { font-size: 18px; }
  .bench-d1 .bench .tile__rest { font-size: 8.5px; }
  .bench-d1 .gdiv { margin-top: 2px; font-size: 9px; }
  .rot.bench-d2 .bench .grid { gap: 5px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .bench-d2 .bench .tile { min-height: 42px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "num name time"; align-items: center; padding: 3px 8px 5px 5px; }
  .bench-d2 .bench .tile__rest, .bench-d2 .bench .tile__pos { display: none; }
  .bench-d2 .bench .tile__num { font-size: 26px; }
  .bench-d2 .bench .tile__time { font-size: 16px; }
  .bench-d2 .gdiv { display: none; }
  .bench-d2 .tile__susp { position: static; grid-column: 1 / -1; text-align: left; }
  .rot.bench-d3 .bench .grid { gap: 4px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .bench-d3 .bench .tile { min-height: 40px; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num name" "num time"; align-items: center; row-gap: 1px; column-gap: 5px; padding: 3px 6px 5px 4px; }
  .bench-d3 .bench .tile__num { font-size: 24px; }
  .bench-d3 .bench .tile__name, .bench-d3 .bench .tile__rest, .bench-d3 .bench .tile__pos, .bench-d3 .gdiv { display: none; }
  .bench-d3 .bench .tile__short { display: block; grid-area: name; font: 600 9.5px/1.05 var(--f-mono); text-transform: uppercase; }
  .bench-d3 .bench .tile__time { font-size: 13px; }
  .bench-d3 .tile__susp { position: static; grid-column: 1 / -1; font-size: 8px; text-align: left; }
  .rot.is-pre .subs-feed { display: none; }
  /* ---------- quick action ring (double tap on the pitch) ---------- */
  .quick { position: fixed; inset: 0; z-index: 72; }
  .quick[hidden] { display: none; }
  .quick__scrim { position: absolute; inset: 0; background: radial-gradient(circle at var(--cx, 50%) var(--cy, 50%), rgba(0, 0, 0, .35), rgba(0, 0, 0, .65)); animation: fade .15s ease-out both; }
  .quick__ring { position: absolute; width: 0; height: 0; scale: var(--s, 1); }
  .quick__center, .quick__item { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; }
  .quick__center { width: 96px; height: 96px; gap: 1px; transform: translate(-50%, -50%); background: var(--sel-bg); border: 2px solid var(--amber); box-shadow: var(--glow-a); color: var(--amber); }
  .quick__center b { font: 400 42px/.8 var(--f-led); font-weight: 400; }
  .quick__center small { max-width: 84px; font: 700 9px/1.1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--bone); text-align: center; }
  .quick__center i { margin-top: 2px; font: 600 8px/1 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; font-style: normal; color: var(--mute); }
  .quick__center:not(:disabled):active { scale: .96; }
  .quick__item {
  width: 88px; height: 88px; padding: 8px; background: var(--panel-3); border: 1px solid var(--line-2); color: var(--bone); box-shadow: var(--shadow);
  transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y)));
  animation: quick-in .22s cubic-bezier(.2, 0, 0, 1) both; animation-delay: calc(var(--i) * 18ms);
  transition-property: scale, background-color; transition-duration: .12s;
}
  .quick__item span { font: 700 10.5px/1.15 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; text-align: center; overflow-wrap: break-word; }
  .quick__item em { position: absolute; top: -5px; right: -1px; padding: 2px 6px; border-radius: 4px; background: var(--amber); color: var(--on-amber); font: 400 16px/1 var(--f-led); font-style: normal; }
  .quick__item[data-tone="goal"] { border-color: var(--amber); color: var(--amber); }
  .quick__item[data-tone="good"] { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--phos) 40%, transparent); }
  .quick__item[data-tone="bad"] { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tally) 40%, transparent); }
  .quick__item[data-tone^="card"] { background: color-mix(in srgb, var(--c) 22%, var(--panel-3)); border-color: var(--c); }
  .quick__item:not(:disabled):active { scale: .96; background: var(--sel-bg); }
  @media (prefers-reduced-motion: reduce) {
    .quick__item { animation: none; }
  }
  .pc-h { align-items: flex-start; }
  .pc-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .pc-num { font: 400 64px/.8 var(--f-led); color: var(--phos); font-weight: 400; }
  .pc-id h2 { font: 400 26px/1.05 var(--f-slate); letter-spacing: .03em; text-transform: uppercase; text-wrap: balance; }
  .pc-id .kicker { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
  .pc-g { width: 8px; height: 8px; border-radius: 2px; background: var(--gc); }
  .pc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line-2); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
  .pc-kpi { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--sunk); }
  .pc-kpi b { font: 400 32px/.8 var(--f-led); color: var(--amber); font-weight: 400; }
  .pc-kpi.is-live b { color: var(--phos); text-shadow: var(--glow-p); }
  .pc-stints { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; font: 400 18px/1 var(--f-led); color: var(--bone); }
  .pc-stats { display: flex; flex-wrap: wrap; gap: 6px; }
  .pc-stat { padding: 5px 9px; border: 1px solid var(--line-2); border-radius: 5px; font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }
  .pc-stat b { font: 400 17px/1 var(--f-led); color: var(--amber); margin-left: 4px; font-weight: 400; }
  .pc-actions .btn { min-height: 46px; }
  .pc-card { border-left: 6px solid var(--c); }
  @media (max-width: 600px) {
    .pc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  .zone-h--bench { justify-content: flex-start; align-items: baseline; gap: 10px; }
  .squad-link { min-height: 32px; padding: 0 2px; font: 600 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--mute); text-decoration: underline dotted; text-underline-offset: 4px; }
  .squad-link span { margin-left: 2px; }
  .squad-link:focus-visible { color: var(--phos); }
  @media (hover: hover) { .squad-link:hover { color: var(--phos); } }
  .spot__back { font: 600 8.5px var(--f-mono) !important; letter-spacing: .12em !important; opacity: .85; }
  .tile.is-susp .tile__rest { visibility: hidden; }
  /* live: the rotations hint only shows while picking someone, floating so nothing reflows */
  .rot { position: relative; }
  .rot:not(.is-pre):not(.has-sel) .hint { display: none; }
  .rot:not(.is-pre).has-sel .hint { position: absolute; top: 0; left: 0; right: 0; z-index: 20; box-shadow: var(--shadow), var(--glow-a); animation: hint-in .18s ease-out; }
  .swap-chip { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "num name" "num sub"; column-gap: 8px; align-items: center; min-height: 52px; min-width: 112px; padding: 6px 12px 6px 8px; background: var(--sunk); border: 1px solid var(--line-2); border-left: 4px solid var(--gc, var(--line-2)); border-radius: 8px; color: var(--bone); text-align: left; }
  .swap-chip b { grid-area: num; font: 400 28px/.9 var(--f-led); color: var(--phos); }
  .swap-chip span { grid-area: name; font: 600 10.5px/1.1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .swap-chip small { grid-area: sub; font: 400 13px/1 var(--f-led); color: var(--mute); }
  .swap-chip:not(:disabled):active { transform: scale(.96); border-color: var(--amber); }
  .pc-swap { display: flex; flex-direction: column; gap: 8px; }
  .pc-swap__row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; scroll-snap-type: x proximity; }
  .pc-swap__row > * { scroll-snap-align: start; }
  @media (max-width: 600px) {
    /* the bench rides along the bottom of the board as a strip: a sub is two taps, no scroll */
    .rot .bench, .rot.is-portrait .bench { position: sticky; bottom: -1px; z-index: 11; margin: 0 -12px -24px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line-2); box-shadow: 0 -14px 28px -16px rgba(0, 0, 0, .7); }
    .rot .bench .zone-h { margin: 0 0 6px; align-items: center; }
    .rot .bench .zone-h h2 { font-size: 18px; }
    .rot .bench .role-gaps { margin-bottom: 6px; padding: 6px 10px; }
    .rot .bench .grid, .rot.is-portrait .bench .grid { display: flex; grid-template-columns: none; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; scroll-snap-type: x proximity; padding: 2px 0 2px; -webkit-overflow-scrolling: touch; }
    .rot .bench .grid > * { scroll-snap-align: start; }
    .rot .bench .tile, .rot.is-portrait .bench .grid .tile { flex: 0 0 auto; width: 118px; min-height: 58px; padding: 5px 9px 7px 6px; column-gap: 7px; grid-template-areas: "num name" "num rest"; }
    .rot .bench .tile__num { font-size: 30px; }
    .rot .bench .tile__name { display: none; }
    .rot .bench .tile__short { display: block; grid-area: name; font: 600 10px/1.1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rot .bench .tile__time, .rot .bench .tile__bar, .rot .bench .tile__pos { display: none; }
    .rot .bench .tile__rest { grid-area: rest; }
    .rot .bench .gdiv, .rot.is-portrait .gdiv { display: none; }
    .rot .bench .bench-empty { flex: 1 1 auto; padding: 10px 12px; }
    .rot .bench .bench-empty .btn { min-height: 44px; padding: 0 10px; letter-spacing: .1em; }
    .rot .subs-feed { display: none; }
    .rot .pitch { padding-bottom: 6px; }
    .pc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-height: 520px) and (orientation: landscape) {
    .rot, .rot.is-portrait, .rot.is-portrait.side-bench { display: flex; flex-direction: column; gap: 10px; }
    .rot .pitch { flex: none; }
    /* size containment needs a height the flow no longer gives it: the turf sizes itself from the viewport height */
    .turf-wrap { container-type: inline-size; display: block; }
    .turf { margin: 0 auto; }
    .rot .bench, .rot.is-portrait .bench { position: sticky; bottom: -1px; z-index: 11; margin: 0 -12px -12px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line-2); box-shadow: 0 -14px 28px -16px rgba(0, 0, 0, .7); }
    .rot .bench .zone-h { margin: 0 0 4px; align-items: center; }
    .rot .bench .zone-h h2 { font-size: 16px; }
    .rot .bench .gfilter, .rot .bench .role-gaps { display: none; }
    .rot .bench .grid, .rot.is-portrait .bench .grid { display: flex; grid-template-columns: none; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 2px 0; }
    .rot .bench .tile, .rot.is-portrait .bench .grid .tile { flex: 0 0 auto; width: 118px; min-height: 52px; padding: 4px 9px 6px 6px; column-gap: 7px; grid-template-areas: "num name" "num rest"; }
    .rot .bench .tile__num { font-size: 28px; }
    .rot .bench .tile__name, .rot .bench .tile__time, .rot .bench .tile__bar, .rot .bench .tile__pos, .rot .bench .gdiv, .rot.is-portrait .gdiv, .rot .subs-feed { display: none; }
    .rot .bench .tile__short { display: block; grid-area: name; font: 600 10px/1.1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rot .bench .tile__rest { grid-area: rest; }
  }
  /* ---------- bench strip: fold (phone layouts only) ---------- */
  .bench-fold { display: inline-flex; align-items: center; gap: 6px; padding: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; cursor: default; }
  .bench-fold__chev { display: none; }
  @media (max-width: 600px), (max-height: 520px) and (orientation: landscape) {
    .rot .bench .bench-fold { cursor: pointer; min-height: 32px; }
    .rot .bench .bench-fold__chev { display: inline-block; width: 9px; height: 9px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: translateY(-3px) rotate(45deg); transition: transform .18s cubic-bezier(.2, 0, 0, 1); }
    .rot .bench.is-folded .bench-fold__chev { transform: translateY(1px) rotate(-135deg); }
    .rot .bench.is-folded .grid, .rot .bench.is-folded .gfilter, .rot .bench.is-folded .role-gaps { display: none; }
    .rot .bench.is-folded .zone-h { margin-bottom: 0; }
  }
  /* short landscape: the header stands beside the tiles, not above them — 60px of strip instead of 110 */
  @media (max-height: 520px) and (orientation: landscape) {
    .rot .bench, .rot.is-portrait .bench { display: flex; flex-direction: row; align-items: center; gap: 12px; }
    .rot .bench .zone-h--bench { flex: none; flex-direction: column; align-items: flex-start; gap: 0; margin: 0; width: 60px; }
    .rot .bench .zone-h h2 { font-size: 15px; }
    .rot .bench .squad-link { min-height: 0; font-size: 9px; letter-spacing: .06em; }
    .rot .bench .squad-link__w { display: none; }
    .rot .bench .grid, .rot.is-portrait .bench .grid { flex: 1 1 auto; min-width: 0; }
    .rot .bench.is-folded { padding-top: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
    /* folded, the header is one line: 36px of strip */
    .rot .bench.is-folded .zone-h--bench { flex-direction: row; align-items: baseline; gap: 10px; width: auto; }
  }
  /* ---------- UI audit 2026-10-20 ---------- */
  /* Empty bench: the two ways out side by side, equal, wrapping only when they cannot fit. */
  .bench-empty .btn-row { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .bench-empty .btn-row .btn { justify-content: center; min-width: 0; padding: 0 10px; letter-spacing: .1em; line-height: 1.2; text-align: center; }
  .bench-empty .empty { padding: 0; }
  /* Chips that overflow say so with a fade instead of a hard cut. */
  .gfilter { mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 24px; }
  .forms { mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 24px; }
  /* A wide bench (portrait tablet) must not stretch the two actions across it: equal, side by side, capped. */
  .bench-empty .btn-row { display: flex; flex-wrap: nowrap; }
  .bench-empty .btn-row .btn { flex: 1 1 0; max-width: 300px; }
  /* Phone: the plan button joins the "en cancha" row; the formations take the next one whole. */
  @media (max-width: 600px) {
    .pitch-h .plan-btn { order: 1; }
    .pitch-h .forms { order: 2; flex-basis: 100%; }
  }
}
