/* Schedule action hierarchy
 *
 * Keep the result editor as the visible primary action. Scheduling and result
 * reset live in one secondary surface, so adding organizer tools never makes
 * bracket controls narrower or shorter. */
.schedule-centre-page .group-workbench-title-row {
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.schedule-centre-page .group-workbench-title-row>h2 {
  flex:0 1 auto;
  min-width:0;
}

.schedule-centre-page .fixture-round-jump {
  position:relative;
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  margin-top:4px;
}

.schedule-centre-page .fixture-round-jump::before {
  position:absolute;
  z-index:1;
  top:50%;
  left:12px;
  color:#8fa7b4;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  line-height:1;
  pointer-events:none;
  transform:translateY(-50%);
  content:"轮次";
}

.schedule-centre-page .fixture-round-jump::after {
  position:absolute;
  z-index:1;
  top:50%;
  right:14px;
  width:7px;
  height:7px;
  border-right:2px solid #b7ff4a;
  border-bottom:2px solid #b7ff4a;
  pointer-events:none;
  transform:translateY(-68%) rotate(45deg);
  content:"";
}

.schedule-centre-page .fixture-round-jump select {
  box-sizing:border-box;
  min-width:132px;
  height:42px;
  padding:0 38px 0 49px;
  border:1px solid rgba(142,181,200,.42);
  border-radius:4px;
  appearance:none;
  background:
    linear-gradient(90deg,rgba(183,255,74,.72) 0 3px,transparent 3px),
    linear-gradient(145deg,rgba(17,49,67,.98),rgba(6,22,35,.98));
  box-shadow:inset 0 1px rgba(255,255,255,.045),0 8px 18px rgba(0,0,0,.18);
  color:#eff8fc;
  color-scheme:dark;
  cursor:pointer;
  font:inherit;
  font-size:15px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
  line-height:1;
  transition:border-color .16s ease,background .16s ease,box-shadow .16s ease;
}

.schedule-centre-page .fixture-round-jump select:hover {
  border-color:rgba(183,255,74,.68);
  background:
    linear-gradient(90deg,#b7ff4a 0 3px,transparent 3px),
    linear-gradient(145deg,rgba(23,60,75,.99),rgba(7,28,42,.99));
}

.schedule-centre-page .fixture-round-jump select:focus-visible {
  border-color:#b7ff4a;
  outline:2px solid rgba(183,255,74,.56);
  outline-offset:3px;
  box-shadow:inset 0 1px rgba(255,255,255,.06),0 0 0 4px rgba(183,255,74,.1);
}

.schedule-centre-page .fixture-round-jump select option {
  background:#0a2233;
  color:#eff8fc;
}

.schedule-centre-page .fixture-action-cluster {
  display:grid!important;
  grid-template-columns:minmax(96px,1fr) minmax(92px,1fr)!important;
  align-items:center;
  justify-self:end;
  gap:7px!important;
  width:auto!important;
  min-width:195px;
}

.schedule-centre-page .fixture-action-cluster>.button-link {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box;
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  min-height:42px!important;
  margin:0!important;
  padding:0 9px!important;
  font-size:15px!important;
  font-weight:850;
  line-height:1!important;
  white-space:nowrap;
}

.schedule-centre-page .fixture-options-trigger,
.schedule-centre-page .fixture-card-options,
.schedule-centre-page .postseason-round-options {
  border:1px solid rgba(87,168,255,.54);
  background:linear-gradient(135deg,rgba(87,168,255,.16),rgba(17,47,72,.9));
  color:#d8edff;
  cursor:pointer;
}

.schedule-centre-page .fixture-options-trigger:hover,
.schedule-centre-page .fixture-options-trigger:focus-visible,
.schedule-centre-page .fixture-card-options:hover,
.schedule-centre-page .fixture-card-options:focus-visible,
.schedule-centre-page .postseason-round-options:hover,
.schedule-centre-page .postseason-round-options:focus-visible {
  border-color:rgba(183,255,74,.76);
  color:#efffd5;
  outline:2px solid rgba(210,255,137,.36);
  outline-offset:1px;
}

/* Single-leg playoff and knockout cards mirror the group-stage hierarchy:
 * one state destination, one lime score action, and one settings action. */
.schedule-centre-page .fixture-action-label-short {
  display:none;
}

.schedule-centre-page .bracket-fixture-actions.is-organizer {
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:6px!important;
}

.schedule-centre-page .bracket-fixture-actions.is-organizer.has-state-action {
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

.schedule-centre-page .bracket-fixture-actions.public-only {
  grid-template-columns:minmax(0,1fr)!important;
}

.schedule-centre-page .bracket-fixture-actions.is-organizer>.fixture-card-action {
  width:100%;
  min-width:0;
  min-height:36px!important;
}

.schedule-centre-page .bracket-fixture-actions.is-organizer>.fixture-card-record {
  border-color:rgba(183,255,74,.7);
  background:linear-gradient(135deg,rgba(183,255,74,.2),rgba(15,70,55,.96));
  color:#edffc9;
}

.schedule-centre-page .bracket-fixture-actions.is-organizer>.fixture-card-options {
  border-color:rgba(87,168,255,.54);
  background:linear-gradient(135deg,rgba(87,168,255,.16),rgba(17,47,72,.9));
  color:#d8edff;
}

/* Each physical leg owns a compact state/settings row. Result entry stays a
 * single combined action at the bottom of the logical two-leg tie. */
.schedule-centre-page .postseason-leg>header {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  align-items:stretch;
  gap:4px;
  min-width:0;
  margin:0 0 5px;
}

.schedule-centre-page .postseason-leg-meta {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:5px;
  min-width:0;
}

.schedule-centre-page .postseason-leg-meta>span {
  color:#c9ff75;
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

.schedule-centre-page .postseason-leg-meta>b {
  overflow:hidden;
  color:#91a9b6;
  font-size:11px;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.schedule-centre-page .postseason-leg-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:4px;
  min-width:0;
}

.schedule-centre-page .postseason-leg-state,
.schedule-centre-page .postseason-round-options {
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:28px;
  margin:0;
  padding:0 6px;
  font-size:12px;
  font-weight:850;
  line-height:1;
  text-decoration:none;
  white-space:nowrap;
}

.schedule-centre-page .postseason-leg-state {
  flex:1 1 auto;
  overflow:hidden;
  border:1px solid rgba(183,255,74,.48);
  background:rgba(183,255,74,.1);
  color:#e4ffb6;
  text-overflow:ellipsis;
}

.schedule-centre-page .postseason-round-options {
  flex:0 0 auto;
  min-width:38px;
}

.schedule-centre-page .postseason-leg-state:hover,
.schedule-centre-page .postseason-leg-state:focus-visible {
  border-color:rgba(183,255,74,.82);
  background:rgba(183,255,74,.17);
  color:#f2ffd9;
  outline:2px solid rgba(210,255,137,.3);
  outline-offset:1px;
}

.schedule-centre-page .postseason-tie-actions,
.schedule-centre-page .postseason-tie-actions.is-organizer,
.schedule-centre-page .postseason-tie-actions.is-organizer:has(.fixture-card-report) {
  grid-template-columns:minmax(0,1fr)!important;
}

/* Shared settings and confirmation surfaces. */
.fixture-options-dialog,
.fixture-restore-dialog {
  box-sizing:border-box;
  width:min(560px,calc(100vw - 28px));
  max-height:calc(100vh - 36px);
  overflow:auto;
  padding:0;
  border:1px solid rgba(87,168,255,.46);
  background:linear-gradient(145deg,#102b3d,#071522);
  color:#edf8fc;
  box-shadow:0 30px 90px rgba(0,0,0,.64);
}

.fixture-options-dialog::backdrop,
.fixture-restore-dialog::backdrop {
  background:rgba(1,8,14,.76);
  backdrop-filter:blur(6px);
}

.fixture-options-dialog>.dialog-close,
.fixture-restore-dialog>.dialog-close {
  position:absolute;
  z-index:3;
  top:12px;
  right:12px;
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  padding:0;
  border:1px solid rgba(164,208,230,.28);
  background:#102a3c;
  color:#fff;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}

.fixture-options-dialog>.dialog-close:hover,
.fixture-options-dialog>.dialog-close:focus-visible,
.fixture-restore-dialog>.dialog-close:hover,
.fixture-restore-dialog>.dialog-close:focus-visible {
  border-color:var(--lime);
  outline:2px solid rgba(210,255,137,.36);
  outline-offset:1px;
}

.fixture-options-dialog-body,
.fixture-restore-dialog>form {
  padding:24px;
}

.fixture-options-panel {
  display:grid;
  gap:14px;
}

.fixture-options-panel>header,
.fixture-restore-dialog form>header {
  min-width:0;
  padding-right:46px;
}

.fixture-options-panel>header>span,
.fixture-restore-dialog form>header>span {
  color:var(--lime);
  font-size:12px;
  font-weight:900;
  letter-spacing:.13em;
}

.fixture-options-panel>header h2,
.fixture-restore-dialog form>header h2 {
  margin:5px 0 0;
  font-size:clamp(23px,3vw,28px);
  line-height:1.2;
}

.fixture-options-links {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:8px;
}

.fixture-options-links>.button-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  margin:0;
  font-size:15px;
}

.fixture-options-section {
  display:grid;
  gap:11px;
  padding:15px;
  border:1px solid rgba(142,181,200,.22);
  background:rgba(4,19,31,.62);
}

.fixture-options-section>header {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}

.fixture-options-section>header h3 {
  margin:0;
  font-size:18px;
}

.fixture-options-section>header small {
  overflow:hidden;
  color:#9eb4bf;
  font-size:13px;
  font-variant-numeric:tabular-nums;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.fixture-options-kickoff-form {
  display:grid;
  gap:10px;
  margin:0;
}

.fixture-options-kickoff-form label {
  display:grid;
  gap:6px;
  color:#c5d6de;
  font-size:14px;
  font-weight:800;
}

.fixture-options-kickoff-form input {
  box-sizing:border-box;
  width:100%;
  min-height:44px;
  padding:0 11px;
  border:1px solid rgba(142,181,200,.36);
  background:#061722;
  color:#f4fbff;
  font-size:16px;
  font-variant-numeric:tabular-nums;
}

.fixture-options-kickoff-form input:focus-visible {
  border-color:var(--lime);
  outline:2px solid rgba(210,255,137,.3);
  outline-offset:1px;
}

.fixture-options-kickoff-form footer,
.fixture-restore-dialog form>footer {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
}

.fixture-options-kickoff-form footer>.button-link,
.fixture-restore-dialog form>footer>.button-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  margin:0;
  padding:0 12px;
  font-size:15px;
}

.fixture-options-kickoff-form .time-tbd-button {
  border:1px solid rgba(142,181,200,.46);
  background:rgba(142,181,200,.08);
  color:#cadbe4;
}

.fixture-options-danger-zone {
  border-color:rgba(255,126,113,.34);
  background:rgba(107,31,29,.12);
}

.fixture-options-danger-zone>header h3 {
  color:#ffd1cb;
}

.fixture-options-danger-zone>p {
  margin:0;
  color:#b9cbd3;
  font-size:14px;
  line-height:1.55;
}

.fixture-restore-trigger {
  justify-self:start;
  min-height:40px;
  padding:0 13px;
  border:1px solid rgba(255,126,113,.58);
  background:rgba(138,42,37,.2);
  color:#ffd1cb;
  font-size:14px;
  font-weight:850;
  cursor:pointer;
}

.fixture-restore-trigger:hover,
.fixture-restore-trigger:focus-visible {
  border-color:#ff9f95;
  background:rgba(170,48,42,.32);
  outline:2px solid rgba(255,159,149,.3);
  outline-offset:1px;
}

.fixture-restore-dialog {
  border-color:rgba(255,126,113,.48);
}

.fixture-restore-dialog>form {
  display:grid;
  gap:16px;
}

.fixture-restore-dialog form>header>span {
  color:#ffaaa1;
}

.fixture-restore-dialog form>p {
  margin:0;
  color:#c6d5dc;
  font-size:15px;
  line-height:1.6;
}

.fixture-restore-impact {
  padding:14px 15px;
  border:1px solid rgba(255,196,125,.28);
  background:rgba(117,72,25,.1);
}

.fixture-restore-impact>b {
  color:#ffe0aa;
  font-size:14px;
}

.fixture-restore-impact ul {
  display:grid;
  gap:6px;
  margin:9px 0 0;
  padding-left:20px;
  color:#bdcdd5;
  font-size:14px;
  line-height:1.45;
}

.fixture-restore-status {
  padding:12px 14px;
  border:1px solid rgba(142,181,200,.3);
  background:rgba(8,29,43,.72);
  color:#d5e5ec;
  font-size:14px;
  line-height:1.5;
}

.fixture-restore-status.is-error {
  border-color:rgba(255,126,113,.5);
  background:rgba(119,34,31,.18);
  color:#ffd1cb;
}

.fixture-restore-status.is-success {
  border-color:rgba(183,255,74,.5);
  background:rgba(75,109,35,.16);
  color:#e5ffc0;
}

.fixture-restore-status b {
  display:block;
  margin-bottom:5px;
}

.fixture-restore-status ul {
  display:grid;
  gap:3px;
  margin:6px 0 0;
  padding-left:19px;
}

.fixture-restore-dialog .button-link.danger {
  border-color:rgba(255,126,113,.66);
  background:linear-gradient(135deg,rgba(170,48,42,.72),rgba(93,28,27,.9));
  color:#fff1ef;
}

.fixture-restore-dialog .button-link:disabled {
  opacity:.58;
  cursor:wait;
}

@media (max-width:760px) {
  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-queue-row {
    grid-template-columns:40px minmax(0,1fr)!important;
    grid-template-rows:18px 44px 40px!important;
    height:auto!important;
    min-height:124px!important;
    gap:4px 6px!important;
    padding:6px!important;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-drag-handle {
    grid-column:1!important;
    grid-row:1 / 3!important;
    align-self:center;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-queue-meta {
    display:flex;
    grid-column:2!important;
    grid-row:1!important;
    align-items:center;
    justify-content:center;
    min-width:0;
    gap:8px;
    overflow:hidden;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-queue-meta b,
  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-queue-meta span {
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-queue-teams {
    grid-column:2!important;
    grid-row:2!important;
    grid-template-columns:minmax(0,1fr) 64px minmax(0,1fr);
    gap:4px;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-queue-teams>div>b {
    display:-webkit-box;
    flex:1 1 auto;
    width:100%;
    max-width:none;
    min-width:0;
    min-height:0;
    overflow:hidden;
    line-height:1.15;
    text-overflow:ellipsis;
    white-space:normal;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    line-clamp:2;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-action-cluster {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-column:1 / -1!important;
    grid-row:3!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
  }

  .schedule-centre-page .fixture-queue-list[data-reorder-url] .fixture-action-cluster>.button-link {
    box-sizing:border-box;
    width:100%!important;
    min-width:0!important;
    height:40px!important;
    min-height:40px!important;
    padding:0 3px!important;
    font-size:12px!important;
  }

  .fixture-options-dialog,
  .fixture-restore-dialog {
    width:calc(100vw - 18px);
    max-height:calc(100vh - 18px);
  }

  .fixture-options-dialog-body,
  .fixture-restore-dialog>form {
    padding:18px;
  }

  .fixture-options-panel>header h2,
  .fixture-restore-dialog form>header h2 {
    font-size:22px;
  }

  .fixture-options-section {
    padding:12px;
  }

  .fixture-options-section>header {
    align-items:flex-start;
    flex-direction:column;
    gap:3px;
  }
}

@media (min-width:2400px) {
  .schedule-centre-page .group-workbench-title-row {
    gap:18px;
  }

  .schedule-centre-page .fixture-round-jump select {
    min-width:154px;
    height:48px;
    padding-right:44px;
    padding-left:56px;
    font-size:17px;
  }

  .schedule-centre-page .fixture-round-jump::before {
    left:14px;
    font-size:12px;
  }

  .schedule-centre-page .fixture-round-jump::after {
    right:17px;
    width:8px;
    height:8px;
  }

  .schedule-centre-page .fixture-action-cluster {
    grid-template-columns:repeat(2,minmax(104px,1fr))!important;
    min-width:217px;
    gap:9px!important;
  }

  .schedule-centre-page .fixture-action-cluster>.button-link {
    height:48px!important;
    min-height:48px!important;
    padding:0 12px!important;
    font-size:16px!important;
  }

  .schedule-centre-page .postseason-leg-state,
  .schedule-centre-page .postseason-round-options {
    min-height:32px;
    padding:0 7px;
    font-size:14px;
  }

  .schedule-centre-page .postseason-round-options {
    min-width:46px;
  }

  .schedule-centre-page .postseason-leg-meta>span {
    font-size:14px;
  }

  .schedule-centre-page .postseason-leg-meta>b {
    font-size:13px;
  }

  .schedule-centre-page .bracket-fixture-actions.is-organizer>.fixture-card-action {
    min-height:42px!important;
  }

  .fixture-options-dialog,
  .fixture-restore-dialog {
    width:680px;
  }

  .fixture-options-dialog-body,
  .fixture-restore-dialog>form {
    padding:30px;
  }

  .fixture-options-panel>header>span,
  .fixture-restore-dialog form>header>span {
    font-size:14px;
  }

  .fixture-options-panel>header h2,
  .fixture-restore-dialog form>header h2 {
    font-size:32px;
  }

  .fixture-options-section>header h3 {
    font-size:21px;
  }

  .fixture-options-section>header small,
  .fixture-options-danger-zone>p,
  .fixture-restore-impact ul,
  .fixture-restore-status {
    font-size:16px;
  }

  .fixture-options-kickoff-form input {
    min-height:50px;
    font-size:18px;
  }

  .fixture-options-kickoff-form footer>.button-link,
  .fixture-restore-dialog form>footer>.button-link {
    min-height:48px;
    font-size:17px;
  }
}

@media (max-width:760px) {
  .schedule-centre-page .fixture-round-jump {
    display:none;
  }
}

/* Read-only knockout cards do not reserve the organizer-only action row.
 * Keep their visual centres pinned to the SVG route so a shorter card never
 * pulls a quarter-final connector above or below the match. */
.schedule-centre-page .football-knockout-bracket .knockout-match.is-readonly {
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
}

.schedule-centre-page .football-knockout-bracket .bracket-qf-left .knockout-match.is-readonly:first-child,
.schedule-centre-page .football-knockout-bracket .bracket-qf-right .knockout-match.is-readonly:first-child {
  top:21.25%!important;
  transform:translateY(-50%);
}

.schedule-centre-page .football-knockout-bracket .bracket-qf-left .knockout-match.is-readonly:last-child,
.schedule-centre-page .football-knockout-bracket .bracket-qf-right .knockout-match.is-readonly:last-child {
  top:78.75%!important;
  bottom:auto!important;
  transform:translateY(-50%);
}

.schedule-centre-page .schedule-sync-notice {
  position:fixed;
  z-index:80;
  right:clamp(16px,2.2vw,36px);
  bottom:clamp(16px,2.4vw,34px);
  display:flex;
  align-items:center;
  gap:18px;
  width:min(430px,calc(100vw - 32px));
  min-height:68px;
  padding:12px 12px 12px 18px;
  border:1px solid rgba(183,255,74,.52);
  border-left:4px solid #b7ff4a;
  border-radius:6px;
  background:linear-gradient(135deg,rgba(14,43,59,.985),rgba(5,20,32,.99));
  box-shadow:0 22px 56px rgba(0,0,0,.48),inset 0 1px rgba(255,255,255,.045);
  color:#eef7fb;
}

.schedule-centre-page .schedule-sync-notice[hidden] {
  display:none!important;
}

.schedule-centre-page .schedule-sync-notice>span {
  display:grid;
  flex:1 1 auto;
  min-width:0;
  gap:4px;
  color:inherit;
  font-size:inherit;
  font-weight:inherit;
  letter-spacing:0;
}

.schedule-centre-page .schedule-sync-notice b {
  color:#eaffbf;
  font-size:15px;
  font-weight:900;
}

.schedule-centre-page .schedule-sync-notice small {
  color:#aec2cc;
  font-size:12px;
  font-weight:700;
  line-height:1.35;
}

.schedule-centre-page .schedule-sync-notice button {
  flex:0 0 auto;
  min-height:38px;
  padding:0 13px;
  border:1px solid rgba(183,255,74,.62);
  border-radius:4px;
  background:rgba(183,255,74,.12);
  color:#ddff9f;
  cursor:pointer;
  font:inherit;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}

.schedule-centre-page .schedule-sync-notice button:hover {
  border-color:#b7ff4a;
  background:rgba(183,255,74,.2);
  color:#f5ffe4;
}

.schedule-centre-page .schedule-sync-notice button:focus-visible {
  outline:2px solid #b7ff4a;
  outline-offset:3px;
}

@media (max-width:760px) {
  .schedule-centre-page .schedule-sync-notice {
    right:10px;
    bottom:calc(10px + env(safe-area-inset-bottom));
    gap:10px;
    width:calc(100vw - 20px);
    min-height:64px;
    padding:10px 10px 10px 14px;
  }

  .schedule-centre-page .schedule-sync-notice small {
    font-size:11px;
  }

  .schedule-centre-page .schedule-sync-notice button {
    min-height:36px;
    padding:0 10px;
    font-size:12px;
  }
}
