/* Tabletop finish. Geometry and components remain in style.css. */
@font-face {
  font-family: Cinzel;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/assets/fonts/cinzel-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin.woff2") format("woff2");
}
:root {
  --font-display: Cinzel, Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-num: "Source Sans 3", "Segoe UI", sans-serif;
  --bg: #101616;
  --bg-soft: #141c1c;
  --panel: #1e2727;
  --panel-2: #283130;
  --raised: #35403b;
  --text: #eee6d5;
  --muted: #b7b3a4;
  --line: #49504a;
  --line-strong: #8e805f;
  --accent: #a27e40;
  --accent-hover: #bb9854;
  --accent-deep: #705429;
  --accent-dark: #49391f;
  --accent-2: #d8be82;
  --accent-2-soft: #f1e1bb;
  --on-accent: #fff5dc;
  --danger: #b94338;
  --scrim: #080e10ed;
  --row-hover: #d8be821a;
  --metal: #998157;
  --metal-soft: #ab90612e;
  --edge-light: #e8d4a527;
  --edge-shadow: #0007;
  --table-grain: #ffffff03;
  --panel-wash: #d4bd8a0b;
  --focus: #eed08a;
  --tactical: #eee2b5;
  --tactical-route: #a9e3ca;
  --radius-s: 3px;
  --radius-m: 5px;
  --radius-l: 8px;
  --bw: 1px;
  --bw-thick: 2px;
  --relief-xs: inset 0 1px 0 var(--edge-light), 0 2px 3px var(--edge-shadow);
  --relief-sm: inset 0 1px 0 var(--edge-light), 0 4px 12px var(--edge-shadow);
  --shadow: 0 14px 38px #0006;
  --well: inset 0 2px 5px #0003;
  --step--2: 11px;
  --step--1: 12px;
  --step-0: 13px;
  --step-1: 15px;
}
:root[data-theme="light"] {
  --bg: #c5bead;
  --bg-soft: #d2cab7;
  --panel: #eee5d1;
  --panel-2: #e0d5bc;
  --raised: #f7ecd3;
  --text: #302e25;
  --muted: #615b4c;
  --line: #b8aa8d;
  --line-strong: #8e7850;
  --accent: #80612f;
  --accent-hover: #94743d;
  --accent-deep: #705429;
  --accent-dark: #49391f;
  --accent-2: #735827;
  --accent-2-soft: #473718;
  --on-accent: #fff5dc;
  --scrim: #c4bdaceb;
  --row-hover: #80612f10;
  --metal: #a0895e;
  --metal-soft: #80612f2b;
  --edge-light: #fffaf09c;
  --edge-shadow: #39301e2b;
  --table-grain: #ffffff0b;
  --panel-wash: #fff8e545;
  --focus: #74501b;
}
body {
  background:
    radial-gradient(ellipse at 50% 0, var(--panel-wash), transparent 75%),
    repeating-linear-gradient(
      115deg,
      var(--table-grain) 0 1px,
      transparent 1px 5px
    ),
    var(--bg);
}
h1,
h2 {
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-shadow: none;
  font-weight: 600;
}
.eyebrow,
.tag,
.skill-label,
.role-chip,
.bench-title,
.dice-owner {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.09em;
}
.eyebrow {
  font-size: 10px;
}
.muted,
.notice,
.control-status {
  line-height: 1.5;
}
::selection {
  background: var(--accent-deep);
  color: var(--on-accent);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--metal) transparent;
}
/* Fine bevels and restrained brass: controls read like pieces on the table. */
button,
#actions button.action-icon,
#actions button:first-of-type {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-transform: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  color: var(--text);
  background: linear-gradient(var(--panel-2), var(--bg-soft));
  box-shadow: var(--relief-xs);
}
button:hover:not(:disabled),
#actions button:hover:not(:disabled) {
  border-color: var(--metal);
  background: linear-gradient(var(--raised), var(--panel-2));
}
button:active:not(:disabled),
#actions button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: var(--well);
}
button:disabled {
  opacity: 0.5;
}
button.primary,
#actions button.primary,
#actions button.action-icon[aria-pressed="true"] {
  background: linear-gradient(var(--accent), var(--accent-deep));
  border-color: var(--metal);
  color: var(--on-accent);
  box-shadow:
    inset 0 1px 0 #fff3,
    0 2px 4px var(--edge-shadow);
}
button.primary:hover:not(:disabled),
#actions button.primary:hover:not(:disabled),
#actions button.action-icon[aria-pressed="true"]:hover:not(:disabled) {
  background: linear-gradient(var(--accent-hover), var(--accent-deep));
}
:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
input,
select,
textarea,
.hotseat-card form > input {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--bg-soft);
  box-shadow: var(--well);
}
/* The same engraved frame on coach plaques, cards, trays and dialogs. */
.coach-head,
.player-card,
.layout > aside > .rail-dice,
.hotseat-card,
.manager-panel,
.roster,
.log-panel {
  border: 1px solid var(--metal);
  border-radius: var(--radius-m);
  background:
    linear-gradient(135deg, var(--panel-wash), transparent 45%), var(--panel);
  box-shadow:
    inset 0 0 0 3px var(--panel),
    inset 0 0 0 4px var(--metal-soft),
    var(--relief-sm);
}
.hotseat-card::before,
.manager-panel::before,
.roster::before,
.player-card::before {
  inset: 0 16px auto;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--metal), transparent);
}
.hotseat-card h2 {
  font-size: clamp(23px, 4vw, 30px);
}
.hotseat-card {
  position: relative;
  border-radius: 8px;
}
.hotseat-layer {
  background:
    radial-gradient(ellipse at 50% 40%, var(--panel-wash), transparent 70%),
    repeating-linear-gradient(
      115deg,
      var(--table-grain) 0 1px,
      transparent 1px 5px
    ),
    var(--scrim);
}
.hotseat-card button {
  min-height: 40px;
}
.hotseat-description {
  font-size: 15px;
}
.form-field {
  font-size: 13px;
}
.lobby-list li,
.manager-rosters li {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg-soft);
}
.coach-head {
  position: relative;
  border-left: 3px solid var(--seat-home);
  padding: 10px 10px 9px;
  gap: 3px;
}
.coach-head.coach-away {
  border-left: 1px solid var(--metal);
  border-right: 3px solid var(--seat-away);
}
.coach-name {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
}
.coach-row {
  font-size: 12px;
  line-height: 1.35;
}
.coach-head[data-active="true"] {
  background:
    linear-gradient(135deg, var(--metal-soft), transparent 85%), var(--panel);
  box-shadow:
    inset 0 0 0 3px var(--panel),
    inset 0 0 0 4px var(--metal-soft),
    inset 0 -2px 0 var(--metal);
}
.coach-head[data-active="true"] .coach-name {
  color: var(--accent-2-soft);
}
.coach-head[data-active="true"] .coach-row:nth-child(2) {
  color: var(--text);
  font-weight: 600;
}
.coach-head[data-active="true"] .coach-row:nth-child(2)::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--accent-2);
  transform: rotate(45deg);
}
.player-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.player-card .eyebrow {
  letter-spacing: 0.08em;
  font-size: 9px;
}
.player-card .role-chip {
  margin: 5px 0;
  font-size: 11px;
}
.player-card .stats {
  margin: 8px 0;
  border-color: var(--metal-soft);
}
.player-card .stats b {
  font-size: 19px;
  color: var(--text);
  font-weight: 600;
}
.player-card .stats small {
  font-size: 9px;
  letter-spacing: 0.03em;
}
.player-card .stats > div {
  border-color: var(--metal-soft);
}
.player-card > p.muted {
  font-size: 11px;
  line-height: 1.4;
  margin: 6px 0;
}
.skill-icon {
  border-radius: 3px;
  border: 1px solid var(--metal);
  box-shadow: 0 1px 3px var(--edge-shadow);
}
.skill-label {
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  letter-spacing: 0.02em;
}
/* A quiet tabletop surrounds the pitch; fine corners frame the playing area. */
.arena {
  background:
    radial-gradient(ellipse at 50% 48%, var(--panel-wash), transparent 72%),
    repeating-linear-gradient(
      0deg,
      var(--table-grain) 0 1px,
      transparent 1px 4px
    ),
    var(--bg-soft);
  border-radius: var(--radius-m);
  box-shadow: inset 0 0 0 1px var(--metal-soft);
}
.scroll::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid var(--metal-soft);
  background:
    linear-gradient(var(--metal), var(--metal)) left top / 16px 1px no-repeat,
    linear-gradient(var(--metal), var(--metal)) left top / 1px 16px no-repeat,
    linear-gradient(var(--metal), var(--metal)) right bottom / 16px 1px
      no-repeat,
    linear-gradient(var(--metal), var(--metal)) right bottom / 1px 16px
      no-repeat;
}
.pitchbar {
  min-height: 34px;
  padding-right: 8px;
  gap: 8px;
}
.pitchbar .score {
  background: var(--bg-soft);
  border: 1px solid var(--metal-soft);
  border-radius: 4px;
  box-shadow: inset 0 1px 4px var(--edge-shadow);
  padding: 3px 10px;
  letter-spacing: 0;
}
.pitchbar .numbers {
  box-shadow: none;
  background: none;
  border: 0;
  padding: 0;
}
.pitchbar .numbers > span {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-2-soft);
}
.pitchbar .numbers small {
  font-size: 10px;
  letter-spacing: 0.04em;
}
.tag {
  border: 1px solid var(--metal-soft);
  border-radius: 3px;
  font-size: 9px;
  padding: 3px 6px;
  background: var(--bg-soft);
}
.bench-box {
  border-color: var(--metal-soft);
  background: var(--bg-soft);
}
.bench-title {
  background: linear-gradient(var(--panel-2), var(--panel));
  color: var(--text);
  border-bottom: 1px solid var(--metal-soft);
  padding-block: 5px;
  font-size: 9px;
  letter-spacing: 0.04em;
}
.log-panel {
  border-radius: 4px;
}
.log-toggle {
  box-shadow: none;
  border: 0;
  font-size: 10px;
  letter-spacing: 0.06em;
}
.log-panel #log {
  background: var(--panel);
}
#log p.harm {
  border-left-color: var(--error-line);
}
.legend-toggle {
  box-shadow: var(--relief-sm);
}
/* Cast ivory dice, inset pips and crisp, original vector block symbols. */
.die,
.dice-tray .die {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  border: 1px solid #9b8760;
  background: linear-gradient(145deg, #fff7df 5%, #e4d5b3 70%, #c4ad7d);
  color: #30291f;
  box-shadow:
    inset 0 1px 1px #fff,
    inset 0 -2px 1px #927c494d,
    0 2px 3px #0006;
}
.pip-die {
  padding: 4px;
  gap: 2px;
}
.pip {
  background: #30291f;
  box-shadow:
    inset 0 1px 1px #0008,
    0 1px 0 #fff9;
  max-width: 5px;
}
.block-face,
.dice-tray .block-face {
  width: 100%;
  height: 100%;
  background: none;
  transform: none;
}
.block-face svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 2px;
}
.dice-section,
.dice-section.home,
.dice-section.away {
  border: 0;
  background: var(--bg-soft);
  border-radius: 3px;
  padding: 7px 5px;
  min-height: 80px;
}
.dice-section.home {
  --dice-seat: var(--seat-home);
}
.dice-section.away {
  --dice-seat: var(--seat-away);
}
.dice-section .dice-owner,
.dice-section.home .dice-owner,
.dice-section.away .dice-owner {
  background: none;
  color: var(--text);
  border-bottom: 1px solid var(--metal-soft);
  border-left: 2px solid var(--dice-seat, var(--metal));
  padding: 2px 4px 6px;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.dice-section .dice-roll {
  padding-block: 7px;
  border-top: 1px solid var(--metal-soft);
  gap: 4px;
}
.dice-roll > span:first-child {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
}
.dice-section.home .die,
.dice-section.away .die {
  border-color: #9b8760;
}
.dice-section.home .dice-total,
.dice-section.away .dice-total {
  font-family: var(--font-num);
  font-size: 16px;
  color: var(--accent-2-soft);
}
.dice-empty {
  font-size: 12px;
}
.dice-close {
  color: var(--muted);
  border: 0;
  background: transparent;
  box-shadow: none;
}
#actions .die-choice {
  min-width: 44px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
}
#actions .die-choice .die {
  width: 30px;
  height: 30px;
}
.cell-dice .die {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}
.cell-dice .pip-die {
  padding: 2px;
  gap: 1px;
}
.cell-dice .block-face svg {
  padding: 1px;
}
/* Feedback retains its meaning in both themes and does not rely on colour alone. */
.pitch .cell:hover:not(:disabled) {
  background-color: #f6e9b91a;
  box-shadow: inset 0 0 0 1px #f8e5b8aa;
}
.pitch .cell:focus-visible {
  outline: 2px solid var(--tactical);
  outline-offset: -3px;
  z-index: 5;
}
.pitch .cell:disabled {
  opacity: 1;
}
.pitch .cell:active:not(:disabled) {
  transform: none;
}
.pitch .cell.reachable::after {
  background: var(--tactical-route);
  box-shadow: 0 0 0 1px #17372e;
  border-radius: 50%;
  transform: none;
  width: 18%;
}
.pitch .cell.reachable[data-step]:not([data-step=""])::after {
  color: var(--tactical-route);
  background: #17372ee6;
  box-shadow: 0 0 0 1px #a9e3ca55;
  min-width: 17px;
  width: 55%;
  line-height: 1.3;
  border-radius: 3px;
  font-family: var(--font-num);
  font-size: max(12px, 39cqmin);
}
.pitch .cell.reachable-far:not(.planned) {
  background: #a9e3ca16;
}
.pitch .cell.planned {
  background: #a9e3ca38;
  box-shadow: inset 0 0 0 2px var(--tactical-route);
}
.pitch .cell.reachable:has(.token:not([hidden])) {
  box-shadow: inset 0 0 0 2px var(--tactical);
}
.pitch .cell:has(.token.selected:not([hidden])) {
  box-shadow: inset 0 0 0 2px var(--tactical);
  background-color: #eee2b51a;
}
.token[data-figure].selected {
  box-shadow:
    inset 0 0 0 1px var(--role-fillet),
    0 0 0 1.5px var(--seat),
    0 0 0 3px var(--tactical);
}
.token[data-figure].target {
  outline: 2px dashed var(--tactical);
  outline-offset: 2px;
  box-shadow:
    inset 0 0 0 1px var(--role-fillet),
    0 0 0 1.5px var(--seat);
}
.token.used {
  filter: saturate(0.55) brightness(0.8);
}
.token[data-figure] .token-posture {
  color: #fff6db;
  background: #382b21;
  border: 1px solid #ebd6a5;
  border-radius: 3px;
}
.route-summary {
  color: var(--text);
  font-size: 12px;
}
.layout > .action-panel,
.layout > .action-panel.home,
.layout > .action-panel.away {
  background: var(--panel);
  border: 1px solid var(--metal);
  box-shadow: inset 0 1px 0 var(--edge-light);
}
.action-card::before {
  display: none;
}
.action-card,
.control-bar {
  box-shadow: none;
}
#actions .action-icon svg {
  color: var(--accent-2);
}
#actions .action-icon[aria-pressed="true"] svg {
  color: var(--on-accent);
}
@media (min-width: 901px) {
  .card-slot {
    container-type: size;
  }
  .layout {
    gap: 6px;
  }
  .layout > .action-panel {
    padding-right: 90px;
  }
  .layout > aside > .rail-dice {
    padding: 9px 7px;
  }
  .player-card {
    padding: 10px;
  }
  .action-card {
    padding: 0;
  }
  .pitchbar > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* Keep the stats and skills visible on laptop-height screens. */
@container (max-height: 330px) {
  .player-card {
    padding: 7px;
  }
  .player-card h2 {
    font-size: 14px;
  }
  .player-card .portrait-frame:has([data-figure]) {
    height: 64px;
  }
  .player-card .portrait-frame .player-portrait[data-figure] {
    width: 50px;
    height: 62px;
  }
  .player-card .portrait-frame .player-portrait[data-figure] .token-figure {
    width: 44px;
    height: 64px;
  }
  .player-card .portrait-frame::before {
    width: 40px;
    height: 40px;
    top: 6px;
  }
  .player-card .stats {
    margin: 5px 0;
  }
  .player-card .stats b {
    font-size: 17px;
  }
  .player-card .player-skills {
    margin-top: 5px;
    gap: 5px;
  }
  .player-card .role-chip {
    margin: 3px 0;
  }
}
@media (max-width: 900px) {
  .layout > .dice-rail {
    grid-template-rows: auto auto auto;
  }
  .layout > aside > .rail-dice {
    align-self: stretch;
  }
  .pitchbar {
    flex-wrap: wrap;
    padding-left: 0;
  }
  .arena .scroll {
    overflow: auto;
  }
  .arena .field {
    justify-self: start;
  }
  .scroll::before {
    display: none;
  }
  .action-icon span {
    display: inline;
  }
  #actions .action-icon {
    height: 44px;
  }
  .legend-toggle {
    bottom: 12px;
    right: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  button:active:not(:disabled),
  #actions button:active:not(:disabled) {
    transform: none;
  }
}

