.dodgeball-game {
  margin: 0;
  background: #17292c;
  color: #f5f0df;
  font-family: system-ui, sans-serif;
  overflow: hidden;
}
.dodgeball-game canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  outline: none;
}
.dodgeball-game button,
.dodgeball-game select {
  font: inherit;
}
.dodgeball-game button {
  cursor: pointer;
}
.dodgeball-game button:disabled {
  cursor: default;
}
.dodgeball-game :focus-visible {
  outline: 3px solid #ffcf77;
  outline-offset: 4px;
}
#match-lobby {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  color: #291d32;
  font-family: 'Trebuchet MS', sans-serif;
  #view {
    position: absolute;
    inset: 0;
  }
  #view {
    touch-action: none;
    cursor: pointer;
  }
  header {
    position: absolute;
    top: max(22px, env(safe-area-inset-top));
    left: max(24px, env(safe-area-inset-left));
    transform: rotate(-3deg);
    pointer-events: none;
    display: grid;
    justify-items: start;
    filter: drop-shadow(2px 3px 0 #352033);
  }
  .title,
  #player {
    font:
      italic 900 clamp(29px, 4.4vw, 69px)/0.98 Impact,
      'Arial Black',
      sans-serif;
    letter-spacing: -0.025em;
  }
  .title {
    color: #fff5cf;
    background: #da4033;
    padding: 0.12em 0.28em 0.17em;
    border: 3px solid #352033;
  }
  .sport {
    font: bold 11px/1 system-ui;
    letter-spacing: 0.13em;
    color: #422439;
    background: #ffda63;
    padding: 6px 11px;
    margin-left: 13px;
  }
  .sr {
    position: absolute;
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
  #loading {
    position: absolute;
    inset: 47% auto auto 50%;
    background: #fff2bd;
    border: 2px solid;
    padding: 10px 17px;
    width: min(33rem, 82vw);
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    font-weight: 800;
    #locker-tip {
      margin: 0.5em 0 0;
      font-weight: 500;
      line-height: 1.4;
    }
  }
  #dock {
    position: absolute;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 96vw;
    text-align: center;
  }
  button {
    font: inherit;
    cursor: pointer;
    border: 2px solid #382437;
    color: #382437;
    border-radius: 7px;
    box-shadow: 2px 3px 0 #382437;
    touch-action: manipulation;
  }
  button:hover,
  button:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
  }
  button:active {
    translate: 0 2px;
  }
  #navigation,
  .teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }
  #player {
    background: #fff2c8;
    font-size: clamp(26px, 3.4vw, 46px);
    border-radius: 4px;
    transform: rotate(-1.4deg);
    padding: 4px 20px 8px;
    min-width: 155px;
  }
  #hint,
  #back {
    background: #fff9de;
    color: #442a38;
    font-weight: 800;
    font-size: 13px;
    padding: 5px 12px;
    display: table;
    margin: 8px auto 0;
    border-radius: 4px;
  }
  .teams button {
    font:
      italic bold clamp(19px, 2.7vw, 30px) Impact,
      'Arial Black',
      sans-serif;
    min-height: 44px;
    padding: 5px 15px;
  }
  .teams {
    margin-top: 12px;
  }
  .teams button[data-team='Gold'] {
    background: #ffcb3b;
    color: #9e182a;
  }
  .teams button[data-team='Purple'] {
    background: #783ec0;
    color: #fff2ff;
  }
  .teams button[aria-pressed='true'] {
    outline: 4px solid white;
    outline-offset: 2px;
  }
  #teams[hidden],
  #dock[hidden],
  #loading[hidden],
  #hint[hidden] {
    display: none;
  }
  #dock.choosing #brain-dots {
    display: none;
  }
  @media (max-height: 470px) {
    header {
      top: 8px;
      left: 12px;
    }
    .title {
      font-size: 24px;
    }
    .sport {
      font-size: 8px;
    }
    #dock {
      bottom: 8px;
    }
    .teams {
      margin-top: 5px;
    }
    #player {
      font-size: 24px;
    }
    #hint,
    #back {
      margin-top: 4px;
    }
  }

  #join-match {
    margin: 8px 0 0;
    background: #ffda63;
    font-weight: bold;
    padding: 7px 22px;
  }
  #join-match:disabled {
    opacity: 0.5;
  }
  #lobby-status:not(:empty),
  #retry-match {
    background: #fff2c8;
    color: #382437;
    padding: 5px 10px;
    border-radius: 4px;
  }
  #lobby-status:empty {
    display: none;
  }
  #lobby-status {
    margin: 4px auto 0;
    font-size: 13px;
  }
}
#roll-call[data-entry] > :is(.rc-benches, .bench-bottom, #roll-call-load, #rc-repick),
#roll-call[data-entry] .rc-controls > :not(#enter-bench, #open-couch, .bench-home) {
  display: none;
}
#roll-call:not([data-entry]) #open-couch {
  display: none;
}
@media (hover: none) and (pointer: coarse) {
  #open-couch {
    display: none;
  }
}
#couch-setup {
  color: #fff;
  background: #1d2026;
  border: 1px solid #687078;
  border-radius: 12px;
  padding: clamp(15px, 3vw, 32px);
  max-height: 90vh;
  overflow: auto;
}
#couch-setup::backdrop {
  background: #101420b8;
}
#couch-setup form {
  display: grid;
  gap: 14px;
}
.pickup-options label {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 4px 12px 4px 0;
}
#couch-setup h2,
#couch-setup p {
  margin: 0;
}
#couch-setup fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0.4em 0;
  border: 1px solid #59626a;
}
#couch-setup label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#couch-setup select,
#couch-setup button,
#leave-couch {
  font: inherit;
  padding: 5px 9px;
}
#couch-setup footer {
  display: flex;
  justify-content: space-between;
}
#couch-hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#leave-couch {
  position: absolute;
  right: 6px;
  top: 6px;
  pointer-events: auto;
  z-index: 2;
}
.couch-view {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #202527;
  overflow: hidden;
  color: white;
  text-shadow: 0 1px 4px #000;
}
.couch-view strong,
.couch-view .seat-status {
  position: absolute;
  left: 0.6rem;
  background: #101b20cd;
  padding: 4px 8px;
  border-radius: 3px;
}
.couch-view strong {
  top: 0.6rem;
}
.couch-view .seat-status {
  bottom: 0.6rem;
}
#couch-setup {
  width: min(940px, 96vw);
  box-sizing: border-box;
  padding: clamp(16px, 3.2vw, 36px);
  color: #382437;
  background: repeating-linear-gradient(172deg, transparent 0 42px, #eed59c55 43px 45px), #fff0cc;
  border: 2px solid #392b38;
  border-radius: 14px;
  box-shadow: 0 12px 48px #18102066;
}
#couch-setup::backdrop {
  background: #221726cc;
}
#couch-setup form {
  gap: clamp(8px, 1.7vh, 17px);
}
.lineup-heading {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #412b42;
  padding-bottom: 0.65rem;
}
#couch-title {
  font-size: clamp(1.4rem, 3.5vw, 2.45rem);
  letter-spacing: -0.045em;
  line-height: 1;
}
#lineup-ready {
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.couch-seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(152px, 100%), 1fr));
  gap: clamp(6px, 1.5vw, 16px);
}
#couch-setup .couch-seats fieldset {
  display: grid;
  min-width: 0;
  gap: 0;
  margin: 0;
  padding: 0;
  border: 2px solid #443344;
  border-radius: 8px;
  background: #fff8e9;
  overflow: hidden;
}
#couch-setup .seat-card {
  position: relative;
  display: grid;
  width: 100%;
  padding: 0 0 0.6em;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.seat-card img {
  width: 100%;
  height: clamp(80px, 22vh, 178px);
  object-fit: contain;
  background: radial-gradient(ellipse at 50% 90%, #cfa55c, #ffe8b5 75%);
  border-bottom: 2px solid #443344;
}
.seat-card[data-club='purple'] img {
  background: radial-gradient(ellipse at 50% 90%, #9274ae, #e3d6f3 75%);
}
.seat-card strong,
.seat-card span {
  padding: 0.25rem 0.7rem 0;
}
.seat-card strong {
  font-size: 1.1rem;
}
.seat-card span {
  font-size: 0.88rem;
}
.seat-card .kit-action,
.rc-kit-card .kit-action {
  color: #fff7d9;
  font-weight: 800;
  background: linear-gradient(110deg, #392937 0 88%, #624657 88% 91%, #392937 91%);
  border-left: 4px solid #f5bc35;
}
.seat-card .kit-action {
  margin: 0.45rem 0.65rem 0;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.86rem;
  border-radius: 3px;
}
.kit-action::after {
  content: '›';
  font-size: 1.25em;
  line-height: 1;
}
#couch-setup .seat-card:is(:focus, :hover) .kit-action,
.rc-kit-card:is(:focus, :hover) .kit-action {
  background: #ffda62;
  color: #332638;
  border-color: #59394f;
}
#couch-setup select {
  color: #382437;
  background: #fff9e7;
  border: 1px solid #8c7561;
  border-radius: 4px;
}
#couch-setup .couch-seats select {
  max-width: 100%;
  width: 100%;
  border: 0;
  border-radius: 0;
  border-top: 1px solid #c5b291;
  padding: 0.45rem 0.5rem;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}
.lineup-settings {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
}
.lineup-settings summary {
  cursor: pointer;
}
#couch-setup .lineup-settings {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.3rem;
}
#couch-setup .lineup-choice {
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
}
.lineup-choice legend {
  font-weight: 750;
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
}
#couch-setup .lineup-choice:last-child {
  grid-column: 1/-1;
}
#couch-setup .lineup-choice label {
  cursor: pointer;
  min-height: 28px;
  border: 1px solid #937d6a;
  border-radius: 5px;
  background: #fff9ea;
  margin: 2px;
  padding: 2px 7px;
  gap: 0.32rem;
}
.lineup-choice input {
  margin: 0;
  accent-color: #6a377a;
}
#couch-setup .lineup-choice label:has(:checked) {
  border-color: #693b72;
  background: #f0d7f4;
}
#couch-setup .lineup-choice label:focus-within {
  outline: 3px solid #1165a4;
  outline-offset: 1px;
}
#roll-call .rc-bench[data-club='nomads'] {
  background: #78beb0;
  color: #213b38;
}
#roll-call .rc-bench[data-club='purple'] {
  background: #714198;
  color: #fff;
}
#roll-call .rc-bench[data-club='gold'] {
  background: #ffd34f;
  color: #382437;
}
#roll-call .rc-bench[data-club='nomads'] h3 {
  color: #243e3b;
}
#roll-call .rc-bench[data-club='purple'] h3 {
  color: white;
}
#roll-call .rc-bench[data-club='gold'] h3 {
  color: #922837;
}
.bench-invite {
  pointer-events: auto;
  margin-inline-start: auto;
  display: grid;
  gap: 3px;
  max-width: 16rem;
}
.bench-invite:has(#copy-invite[hidden]) {
  display: none;
}
.bench-invite button {
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  border-radius: 5px;
  border: 1px solid #573a47;
  background: #ffdc74;
  color: #352533;
  padding: 0.4em 0.75em;
}
#roll-call[data-pad-nav] .bench-invite :focus {
  outline: 3px solid #1165a4;
}
.lineup-guide {
  font-size: 0.83rem;
  line-height: 1.4;
}
#couch-setup [role='status']:empty {
  display: none;
}
#couch-setup footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid #af936c;
  padding-top: 0.65rem;
}
#couch-setup footer button {
  background: #fff8e9;
  color: #382437;
  border: 1.5px solid #49354b;
  border-radius: 5px;
  font-weight: 700;
  padding: 0.55em 0.9em;
}
#couch-setup footer [data-back] {
  margin-right: auto;
}
#couch-setup footer [data-local] {
  background: #ffd34f;
}
#couch-setup footer :disabled {
  opacity: 0.55;
}
#couch-setup[data-pad-nav] :focus,
#couch-setup :focus-visible {
  outline: 4px solid #1165a4;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 6px #fff;
}
#couch-setup [data-adjusting='true'] {
  background: #d4ebfa;
}
@media (max-width: 600px) {
  .couch-seats {
    grid-template-columns: 1fr 1fr;
  }
  .seat-card img {
    height: clamp(64px, 15vh, 116px);
  }
}

