.sd-match-host {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 12px 20px 24px;
  scroll-margin-top: var(--sd-banner-offset, 76px);
}

.sd-match-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.sd-match-substitutions {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.sd-sub-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: min(52dvh, 440px);
  overflow-y: auto;
  scrollbar-color: var(--site-accent) transparent;
  scrollbar-width: thin;
}

.sd-sub-columns h3 {
  margin: 0 0 8px;
}

.sd-sub-player {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  margin-bottom: 6px;
  padding: 6px;
  border: 1px solid var(--site-line);
  border-radius: 6px;
  background: var(--site-deep);
  color: var(--site-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.sd-sub-player[aria-pressed="true"] {
  outline: 2px solid var(--site-accent);
  background: var(--site-panel);
}

.sd-sub-player > span {
  flex: 1;
  min-width: 0;
}

.sd-sub-player :is(strong, small) {
  display: block;
  overflow-wrap: anywhere;
}

.sd-sub-player small {
  color: var(--site-muted);
}

.sd-sub-player .sd-portrait {
  width: 32px;
  height: 36px;
  flex: 0 0 32px;
}

.sd-match-toolbar p {
  min-width: 0;
  margin: 0;
  color: var(--site-muted, #bdd0ed);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.sd-match-toolbar .sd-button {
  flex-shrink: 0;
}

/* The native match heading owns the fixture title once playback is ready.
   Keep loading and error feedback visible before the ready marker is set. */
.sd-match-host:has(#snakeMatchFrame[data-ready="true"]) #snakeMatchStatus {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sd-match-frame-wrap {
  min-height: 760px;
  overflow: hidden;
  background: var(--site-bg, #081631);
}

#snakeMatchFrame {
  display: block;
  width: 100%;
  height: max(900px, calc(100dvh - 170px));
  border: 0;
}

body.snake-match-open > main {
  display: none;
}

@media (max-width: 700px) {
  .sd-match-substitutions {
    padding: 16px;
  }

  .sd-sub-player {
    font-size: 12px;
    gap: 6px;
  }

  .sd-match-host {
    padding: 8px 0 16px;
  }

  .sd-match-toolbar {
    padding-inline: 12px;
    align-items: flex-start;
    gap: 10px;
  }

  .sd-match-toolbar p {
    font-size: 12px;
  }

  #snakeMatchFrame {
    height: 1100px;
  }
}
