/* Shared menu hierarchy. Gameplay HUD remains in style.css. */
:root {
  --menu-border: #355163;
  --menu-secondary: #b4c9d8;
}
.screen.center:not(.hidden) {
  padding: 96px 24px 48px;
}
.screen .panel {
  background: linear-gradient(125deg, #102838, #0b1a28 65%);
  border: 1px solid var(--menu-border);
  border-top: 3px solid #65d3f5;
  border-radius: 8px;
  box-shadow: 0 20px 70px #0008;
  padding: 24px;
  max-height: calc(100dvh - 144px);
  scrollbar-width: thin;
  scrollbar-color: #658397 #0b1a28;
  scroll-padding: 90px 12px 16px;
}
.screen .panel :is(button, select, input:not([type="checkbox"]), summary),
.play-sheet button {
  min-height: 44px;
  border-radius: 6px;
  font-size: 14px;
  letter-spacing: 0.015em;
}
.screen .panel button:hover,
.play-sheet button:hover {
  transform: none;
}
.screen .panel :is(button, select, input, summary):focus-visible {
  outline: 3px solid #ffe09c;
  outline-offset: 2px;
}
.screen .panel button:disabled {
  opacity: 0.55;
}
.screen .panel p {
  color: var(--menu-secondary);
  font-size: 15px;
  line-height: 1.55;
}
.screen .panel h2 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0.01em;
}
.screen .panel h3 {
  margin: 0 0 10px;
  line-height: 1.25;
}
.screen .panel .eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  margin: 0 0 5px;
  color: #8ad9f3;
}
.screen .panel .menu-header {
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky;
  top: -24px;
  z-index: 5;
  margin: -24px -24px 22px;
  padding: 16px 24px;
  background: #0d2130;
  border-bottom: 1px solid var(--menu-border);
}
.screen .panel .menu-header h2 {
  margin: 0;
}
.screen .panel .menu-header .back {
  position: static;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 14px;
  min-width: 84px;
  min-height: 44px;
  color: #d9f4ff;
  background: #173449;
  border: 1px solid #56798e;
  font-size: 14px;
  line-height: 22px;
}
.menu-header-title {
  min-width: 0;
}
.screen .panel .panel-note {
  color: var(--menu-secondary) !important;
  font-size: 13px !important;
  margin: 18px 0 0;
  padding-top: 14px;
}
.screen .panel [role="status"]:empty {
  display: none;
}
.screen .mode-panel {
  width: min(960px, 100%);
}
.menu-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.screen .panel .menu-section-heading h3 {
  font:
    700 16px/1.4 Inter,
    Arial,
    sans-serif;
  margin: 0;
  color: #edf6ff;
}
.menu-section-heading > span {
  color: var(--menu-secondary);
  font-size: 13px;
}
#mode .mode-panel .mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#mode .mode-panel .mode-card {
  min-height: 145px;
  padding: 18px 42px 18px 18px;
  border: 1px solid #4b7187;
  border-radius: 8px;
  background: linear-gradient(115deg, #183c51, #102839);
}
#mode .mode-panel .mode-card::before {
  display: none;
}
#mode .mode-panel .mode-card:hover {
  background: #204960;
  border-color: #8adeff;
}
#mode .mode-panel .mode-card .mode-number {
  display: block;
  float: none;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: #95def7;
}
#mode .mode-panel .mode-card strong {
  margin: 9px 0 6px;
  font-size: 29px;
  font-style: normal;
  line-height: 1.1;
}
#mode .mode-panel .mode-card p {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
}
#mode .mode-panel .mode-card .card-arrow {
  top: 20px;
  right: 18px;
  font-size: 24px;
}
#mode .mode-panel .mode-card-secondary {
  background: #102633;
  min-height: 130px;
  border-color: #355366;
}
.menu-group {
  margin-top: 22px;
}
#mode .mode-panel .arena-picker {
  gap: 12px;
}
#mode .mode-panel .arena-option {
  border-radius: 6px;
  overflow: hidden;
}
#mode .mode-panel .arena-option img {
  height: 80px;
  object-fit: cover;
}
#mode .mode-panel .arena-option strong {
  font-size: 22px;
}
#mode .mode-panel .arena-option small {
  font-size: 11px;
}
#mode .mode-panel .arena-option[aria-pressed="true"] {
  outline: 2px solid #8adeff;
  outline-offset: 2px;
}
.screen .panel .setting-row {
  margin: 0;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0.015em;
  border-bottom: 1px solid #355163;
  background: #132c3d80;
}
.screen .panel .setting-row:first-child {
  border-radius: 8px 8px 0 0;
}
.screen .panel .setting-row:last-of-type {
  border-radius: 0 0 8px 8px;
}
.screen .panel .setting-row span {
  float: none;
}
.screen .panel .setting-row strong {
  display: block;
}
.screen .panel .setting-row small {
  display: block;
  font-size: 12px;
  color: var(--menu-secondary);
  margin-top: 4px;
  max-width: 390px;
  letter-spacing: 0;
}
.screen .panel .setting-row select {
  flex: 0 1 300px;
  width: 300px;
  min-width: 0;
  background: #081a29;
  border: 1px solid #57788d;
  color: #edf6ff;
  padding: 10px 12px;
  height: auto;
}
.screen .panel .setting-row input[type="range"] {
  flex: 0 1 260px;
  width: 260px;
  accent-color: #70d7fa;
}
.practice-options .setting-row {
  border: 1px solid #355163;
  border-radius: 8px !important;
}
#info.center {
  padding: 96px 24px 48px;
}
#info .info-panel {
  width: min(1100px, 100%);
  height: min(760px, 100%);
  max-height: 100%;
  padding: 24px;
}
#info .menu-header {
  flex: 0 0 auto;
  position: relative;
  top: auto;
}
#info-close {
  position: static;
}
#info-body {
  padding: 3px;
  scroll-padding: 12px;
}
#info.tabbed-info #info-body {
  overflow: hidden;
}
#team-tabs,
#settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}
#info .menu-tabs {
  flex-direction: row;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid #355163;
  border-radius: 8px;
  background: #071725;
  overflow-x: auto;
}
#info .menu-tabs [role="tab"] {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  text-align: center;
  font-size: 13px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 5px;
}
#info .menu-tabs [aria-selected="true"] {
  background: #82ddfa;
  color: #062033;
  box-shadow: none;
}
#info [role="tabpanel"] {
  flex: 1;
  padding: 3px 10px 16px 3px;
  scroll-padding: 12px;
}
#info [role="tabpanel"] > h3 {
  font-size: 21px;
}
#info .career-section {
  padding: 20px 0;
}
#info .career-caption,
#info .career-note,
#info .career-rating-detail {
  font-size: 14px;
  line-height: 1.5;
}
#info .career-name h2 {
  font-size: 32px;
  overflow-wrap: anywhere;
}
#info .career-identity {
  border-radius: 8px;
}
#info .career-metric strong {
  font-size: 30px;
}
#info .career-stats {
  margin: 16px 0;
}
#info .celebration-browser {
  gap: 16px;
}
#info .celebration-preview {
  border-radius: 8px;
}
#info .celebration-choice {
  padding: 12px;
}
#info .celebration-choice strong {
  font-size: 15px;
}
#info .celebration-choice small {
  font-size: 13px;
  line-height: 1.4;
}
#info .account-edit {
  padding: 16px;
  border: 1px solid #355163;
  border-radius: 8px;
  background: #102737;
}
#info .account-edit input {
  font-size: 16px;
}
#info details {
  margin-top: 18px;
  border-top: 1px solid #355163;
  padding-top: 8px;
}
#info summary {
  padding: 12px 0;
  font-size: 14px;
  cursor: pointer;
  color: #cceeff;
}
#info .training-grid {
  gap: 16px;
}
#info .training-grid article {
  background: #112b3b;
  border: 1px solid #35576c;
  border-radius: 8px;
  padding: 18px;
}
#info .training-grid h3 {
  font-size: 23px;
}
#info .training-grid article > p {
  min-height: 46px;
}
#info .training-grid button {
  padding: 12px;
  font-size: 14px;
  text-align: center;
  background: #1c3d52;
}
#info .training-grid small {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 400;
  color: #c4dbea;
}
#online .panel {
  width: min(740px, 100%);
}
#online .join-row {
  gap: 12px;
}
#online input {
  font-size: 16px;
  border: 1px solid #56798e;
  border-radius: 6px;
  min-width: 0;
}
#online .or {
  font-size: 12px;
  margin: 20px 0 12px;
}
#online .lobby-roster {
  gap: 12px;
}
#online .lobby-player {
  border-radius: 8px;
  border: 1px solid #355163;
  padding: 14px;
}
#pause .panel {
  width: min(450px, 100%);
}
#pause .panel > button {
  min-height: 48px;
  padding: 12px 16px;
}
#pause .panel > h2,
#final .panel > h2 {
  margin: 8px 0 20px;
}
#pause #quit {
  margin-top: 24px;
  background: transparent;
  border-color: #688394;
}
#coin .button-row {
  gap: 12px;
}
#coin .button-row button {
  text-align: center;
}
#final .panel {
  width: min(600px, 100%);
}
#final #final-score {
  font-size: clamp(44px, 7vw, 72px);
}
#play-select .play-sheet {
  border-radius: 8px;
  border: 1px solid #355163;
  border-top: 3px solid #70d7fa;
}
#play-select .sheet-header h2 {
  margin: 4px 0 8px;
}
#play-select .sheet-header p,
#play-select .route-key {
  font-size: 14px;
  line-height: 1.45;
}
#play-select .selection-tips {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
#play-select .selection-tips input {
  width: 20px;
  height: 20px;
  accent-color: #70d7fa;
}
#play-select #special-teams {
  gap: 10px;
}
@media (max-width: 700px) {
  .screen.center:not(.hidden),
  #info.center {
    padding: 76px 12px 32px;
  }
  .screen .panel {
    max-height: calc(100dvh - 108px);
    padding: 16px;
  }
  .screen .panel .menu-header {
    margin: -16px -16px 16px;
    padding: 12px 16px;
    top: -16px;
    gap: 12px;
  }
  .screen .panel .menu-header h2 {
    font-size: 27px;
  }
  .screen .panel .menu-header .eyebrow {
    font-size: 10px;
  }
  .screen .panel .menu-header .back {
    min-width: 76px;
    padding: 10px;
  }
  #info .info-panel {
    padding: 16px;
    height: 100%;
  }
  #info .menu-header {
    top: auto;
  }
  #info .menu-tabs [role="tab"] {
    flex: 1 0 auto;
    font-size: 12px;
    padding: 10px 12px;
  }
  #team-tabs,
  #settings-tabs {
    gap: 12px;
  }
  .menu-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  #mode .mode-panel .mode-grid {
    gap: 10px;
  }
  #mode .mode-panel .mode-card {
    min-height: 155px;
    padding: 14px;
  }
  #mode .mode-panel .mode-card strong {
    font-size: 25px;
    margin-top: 8px;
  }
  #mode .mode-panel .mode-card .card-arrow {
    position: static;
    float: right;
    font-size: 18px;
    margin-top: 6px;
  }
  #mode .mode-panel .mode-card p {
    font-size: 13px;
  }
  #mode .mode-panel .mode-card .mode-number {
    font-size: 9px;
  }
  #mode .mode-panel .arena-picker {
    gap: 8px;
  }
  #mode .mode-panel .arena-option img {
    height: 64px;
  }
  #mode .mode-panel .arena-option strong {
    font-size: 18px;
  }
  .screen .panel .setting-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
  }
  .screen .panel .setting-row :is(select, input[type="range"]) {
    flex: none;
    width: 100%;
    font-size: 16px;
  }
  #info .celebration-browser {
    grid-template-columns: 1fr;
  }
  #info .celebration-preview {
    height: 180px;
  }
  #info .training-grid {
    grid-template-columns: 1fr;
  }
  #info .training-grid article > p {
    min-height: 0;
  }
  #info .training-grid article > div {
    flex-wrap: nowrap;
  }
  #info .training-grid button {
    min-width: 0;
    padding: 10px 6px;
    font-size: 13px;
  }
  #info .training-grid small {
    font-size: 11px;
  }
}
@media (max-width: 360px) {
  #mode .mode-panel .mode-grid {
    grid-template-columns: 1fr;
  }
  #mode .mode-panel .mode-card {
    min-height: 0;
  }
  #mode .mode-panel .mode-card .card-arrow {
    position: absolute;
    top: 18px;
    right: 14px;
  }
  #mode .mode-panel .arena-picker {
    grid-template-columns: 1fr;
  }
}
@media (max-height: 500px) {
  .screen.center:not(.hidden),
  #info.center {
    padding: 64px 12px 24px;
  }
  .screen .panel {
    max-height: calc(100dvh - 88px);
    padding: 16px;
  }
  .screen .panel .menu-header {
    margin: -16px -16px 14px;
    padding: 10px 16px;
    top: -16px;
  }
  .screen .panel .menu-header h2 {
    font-size: 26px;
  }
  #info .info-panel {
    padding: 16px;
    height: 100%;
  }
  #info .menu-header {
    top: auto;
  }
  #info .menu-header .eyebrow {
    display: none;
  }
  #info .menu-tabs {
    padding: 2px;
  }
  #team-tabs,
  #settings-tabs {
    gap: 10px;
  }
  #info .menu-tabs [role="tab"] {
    padding: 8px 12px;
  }
  #coin .coin-object {
    width: 80px;
    height: 80px;
    margin: 12px auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen .panel *,
  .play-sheet * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Override the former independently positioned Back control at every breakpoint. */