#roll-call[data-entry] {
  justify-content: center;
  align-items: center;
}
#roll-call[data-entry] .rc-controls {
  margin-top: 0;
}
#enter-bench {
  min-height: 44px;
}
#brain-dots button:disabled,
#player:disabled,
#teams button[data-team]:disabled {
  opacity: 0.45;
  filter: grayscale(1);
}
/* Roll call: the 4 v 4 lineup between Start and the gym. */
#roll-call {
  --blue: #ffd64a;
  --red: #cb9aff;
  position: fixed;
  z-index: 5;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.6vh, 16px);
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden auto;
  color: #382437;
  background: repeating-linear-gradient(172deg, transparent 0 42px, #e8b85130 43px 45px), #fff0c8;
  transition: opacity 0.5s ease;
}
.rc-head {
  position: static;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.rc-kicker {
  margin: 0 0 4px;
  color: #b7c7bd;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#roll-call-title {
  margin: 0;
  font-size: clamp(22px, 4vmin, 40px);
  letter-spacing: -0.04em;
  outline: none;
}
#roll-call-status {
  margin: 0;
  max-width: 46ch;
  text-align: right;
  font-size: clamp(12px, 1.8vmin, 15px);
  color: #e8c578;
}
#roll-call-load {
  width: 100%;
  height: 6px;
  accent-color: #e8c578;
  flex: none;
}
.rc-benches {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(8px, 2vw, 32px);
}
.rc-bench {
  --team: var(--blue);
  min-width: 0;
}
.rc-bench[data-team='1'] {
  --team: var(--red);
}
.rc-bench h3 {
  margin: 0 0 6px;
  color: var(--team);
  font-size: clamp(11px, 1.8vmin, 14px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.rc-list {
  list-style: none;
  margin: 0 auto;
  padding: 0 0 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(4px, 1vw, 14px);
  max-width: 760px;
  border-bottom: 5px solid var(--team);
  border-radius: 0 0 4px 4px;
}
.rc-vs {
  font:
    700 clamp(18px, 3vmin, 30px) Georgia,
    serif;
  color: #e8c578;
  letter-spacing: 0.1em;
}
.rc-kit-card {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 3px;
  font: inherit;
  text-align: inherit;
  color: inherit;
  border: 2px solid #382437;
  border-radius: 8px;
  background: #ffedc6;
  cursor: pointer;
}
.rc-kit-card .kit-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  padding: 3px 2px;
  font-size: clamp(10px, 1.4vmin, 14px);
  line-height: 1.15;
}
.rc-kit-card:focus,
#couch-setup .seat-card:focus {
  outline: 3px solid #1165a4;
  outline-offset: 1px;
}
.rc-tile .rc-stage,
.rc-tile .rc-info {
  display: block;
}