/* Match HUD: centred score, explicit actor, and coloured coach plaques. */
.arena .pitchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 4px;
  padding: 12px 16px 10px;
  margin: 0;
  min-height: 116px;
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--team-home) 16%, var(--panel)),
    var(--panel) 45%,
    color-mix(in srgb, var(--team-away) 16%, var(--panel))
  );
  border: 1px solid var(--metal-soft);
  border-radius: 6px;
}
.arena .pitchbar .score {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.arena .pitchbar .numbers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.arena .pitchbar .numbers > span {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0.08em;
}
.arena .pitchbar .numbers small {
  display: block;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}
.arena .pitchbar .active-turn {
  display: block;
  font: 600 clamp(15px, 1.5vw, 21px)/1.3 var(--font-display);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 5px 20px;
  border-radius: 4px;
  border: 1px solid var(--metal);
  color: var(--text);
  background: var(--panel-2);
}
.arena .pitchbar[data-side="home"] .active-turn {
  background: color-mix(in srgb, var(--seat-home) 25%, var(--panel));
  border-color: var(--seat-home);
}
.arena .pitchbar[data-side="away"] .active-turn {
  background: color-mix(in srgb, var(--seat-away) 25%, var(--panel));
  border-color: var(--seat-away);
}
.arena .pitchbar .match-instruction {
  display: block;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
  white-space: normal;
}
.coach-head {
  --coach-colour: var(--seat-home);
  background: linear-gradient(
    130deg,
    color-mix(in srgb, var(--coach-colour) 22%, var(--panel)),
    var(--panel)
  );
}
.coach-head.coach-away {
  --coach-colour: var(--seat-away);
}
.coach-head[data-active="true"] {
  background: linear-gradient(
    130deg,
    color-mix(in srgb, var(--coach-colour) 42%, var(--panel)),
    color-mix(in srgb, var(--coach-colour) 17%, var(--panel))
  );
  box-shadow:
    inset 0 0 0 3px var(--panel),
    inset 0 0 0 4px var(--metal-soft),
    inset 0 -3px 0 var(--coach-colour);
}
.coach-head .coach-row:nth-child(2) {
  font-size: 18px;
  font-weight: 700;
}
.arena .log-panel {
  position: relative;
  top: auto;
  left: auto;
  justify-self: start;
  width: min(270px, 100%);
}
.arena .log-panel[data-open="true"] #log {
  position: absolute;
  top: 100%;
  left: -1px;
  width: calc(100% + 2px);
  background: var(--panel);
  border: 1px solid var(--metal-soft);
}
/* Menu is a contained sheet; the field remains where it was. */
.match-menu {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: min(580px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  z-index: 45;
  padding: 22px;
  overscroll-behavior: contain;
  box-shadow:
    inset 0 0 0 4px var(--metal-soft),
    0 20px 70px #0009;
}
.menu-top {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.direction-disc {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 8px #0006);
}
.menu-tools {
  display: grid;
  gap: 7px;
}
.menu-tools h2 {
  font-size: 20px;
}
.menu-tools p {
  margin: 0 0 4px;
}
.menu-tools button {
  min-height: 34px;
  width: 100%;
  margin: 0;
}
.match-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 10px;
}
.match-info > div {
  padding: 9px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--metal-soft);
  border-radius: 4px;
}
.match-info dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.match-info dd {
  margin: 2px 0 0;
  font-weight: 600;
  font-size: 13px;
}
.match-menu .tag {
  display: block;
  text-align: center;
}
.match-statistics {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  table-layout: fixed;
}
.match-statistics caption {
  font: 600 17px var(--font-display);
  text-align: left;
  padding: 4px 0 12px;
}
.match-statistics th,
.match-statistics td {
  padding: 8px;
  border-bottom: 1px solid var(--metal-soft);
}
.match-statistics thead th {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.match-statistics th:first-child {
  text-align: left;
  width: 40%;
}
.match-statistics tbody th {
  font-size: 13px;
  font-weight: 500;
}
.match-statistics td {
  text-align: center;
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.match-statistics .home {
  background: color-mix(in srgb, var(--seat-home) 12%, var(--panel));
}
.match-statistics .away {
  background: color-mix(in srgb, var(--seat-away) 12%, var(--panel));
}
.match-statistics thead .home {
  border-top: 2px solid var(--seat-home);
}
.match-statistics thead .away {
  border-top: 2px solid var(--seat-away);
}
.stats-note {
  font-size: 11px;
}
.menu-legend {
  border-top: 1px solid var(--metal-soft);
  padding-top: 12px;
  margin-top: 14px;
}
.menu-legend summary {
  cursor: pointer;
}
.menu-legend .bottom {
  display: block;
}
.menu-legend .help {
  padding: 8px;
  border: 0;
  box-shadow: none;
}
.menu-legend .help::before {
  display: none;
}
@media (max-width: 600px) {
  .menu-top {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
  }
  .match-menu {
    padding: 16px;
  }
  .menu-tools h2 {
    font-size: 16px;
  }
  .arena .pitchbar {
    padding: 10px 8px;
  }
}

/* --- Feedback del primer beta test (Gon, octubre 2026) -------------------
   Capçalera d'una sola línia, registre fix, camp vertical opcional, pilota
   que es veu, zones de placatge, tirades necessàries i daus de placatge.   */

/* Capçalera compacta: tot en una fila perquè el camp tingui l'alçada. */
.arena .pitchbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: start;
  gap: 12px;
  min-height: 0;
  padding: 6px 12px;
}
.arena .pitchbar .numbers {
  flex-direction: row;
  align-items: baseline;
  gap: 10px;
}
.arena .pitchbar .numbers > span {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1;
}
.arena .pitchbar .numbers small {
  display: inline;
  font-size: 12px;
}
.arena .pitchbar .active-turn {
  font-size: clamp(13px, 1.1vw, 15px);
  padding: 3px 12px;
  white-space: nowrap;
}
.pitch-status {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-width: 100%;
}
.arena .pitchbar .match-instruction {
  text-align: left;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ball-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pitch-tools {
  display: flex;
  gap: 6px;
  justify-self: end;
}
.pitch-tools button {
  font-size: 11px;
  padding: 4px 9px;
  min-height: 0;
  white-space: nowrap;
}
.zones-toggle[aria-pressed="true"] {
  border-color: #c9584c;
}

/* Registre fix: sota el camp en horitzontal, al costat en vertical. */
.log-box {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 6px 10px 4px;
  border: 1px solid var(--metal);
  border-radius: var(--radius-m);
  background:
    linear-gradient(135deg, var(--panel-wash), transparent 45%), var(--panel);
  box-shadow:
    inset 0 0 0 3px var(--panel),
    inset 0 0 0 4px var(--metal-soft);
}
.log-box > .eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.log-box #log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  font-size: 12px;
  padding: 0;
  background: none;
}
.log-box #log p {
  padding: 3px 0;
}
.log-box #log p:first-child {
  color: var(--text);
  font-weight: 600;
}
@media (min-width: 901px) {
  .arena > .log-box {
    flex: 0 0 clamp(96px, 17vh, 176px);
  }
  .arena[data-orientation="vertical"] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(220px, 26%, 340px);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
  }
  .arena[data-orientation="vertical"] > .pitchbar {
    grid-column: 1 / -1;
  }
  .arena[data-orientation="vertical"] > .scroll {
    grid-column: 1;
    grid-row: 2;
  }
  .arena[data-orientation="vertical"] > .log-box {
    grid-column: 2;
    grid-row: 2;
  }
}
@media (max-width: 900px) {
  .arena .pitchbar {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .arena .pitchbar .active-turn {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
  }
  .pitch-status,
  .pitch-tools {
    grid-column: 1 / -1;
  }
  .pitch-tools {
    justify-self: start;
  }
  .arena > .log-box {
    height: 200px;
  }
  /* En vertical el camp cap sencer a l'amplada del mòbil. */
  .arena[data-orientation="vertical"] .field {
    --cell: min(28px, calc((100vw - 56px) / 19));
    width: auto;
  }
  .arena[data-orientation="vertical"] .pitch {
    flex: 0 0 auto;
    width: calc(var(--cell) * var(--cols));
  }
  .arena[data-orientation="vertical"] .scroll {
    min-height: calc(min(28px, calc((100vw - 56px) / 19)) * 26 + 10px);
  }
}

/* Camp vertical: 15 columnes per 26 files, banquetes als costats. */
@media (min-width: 901px) {
  .arena[data-orientation="vertical"] .field {
    --cell: min(calc(100cqw / 19), calc(100cqh / 26));
  }
}
.arena[data-orientation="vertical"] .bench {
  height: calc(var(--cell) * 26);
}
.pitch[data-orientation="vertical"] {
  background-image: none;
  isolation: isolate;
  overflow: hidden;
}
/* La gespa pintada és horitzontal: es gira sencera per sota de les caselles. */
.pitch[data-orientation="vertical"]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--cell) * var(--rows));
  height: calc(var(--cell) * var(--cols));
  transform: translate(-50%, -50%) rotate(-90deg);
  background-image:
    radial-gradient(ellipse at 50% 42%, transparent 35%, #06151099 100%),
    url("/assets/art/ironwood-pitch.svg");
  background-size: 100% 100%;
  z-index: -1;
  pointer-events: none;
}
.pitch[data-orientation="vertical"] .cell.halfway {
  border-right: 1px solid var(--turf-line-soft);
  border-top: 2px solid #e4d9b6a8;
}
.pitch[data-orientation="vertical"] .cell.wide {
  border-bottom: 1px solid var(--turf-line-soft);
  border-right: 2px dashed color-mix(in srgb, var(--turf-line) 70%, transparent);
}
.pitch[data-orientation="vertical"] .cell.endzone {
  border-right-color: var(--turf-line-soft);
}