#info .menu-header #info-close {
  position: static;
  margin: 0;
  align-self: center;
  padding: 10px 14px;
  min-height: 44px;
  min-width: 84px;
}
/* Native WebKit selects need an explicit height in addition to min-height. */
.screen .panel .setting-row select {
  height: 46px;
  min-height: 46px;
}
.screen .panel h2,
#mode .mode-panel .mode-card strong {
  text-transform: uppercase;
}
#menu .menu-buttons button {
  border-radius: 6px;
  font-size: 16px;
  letter-spacing: 0.035em;
}
#menu .menu-player {
  border-radius: 8px;
  border: 1px solid #52768c;
  background: #0b2132f5;
}
#menu .menu-player [data-player-name] {
  font-size: 18px;
}
#menu .menu-player [data-player-title] {
  font-size: 12px;
}
#menu .menu-player [data-player-progress] {
  font-size: 12px;
}
#menu .menu-player [data-player-action] {
  min-height: 44px;
  font-size: 13px;
  border-radius: 6px;
}
#top-tools button {
  border-radius: 6px;
}
@media (max-width: 700px) {
  #menu .menu-buttons button {
    font-size: 14px;
  }
  #menu .menu-player [data-player-name] {
    font-size: 16px;
  }
  #menu .menu-player [data-player-action] {
    font-size: 12px;
  }
}

