/* Pass D — lineup coach detail */

/* ===== lineupStyle ===== */

.lineup-board {
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(260px,.92fr);
  gap: 1rem;
  margin-top: 1rem;
}

.lineup-pitch {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border: 5px solid #f4fbf5;
  border-radius: 20px;
  background: linear-gradient(90deg,#16854b 0 2%,transparent 2% 98%,#16854b 98%),linear-gradient(#16854b 0 2%,transparent 2% 98%,#16854b 98%),repeating-linear-gradient(90deg,#2e9b60 0 9%,#278f56 9% 18%);
  box-shadow: inset 0 0 0 1px #ffffff66;
  cursor: crosshair;
  touch-action: manipulation;
}

.lineup-pitch:before,.lineup-pitch:after {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  border: 2px solid #ffffffa6;
  pointer-events: none;
}

.lineup-pitch:before {
  top: 5%;
  bottom: 5%;
}

.lineup-pitch:after {
  top: 50%;
  border-width: 1px 0 0;
}

.lineup-pitch .center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22%;
  aspect-ratio: 1;
  border: 2px solid #ffffffa6;
  border-radius: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}

.lineup-token {
  position: absolute;
  z-index: 2;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #075b32;
  color: #fff;
  box-shadow: 0 5px 12px #00281870;
  transform: translate(-50%,-50%);
  font: 900 1rem/1 Inter,system-ui,sans-serif;
  text-align: center;
  cursor: pointer;
}

.lineup-token b {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.lineup-token small {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  width: 110px;
  transform: translateX(-50%);
  color: #fff;
  text-shadow: 0 1px 2px #00351d99;
  font-size: .61rem;
  font-weight: 400;
  line-height: 1.1;
  white-space: normal;
}

.lineup-token.active {
  background: #f6c844;
  color: #143b23;
  box-shadow: 0 0 0 5px #f6c84488;
}

.lineup-token.active small {
  color: #fff;
}

.lineup-slot {
  display: block !important;
  position: absolute;
  z-index: 1;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 3px solid #fff !important;
  border-radius: 50%;
  background: #ffffff66 !important;
  box-shadow: 0 1px 5px #00351d99;
  transform: translate(-50%,-50%);
  cursor: pointer;
}

.lineup-slot:hover,.lineup-slot:focus {
  background: #f6c844cc !important;
  border-color: #fff !important;
  outline: none;
}

.lineup-bench {
  position: absolute;
  z-index: 5;
  left: 2%;
  right: 2%;
  bottom: 2%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  pointer-events: none;
  color: #fff;
}

.lineup-bench-single {
  justify-content: flex-end;
}

.lineup-bench-side {
  width: 27%;
  padding: .25rem;
  border-radius: 8px;
  background: #064b2dcc;
  border: 1px solid #ffffff80;
  pointer-events: auto;
}

.lineup-bench-side.lineup-bench-few {
  width: 34%;
}

.lineup-bench-side>span {
  display: block;
  margin-bottom: .15rem;
  font-size: .44rem;
  font-weight: 500;
  color: inherit;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.lineup-bench-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  grid-template-rows: repeat(4,min-content);
  grid-auto-flow: column;
  gap: .18rem;
}

.lineup-bench-side.lineup-bench-one-col .lineup-bench-grid {
  grid-template-columns: 1fr;
  grid-template-rows: none;
  grid-auto-flow: row;
}

.lineup-bench-player {
  display: flex;
  align-items: center;
  gap: .12rem;
  width: 100%;
  padding: .1rem .16rem;
  border: 1px solid #ffffff80;
  border-radius: 999px;
  background: #ffffff18;
  color: #fff;
  font-size: .46rem;
  font-weight: 800;
  cursor: pointer;
}

.lineup-bench-side.lineup-bench-few .lineup-bench-player {
  font-size: .54rem;
  padding: .14rem .2rem;
}

.lineup-coach-panel {
  position: absolute;
  z-index: 5;
  top: 2%;
  right: 2%;
  width: min(34%, 220px);
  pointer-events: auto;
  color: #fff;
}

.lineup-coach-panel .lineup-bench-grid {
  grid-template-columns: 1fr;
  grid-auto-flow: row;
}

.lineup-coach-panel .lineup-bench-player {
  cursor: default;
}

.lineup-bench-player b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
  min-width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  color: #075b32;
  font-size: .46rem;
}

.lineup-bench-player small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Inter,system-ui,sans-serif;
  font-weight: 400;
  line-height: 1.1;
  text-shadow: 0 1px 2px #00351d99;
}

.lineup-roster {
  display: grid;
  align-content: start;
  gap: .45rem;
}

.lineup-roster-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.lineup-roster h3 {
  margin: 0;
  font-size: .9rem;
}

