/* ---------- App header additions ---------- */

.pitch-site--app .stage__header > .stage-brand {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pitch-site--app .stage__header > .stage-actions {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: flex-end;
}

/* Signed in, the header is a bar of its own: the logo, the persona's tabs,
   "More", the search button and the organisation chip. */
.pitch-site--app .stage__header--shell {
  background: var(--ps-turf);
  border-bottom: 2px solid var(--ps-ink);
  gap: clamp(10px, 1.6vw, 28px);
  justify-content: flex-start;
  margin-bottom: 8px;
  min-height: 60px;
  padding-block: 0;
}

.pitch-site--hockey .stage__header--shell {
  background: var(--ps-night);
}

.pitch-site--app .stage__header--shell > .stage__logo {
  flex: none;
}

.pitch-site--app .stage__header--shell > .stage-actions {
  min-width: 0;
}

.stage-nav {
  align-items: stretch;
  align-self: stretch;
  display: flex;
  flex: none;
  gap: 2px;
}

.stage-nav__tab {
  align-items: center;
  border-block: 3px solid transparent;
  color: var(--ps-cream);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  list-style: none;
  padding-inline: 12px;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.stage-nav__tab::-webkit-details-marker {
  display: none;
}

.stage-nav__tab:hover {
  color: var(--ps-yellow);
}

.stage-nav__tab:is([aria-current="page"], .is-current) {
  border-bottom-color: var(--ps-yellow);
  font-weight: 600;
}

.stage-nav__more {
  display: flex;
  position: relative;
}

.stage-nav__more > summary::after {
  color: var(--ps-yellow);
  content: "▾";
  margin-inline-start: 6px;
}

.stage-nav__more[open] > summary {
  background: var(--ps-turf-deep);
}

.stage-nav__more[open] > summary::after {
  content: "▴";
}

.stage-nav__more > .stage-menu-card {
  left: 0;
  right: auto;
  top: 100%;
}

/* ---------- Search button and palette ---------- */

.stage-palette__button {
  align-items: center;
  background: var(--ps-turf-deep);
  border: 2px solid var(--ps-cream-soft);
  border-radius: 8px;
  color: var(--ps-cream-soft);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 14px;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
}

.stage-palette__button:hover {
  border-color: var(--ps-yellow);
  color: var(--ps-cream);
}

.stage-palette__icon {
  flex: none;
  height: 14px;
  width: 14px;
}

.stage-palette__shortcut {
  border: 1px solid currentColor;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  white-space: nowrap;
}

.stage-palette__dialog {
  background: var(--ps-night);
  border: 2px solid var(--ps-ink);
  border-radius: 12px;
  box-shadow: var(--ps-chrome-shadow);
  color: var(--ps-cream);
  margin: 12vh auto auto;
  max-width: calc(100vw - 32px);
  padding: 16px;
  width: 40rem;
}

.stage-palette__dialog::backdrop {
  background: rgba(7, 26, 14, 0.6);
}

.stage-palette__hints {
  color: var(--ps-cream-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 12px 0 0;
}

/* ---------- Organisation chip ---------- */

.stage-org-switcher {
  flex: 0 1 auto;
  min-width: 0;
  position: relative;
}

.stage-org-switcher__label {
  align-items: center;
  border: 2px solid var(--ps-cream-soft);
  border-radius: 100px;
  color: var(--ps-cream);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  gap: 8px;
  height: 38px;
  list-style: none;
  padding: 0 12px 0 4px;
  user-select: none;
}

.stage-org-switcher__label::-webkit-details-marker {
  display: none;
}

.stage-org-switcher__label::after {
  color: var(--ps-yellow);
  content: "▾";
}

.stage-org-switcher[open] > .stage-org-switcher__label::after {
  content: "▴";
}

.stage-org-switcher__label--link {
  text-decoration: none;
}

.stage-org-switcher__label--link::after {
  content: none;
}

.stage-org-switcher__label:hover {
  border-color: var(--ps-yellow);
}

.stage-org-switcher__crest {
  flex: none;
}

.stage-org-switcher__initials {
  align-items: center;
  background: var(--ps-yellow);
  border-radius: 50%;
  color: var(--ps-ink);
  display: flex;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.stage-org-switcher__initials--person {
  background: var(--ps-cream);
}

.stage-org-switcher__text {
  max-width: 12rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-org-switcher__tier {
  background: var(--ps-yellow);
  border-radius: 4px;
  color: var(--ps-ink);
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  padding: 1px 6px;
  white-space: nowrap;
}

.stage-org-switcher__user {
  margin: 0;
  padding: 8px 10px 4px;
}

.stage-org-switcher__user-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

/* ---------- Chips ---------- */

.stage-chip {
  align-items: center;
  backdrop-filter: blur(10px);
  background: var(--ps-chrome);
  border: 2px solid var(--ps-ink);
  border-radius: 100px;
  box-shadow: var(--ps-chrome-shadow);
  color: var(--ps-cream);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 9px 14px;
  text-decoration: none;
  white-space: nowrap;
}

a.stage-chip:hover {
  color: var(--ps-yellow);
}

details.stage-chip {
  padding: 0;
  position: relative;
}

details.stage-chip > summary {
  cursor: pointer;
  list-style: none;
  padding: 9px 14px;
  user-select: none;
}

details.stage-chip > summary::-webkit-details-marker {
  display: none;
}

details.stage-chip > summary::after {
  color: var(--ps-yellow);
  content: " ▾";
}

details.stage-chip[open] > summary::after {
  content: " ▴";
}

.stage-chip--warning {
  color: var(--ps-yellow);
  font-family: var(--font-mono);
  text-transform: uppercase;
}

/* ---------- Paper menu card (chips, switcher, user menu) ---------- */

.stage-menu-card {
  background: var(--ps-paper-raised);
  border: 2px solid var(--ps-ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 rgba(6, 20, 11, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(70vh, 480px);
  min-width: 14rem;
  overflow-y: auto;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 6;
}

.stage-menu-card form {
  margin: 0;
}

.stage-menu-card__item {
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--ps-ink);
  cursor: pointer;
  display: block;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  padding: 8px 10px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
}

.stage-menu-card__item:hover {
  background: var(--ps-paper-shade);
  color: var(--ps-ink);
}

.stage-menu-card__item.is-active {
  background: var(--ps-yellow);
}

.stage-menu-card__item--muted {
  color: var(--ps-ink-soft);
}

.stage-menu-card__item--signout,
.stage-menu-card__item--danger {
  color: var(--ps-red-deep);
}

.stage-menu-card__hint {
  color: var(--ps-ink-soft);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stage-menu-card__heading {
  color: var(--ps-red-deep);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 8px 10px 2px;
  text-transform: uppercase;
}

.stage-menu-card__group {
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  padding-top: 4px;
}

.stage-menu-card--grouped {
  column-gap: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(13rem, 1fr));
  max-height: min(80vh, 640px);
  padding: 16px;
  row-gap: 16px;
}

.stage-menu-card__section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stage-menu-card__section > .stage-menu-card__heading {
  margin: 0;
}

/* ---------- Row actions: a three-dot menu of what a page can do ---------- */

.stage-actions {
  position: relative;
}

.stage-actions__trigger {
  align-items: center;
  border: 2px solid var(--color-ink);
  border-radius: 8px;
  color: var(--color-ink);
  cursor: pointer;
  display: flex;
  height: 2.25rem;
  justify-content: center;
  list-style: none;
  user-select: none;
  width: 2.25rem;
}

.stage-actions__trigger::-webkit-details-marker {
  display: none;
}

.stage-actions__trigger:hover,
.stage-actions[open] .stage-actions__trigger {
  background: var(--color-shade);
}

.stage-actions__trigger svg {
  height: 1.125rem;
  width: 1.125rem;
}

.stage-actions__card {
  background: var(--color-surface);
  border: 2px solid var(--color-ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 rgba(6, 20, 11, 0.25);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 12rem;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 8;
}

.stage-actions__card form {
  margin: 0;
}

.stage-actions__card .folder-picker {
  position: static;
}

.stage-actions__card .folder-picker__dropdown {
  background: none;
  border: none;
  box-shadow: none;
  margin: 0;
  min-width: 0;
  padding: 0 0 4px;
  position: static;
}

.stage-actions__card .folder-picker__title {
  display: none;
}

/* ---------- User avatar ---------- */

.stage-user__avatar {
  align-items: center;
  background: var(--ps-yellow);
  border: 2px solid var(--ps-ink);
  border-radius: 50%;
  box-shadow: 3px 3px 0 rgba(6, 20, 11, 0.7);
  color: var(--ps-ink);
  display: flex;
  flex: none;
  font-size: 12px;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  letter-spacing: 0.02em;
  width: 36px;
}

.stage-user__avatar--large {
  font-size: 1rem;
  height: 3rem;
  width: 3rem;
}

/* ---------- Landing: greeting, recent activity and module glyphs ---------- */

.stage-landing {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 12px 0 24px;
  width: 100%;
}

.stage-landing__work {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.stage-greeting {
  color: var(--ps-yellow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin: 0;
  text-align: center;
  text-shadow: 0 1px 10px rgba(6, 20, 11, 0.7);
  text-transform: uppercase;
}

/* The search bar under the greeting. On the landing the live results drop
   down over the stage while the field has focus or the pointer is over them. */
.stage-search {
  margin-inline: auto;
  max-width: 40rem;
  position: relative;
  width: 100%;
}

.stage-search__input {
  backdrop-filter: blur(6px);
  background: var(--ps-chrome);
  border: 2px solid var(--ps-ink);
  border-radius: 999px;
  box-shadow: var(--ps-chrome-shadow);
  color: var(--ps-cream);
  font: inherit;
  font-size: 15px;
  padding: 10px 20px;
  width: 100%;
}

.stage-search__input::placeholder {
  color: var(--ps-cream-soft);
}

.stage-search__input:focus {
  border-color: var(--ps-yellow);
}

.stage-search__results {
  display: none;
  inset-inline: 0;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 5;
}

.stage-search--landing:is(:focus-within, :hover) .stage-search__results:not(:empty) {
  backdrop-filter: blur(10px);
  background: var(--ps-chrome);
  border: 2px solid var(--ps-ink);
  border-radius: 12px;
  box-shadow: var(--ps-chrome-shadow);
  color: var(--ps-cream);
  display: block;
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 16px;
}

.stage-search--palette .stage-search__results {
  display: block;
  max-height: 50vh;
  overflow-y: auto;
  position: static;
}

.stage-search--palette .stage-search__results:not(:empty) {
  margin-block-start: 14px;
  padding: 4px;
}

.stage-search .is-picked {
  background: var(--ps-yellow);
  border-radius: 3px;
  box-shadow: 0 0 0 4px var(--ps-yellow);
  color: var(--ps-ink);
}

.stage-search .is-picked .stage-search__meta {
  color: inherit;
}

.stage-search__groups {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.stage-search__meta {
  color: var(--ps-cream-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  margin-inline-start: 6px;
}

/* A long matchup gives way before its date does. */
.stage-search__link {
  align-items: baseline;
  display: flex;
}

.stage-search__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stage-search__link .stage-search__meta {
  flex: none;
}

.stage-search__empty {
  color: var(--ps-cream-soft);
  font-size: 13.5px;
  margin: 0;
}

.stage-search__all {
  color: var(--ps-yellow);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-block-start: 12px;
  text-transform: uppercase;
}

.stage-plan {
  color: var(--ps-cream-soft);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 4px 8px;
  justify-content: center;
  margin: 0;
  text-shadow: 0 1px 8px rgba(6, 20, 11, 0.8);
}

.stage-plan__link {
  color: var(--ps-yellow);
  font-weight: 600;
  text-decoration: none;
}

.stage-plan__link:hover {
  text-decoration: underline;
}

.stage-recent {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stage-recent__title {
  color: var(--ps-cream);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  text-shadow: 0 1px 8px rgba(6, 20, 11, 0.8);
}

.stage-recent__groups {
  align-content: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.stage-recent__group {
  backdrop-filter: blur(6px);
  background: var(--ps-chrome);
  border: 2px solid var(--ps-ink);
  border-radius: 12px;
  box-shadow: var(--ps-chrome-shadow);
  color: var(--ps-cream);
  min-width: 0;
  padding: 12px 16px;
}

.stage-recent__heading {
  color: var(--ps-yellow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.stage-recent__list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stage-recent__link {
  color: var(--ps-cream);
  display: block;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-recent__link:hover {
  color: var(--ps-yellow);
}

.stage-recent__empty {
  backdrop-filter: blur(6px);
  background: var(--ps-chrome);
  border: 2px solid var(--ps-ink);
  border-radius: 12px;
  box-shadow: var(--ps-chrome-shadow);
  color: var(--ps-cream-soft);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  margin: 0;
  text-transform: uppercase;
}

.stage-modules {
  display: grid;
  gap: 28px 12px;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.stage-module {
  align-items: center;
  animation: stage-module-bob 6s ease-in-out infinite;
  display: flex;
  justify-content: center;
  margin: 0;
}

.stage-module__link {
  align-items: center;
  color: var(--ps-cream);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 8px rgba(6, 20, 11, 0.7);
}

.stage-module__art {
  aspect-ratio: 1;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(6, 20, 11, 0.55));
  transition: filter 160ms, transform 160ms;
  width: 4.5rem;
}

.stage-module__art svg {
  display: block;
  height: 100%;
  width: 100%;
}

.stage-module__label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 160ms;
}

.stage-module__status {
  color: var(--ps-cream-soft);
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1.35;
  min-height: 1.35em;
  text-wrap: balance;
}

.stage-module__status turbo-frame {
  display: block;
}

.stage-module__status-loading {
  animation: stage-module-status-shimmer 1.4s linear infinite;
  background: linear-gradient(90deg, rgba(245, 242, 234, 0.14) 25%, rgba(245, 242, 234, 0.4) 50%, rgba(245, 242, 234, 0.14) 75%);
  background-size: 200% 100%;
  border-radius: 999px;
  display: inline-block;
  height: 0.625rem;
  vertical-align: middle;
  width: 6.5rem;
}

@keyframes stage-module-status-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.stage-module--hero .stage-module__art {
  color: var(--ps-yellow);
}

.stage-module__link:hover .stage-module__art {
  filter: brightness(1.25) drop-shadow(0 2px 10px rgba(6, 20, 11, 0.6));
  transform: translateY(-2px);
}

.stage-module__link:hover .stage-module__label {
  color: var(--ps-yellow);
}

.stage-module__link:focus-visible {
  border-radius: 14px;
  outline-offset: 4px;
}

.stage-module--slot-1 { animation-delay: 0s; }
.stage-module--slot-2 { animation-delay: -0.9s; }
.stage-module--slot-3 { animation-delay: -1.8s; }
.stage-module--slot-4 { animation-delay: -2.7s; }
.stage-module--slot-5 { animation-delay: -3.6s; }
.stage-module--slot-6 { animation-delay: -4.5s; }
.stage-module--slot-7 { animation-delay: -5.4s; }
.stage-module--slot-8 { animation-delay: -6.3s; }

@keyframes stage-module-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -9px; }
}

@media (min-width: 75rem) {
  .stage-landing {
    align-items: stretch;
    column-gap: clamp(24px, 3vw, 40px);
    display: grid;
    grid-template-columns: minmax(20rem, 25rem) minmax(0, 1fr);
    inset: 0;
    padding: 4px clamp(16px, 3vw, 48px) 16px;
    position: absolute;
  }

  .stage-landing__work {
    justify-content: center;
  }

  .stage-landing .stage-greeting {
    text-align: start;
  }

  .stage-landing .stage-plan {
    justify-content: start;
  }

  .stage-landing .stage-recent {
    padding-block-start: 10px;
  }

  .stage-landing .stage-recent__groups {
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stage-landing .stage-modules {
    display: block;
    min-height: 26rem;
    position: relative;
  }

  .stage-landing .stage-module {
    inset-block-start: var(--module-top);
    inset-inline-start: var(--module-left);
    position: absolute;
    transform: translate(-50%, -50%);
    width: clamp(9rem, 24%, 11rem);
  }

  .stage-module--slot-1 { --module-left: 13%; --module-top: 30%; }
  .stage-module--slot-2 { --module-left: 38%; --module-top: 36%; }
  .stage-module--slot-3 { --module-left: 62%; --module-top: 28%; }
  .stage-module--slot-4 { --module-left: 87%; --module-top: 35%; }
  .stage-module--slot-5 { --module-left: 26%; --module-top: 74%; }
  .stage-module--slot-6 { --module-left: 50%; --module-top: 68%; }
  .stage-module--slot-7 { --module-left: 74%; --module-top: 75%; }
}

@media (max-width: 49.999rem) {
  .stage-modules {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Hockey: coming soon ---------- */

.stage-coming-soon {
  align-items: center;
  color: var(--ps-cream);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  text-shadow: 0 1px 10px rgba(6, 20, 11, 0.7);
}

.stage-coming-soon__kicker {
  color: var(--ps-yellow);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  margin: 0;
  text-transform: uppercase;
}

.stage-coming-soon__line {
  color: var(--ps-cream);
  font-size: clamp(34px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
}

/* ---------- View frame: switching view swaps the stage in place ---------- */

.pitch-site--app #stage_view {
  display: contents;
}

/* The stream a swap carries for the turf is not a slot in the stage's column:
   left to display as a block it takes a gap and nudges the window down. */
.pitch-site--app #stage_view > turbo-stream {
  display: none;
}

.pitch-site--app #stage_view[busy] .stage__overlay,
.pitch-site--app #stage_view[busy] .stage-statpanel,
.pitch-site--app #stage_view[busy] .stage-bench,
.pitch-site--app #stage_view[busy] .pitch-window {
  opacity: 0.5;
  transition: opacity 0.15s ease 0.15s;
}

/* The header inside a window already fades with the window; fading it again
   as an overlay would leave it fainter than the view it heads. */
.pitch-site--app #stage_view[busy] .pitch-window > .stage-band {
  opacity: 1;
}

/* ---------- Window variants ---------- */

.pitch-site--app .pitch-window--stretch {
  flex: 1 1 auto;
}

.pitch-site--app .pitch-window--stretch .pitch-window__body {
  display: flex;
  flex-direction: column;
}

.pitch-site--app .pitch-window--stretch .pitch-window__body > * {
  flex: 1 1 auto;
}

.pitch-site--app .pitch-window--full {
  align-self: stretch;
  flex: 1 1 auto;
  max-width: none;
  min-height: 60dvh;
}

.pitch-site--app .pitch-window--full .pitch-window__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0;
}

.pitch-site--app .pitch-window__body > .auth-flash {
  margin-inline: clamp(16px, 3vw, 32px);
}

.pitch-site--app .pitch-window:not(.pitch-window--full) .pitch-window__body {
  padding-block: clamp(14px, 2.5vh, 24px);
}

.pitch-site--app .pitch-window__bar {
  padding-block: 5px;
}

.pitch-site--app .pitch-window__control {
  height: 22px;
  width: 22px;
}

.pitch-site--app .pitch-window__crumb-link {
  padding-block: 0;
}

.pitch-site--app .pitch-window__control svg {
  height: 10px;
  width: 10px;
}

.pitch-site--app .pitch-window:not(.pitch-window--full) .pitch-window__body > :not(.container, .container-large, .container-small, .auth-flash, .stage-auth-card) {
  padding-inline: clamp(16px, 3vw, 32px);
}

/* ---------- Auth tabs (sign in / create account) ---------- */

.stage-auth-tabs {
  background: var(--ps-paper-shade);
  border: 2px solid var(--ps-ink);
  border-radius: 99rem;
  display: flex;
  gap: 4px;
  margin-inline: auto;
  padding: 4px;
  width: fit-content;
}

.stage-auth-tabs__link {
  border-radius: 99rem;
  color: var(--ps-ink);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 18px;
  text-decoration: none;
}

.stage-auth-tabs__link.is-active {
  background: var(--ps-red);
  color: var(--ps-cream);
}

.stage-auth-card__title {
  font-size: 1.75rem;
  letter-spacing: -0.025em;
  margin: 0;
  text-align: center;
}

/* ---------- Locked CTA on paper ---------- */

.pitch-site--app .locked-section__card {
  background: var(--ps-paper-raised);
  border: 2px solid var(--ps-ink);
  border-radius: 10px;
  box-shadow: var(--ps-hard-shadow);
}

.pitch-site--app .locked-section__title {
  color: var(--ps-ink);
}

/* ---------- Responsive header ---------- */

@media (max-width: 74.999rem) {
  .stage-chip {
    font-size: 12px;
  }

  .stage-palette__label,
  .stage-org-switcher__text {
    display: none;
  }

  .stage-org-switcher__label {
    padding-inline-end: 8px;
  }
}

@media (max-width: 61.999rem) {
  .stage-nav__tab--module {
    display: none;
  }
}

@media (max-width: 49.999rem) {
  .stage-palette__shortcut {
    display: none;
  }

  .stage-menu-card {
    max-width: calc(100vw - 32px);
  }

  .stage-menu-card--grouped {
    grid-template-columns: minmax(0, 1fr);
  }

  .pitch-site--app .stage__header > .stage-brand {
    flex: none;
  }

  .pitch-site--app .stage__sport-pill {
    padding: 7px 12px;
  }
}

/* On a narrow phone the landing's header holds the logo, More, the sport
   toggle, search and the account chip: each gives a little room so the chip
   stays whole. */
@media (max-width: 29.999rem) {
  .pitch-site--app .stage__header--shell {
    gap: 6px;
  }

  .pitch-site--app .stage__header--shell .stage-nav__tab {
    padding-inline: 8px;
  }

  .pitch-site--app .stage__sport-pill {
    font-size: 12px;
    padding: 6px 9px;
  }

  .pitch-site--app .stage__header--shell > .stage-actions {
    gap: 6px;
    min-width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-module,
  .stage-module__status-loading {
    animation: none;
  }
}

/* ---------- Subject header and grouped tabs ----------
   The chrome every subject page wears above its content: a dark strip saying
   who or what the page is about, and under it the views grouped by what they
   show. Both are as wide as the window they sit over. */

/* A subject page keeps one shape whatever its tab shows: the header and tabs
   sit at the top at one width, and the window under them takes the same width
   and the height that is left, so moving between tabs moves nothing. */
.pitch-site--app .stage__overlay:has(.stage-subject, .stage-tabs) {
  --stage-chrome-width: min(100%, 96rem);

  align-self: stretch;
  gap: 0;
}

.pitch-site--app .stage__main:has(.stage__overlay .stage-subject, .stage__overlay .stage-tabs) {
  gap: 8px;
  justify-content: flex-start;
}

.pitch-site--app .stage__main:has(.stage__overlay .stage-subject, .stage__overlay .stage-tabs) .pitch-window:not(.pitch-window--compact, .pitch-window--peek) {
  align-self: center;
  flex: 1 1 auto;
  max-width: min(100%, 96rem);
}

.pitch-site--app .stage-subject,
.pitch-site--app .stage-tabs {
  backdrop-filter: blur(6px);
  background: var(--ps-chrome);
  border: 2px solid var(--ps-ink);
  border-radius: 12px;
  box-shadow: var(--ps-chrome-shadow);
  box-sizing: border-box;
  color: var(--ps-cream);
  margin: 0;
  max-width: var(--stage-chrome-width);
  width: 100%;
}

.pitch-site--app .stage__overlay:has(.stage-tabs) .stage-subject {
  border-end-end-radius: 0;
  border-end-start-radius: 0;
}

.pitch-site--app .stage__overlay:has(.stage-subject) .stage-tabs {
  border-block-start: 0;
  border-start-end-radius: 0;
  border-start-start-radius: 0;
}

/* The subject header and its tabs are one dark band under a window bar, on
   every view of the subject. A page with a window carries the band inside it,
   above the content; a page drawn on the pitch wears the same bar and band as
   a frame of its own (.stage-chrome), so moving between a pitch tab and a
   window tab moves nothing. */
.pitch-site--app .stage-band {
  align-items: stretch;
  background: var(--ps-night);
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  position: relative;
  z-index: 2;
}

.pitch-site--app .pitch-window > .stage-band {
  border-block-end: 2px solid var(--ps-ink);
}

/* A window that carries the band does not pop in: the header has to stand
   still when a tab swaps the view under it. */
.pitch-site--app .pitch-window:has(> .stage-band) {
  animation: none;
}

.pitch-site--app .stage-band::before {
  content: none;
}

.pitch-site--app .stage-band :is(.stage-subject, .stage-tabs) {
  backdrop-filter: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
}

.pitch-site--app .stage-band .stage-subject + .stage-tabs {
  border-block-start: 1px solid var(--ps-line);
}

.pitch-site--app .stage__overlay:has(> .stage-chrome) {
  padding-block-start: 0;
}

.pitch-site--app .stage-chrome {
  background: var(--ps-paper);
  border: 2px solid var(--ps-ink);
  border-radius: 14px;
  box-shadow: 10px 10px 0 rgba(6, 20, 11, 0.7);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-width: var(--stage-chrome-width, min(100%, 96rem));
  overflow: visible;
  pointer-events: auto;
  width: 100%;
}

.pitch-site--app .stage-chrome > .pitch-window__bar {
  border-start-end-radius: 12px;
  border-start-start-radius: 12px;
}

.pitch-site--app .stage-chrome > .stage-band {
  border-end-end-radius: 12px;
  border-end-start-radius: 12px;
}

/* The frame minimised: the panels leave the turf and keep their room, so the
   pitch stays where it is and they come back in place. */
.pitch-site--app #stage_view:has(.stage-chrome--peek) > :not(.stage__overlay, .stage__field),
.pitch-site--app #stage_view:has(.stage-chrome--peek) .stage__field > :not(.stage__turf),
.pitch-site--app #stage_view:has(.stage-chrome--peek) .player-stage > :not(.player-stage__pitch) {
  visibility: hidden;
}


.pitch-site--app .stage-subject {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 8px 16px;
}

.pitch-site--app .stage-subject--scoreboard {
  display: block;
}

.pitch-site--app .stage-subject--scoreboard .stage-scoreboard__meta {
  margin-block-end: 2px;
}

.pitch-site--app .stage-subject--scoreboard .crest {
  height: 2.25rem;
  width: 2.25rem;
}

.pitch-site--app .stage-subject--scoreboard .stage-scoreboard__team-link {
  font-size: clamp(18px, 1.6vw, 24px);
}

.pitch-site--app .stage-subject--scoreboard .stage-scoreboard__score {
  font-size: clamp(20px, 1.9vw, 28px);
}

/* The sides' playing styles are on the Match info tab, so the strip keeps to
   the meta, the score and one line of facts. */
.pitch-site--app .stage-subject--scoreboard .stage-scoreboard__styles:not(.stage-scoreboard__facts) {
  display: none;
}

/* On a short screen or a phone the scoreboard says the same in a tighter
   voice, so the window or the pitch under it keeps room. */
@media (max-height: 50rem), (max-width: 49.999rem) {
  .pitch-site--app .stage-subject--scoreboard {
    padding-block: 8px;
  }

  .pitch-site--app .stage-subject--scoreboard .stage-scoreboard__meta {
    margin-block-end: 2px;
  }

  .pitch-site--app .stage-subject--scoreboard .crest {
    height: 1.9rem;
    width: 1.9rem;
  }

  .pitch-site--app .stage-subject--scoreboard .stage-scoreboard__team-link {
    font-size: 22px;
  }

  .pitch-site--app .stage-subject--scoreboard .stage-scoreboard__score {
    font-size: 26px;
  }

  .pitch-site--app .stage-subject--scoreboard .stage-scoreboard__styles {
    margin-block-start: 2px;
  }
}

.pitch-site--app .stage-subject__crest {
  display: flex;
  flex: none;
}

.pitch-site--app .stage-subject__crest .crest {
  font-size: 0.95rem;
  height: 2.25rem;
  width: 2.25rem;
}

.pitch-site--app .stage-subject__naming {
  flex: 1 1 auto;
  min-width: 0;
  text-align: start;
}

.pitch-site--app .stage-subject__naming .stage-scoreboard__meta {
  margin-block-end: 0;
}

.pitch-site--app .stage-subject__naming .stage-scoreboard__title {
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.2;
}

.pitch-site--app .stage-subject__facts {
  align-items: center;
  color: var(--ps-cream-soft);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 4px 16px;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.pitch-site--app .stage-subject__fact strong {
  color: var(--ps-cream);
}

.pitch-site--app .stage-subject__fact a:not(.form-result) {
  color: inherit;
  text-decoration: none;
}

.pitch-site--app .stage-subject__fact a:not(.form-result):hover,
.pitch-site--app .stage-subject__fact a:not(.form-result):hover strong {
  color: var(--ps-yellow);
}

/* Form chips: cream letters on fills dark enough to read at 4.5:1 */
.pitch-site--app .form-result {
  color: var(--ps-cream);
}

.pitch-site--app .form-result--w {
  background-color: oklch(48% 0.14 147);
}

.pitch-site--app .form-result--d {
  background-color: var(--ps-ink-soft);
}

.pitch-site--app .form-result--l {
  background-color: var(--ps-red);
}

.pitch-site--app .stage-subject__actions {
  flex: none;
}

.pitch-site--app .stage-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 6px 16px;
  position: relative;
  z-index: 3;
}

.pitch-site--app .stage-tabs__groups {
  align-items: center;
  display: flex;
  flex: 1 1 0;
  flex-wrap: wrap;
  gap: 6px 20px;
  min-width: min(100%, 16rem);
}

.pitch-site--app .stage-tabs__group {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.pitch-site--app .stage-tabs__group + .stage-tabs__group {
  border-inline-start: 1px solid var(--ps-cream-soft);
  padding-inline-start: 20px;
}

.pitch-site--app .stage-tabs__label {
  color: var(--ps-cream-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pitch-site--app .stage-tabs__link {
  border-block-end: 2px solid transparent;
  color: var(--ps-cream);
  font-size: 14px;
  padding-block: 3px 1px;
  text-decoration: none;
  white-space: nowrap;
}

.pitch-site--app .stage-tabs__link:hover {
  color: var(--ps-yellow);
}

.pitch-site--app .stage-tabs__link.is-active {
  border-block-end-color: var(--ps-yellow);
  color: var(--ps-yellow);
  font-weight: 600;
}

.pitch-site--app .stage-tabs__toggles {
  align-items: center;
  display: flex;
  flex: none;
  gap: 18px;
  margin-inline-start: auto;
}

.pitch-site--app .stage-tabs__toggles .stage-competitions {
  margin: 0;
}

/* In the tab row and the subject header the competition picker reads as one
   line, so neither is taller than its own content. */
.pitch-site--app :is(.stage-tabs__toggles, .stage-subject__actions) .stage-competitions summary,
.pitch-site--app :is(.stage-tabs__toggles, .stage-subject__actions) .stage-competitions--single {
  align-items: baseline;
  flex-direction: row;
  gap: 8px;
}

.pitch-site--app .stage-tabs__toggles .stage-competitions__menu {
  left: auto;
  right: -10px;
}

/* On phones the tabs scroll sideways in one line, as the header's do. */
@media (max-width: 49.999rem) {
  .pitch-site--app .stage-tabs__groups {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-block-end: 6px;
    scrollbar-color: var(--ps-yellow) rgb(255 251 240 / 0.18);
    scrollbar-width: thin;
  }

  .pitch-site--app .stage-tabs__group {
    flex: none;
    flex-wrap: nowrap;
  }

  .pitch-site--app .stage-tabs__groups.is-scrollable:not(.is-at-end) {
    mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent 100%);
  }

  .pitch-site--app .stage-tabs__groups.is-scrollable:not(.is-at-start):not(.is-at-end) {
    mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 34px), transparent 100%);
  }

  .pitch-site--app .stage-tabs__groups.is-scrollable:not(.is-at-start).is-at-end {
    mask-image: linear-gradient(to right, transparent 0, #000 24px);
  }
}

/* ---------- Studio button ----------
   A secondary button: an ink outline in the window bar, a cream one where a
   page without a window carries it on the turf. */

.pitch-site--app .studio-button {
  align-items: center;
  border: 2px solid currentColor;
  border-radius: 8px;
  color: var(--ps-ink);
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  gap: 7px;
  padding: 2px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.pitch-site--app .studio-button svg {
  flex: none;
  height: 16px;
  stroke-width: 2;
  width: 16px;
}

.pitch-site--app .studio-button:hover {
  background: var(--ps-ink);
  border-color: var(--ps-ink);
  color: var(--ps-cream);
}

/* On a phone the bar keeps its room for the breadcrumbs: the button is its
   glyph, and still says what it does to a screen reader. */
@media (max-width: 49.999rem) {
  .pitch-site--app .pitch-window__actions .studio-button span {
    block-size: 1px;
    clip-path: inset(50%);
    inline-size: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
  }
}

.pitch-site--app .stage__actions {
  display: flex;
  flex: none;
  gap: 8px;
  justify-content: flex-end;
  max-width: min(100%, 96rem);
  order: 1;
  width: 100%;
}

.pitch-site--app .stage__main:has(.stage__actions) #stage_view > :not(.stage__overlay, .stage__actions) {
  order: 2;
}

/* A pitch page's field: its stat panels beside the empty cell it leaves for
   the turf. pitch-inset draws the pitch inside that cell, under the subject
   chrome and clear of the panels. */
.pitch-site--app .stage__field {
  display: contents;
}

.pitch-site--app .stage__turf {
  display: none;
}

@media (min-width: 75rem) and (min-height: 45rem) {
  .pitch-site--app .stage__field {
    align-items: center;
    display: flex;
    flex: 1 1 0;
    gap: 16px;
    max-width: min(100%, 96rem);
    min-height: 0;
    pointer-events: none;
    width: 100%;
  }

  .pitch-site--app .stage__field > .stage-statpanel {
    flex: none;
    max-height: 100%;
    overflow-y: auto;
    position: static;
    transform: none;
  }

  .pitch-site--app .stage__field > .stage-statpanel--right {
    order: 2;
  }

  .pitch-site--app .stage__turf {
    align-self: stretch;
    display: block;
    flex: 1 1 0;
    min-width: 0;
    order: 1;
  }
}

.pitch-site--app .stage__actions .studio-button {
  backdrop-filter: blur(6px);
  background: var(--ps-chrome);
  color: var(--ps-cream);
}

.pitch-site--app .stage__actions .studio-button:hover {
  background: var(--ps-cream);
  border-color: var(--ps-cream);
  color: var(--ps-ink);
}