/* Resolve old ID-specific compact-menu rules into this common scale. */
#info .info-panel {
  border-radius: 8px;
}
#info .setting-row {
  padding: 16px;
  min-height: 76px;
  border-color: #355163;
}
#mode .mode-panel {
  padding: 24px;
}
#mode .mode-panel .mode-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
#mode .mode-panel .mode-card p {
  font-size: 14px;
}
#mode .mode-panel .mode-card .card-arrow {
  display: block;
}
#mode .menu-header h2 {
  margin: 0;
}
#mode .mode-panel .setting-row {
  margin: 0;
}
#leaderboards-content > .eyebrow,
#leaderboards-content > h2 {
  display: none;
}
#info .leaderboard-refresh {
  font-size: 13px !important;
}
#info .leaderboard-table {
  font-size: 14px;
}
#info .leaderboard-table th {
  font-size: 12px;
}
@media (max-width: 700px) {
  #mode .mode-panel {
    padding: 16px;
  }
  #info .setting-row {
    padding: 14px;
  }
  #mode .mode-panel .mode-card .card-arrow {
    display: none;
  }
}
@media (max-width: 420px) {
  #mode .mode-panel .mode-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #mode .mode-panel .mode-card {
    min-height: 0;
    padding: 14px 16px;
  }
  #mode .mode-panel .mode-card strong {
    margin: 6px 0;
    font-size: 25px;
  }
  #mode .mode-panel .mode-card p {
    margin: 0;
  }
  #mode .mode-panel .arena-picker {
    grid-template-columns: 1fr;
  }
  #mode .mode-panel .arena-option {
    display: grid;
    grid-template-columns: 100px 1fr;
    grid-template-rows: 1fr 1fr;
    align-items: center;
    padding: 0;
    text-align: left;
  }
  #mode .mode-panel .arena-option img {
    grid-row: 1 / 3;
    width: 100px;
    height: 76px;
    margin: 0;
  }
  #mode .mode-panel .arena-option strong {
    align-self: end;
    padding: 6px 12px 0;
    font-size: 21px;
  }
  #mode .mode-panel .arena-option small {
    align-self: start;
    padding: 4px 12px 8px;
    font-size: 11px;
  }
}
@media (max-height: 500px) {
  #mode .mode-panel {
    padding: 16px;
  }
}
#info .setting-row input[type="range"] {
  width: 260px;
  height: 44px;
  flex: 0 1 260px;
}
@media (max-width: 700px) {
  #info .setting-row input[type="range"] {
    width: 100%;
    flex: none;
  }
}
/* Empty room slots communicate capacity without looking like six forms to fill. */
#online .panel:has(#room-lobby:not(.hidden)) {
  width: min(900px, 100%);
  padding: 24px;
  max-height: 100%;
}
#online .panel .menu-header h2 {
  margin: 0;
}
#online .panel .menu-header .eyebrow {
  margin: 0 0 5px;
}
#online .lobby-roster.room-six {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#online .lobby-player.empty-slot {
  min-height: 64px;
  padding: 10px 12px;
  opacity: 0.75;
}
#online .empty-slot .team-choice,
#online .empty-slot small,
#online .empty-slot .member-note {
  display: none;
}
#online .empty-slot .lobby-avatar {
  font-size: 20px;
  width: 28px;
}
#online .empty-slot strong {
  font-size: 13px;
}
#online #ready-room,
#online #begin-match {
  display: block;
  width: 100%;
  margin: 12px 0;
  min-height: 48px;
}
#online .lobby-player strong {
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  #online .panel:has(#room-lobby:not(.hidden)) {
    padding: 16px;
  }
  #online .lobby-player:not(.empty-slot) {
    grid-column: 1 / -1;
    padding: 12px;
  }
  #online .lobby-player .team-choice {
    margin-top: 8px;
  }
  #online .lobby-player:not(.empty-slot) .lobby-avatar {
    width: 32px;
    font-size: 26px;
  }
  #online .panel .menu-header .back {
    min-width: 0;
  }
}