.lineup-roster-count {
  padding: .25rem .5rem;
  border-radius: 999px;
  background: #dff4e6;
  color: #075b32;
  font-size: .68rem;
  font-weight: 900;
}

.lineup-member {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: .3rem;
  padding: .34rem .4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.lineup-member.name-only {
  grid-template-columns: minmax(0,1fr);
}

.lineup-member.is-selected {
  border-color: #85c99b;
  background: #f2fbf4;
}

.lineup-member .avatar {
  width: 24px;
  height: 24px;
  font-size: .56rem;
}

.lineup-member b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
}

.lineup-member small {
  display: block;
  color: var(--muted);
  font-size: .62rem;
}

.lineup-member-actions {
  display: flex;
  gap: .25rem;
}

.lineup-member button {
  min-width: 28px;
  min-height: 28px;
  padding: .14rem .3rem;
  border: 1px solid #9ecbad;
  border-radius: 8px;
  background: #fff;
  color: #075b32;
  font-size: .62rem;
  font-weight: 900;
}

.lineup-member button.is-on {
  background: #08713d;
  color: #fff;
}

.lineup-member button:disabled {
  opacity: .4;
}

.lineup-help {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
}

.lineup-help b {
  color: #075b32;
}

.coach-action-toast {
  position: fixed;
  z-index: 40;
  top: calc(.65rem + env(safe-area-inset-top, 0px));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 1.3rem);
  margin: 0;
  padding: .45rem .7rem;
  border: 1px solid #efb7b3;
  border-radius: 8px;
  background: #fff3f2;
  color: #992e29;
  font-size: .72rem;
  box-shadow: 0 5px 16px #4d141433;
  transform: translateX(-50%);
  animation: coach-action-toast-fade 2.7s ease both;
}

@keyframes coach-action-toast-fade {
  0%, 12% { opacity: 0; transform: translate(-50%, -.35rem); }
  20%, 72% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -.2rem); }
}

.lineup-player-composition {
  margin-top: .8rem;
}

.lineup-player-composition summary {
  cursor: pointer;
  color: #075b32;
  font-size: .76rem;
  font-weight: 900;
}

@media (max-width:720px) {
  .lineup-board {
    grid-template-columns: 1fr;
  }
  .lineup-pitch {
    min-height: 600px;
    border-radius: 16px;
  }
  .lineup-token {
    width: 48px;
    height: 48px;
    font-size: .85rem;
  }
  .lineup-token small {
    top: calc(100% + 3px);
    width: 88px;
    font-size: .5rem;
  }
  .lineup-roster {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: .4rem;
  }
  .lineup-roster-head,.lineup-help {
    grid-column: 1/-1;
  }
  .lineup-member {
    grid-template-columns: auto auto minmax(0,1fr) auto;
    grid-template-rows: auto;
    padding: .42rem;
  }
  .lineup-member-actions {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }
  .lineup-member .avatar {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .lineup-member-main {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
  }
  .lineup-attendance {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: center;
  }
  .lineup-member button {
    min-width: 42px;
    min-height: 36px;
  }
  .lineup-member-actions button:last-child {
    padding: 0 .65rem;
  }
  .lineup-pitch:before {
    left: 5%;
    right: 5%;
  }
}

/* ===== coachMatchStyle ===== */

.coach-match-panel {
  padding: clamp(.75rem,2vw,1.35rem);
}

.coach-match-panel>.actions {
  display: none;
}

.coach-match-panel .lineup-summary>b,.coach-match-panel .lineup-summary>span {
  display: none;
}

.coach-match-panel .lineup-summary {
  justify-content: center;
}

.coach-match-panel>.title {
  justify-content: center;
  text-align: center;
}

.coach-match-panel>.coach-publish-actions {
  display: flex;
  padding-bottom: .35rem;
}

.coach-match-panel>.coach-update-actions {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: .35rem;
}

.coach-match-panel>.coach-update-actions-floating {
  position: fixed;
  z-index: 30;
  right: .75rem;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px) + .75rem);
  display: flex;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.coach-update-actions-floating .primary {
  min-height: 34px;
  padding: .35rem .65rem;
  border-radius: 8px;
  font-size: .72rem;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 4px 12px #00351d33;
}

.coach-update-actions-floating .secondary {
  display: none;
}

.missions-panel {
  display: grid;
  gap: .4rem;
  margin-top: .8rem;
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdfb;
}

.missions-panel h3 {
  margin: 0 0 .15rem;
  color: var(--deep);
  font-size: .72rem;
  letter-spacing: .08em;
}

.missions-panel label {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(150px,.8fr);
  align-items: center;
  gap: .55rem;
  font-size: .72rem;
  font-weight: 700;
}