/* La pilota: halo a la seva casella i més mida. */
.pitch .cell.has-ball {
  outline: 2px solid #f3c64f;
  outline-offset: -2px;
  z-index: 2;
}
.ball-marker {
  font-size: max(16px, 50cqmin);
  filter: drop-shadow(0 0 3px #ffd76a) drop-shadow(0 1px 1px #000);
}
.token[data-figure] .ball-marker {
  font-size: max(15px, 46cqmin);
}
/* A terra, sense ningú a sobre: al mig de la casella. */
.cell > .token[hidden] + .ball-marker {
  position: absolute;
  inset: 0;
  right: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.ball-marker.in-air {
  opacity: 0.9;
  animation: ball-float 1.3s ease-in-out 3;
}
@keyframes ball-float {
  50% {
    transform: translateY(-14%) scale(1.08);
  }
}
.pitch .cell.has-ball::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd76a66, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.token.carrier {
  box-shadow:
    inset 0 0 0 1px var(--role-fillet, #000),
    0 0 0 2px #f3c64f;
}

/* Zones de placatge del rival: com més rivals hi marquen, més vermell. */
.pitch .cell[data-tz] {
  background-image: linear-gradient(#c8463a2e, #c8463a2e);
}
.pitch .cell[data-tz="2"] {
  background-image: linear-gradient(#c8463a47, #c8463a47);
}
.pitch .cell[data-tz="3"],
.pitch .cell[data-tz="4"] {
  background-image: linear-gradient(#c8463a66, #c8463a66);
}

/* El que caldrà treure en fer el pas, i els daus de placatge previstos. */
.cell-hint {
  position: absolute;
  top: 1px;
  left: 1px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  pointer-events: none;
}
.cell-hint i {
  font: 800 max(9px, 27cqmin) / 1.15 var(--font-num);
  font-style: normal;
  padding: 0 2px;
  border-radius: 2px;
  background: #121a1ae6;
  color: #fff;
  box-shadow: 0 1px 1px #0009;
}
.cell-hint .need-dodge {
  background: #e0a93a;
  color: #1d1406;
}
.cell-hint .need-rush {
  background: #5b8fd6;
}
.cell-hint .need-pickup {
  background: #ece6d4;
  color: #191510;
}
.cell-hint .block-dice {
  font-size: max(10px, 32cqmin);
  padding: 1px 3px;
}
.cell-hint .block-dice.favour {
  background: #2f8a4a;
}
.cell-hint .block-dice.against {
  background: #b94338;
}
.cell-hint .block-dice.even {
  background: #5f5f58;
}

/* Servei: la meitat on es pot apuntar i qui es pot moure a l'esdeveniment. */
.pitch .cell.kick-zone:not(:disabled):hover {
  background-color: #a9e3ca33;
}
.pitch .cell.kick-zone {
  background-color: #a9e3ca14;
}
.pitch .cell.kick-eligible {
  box-shadow: inset 0 0 0 2px var(--tactical-route);
}

/* L'última tirada, a la barra de sota. */
.roll-strip {
  display: flex;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
}
.roll-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 230px;
  padding: 2px 7px;
  border: 1px solid var(--metal-soft);
  border-radius: 4px;
  background: var(--bg-soft);
  font-size: 11px;
  white-space: nowrap;
}
.roll-chip .roll-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.roll-chip .dice-group .die {
  width: 20px;
  height: 20px;
}
.roll-chip .roll-verdict {
  font-weight: 700;
}
.roll-chip.ok {
  border-color: #4f9a62;
}
.roll-chip.ok .roll-verdict {
  color: #8fd19e;
}
.roll-chip.fail {
  border-color: var(--danger);
}
.roll-chip.fail .roll-verdict {
  color: #f08a7e;
}
@media (prefers-reduced-motion: reduce) {
  .ball-marker.in-air {
    animation: none;
  }
}
