/* Bilibili Toy slim build: NVN + straight-line only. */
#modeSelector,
#arenaPhysicsControl,
#rigPanel,
.ball-search-panel {
  display: none !important;
}

/* ------------------------------------------------------------------
   Toy mobile selection UI
   选球页统一使用战场标题的像素字体；队伍框更紧凑，字号更大。
   ------------------------------------------------------------------ */
#selectScreen,
#selectScreen button,
#selectScreen input,
#selectScreen select,
#selectScreen output {
  font-family: "Fusion Pixel 12 SC", "Microsoft YaHei", sans-serif;
}

#selectScreen .selection-title {
  letter-spacing: 0;
}

#selectScreen .team-builder {
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 8px;
}

#selectScreen .team-column-head {
  gap: 6px;
  margin-bottom: 4px;
}

#selectScreen .team-column h3 {
  font-size: 14px;
  color: #e8e8e8;
}

#selectScreen .team-random-button {
  min-height: 32px;
  height: 32px;
  padding: 2px 7px;
  gap: 4px;
  font-size: 12px;
  color: #c8c8c8;
}

#selectScreen .team-random-button .control-icon {
  width: 12px;
  height: 12px;
  flex-basis: 12px;
}

#selectScreen .builder-vs {
  font-size: 18px;
  color: #ffd34a;
}

#selectScreen .team-slot-row {
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 4px;
}

#selectScreen .team-slot {
  height: 44px;
  min-height: 44px;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 6px;
  padding: 4px 6px;
}

#selectScreen .slot-ball {
  width: 18px;
  height: 18px;
  box-shadow:
    2px 0 var(--slot-color, #333),
    -2px 0 var(--slot-color, #333);
}

#selectScreen .slot-copy {
  font-size: 14px;
  line-height: 1.15;
}

#selectScreen .slot-clear {
  width: 36px;
  height: 44px;
  min-height: 36px;
  font-size: 18px;
  color: #d0d0d0;
}

/* 左右队人数：强制两列并排，不再上下叠。 */
#selectScreen #teamCountControls:not(.hidden) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  font-size: 14px;
}

#selectScreen #teamCountControls .team-count-group {
  display: grid;
  grid-template-columns: auto 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 2px;
}

#selectScreen #teamCountControls .team-count-group > span {
  font-size: 14px;
  color: #e0e0e0;
  white-space: nowrap;
}

#selectScreen #teamCountControls .team-count-group output {
  font-size: 14px;
  color: #f0f0f0;
  text-align: center;
  white-space: nowrap;
  border: 0;
  background: transparent;
}

#selectScreen #teamCountControls .count-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 18px;
  border-color: #555;
  color: #d8d8d8;
}

#selectScreen .ball-card {
  min-height: 72px;
  padding: 6px 4px;
  gap: 4px;
}

#selectScreen .ball-card .name {
  font-size: 12px;
  line-height: 1.15;
}

#selectScreen .ball-card .meta {
  font-size: 9px;
}

@media (max-width: 360px) {
  #selectScreen .team-builder {
    grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
    gap: 6px;
  }

  #selectScreen .builder-vs {
    font-size: 16px;
  }

  #selectScreen .team-slot-row {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  #selectScreen .slot-clear {
    width: 34px;
    min-height: 34px;
  }

  #selectScreen .slot-copy {
    font-size: 13px;
  }

  #selectScreen #teamCountControls:not(.hidden) {
    gap: 6px;
  }

  #selectScreen #teamCountControls .team-count-group {
    grid-template-columns: auto 32px minmax(0, 1fr) 32px;
    gap: 3px;
  }

  #selectScreen #teamCountControls .count-button {
    width: 32px;
    height: 32px;
    min-height: 32px;
  }

  #selectScreen #teamCountControls .team-count-group > span,
  #selectScreen #teamCountControls .team-count-group output {
    font-size: 13px;
  }

  #selectScreen .ball-card .name {
    font-size: 11px;
  }
}

/* 移动端自带搜索面板：Toy 版隐藏自由输入，只保留类型筛选。 */
#selectScreen .mobile-ball-search-label,
#selectScreen #mobileBallSearch {
  display: none !important;
}