.missions-panel select {
  min-height: 32px;
  padding: .25rem .4rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--deep);
  font: inherit;
  font-size: .7rem;
}

.coach-match-panel .lineup-draft-notice {
  margin: .45rem 0 0;
  color: #9a6a00;
  font-size: .7rem;
  font-weight: 700;
  text-align: center;
}

.coach-match-panel>.help {
  margin: .55rem 0;
  color: var(--muted);
}

.lineup-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin: .8rem 0;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: #eef7f0;
  color: #24533a;
  font-size: .74rem;
}

.lineup-summary b {
  margin-right: auto;
  color: #075b32;
  font-size: .82rem;
}

.lineup-summary span {
  padding: .25rem .45rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d5e8da;
  font-weight: 800;
}

.formation-picker {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: #075b32;
  font-size: .65rem;
  font-weight: 900;
}

.formation-picker select {
  min-height: 30px;
  padding: .2rem .35rem;
  border: 1px solid #b8d8c1;
  border-radius: 7px;
  background: #fff;
  color: #075b32;
  font-weight: 900;
}

.grouped-roster {
  gap: .45rem;
}

.lineup-group {
  display: grid;
  gap: .2rem;
}

.lineup-group h3 {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: .15rem 0;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.lineup-roster-head h3 span,
.lineup-group h3 span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 17px;
  padding: 0 .3rem;
  border-radius: 5px;
  background: #eef1ef;
  color: #4d5a52;
  font-size: .64rem;
  line-height: 1;
  box-shadow: none;
}

.lineup-member {
  grid-template-columns: auto minmax(0,1fr) auto auto;
  min-width: 0;
  padding: .28rem .4rem;
  box-shadow: 0 1px 0 #0b43200b;
}

.lineup-member-main {
  min-width: 0;
}

.lineup-member-main b {
  font-size: .76rem;
}

.player-match-panel .lineup-roster {
  gap: .25rem;
}

.player-match-panel .lineup-group {
  gap: .05rem;
}

.player-match-panel .lineup-group h3 {
  margin: .1rem 0;
}

.player-match-panel .lineup-member {
  grid-template-columns: auto minmax(0,1fr);
  justify-content: flex-start;
  text-align: left;
  min-height: 0;
  gap: .3rem;
  padding: .12rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.player-match-panel .lineup-member .avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 22px;
  height: 18px;
  padding: 0 .25rem;
  border: 1px solid #d7dfda;
  border-radius: 5px;
  background: #eef1ef;
  color: #4d5a52;
  font-size: .64rem;
  font-weight: 800;
  line-height: 1;
}

.player-match-panel .lineup-member b {
  font-size: .72rem;
}

.answer.match-answer.player-match-panel .lineup-member b,
.match-card.player-match-panel .lineup-member b,
.answer.training-answer.player-match-panel .lineup-member b,
.training-card.player-match-panel .lineup-member b {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.2;
}

.answer.match-answer.player-match-panel .lineup-member,
.match-card.player-match-panel .lineup-member,
.answer.training-answer.player-match-panel .lineup-member,
.training-card.player-match-panel .lineup-member {
  padding-block: .18rem;
}

.lineup-attendance {
  white-space: nowrap;
  padding: .14rem .3rem;
  border-radius: 999px;
  font-size: .56rem;
  font-weight: 900;
}

.lineup-attendance.present {
  background: #dff4e6;
  color: #08713d;
}

.lineup-attendance.absent {
  background: #ffe5e3;
  color: #a13a35;
}

.lineup-attendance.pending {
  background: #f2f5f2;
  color: #718277;
}

.lineup-add {
  margin-top: .2rem;
  padding-top: .45rem;
  border-top: 1px solid var(--line);
}

.lineup-add summary {
  cursor: pointer;
  padding: .35rem;
  color: #08713d;
  font-size: .72rem;
  font-weight: 900;
}

.draft-lineup-board .lineup-pitch {
  cursor: default;
  opacity: .9;
}

.lineup-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-top: .65rem;
  padding: .55rem;
  border-radius: 10px;
  background: #fff8dc;
  border: 1px solid #ead58a;
}

.lineup-picker b {
  width: 100%;
  font-size: .7rem;
  color: #6b5200;
}

.lineup-picker button {
  min-height: 30px;
  padding: .25rem .45rem;
  border: 1px solid #d6bf65;
  border-radius: 7px;
  background: #fff;
  color: #4d3a00;
  font-size: .65rem;
  font-weight: 900;
}

.lineup-picker .lineup-remove {
  border-color: #e5aaa5;
  background: #fff1f0;
  color: #a13a35;
}