/* Stadium menu system: shared hierarchy, compact choices, clear focus. */
.screen.center .panel {
  border: 1px solid #334d60;
  border-top: 2px solid #69d8fa;
  border-radius: 8px;
  background: linear-gradient(120deg, #102431f5, #08131ff8 70%);
  box-shadow: 0 24px 80px #0008;
}
.screen.center .menu-header {
  gap: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid #87c4df24;
}
.menu-header .eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
}
.screen.center .menu-header h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.1;
}
.section-label {
  margin: 0 0 12px;
  color: #a4c6d7;
  font: 700 12px/1.3 var(--font-ui, sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
#mode .mode-panel {
  display: block;
  width: min(1060px, 100%);
}
.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
}
.match-modes,
.match-options {
  min-width: 0;
}
#mode .mode-panel .mode-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
#mode .mode-panel .mode-card,
#mode .mode-panel .mode-card-secondary {
  min-height: 96px;
  padding: 13px 48px 13px 18px;
  gap: 4px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  border: 1px solid #456478;
  border-radius: 6px;
  background: linear-gradient(110deg, #17394d, #102432);
  text-align: left;
  box-shadow: none;
}
#mode .mode-panel .mode-card-secondary {
  background: #102432;
  border-color: #304d60;
}
#mode .mode-panel .mode-card .mode-number {
  font-size: 10px;
  letter-spacing: 0.11em;
  color: #8edbf2;
  margin: 0;
}
#mode .mode-panel .mode-card strong {
  font-size: 25px;
  line-height: 1.05;
  margin: 0;
}
#mode .mode-panel .mode-card p {
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
  color: #bed0dc;
}
#mode .mode-panel .mode-card .card-arrow {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 24px;
}
#mode .mode-panel .mode-card:hover {
  background: #20485d;
  border-color: #69d8fa;
}
#mode .mode-panel .menu-group {
  margin: 0 0 18px;
}
#mode .mode-panel .menu-section-heading {
  margin: 0 0 12px;
  align-items: baseline;
  gap: 8px;
}
#mode .mode-panel .menu-section-heading h3 {
  font-size: 14px;
}
#mode .mode-panel .menu-section-heading span {
  font-size: 12px;
}
#mode .mode-panel .arena-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
#mode .mode-panel .arena-option {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  align-items: center;
  min-height: 80px;
  padding: 0;
  text-align: left;
  overflow: hidden;
  border-radius: 6px;
}
#mode .mode-panel .arena-option img {
  width: 116px;
  height: 80px;
  object-fit: cover;
  grid-row: 1 / 3;
}
#mode .mode-panel .arena-option strong {
  font-size: 21px;
  padding: 8px 14px 0;
  margin: 0;
  align-self: end;
}
#mode .mode-panel .arena-option small {
  font-size: 10px;
  padding: 4px 14px 8px;
  margin: 0;
  align-self: start;
}
#mode .mode-panel .practice-options .setting-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  margin: 0;
}
#mode .mode-panel .practice-options select {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: auto;
}
#mode .mode-panel .practice-options small {
  font-size: 12px;
  line-height: 1.4;
}
#mode .mode-panel .panel-note {
  margin-top: 18px;
  padding-top: 14px;
  font-size: 12px;
  line-height: 1.5;
}
#career-connect-status:empty {
  display: none;
}
#info-body .setting-row {
  min-height: 64px;
  padding: 12px 16px;
  border-radius: 5px;
  margin: 0 0 8px;
}
#info-body .setting-row strong {
  font-size: 14px;
}
#info-body .setting-row small {
  font-size: 12px;
  line-height: 1.45;
}
#info-body .menu-tabs {
  gap: 4px;
  padding: 4px;
  background: #06121c;
  border-radius: 6px;
}
#info-body .menu-tabs button {
  border: 0;
  border-radius: 4px;
  min-height: 44px;
}
#info-body .menu-tabs button[aria-selected="true"] {
  background: #23485e;
  color: #b5edff;
  box-shadow: inset 0 -2px #69d8fa;
}
.screen :is(button, a, input, select, textarea, summary):focus-visible,
.controller-navigation
  .screen
  :is(button, a, input, select, textarea, summary):focus {
  outline: 2px solid #b5edff;
  outline-offset: 3px;
  scroll-margin: 12px;
}
@media (max-width: 700px) {
  .match-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  #mode .mode-panel .section-label {
    display: none;
  }
  #mode .mode-panel .mode-card,
  #mode .mode-panel .mode-card-secondary {
    min-height: 80px;
    padding: 10px 38px 10px 14px;
  }
  #mode .mode-panel .mode-card strong {
    font-size: 23px;
  }
  #mode .mode-panel .mode-card p {
    font-size: 12px;
  }
  #mode .mode-panel .arena-picker {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #mode .mode-panel .arena-option {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }
  #mode .mode-panel .arena-option img {
    width: 100%;
    height: 62px;
  }
  #mode .mode-panel .arena-option strong {
    font-size: 17px;
    padding: 8px 7px 0;
    align-self: auto;
  }
  #mode .mode-panel .arena-option small {
    font-size: 9px;
    padding: 4px 7px 8px;
    align-self: auto;
  }
  #mode .mode-panel .menu-section-heading span {
    max-width: 50%;
    text-align: right;
  }
  #mode .mode-panel .practice-options .setting-row {
    padding: 12px;
  }
  .screen.center .menu-header {
    gap: 12px;
    margin-bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .screen *,
  .screen *::before,
  .screen *::after {
    scroll-behavior: auto;
    transition-duration: 0s !important;
    animation-duration: 0s !important;
  }
}
.controller-keyboard {
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  background: #0b2030;
  color: #edf7ff;
  border: 1px solid #69d8fa;
  border-radius: 8px;
  padding: 16px;
}
.controller-keyboard::backdrop {
  background: #020914bb;
}
.controller-keyboard header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.controller-keyboard h2 {
  margin: 0;
  font-size: 24px;
}
.controller-keyboard output {
  display: block;
  min-height: 44px;
  padding: 12px;
  margin: 12px 0;
  background: #06111a;
  overflow-wrap: anywhere;
}
.controller-keys {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
.controller-keyboard button {
  min-height: 44px;
  min-width: 0;
  padding: 6px;
  border: 1px solid #4d738b;
  border-radius: 4px;
  background: #18394d;
  color: #edf7ff;
  font-size: 16px;
}
.controller-keyboard button:focus {
  outline: 2px solid #b5edff;
  outline-offset: 2px;
  background: #285770;
}
.controller-keyboard p {
  font-size: 12px;
  color: #b5cede;
}
@media (max-width: 600px) {
  .controller-keys {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
#info .info-panel .setting-row {
  min-height: 64px;
  padding: 10px 16px;
}
#info .training-grid {
  gap: 12px;
}
#info .training-grid article {
  padding: 14px;
  border-radius: 6px;
  background: linear-gradient(120deg, #153346, #102430);
}
#info .training-grid article h3 {
  margin: 0 0 8px;
  font-size: 21px;
}
#info .training-grid article > p {
  margin: 0 0 12px;
  min-height: 0;
  font-size: 14px;
  line-height: 1.4;
}
#info .training-grid article > div {
  gap: 6px;
}
#info .training-grid button {
  padding: 8px;
  min-height: 54px;
}
#info .training-grid small {
  font-size: 11px;
}
#info .info-panel .setting-row:focus-within {
  border-color: #69d8fa;
  background: #193b50;
}
@media (max-width: 360px) {
  .controller-keys {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
#room-setup #host-room {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}
#room-setup .or {
  margin: 14px 0;
  font-size: 11px;
}
#online .join-row {
  gap: 10px;
}
#pause .panel > button {
  width: 100%;
}
#final .panel #final-score {
  font-variant-numeric: tabular-nums;
}
.controller-keys button[data-key="Delete"],
.controller-keys button[data-key="Shift"],
.controller-keys button[data-key="Space"] {
  font-size: 12px;
}