.rc-tile {
  --team: var(--blue);
  min-width: 0;
  text-align: center;
  transition: transform 0.4s ease;
}
.rc-tile[data-team='1'] {
  --team: var(--red);
}
.rc-stage {
  position: relative;
  width: 100%;
  max-height: 46vh;
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  container-type: size;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--team) 24%, transparent),
    transparent 70%
  );
  overflow: hidden;
}
.rc-stage .rc-uniform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rc-tile.is-you .rc-stage {
  box-shadow: 0 0 0 2px #efd08c;
}
.rc-info {
  margin-top: 5px;
  min-width: 0;
}
.rc-name {
  display: block;
  overflow-wrap: anywhere;
  color: var(--club-ink, #fff3cc);
  background: #231c29;
  border-radius: 4px;
  padding: 2px 3px;
  font-size: clamp(15px, 2.5vmin, 24px);
  font-weight: 750;
  line-height: 1.1;
}
.dodgeball-game [data-club='gold'] {
  --club-ink: #ffda65;
}
.dodgeball-game [data-club='purple'] {
  --club-ink: #dbb4ff;
}
.dodgeball-game [data-club='nomads'] {
  --club-ink: #74e3d1;
}
.rc-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px;
  margin-top: 3px;
}
.rc-tag {
  padding: 1px 5px;
  border-radius: 3px;
  font-size: clamp(8px, 1.4vmin, 11px);
  letter-spacing: 0.06em;
  background: #ffffff1f;
  color: #dfe7de;
}
.rc-tag-human {
  background: #f5f0df;
  color: #112629;
}
.rc-tag-host {
  background: #e8c578;
  color: #112629;
}
.rc-tag-you {
  background: #efd08c;
  color: #112629;
  outline: 1px solid #112629;
}
#rc-repick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  flex: none;
}
#rc-repick .match-brain {
  min-height: 0;
  width: 78px;
  padding: 4px;
}
#rc-repick .match-brain img {
  width: 44px;
  height: 44px;
}
.rc-controls {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.rc-controls select,
#leave-lobby,
#lobby-mute {
  color: #f5f0df;
  border: 1px solid #ffffff55;
  background: #12282bd9;
  border-radius: 7px;
  padding: 10px 14px;
  min-height: 44px;
}
.rc-controls select:disabled {
  opacity: 0.6;
}
#start-round {
  border: 0;
  border-radius: 6px;
  background: #e8c578;
  color: #16282a;
  padding: 12px 22px;
  min-height: 44px;
  font-weight: 700;
}
#start-round:disabled {
  opacity: 0.45;
}