@media (max-width:720px) {
  .coach-match-panel {
    border-radius: 14px;
  }
  .lineup-board,.draft-lineup-board {
    display: flex;
    flex-direction: column;
    gap: .7rem;
  }
  .draft-lineup-board .lineup-pitch {
    min-height: 400px;
  }
  .lineup-pitch {
    min-height: 600px;
  }
  .lineup-coach-panel {
    width: min(48%, 220px);
  }
  .coach-match-panel>.coach-update-actions-floating {
    right: .55rem;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px) + .55rem);
  }
  .lineup-roster {
    display: grid;
    grid-template-columns: 1fr;
    gap: .65rem;
  }
  .lineup-member {
    grid-template-columns: auto auto minmax(0,1fr) auto;
    grid-template-rows: auto;
    gap: .38rem;
    padding: .3rem .34rem;
  }
  .lineup-member-actions {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }
  .lineup-member .avatar {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }
  .lineup-member-main {
    grid-column: 3;
    grid-row: 1;
    min-width: 0;
  }
  .lineup-attendance {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    font-size: .56rem;
  }
  .lineup-member-actions button {
    min-width: 28px;
    min-height: 29px;
  }
  .lineup-member-actions button:last-child {
    padding: 0 .34rem;
    font-size: .6rem;
  }
  .lineup-summary {
    font-size: .68rem;
  }
  .lineup-summary b {
    width: 100%;
    margin: 0;
  }
  .formation-picker {
    width: 100%;
    justify-content: space-between;
    margin-top: .2rem;
  }
  .formation-picker select {
    flex: 1;
    max-width: 150px;
  }
  .lineup-add .lineup-group {
    margin-top: .45rem;
  }
  .lineup-bench {
    left: 2%;
    right: 2%;
    gap: .45rem;
  }
  .lineup-bench-side {
    width: 31%;
  }
  .lineup-bench-player {
    font-size: .42rem;
  }
}

/* ===== coachDetailCenterStyle ===== */

.coach-match-panel > .title,
        .coach-event-detail > .title {
  position: relative;
  display: block;
  text-align: center;
}

.coach-match-panel > .title > .status,
        .coach-event-detail > .title > .status {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
}

.coach-match-panel > .title > .status,
        .coach-event-detail > .title > .status {
  padding: .2rem .38rem;
  border-radius: 999px;
  font-size: .61rem;
  line-height: 1.1;
  white-space: nowrap;
}

.coach-panel-title {
  width: 100%;
}

.coach-panel-title > .eyebrow,
        .coach-event-detail > .title .eyebrow {
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.coach-panel-matchup {
  margin: .55rem 0 .2rem;
}

.coach-panel-date {
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coach-panel-teams {
  display: grid;
  grid-template-columns: minmax(0,1fr) 4.4rem minmax(0,1fr);
  align-items: center;
  gap: .45rem;
  margin-top: .5rem;
}

.coach-panel-teams > strong {
  color: var(--deep);
  font-size: clamp(.78rem, 2.8vw, 1.05rem);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

.coach-panel-teams > div {
  text-align: center;
}

.coach-panel-teams b {
  display: block;
  color: var(--deep);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1;
}

.coach-panel-teams span {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 600;
  white-space: nowrap;
}

.coach-event-detail > .title h2 {
  margin-top: .45rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.coach-event-detail > .meta {
  justify-content: center;
  margin-top: .65rem;
}

.coach-event-detail {
  display: flex;
  flex-direction: column;
}

.coach-event-detail > .meta {
  order: 1;
}

.coach-event-detail > .title {
  order: 2;
}

.coach-event-detail > .block {
  order: 3;
}

.coach-event-detail > .actions {
  order: 4;
}

.coach-event-detail > .help {
  order: 5;
}

.coach-training-meta {
  align-items: center;
  gap: .65rem;
}

.coach-training-date {
  color: var(--deep);
  font-size: .84rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.coach-training-time {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
}

.coach-training-time strong {
  color: var(--deep);
  font-weight: 700;
}

@media (max-width: 420px) {
  .coach-panel-teams {
    grid-template-columns: minmax(0,1fr) 3.8rem minmax(0,1fr);
    gap: .25rem;
  }
  .coach-panel-teams > strong {
    font-size: .7rem;
  }
}

/* ===== coachMatchStatsStyle ===== */

.events > .card.detail.match-card .coach-summary,
        .events > .card.detail.training-card .coach-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: .75rem;
  margin-top: .65rem;
  padding: .15rem 0;
  background: transparent;
}

.events > .card.detail.match-card .coach-summary span,
.events > .card.detail.training-card .coach-summary span {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .events > .card.detail.match-card .coach-summary,
  .events > .card.detail.training-card .coach-summary {
    gap: .42rem;
  }
  .events > .card.detail.match-card .coach-summary span,
  .events > .card.detail.training-card .coach-summary span {
    font-size: .62rem;
  }
}