.public-match #copy-room,
.public-match #begin-match,
.public-match #invite-url,
.public-match .lobby-invite-label,
.public-match .lobby-meta > span:first-child,
.public-match #lobby-code,
.public-match .panel > .panel-note {
  display: none;
}
.public-match .room-six {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.public-match .lobby-player[hidden],
.public-match .team-choice,
.public-match #room-lobby > .setting-row {
  display: none;
}
.public-match #room-arena-note {
  margin-top: 12px;
  padding-top: 0;
  border: 0;
}
.public-match .lobby-player {
  min-height: 110px;
}
.public-match #lobby-mode {
  margin: 12px 0;
  padding-top: 0;
  border: 0;
}

/* Matchmaking: honest presence, visible search, and two complete player cards. */
.matchmaking-presence,
.matchmaking-search {
  display: none;
}
.public-match .matchmaking-presence {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b2d3e3;
  font-size: 13px;
  margin: 12px 0;
}
.matchmaking-presence i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #73dcbc;
}
.public-match .matchmaking-search:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin: 14px 0;
  background: #102c3e;
  border: 1px solid #3b6c80;
  color: #a7e7ff;
  font-size: 15px;
}
.matchmaking-radar {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 2px solid #2c566b;
  border-top-color: #87e4ff;
  border-radius: 50%;
  animation: match-search-spin 1.3s linear infinite;
}
@keyframes match-search-spin {
  to {
    transform: rotate(360deg);
  }
}
.search-dots {
  animation: match-search-pulse 1.4s ease-in-out infinite;
}
@keyframes match-search-pulse {
  50% {
    opacity: 0.3;
  }
}
.lobby-avatar {
  position: relative;
}
.lobby-portrait {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border: 1px solid #508297;
  border-radius: 3px;
}
.lobby-portrait[hidden],
.lobby-ready-badge[hidden],
.lobby-career[hidden] {
  display: none;
}
.lobby-ready-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #78e3b6;
  color: #071b23;
  border: 2px solid #102636;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}