/* The match bench uses the locker signs, striped gym floor and team jersey colours. */
.dodgeball-game canvas.hoe-crest {
  position: static;
  display: inline-block;
  vertical-align: middle;
  width: 2em;
  height: 2em;
  margin-right: 0.35em;
}
#roll-call .rc-kicker {
  color: #702b38;
}
#roll-call-title,
.bench-bottom h3,
.rc-bench h3 {
  font:
    italic 900 clamp(24px, 3vw, 44px)/1 Impact,
    'Arial Black',
    sans-serif;
}
#roll-call-title {
  display: inline-block;
  background: #b62d30;
  color: #fff2c8;
  padding: 4px 14px 7px;
  transform: rotate(-2deg);
  border: 2px solid #382437;
  box-shadow: 3px 3px #382437;
}
#roll-call-status {
  color: #512738;
  font-weight: bold;
}
#roll-call .rc-benches {
  flex: 0 0 auto;
  gap: clamp(5px, 1.5vw, 22px);
  align-items: stretch;
}
.rc-bench {
  padding: 8px clamp(8px, 1.4vw, 18px);
  border: 2px solid #382437;
  border-radius: 7px;
  box-shadow: 3px 3px #382437;
  background: #ffd34f;
}
.rc-bench[data-team='1'] {
  background: #714198;
  color: white;
}
#roll-call .rc-bench h3 {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #922837;
  letter-spacing: 0;
  text-transform: none;
  font-size: clamp(18px, 2.5vw, 34px);
  min-height: 1.7em;
}
#roll-call .rc-bench[data-team='1']:not([data-club='nomads'], [data-club='gold']) h3 {
  color: white;
}
#roll-call .rc-bench .hoe-crest {
  width: 1.6em;
  height: 1.6em;
}
.rc-vs {
  align-self: center;
  color: #a12e39;
  font:
    bold italic 25px Impact,
    sans-serif;
}
#roll-call .rc-stage {
  height: clamp(70px, 23vh, 200px);
  max-height: none;
}
#roll-call .rc-tag {
  color: #382437;
  background: #fff2ca;
}
#roll-call .rc-tag-you {
  color: #fff;
  background: #9b2839;
}
.bench-bottom {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 12px;
  flex: 1 0 auto;
  align-content: start;
}
.bench-bottom section {
  padding: 10px 14px 12px;
  border: 2px solid #382437;
  border-radius: 6px;
  background: #fffae9;
  min-width: 0;
}
.bench-bottom h3 {
  margin: 0;
  color: #872739;
  font-size: clamp(20px, 2.5vw, 30px);
}
.bench-rules p {
  margin: 8px 0;
  font-size: 14px;
  max-width: 58ch;
}
.bench-rules summary {
  cursor: pointer;
  font-weight: bold;
}
#bench-messages {
  margin: 6px 0;
  padding: 0;
  list-style: none;
  height: clamp(52px, 11vh, 120px);
  overflow: auto;
  overflow-wrap: anywhere;
}
#bench-messages strong {
  color: #8e2430;
}
#bench-messages strong[data-side='1'] {
  color: #66359c;
}
#bench-form {
  display: flex;
  gap: 5px;
}
#bench-form input {
  min-width: 0;
  flex: 1;
  border: 2px solid #382437;
  border-radius: 4px;
  padding: 8px;
  font: inherit;
}
#bench-feedback {
  font-size: 13px;
  color: #802637;
}
#roll-call .rc-controls {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: auto;
  background: #fff2c8;
  padding: 8px;
  border-top: 2px solid #382437;
  flex-wrap: wrap;
}
#roll-call button,
#roll-call select {
  background: #fff8db;
  color: #382437;
  border: 2px solid #382437;
  box-shadow: 2px 2px #382437;
  border-radius: 5px;
  font-weight: bold;
  padding: 7px 12px;
  cursor: pointer;
}
#roll-call #start-round,
#bench-form button {
  background: #ffd246;
}
#roll-call button:disabled {
  opacity: 0.55;
  cursor: default;
}
@media (max-width: 700px) {
  .bench-bottom {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #roll-call .rc-stage {
    height: clamp(46px, 8vh, 80px);
  }
  #roll-call .rc-controls {
    gap: 6px;
  }
  #roll-call-title {
    font-size: 26px;
  }
}
/* Portrait: stack the benches. Short landscape phones: keep both benches in one row. */
@media (max-aspect-ratio: 1 / 1) {
  .rc-benches {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 6px;
  }
  .rc-vs {
    text-align: center;
    line-height: 1;
  }
  .rc-stage {
    max-height: 22vh;
  }
  #roll-call-status {
    text-align: left;
  }
  .rc-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
