.match-head {
  position: relative;
  padding-right: 112px;
}

/* Match-Center proportions follow the compact WM sidebars. */
.workspace {
  grid-template-columns: 228px minmax(660px, 1fr) 228px;
  gap: 6px;
}

.player-row {
  grid-template-columns: 28px minmax(0, 1fr) 23px;
  gap: 4px;
  min-height: 29px;
  padding: 2px 4px;
}

.player-row .number {
  min-height: 22px;
  font-size: .62rem;
}

.player-row .player-name {
  font-size: .71rem;
}

.player-row .card-btn {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  overflow: visible;
  padding: 0;
}

.card-shape {
  display: block;
  width: 8px;
  height: 12px;
  border: 1px solid rgb(255 255 255 / .55);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .45);
}

.card-shape.yellow { background: #ffd92f; }
.card-shape.red { background: #e53a43; }

.card-stack {
  position: relative;
  display: block;
  width: 13px;
  height: 14px;
}

.card-stack .card-shape {
  position: absolute;
  top: 1px;
}

.card-stack .yellow { left: 0; }
.card-stack .red { right: 0; }

.card-empty {
  display: block;
  width: 11px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
  opacity: .55;
}

.card-btn small {
  position: absolute;
  right: -3px;
  bottom: -7px;
  z-index: 2;
  padding: 0 2px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--text);
  font-size: .47rem;
  line-height: 1.25;
  white-space: nowrap;
}

.field-player .card-btn {
  display: grid;
  place-items: center;
  padding: 0;
  overflow: visible;
}

.bench-tools {
  grid-template-columns: minmax(0, 1fr) 34px 68px;
  padding: 5px 4px;
}

.subs {
  grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr) 27px;
  padding: 4px;
}

.match-info-icons {
  position: absolute;
  right: 14px;
  top: 50%;
  display: flex;
  gap: 6px;
  transform: translateY(-50%);
}

.match-info-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 9px;
}

.match-info-icon.is-empty { opacity: .48; }
.match-info-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.whistle-icon {
  display: block;
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.stadium-schematic img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  margin: 6px auto 0;
  object-fit: contain;
}

.official-team {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.official-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px;
  border-radius: 8px;
  background: var(--soft);
}

.official-line img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}

.official-line div { display: grid; min-width: 0; }
.official-line b { color: var(--accent); font-size: .62rem; text-transform: uppercase; }
.official-line strong, .official-line span { overflow: hidden; text-overflow: ellipsis; }
.official-line span { color: var(--muted); font-size: .7rem; }
.official-line.is-empty { display: grid; }
.official-notes { margin-top: 7px; }
.hover.is-pinned { box-shadow: 0 0 0 2px var(--accent), 0 18px 42px #000b; }
.test-hover-content { display: grid; min-width: 0; }
.test-hover-content.has-notes {
  grid-template-columns: minmax(300px, .95fr) minmax(300px, 1.05fr);
  gap: 10px;
  align-items: start;
}
.test-hover-main { min-width: 0; }
.team-hover-fold { margin-top: 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); overflow: hidden; }
.team-hover-fold summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; color: var(--accent); cursor: pointer; font-size: .75rem; font-weight: 950; list-style: none; }
.team-hover-fold summary::-webkit-details-marker { display: none; }
.team-hover-fold summary::after { content: "+"; margin-left: auto; font-size: 1rem; }
.team-hover-fold[open] summary::after { content: "−"; }
.team-hover-fold summary small { margin-left: auto; color: var(--muted); font-size: .68rem; }
.team-hover-fold-body { padding: 0 9px 9px; color: var(--text); font-size: .74rem; line-height: 1.4; }
.test-hover-content.has-notes > .app-notes-component { min-width: 0; max-height: calc(100vh - 70px); overflow: auto; border-left: 1px solid var(--line); overscroll-behavior: contain; }
.formatted-note-block .note-line-text,.formatted-note-block .note-line-spacer { display: block; }
.formatted-note-block .note-line-spacer { min-height: .65em; }
.formatted-note-block .note-bullets { margin: 2px 0; padding-left: 1.2em; }

@media (max-width: 800px) {
  .match-head { padding-right: 12px; padding-bottom: 52px; }
  .match-info-icons { right: 50%; top: auto; bottom: 6px; transform: translateX(50%); }
  .test-hover-content.has-notes { grid-template-columns: 1fr; }
  .test-hover-content.has-notes > .app-notes-component { max-height: none; border-top: 1px solid var(--line); border-left: 0; }
}

@media (min-width: 801px) and (max-width: 1250px) {
  .workspace { grid-template-columns: 205px minmax(560px, 1fr) 205px; }
}
.team-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.team-head:not(.away) .team-copy {
  align-items: flex-end;
  text-align: right;
}

.team-head.away .team-copy {
  align-items: flex-start;
}

.team-environment {
  line-height: 1.05;
}

.team-scorers {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 2px 5px;
  margin-top: 2px;
  color: var(--accent);
  font-size: .6rem;
  font-weight: 900;
  line-height: 1.15;
}

.goal-scorer-chip {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  padding: 1px 4px 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  white-space: nowrap;
}

.goal-scorer-chip > button {
  width: 15px;
  height: 15px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  line-height: 13px;
}

.goal-scorer-chip > button:hover,
.goal-scorer-chip > button:focus-visible {
  background: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
}

.team-scorers em {
  padding: 1px 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  font-size: .56rem;
  font-style: normal;
}

.team-scorers.is-empty {
  color: var(--muted);
  opacity: .8;
}

.goalbar .goal-kind {
  display: inline-flex;
  width: auto;
  height: 38px;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
}

.goalbar .goal-kind:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}

.goalbar .goal-kind input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.test-menu .menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}

.test-menu .menu-toggle:hover {
  border-color: var(--ad-menu-line);
  background: var(--ad-menu-bg);
}

.test-menu .menu-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.test-menu .menu-range {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--ad-menu-line);
}

.test-menu .menu-range label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  font-size: .78rem;
  font-weight: 900;
}

.test-menu .menu-range strong {
  color: var(--ad-menu-accent-strong);
}

.test-menu .menu-range input {
  width: 100%;
  margin: 0;
}

.test-menu .ad-menu-direct {
  padding: 0;
}

.test-menu .ad-menu-direct .ad-menu-action {
  width: 100%;
}