.lobby-player.is-ready {
  border-color: #78e3b6;
}
.lobby-career {
  margin: 8px 0;
  display: grid;
  gap: 5px;
}
.lobby-xp {
  color: #c7eaff;
  font-size: 12px;
  font-weight: 700;
}
.lobby-xp-next {
  font-size: 11px;
  color: #a4bccb;
}
.lobby-xp-bar {
  width: 100%;
  height: 5px;
  border: 0;
  background: #2a4252;
  accent-color: #72d4f7;
}
.lobby-xp-bar::-webkit-progress-bar {
  background: #2a4252;
}
.lobby-xp-bar::-webkit-progress-value {
  background: #72d4f7;
}
.public-match .lobby-player {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
}
.public-match .lobby-player > div {
  min-width: 0;
  flex: 1;
}
.public-match .lobby-player strong {
  overflow-wrap: anywhere;
}
.public-match .lobby-player.empty-slot .lobby-avatar::after {
  content: "?";
  font-size: 34px;
  color: #5c899f;
}
.public-match #ready-room:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .public-match .lobby-player {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }
  .public-match .lobby-player > div {
    width: 100%;
  }
  .public-match .lobby-portrait {
    width: 52px;
    height: 52px;
  }
  .public-match .lobby-player strong {
    font-size: 15px;
  }
  .public-match .panel {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .matchmaking-radar,
  .search-dots {
    animation: none;
  }
}