@media (max-height: 520px) and (min-aspect-ratio: 1 / 1) {
  #roll-call {
    gap: 4px;
  }
  .rc-kicker,
  .rc-bench h3 {
    display: none;
  }
  .rc-head {
    align-items: center;
  }
  .rc-stage {
    max-height: calc(100vh - 150px);
  }
  .rc-controls {
    flex-wrap: nowrap;
  }
  .rc-controls select,
  #leave-lobby,
  #start-round {
    padding: 6px 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #roll-call,
  .rc-tile {
    transition: none;
  }
}

[hidden] {
  display: none !important;
}

.locker-home {
  position: fixed;
  z-index: 6;
  top: max(12px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  background: #fff2c8;
  color: #382437;
  border: 2px solid;
  border-radius: 6px;
  padding: 9px 14px;
  font-weight: bold;
  text-decoration: none;
}
.in-match .locker-home,
.in-couch-match .locker-home {
  display: none;
}
body:has(#roll-call:not([hidden])) .rc-head {
  padding-right: 76px;
}
.player-name {
  display: grid;
  gap: 4px;
  margin: 10px auto 0;
  width: min(100%, 21rem);
  padding: 6px 10px 8px;
  border-radius: 6px;
  background: #fff2c8;
  text-align: left;
  font-size: 15px;
  font-weight: bold;
}
#display-name {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 6px 12px;
  border: 2px solid #382437;
  border-radius: 5px;
  font: 600 clamp(18px, 2vw, 22px)/1.25 system-ui;
}
.confirm-key {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  min-width: 1.6em;
  padding: 0.12em 0.32em;
  border: 2px solid currentColor;
  border-radius: 1em;
  font: bold 14px/1.2 system-ui;
}
.confirm-key:empty,
#dock.choosing #player .confirm-key,
#dock:has([aria-pressed='true']) .team-confirm {
  display: none;
}
@media (not (any-pointer: coarse)) {
  #brain-dots:not(:focus-within) {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    overflow: hidden;
  }
}