#selectScreen .mobile-ball-search-row {
  grid-template-columns: minmax(0, 1fr);
}

#selectScreen .mobile-roster-filter {
  width: 100%;
  max-width: none;
  height: 40px;
  font-size: 13px;
}

#selectScreen .mobile-ball-detail {
  min-height: 152px;
  grid-template-rows: auto auto 40px auto;
}

#selectScreen .mobile-ball-detail-name {
  font-size: 15px;
}

#selectScreen .mobile-ball-detail-english,
#selectScreen .mobile-current-slot {
  font-size: 11px;
}

#selectScreen .mobile-ball-detail-stats {
  font-size: 12px;
}

#selectScreen .mobile-ball-detail-description {
  height: 40px;
  font-size: 12px;
  line-height: 1.5;
}

#selectScreen .mobile-alphabet button {
  min-height: 26px;
  font-size: 12px;
}

/* ------------------------------------------------------------------
   Tournament: pixel typography, denser bracket, sticky action bar.
   ------------------------------------------------------------------ */
#tournamentScreen,
#tournamentScreen button,
#tournamentScreen output,
#tournamentScreen select {
  font-family: "Fusion Pixel 12 SC", "Microsoft YaHei", sans-serif;
}

#tournamentScreen .tournament-round-status {
  font-size: 12px;
}

#tournamentScreen .tournament-mode-picker-title {
  font-size: 15px;
}

#tournamentScreen .tournament-mode-picker-hint {
  font-size: 11px;
}

#tournamentScreen .tournament-mode-option-label,
#tournamentScreen .tournament-size-option-label {
  font-size: 13px;
}

#tournamentScreen .tournament-mode-option-description,
#tournamentScreen .tournament-size-option-description {
  font-size: 10px;
}

#tournamentScreen .tournament-setup-group-title {
  font-size: 12px;
}

#tournamentScreen .tournament-rounds {
  gap: 6px;
  padding-bottom: 8px;
}

#tournamentScreen .tournament-round {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 4px;
  padding: 6px;
}

#tournamentScreen .tournament-round-heading {
  grid-column: 1 / -1;
  margin: 0 0 2px;
  font-size: 13px;
}

#tournamentScreen .tournament-match {
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
  gap: 4px;
  min-height: 34px;
  padding: 2px 6px;
}

#tournamentScreen .tournament-chip {
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 5px;
}

#tournamentScreen .tournament-chip-dot {
  width: 10px;
  height: 10px;
}

#tournamentScreen .tournament-chip-name {
  font-size: 13px;
  line-height: 1.15;
}

#tournamentScreen .tournament-match-versus {
  font-size: 11px;
}

#tournamentScreen .tournament-footer {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 6px;
  padding: 8px 0 calc(8px + var(--mobile-safe-bottom));
  border-top: 1px solid #383838;
  background: #000;
}

#tournamentScreen .tournament-next-match {
  grid-column: 1 / -1;
  min-height: 0;
  font-size: 12px;
}

#tournamentScreen .tournament-primary-button,
#tournamentScreen .tournament-reset-button {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
}

#tournamentScreen .tournament-reset-button {
  width: 92px;
  font-size: 12px;
}

#tournamentScreen .tournament-round.tournament-round-empty,
#tournamentScreen .tournament-match.tournament-match-empty {
  display: none;
}

#tournamentScreen .tournament-reset-button {
  min-width: 0;
}

/* 锦标赛内容较短时不要垂直居中，直接从顶部开始。 */
.app:has(#tournamentScreen.active) {
  align-content: start;
}


/* 选球页左上角：返回主界面 */
#selectScreen {
  position: relative;
}

#toyMenuBackBtn {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 12;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 2px solid #4b4b4b;
  background: #050505;
  color: #f0f0f0;
  font-family: "Fusion Pixel 12 SC", "Microsoft YaHei", sans-serif;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#toyMenuBackBtn:active {
  background: #f2f2f2;
  color: #050505;
}

#toyMenuBackBtn:focus-visible {
  outline: 2px solid #ffd34a;
  outline-offset: 2px;
}