/* Mode-first flow: choose an experience, then configure that experience. */
#mode .mode-panel {
  position: relative;
  overflow: hidden;
  width: min(1080px, 100%);
  background: #081723f5;
}
#mode .mode-panel .menu-header {
  position: relative;
  top: 0;
  z-index: 2;
}
#mode .mode-panel .mode-grid {
  position: relative;
  z-index: 2;
  width: 62%;
  gap: 10px;
}
#mode .mode-panel .mode-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 22px;
  gap: 16px;
  align-items: center;
  padding: 0 16px 0 0;
  min-height: 104px;
  overflow: hidden;
  background: #102737f2;
}
#mode .mode-panel .mode-card > img {
  width: 128px;
  height: 104px;
  object-fit: cover;
}
#mode .mode-panel .mode-card .mode-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}
#mode .mode-panel .mode-card strong {
  font-size: 27px;
}
#mode .mode-panel .mode-card .card-arrow {
  display: block;
  position: static;
  transform: none;
}
#mode .mode-panel .mode-card .mode-description {
  font-size: 13px;
  line-height: 1.35;
  color: #bad0df;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
#mode .mode-panel .recommended {
  border-color: #74dcf6;
  background: linear-gradient(100deg, #204e64f5, #123046f5);
}
#mode .mode-panel .recommended .mode-number {
  color: #a4f3da;
}
.mode-showcase {
  position: absolute;
  inset: 92px 0 0 44%;
  pointer-events: none;
  opacity: 0.8;
}
.mode-showcase img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  mask-image: linear-gradient(90deg, transparent, #000 50%);
}
.mode-showcase span {
  position: absolute;
  bottom: 32px;
  right: 26px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-shadow: 0 2px 10px #000;
}
#match-setup .setup-panel {
  width: min(920px, 100%);
}
#match-setup .arena-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
#match-setup .arena-option {
  min-width: 0;
  border-radius: 6px;
  overflow: hidden;
  padding: 0 0 14px;
}
#match-setup .arena-option img {
  display: block;
  width: 100%;
  height: 136px;
  object-fit: cover;
}
#match-setup .arena-option strong {
  display: block;
  padding: 14px 12px 4px;
  font-size: 25px;
}
#match-setup .arena-option small {
  display: block;
  padding: 0 12px;
  font-size: 11px;
}
#match-setup .arena-option[aria-pressed="true"] {
  outline: 2px solid #83e4ff;
  outline-offset: 3px;
}
#match-setup .practice-options[hidden],
#private-mode[hidden] {
  display: none;
}
#match-setup .practice-options {
  margin-top: 20px;
}
#match-setup #launch-match {
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
}
#match-setup #private-mode {
  width: 100%;
  margin-top: 10px;
  text-align: center;
}
@media (max-width: 700px) {
  #mode .mode-panel .mode-grid {
    width: 100%;
  }
  .mode-showcase {
    display: none;
  }
  #mode .mode-panel .mode-card {
    grid-template-columns: 88px minmax(0, 1fr) 16px;
    gap: 12px;
    padding-right: 12px;
    min-height: 98px;
  }
  #mode .mode-panel .mode-card > img {
    width: 88px;
    height: 100%;
    min-height: 98px;
  }
  #mode .mode-panel .mode-card strong {
    font-size: 24px;
  }
  #mode .mode-panel .mode-card .mode-number {
    font-size: 9px;
  }
  #mode .mode-panel .mode-card .mode-description {
    font-size: 12px;
  }
  #match-setup .arena-picker {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #match-setup .arena-option {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    padding: 0;
    text-align: left;
  }
  #match-setup .arena-option img {
    grid-row: 1 / 3;
    width: 110px;
    height: 86px;
  }
  #match-setup .arena-option strong {
    align-self: end;
    padding: 8px 12px 2px;
    font-size: 23px;
  }
  #match-setup .arena-option small {
    align-self: start;
    padding: 2px 12px 8px;
  }
}
@media (max-height: 500px) and (min-width: 701px) {
  #mode .mode-panel .mode-grid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mode-showcase {
    display: none;
  }
}
/* Training expands only the selected skill's tiers; all packs remain available. */
.training-pack {
  border: 1px solid #385c70;
  border-radius: 8px;
  background: #102735;
  overflow: hidden;
}
.training-pack summary {
  display: grid;
  gap: 8px;
  padding: 20px;
  cursor: pointer;
  min-height: 90px;
}
.training-pack summary strong {
  font-size: 21px;
  color: #eaf5ff;
}
.training-pack summary span {
  font-size: 14px;
  color: #aac5d3;
  line-height: 1.5;
}
.training-pack summary::after {
  content: "Choose difficulty +";
  color: #81dcf6;
  font-size: 12px;
}
.training-pack[open] summary::after {
  content: "Choose difficulty −";
}
.training-pack > div {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}
.training-pack button {
  min-height: 52px;
  text-align: left;
  padding: 12px;
}
.training-pack button small {
  display: block;
  margin-top: 4px;
}
.training-pack summary:focus-visible {
  outline: 3px solid #85dfff;
  outline-offset: -4px;
}
#mode #open-private-match {
  position: relative;
  z-index: 2;
  display: block;
  width: 62%;
  min-height: 50px;
  margin-top: 12px;
}
@media (max-width: 700px), (max-height: 500px) {
  #mode #open-private-match {
    width: 100%;
  }
}
.queue-context {
  font-size: 13px;
  color: #99dcf3;
  font-variant-numeric: tabular-nums;
}