#brain-dots {
  display: flex;
  justify-content: center;
  margin: 2px auto;
}
#brain-dots button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
#brain-dots button::after {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  background: #fff2c8;
  border: 2px solid #382437;
  border-radius: 50%;
}
#brain-dots button[aria-current='true']::after {
  background: #ffbd13;
  transform: scale(1.3);
}

@media (min-aspect-ratio: 13/10) {
  #match-lobby #dock.choosing {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    transform: none;
    max-width: 35vw;
    background: #fff2c8;
    padding: 8px;
    border: 2px solid #382437;
    border-radius: 7px;
  }
  #dock.choosing .teams {
    flex-wrap: wrap;
    gap: 5px;
  }
  #dock.choosing .teams button {
    font-size: clamp(14px, 1.7vw, 24px);
  }
}

#match-lobby #player {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  max-width: 100%;
}
#player-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.confirm-key:not(:empty) {
  flex: none;
  line-height: 1;
  letter-spacing: 0;
  font-style: normal;
  padding: 0.28em 0.38em;
}
.confirm-key[data-family='xbox'],
.confirm-key[data-family='switch'],
.confirm-key[data-family='playstation'] {
  border-radius: 50%;
  min-width: 1.8em;
  min-height: 1.8em;
  align-content: center;
  background: #263a32;
  color: white;
}
.confirm-key[data-family='xbox'] {
  background: #17672f;
}
#dock:not(.choosing) #player .confirm-key:not(:empty) {
  display: inline-grid;
}
#control-directions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 5px 12px;
  padding: 0;
  margin: 8px 0;
  list-style: none;
}
#control-directions li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  line-height: 1.3;
}
#control-directions kbd[data-family=''] {
  flex: none;
  background: #fff1ca;
  border: 1px solid #735637;
  border-bottom-width: 3px;
  border-radius: 5px;
  padding: 3px 6px;
  font: 700 13px/1.1 system-ui;
}
#control-directions .throw-tip {
  grid-column: 1/-1;
  font-size: 13px;
}
.bench-home {
  font-weight: bold;
  color: #382437;
  padding: 6px 10px;
}
body:has(#roll-call:not([hidden])) > .locker-home {
  display: none;
}
#roll-call[data-pad-nav] :focus,
#roll-call :focus-visible,
#roll-call [data-adjusting='true'] {
  outline: 3px solid #275fc0;
  outline-offset: 2px;
}
#roll-call [data-adjusting='true'] {
  background: #ffdf65;
}
.rc-rotate {
  display: none;
}
@media (pointer: coarse) and (orientation: portrait) and (max-width: 700px) {
  #roll-call:not([data-entry]) > :not(.rc-rotate) {
    display: none;
  }
  #roll-call:not([data-entry]) .rc-rotate {
    display: block;
    margin: auto;
    max-width: 20ch;
    text-align: center;
    font-size: clamp(24px, 6vw, 36px);
    font-weight: 700;
    text-wrap: balance;
  }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 700px) {
  #roll-call .rc-controls {
    position: static;
  }
}

