/* KENROKU Web v2.10.0-rc.5 — Team UI buttons and exact headings.
   Screen only, limited to Team workspace's header and list navigation.
   Does not change match scoring, timer, video, destructive confirmations,
   backup/import handlers, PDF print, auth, synchronization, or permissions. */
@media screen {
  /* Same-width navigation controls within a page header. The title is
     centered relative to the full content width, not the remaining space. */
  body.kenroku-team-ui #main .team-centered-page-bar {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
    align-items:center;
    column-gap:clamp(5px,1.5vw,9px);
  }
  body.kenroku-team-ui #main .team-centered-page-bar > .menu-page-top {
    grid-column:1;justify-self:start;min-width:0;
  }
  body.kenroku-team-ui #main .team-centered-page-bar > h1.team-page-title {
    grid-column:2;justify-self:center;white-space:nowrap;
    min-width:0;text-align:center;flex:none;
  }
  body.kenroku-team-ui #main .team-centered-page-bar > .team-page-help-button {
    grid-column:3;justify-self:end;min-width:0;margin:0;
  }
  body.kenroku-team-ui #main .team-centered-page-bar :is(.app-back-btn,.team-page-help-button) {
    box-sizing:border-box;
    display:inline-flex;align-items:center;justify-content:center;
    width:clamp(80px,22vw,108px)!important;
    min-width:0!important;max-width:none!important;min-height:40px!important;
    padding:8px 6px!important;
    line-height:1.2!important;
    white-space:nowrap;
  }
  /* Player header actions: balanced peers, with the add action visually
     distinct. A small-screen two-row arrangement avoids squeezed words. */
  body.kenroku-team-ui #main .players-page-controls {
    display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);
    width:100%;max-width:800px;column-gap:7px;row-gap:7px;
    align-items:stretch;
  }
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;max-width:none;min-width:0;gap:7px;margin:0;
  }
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action {
    width:100%;min-width:0;max-width:none;margin:0;
    display:flex;align-items:stretch;justify-content:stretch;
  }
  body.kenroku-team-ui #main .players-page-controls :is(.players-page-tabs > .btn,.menu-page-primary-action > .btn) {
    box-sizing:border-box;min-width:0!important;
    width:100%!important;max-width:none!important;
    min-height:42px!important;height:auto!important;
    border-radius:10px;line-height:1.2!important;
    padding:8px 5px!important;font-size:clamp(12px,3.1vw,14px)!important;
    display:inline-flex;align-items:center;justify-content:center;
    white-space:normal!important;text-align:center;
  }
  /* Edit stays a compact, consistent action rather than stretching to half
     a player card on narrow iPhones. */
  body.kenroku-team-ui #main .player-list-item .player-list-actions {
    display:flex;width:auto;max-width:none;min-width:0;
    flex:0 0 auto;gap:7px;margin-left:auto;justify-content:flex-end;
  }
  body.kenroku-team-ui #main .player-list-item .player-list-actions > .btn {
    box-sizing:border-box;min-width:0;width:clamp(90px,27vw,114px);
    min-height:40px!important;padding:8px 10px!important;
  }
  /* The match-list card action should not become a viewport-wide bar. */
  body.kenroku-team-ui #main .match-list-item .match-list-open {
    box-sizing:border-box;display:block;
    width:clamp(112px,36%,156px)!important;
    max-width:100%;min-height:44px!important;margin-left:auto;
  }
  /* Schedule has three peer navigation actions: keep them equal. */
  body.kenroku-team-ui #main .team-schedule-tools :is(.app-back-btn,.team-schedule-add,.team-page-help-button) {
    min-height:40px!important;height:40px!important;
  }
  body.kenroku-team-ui #main .team-analysis-head .team-page-actions-three > .btn {
    min-height:40px!important;
  }
}
@media screen and (max-width:389px) {
  body.kenroku-team-ui #main .players-page-controls {
    grid-template-columns:minmax(0,1fr);
    max-width:none;
  }
  body.kenroku-team-ui #main .players-page-controls .players-page-tabs,
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action {
    grid-column:1;
  }
  body.kenroku-team-ui #main .players-page-controls .menu-page-primary-action > .btn {
    min-height:40px!important;
  }
  /* Exact-centered titles retain space for the two equal-size controls. */
  body.kenroku-team-ui #main .team-centered-page-bar :is(.app-back-btn,.team-page-help-button) {
    width:80px!important;
  }
}

/* rc.6: Removing the manage explanation must not make the full-width
   "名前を変更" button jump beside the name on narrow iPhones. */
@media screen and (max-width:600px) {
  body.kenroku-team-ui #main .team-config-manage .management-self-card > .row.wrap {
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  body.kenroku-team-ui #main .team-config-manage .management-self-card [data-edit-self-display-name] {
    box-sizing:border-box;
    width:100%;
    max-width:100%;
    min-height:40px;
  }
}