/* Controls are original vector drawings with short, anchored callouts. */
.binding-diagrams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.binding-panel {
  margin: 0;
  background: linear-gradient(145deg, #132a3b, #08141f);
  border: 1px solid #294858;
  border-radius: 10px;
  overflow: hidden;
}
.binding-panel figcaption {
  padding: 16px 18px 0;
  color: #99def4;
  font-weight: 700;
  font-size: 16px;
}
.binding-panel svg {
  display: block;
  width: 100%;
}
.binding-panel text {
  fill: #ebf5fc;
  font:
    600 11px system-ui,
    sans-serif;
}
.binding-panel .guide-shell {
  fill: #253c4d;
  stroke: #8baabb;
  stroke-width: 1.5;
}
.binding-panel .guide-seam {
  fill: none;
  stroke: #546f80;
  stroke-width: 1;
}
.binding-panel .guide-key rect,
.binding-panel rect.guide-key {
  fill: #142634;
  stroke: #698494;
  stroke-width: 1;
}
.binding-panel .guide-stick {
  fill: #0b1822;
  stroke: #7795a6;
  stroke-width: 2;
}
.binding-panel .guide-grip {
  fill: #263c4d;
  stroke: #455e70;
  stroke-width: 3;
  stroke-dasharray: 2 2;
}
.binding-panel .guide-face,
.binding-panel .guide-dpad {
  fill: #0a1b27;
  stroke: #7795a6;
}
.binding-panel .guide-screen {
  fill: #0a1b27;
  stroke: #3e6476;
}
.binding-panel .guide-light {
  fill: #70dafa;
}
.binding-panel .touch-key {
  font-size: 9px;
}
.binding-callout path {
  fill: none;
  stroke: #69bcd7;
  stroke-width: 1.2;
  opacity: 0.8;
}
.binding-callout circle {
  fill: #99e8ff;
}
.binding-panel .binding-label {
  font-size: 17px;
  font-weight: 700;
}
.binding-panel .binding-input {
  fill: #90c5d8;
  font-size: 13px;
  font-weight: 500;
}
@media (max-width: 700px) {
  .binding-diagrams {
    grid-template-columns: 1fr;
  }
}