#court-menu,
#handle-keys {
  width: min(28rem, 93vw);
  max-height: 90dvh;
  overflow: auto;
  box-sizing: border-box;
  color: #341e28;
  background: #fff0c8;
  border: 3px solid #472739;
  border-radius: 14px;
  padding: 18px;
}
#court-menu::backdrop,
#handle-keys::backdrop {
  background: #130c1bad;
}
#court-menu[open] {
  pointer-events: auto;
  display: grid;
  gap: 12px;
}
#court-menu :is(h2, ul),
#handle-keys h2 {
  margin: 0;
}
#court-menu button,
#court-menu summary,
#handle-keys button {
  min-height: 34px;
  cursor: pointer;
}
#court-menu :focus-visible,
#handle-keys :focus,
#teams :focus {
  outline: 3px solid #247cc9;
  outline-offset: 2px;
}
#handle-keys output {
  display: block;
  min-height: 1.8em;
  font: 700 22px system-ui;
  overflow-wrap: anywhere;
}
.key-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 3px;
}
.key-grid button {
  padding: 0;
  font: 700 14px system-ui;
}
#handle-keys footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}
#match-menu-toggle {
  margin-left: auto;
  pointer-events: auto;
  width: 44px;
  height: 38px;
  background: #152329e6;
  color: white;
  border: 1px solid #fff6;
  border-radius: 8px;
  font-size: 23px;
  line-height: 1;
}
body.dodgeball-game .phone-settings-toggle {
  display: none;
}
body.using-pad #match-actions [data-action]:not([data-action='signature']),
body.using-pad .phone-controls {
  display: none !important;
}
body.using-pad .rc-controls :focus {
  outline: 3px solid #247cc9;
  outline-offset: 2px;
}
#court-menu .audio-setting {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: inherit;
}
#court-menu :is(label, summary) {
  pointer-events: auto;
}
.court-directions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 6px;
  list-style: none;
  padding: 6px 0;
}
.court-directions li {
  display: flex;
  gap: 8px;
  align-items: center;
}
.court-directions .throw-tip {
  grid-column: 1/-1;
}
kbd.back-key:empty {
  display: none;
}
body.dodgeball-game kbd[data-family]:where(:not([data-family='']):not(:empty)) {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  box-sizing: border-box;
  flex: none;
  width: 2em;
  height: 2em;
  min-width: 0;
  min-height: 0;
  padding: 0 0.1em;
  border-radius: 50%;
  border: 2px solid #687079;
  background: radial-gradient(at 35% 22%, #51575d, #20242a 72%);
  box-shadow:
    inset 0 1px 1px #ffffff80,
    0 2px 1px #14151b;
  color: var(--glyph-ink, #fff);
  font: 800 14px/1 system-ui;
  letter-spacing: 0;
  text-shadow: 0 1px #0009;
}
kbd[data-family='xbox'][data-button='A'],
kbd[data-button='Triangle'] {
  --glyph-ink: #74e980;
}
kbd[data-family='xbox'][data-button='B'],
kbd[data-button='Circle'] {
  --glyph-ink: #ff726a;
}
kbd[data-family='xbox'][data-button='X'],
kbd[data-button='Cross'] {
  --glyph-ink: #79bcff;
}
kbd[data-family='xbox'][data-button='Y'] {
  --glyph-ink: #ffda64;
}
kbd[data-button='Square'] {
  --glyph-ink: #ff9cd3;
}
body.dodgeball-game kbd[data-family][data-shape='bumper'] {
  border-radius: 75% 75% 28% 28%;
  width: 2.65em;
  height: 1.55em;
}
body.dodgeball-game kbd[data-family][data-shape='trigger'] {
  border-radius: 7px 7px 48% 48%;
  width: 2.1em;
  height: 2.2em;
}
body.dodgeball-game kbd[data-family][data-shape='stick'] {
  border: 4px double #999fa6;
  box-shadow: 0 2px 0 2px #14171b;
}
body.dodgeball-game kbd[data-family][data-shape='menu'] {
  border-radius: 40%;
  width: 1.7em;
  height: 1.4em;
}

.handle-hint {
  display: none;
}
.using-pad .player-name .handle-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.using-pad #teams [data-team]:not(:focus) kbd.team-confirm {
  display: none;
}
.using-pad #teams [data-team]:focus kbd.team-confirm {
  display: inline-grid;
}
#court-menu .difficulty-setting {
  color: #342438;
}

body.dodgeball-game kbd[data-button^='Button '] {
  width: auto;
  min-width: 2.6em;
  border-radius: 6px;
  padding: 0 0.35em;
}

#court-menu [data-menu-page]:not([hidden]) {
  display: grid;
  gap: 9px;
}
#court-menu [hidden] {
  display: none;
}
#court-menu [data-menu-page='Start menu'] button {
  min-height: 44px;
  text-align: left;
  padding-inline: 16px;
}
#court-menu #leave-match {
  border-top: 2px solid #b89675;
}
.using-pad #court-menu button:focus {
  outline: 3px solid #166bb3;
  outline-offset: 2px;
}
.pad-menu-hints {
  display: none;
}
.using-pad .pad-menu-hints {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

[data-pad-list] {
  display: block;
  max-width: 36ch;
  overflow-wrap: anywhere;
}
[data-pad-list][hidden] {
  display: none;
}
