
:root{--bg:#f3f6f2;--card:#fff;--ink:#14221e;--muted:#6a7772;--brand:#173f35;--brand2:#2d6f5b;--line:#dce6e1;--danger:#9f2d2d;--shadow:0 8px 30px rgba(17,48,40,.08)}
*{box-sizing:border-box} html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif}
button,input{font:inherit} button{cursor:pointer;-webkit-tap-highlight-color:transparent}
.app-shell{width:min(760px,100%);margin:0 auto;padding:calc(18px + env(safe-area-inset-top)) 16px calc(34px + env(safe-area-inset-bottom))}
.topbar,.round-heading,.history-heading,.add-row,.stepper{display:flex;align-items:center;gap:12px}
.topbar,.round-heading,.history-heading{justify-content:space-between}
h1,h2,h3,p{margin-top:0} h1{font-size:30px;line-height:1.05;margin-bottom:0} h2{font-size:22px;margin-bottom:16px} h3{font-size:17px;margin-bottom:10px}
.version{font-size:12px;vertical-align:middle;color:var(--muted);font-weight:800}
.eyebrow{text-transform:uppercase;letter-spacing:.12em;font-size:11px;font-weight:800;color:var(--brand2);margin-bottom:4px}
.card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:18px;margin-top:16px;box-shadow:var(--shadow)}
.add-row input{flex:1;min-width:0}
input{border:1px solid #cbd8d2;border-radius:13px;padding:13px 14px;color:var(--ink);background:#fff;font-size:16px}
button{border:0;border-radius:13px;padding:13px 16px;font-weight:750;background:#e5ece8;color:var(--ink)}
.primary,.next-round{background:var(--brand);color:#fff}.wide{width:100%;margin-top:14px}.ghost{background:transparent;border:1px solid var(--line)}.danger{color:var(--danger)}
.player-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:14px}
.player-chip{display:flex;align-items:center;justify-content:space-between;gap:8px;border:1px solid var(--line);background:#f9fbfa;border-radius:13px;padding:10px 11px}
.player-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remove-btn{padding:4px 8px;min-width:32px;border-radius:8px;color:var(--danger);background:#fff}
.muted{color:var(--muted);margin:12px 0 0}.small{font-size:13px}.compact{margin:0;font-size:13px}
.field-label{display:block;font-weight:700;margin-bottom:8px}.stepper{justify-content:center}.stepper input{width:92px;text-align:center;font-weight:800;font-size:22px}.stepper-btn{font-size:24px;width:52px;height:52px;padding:0}
.hidden{display:none!important}.stats{text-align:right;display:flex;flex-direction:column;gap:3px;color:var(--muted);font-size:12px}
.courts{display:grid;gap:14px}.court{border:1px solid var(--line);border-radius:18px;overflow:hidden}.court-title{background:#eef4f1;padding:10px 14px;font-weight:850;font-size:14px}
.matchup{display:grid;grid-template-columns:1fr auto 1fr;gap:12px;align-items:center;padding:16px 14px}.team{text-align:center;font-weight:800;font-size:18px;line-height:1.35}.vs{color:var(--muted);font-size:12px;font-weight:800}
.waiting-wrap{margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}.waiting-list{display:flex;flex-wrap:wrap;gap:8px}.waiter{background:#f1f4f2;border-radius:999px;padding:8px 12px;font-weight:700}
.next-round{width:100%;margin-top:20px;padding:17px;font-size:18px;border-radius:16px}
.history-note{margin-top:-6px;margin-bottom:14px}.history-list{display:grid;gap:12px}.history-round{border:1px solid var(--line);border-radius:16px;overflow:hidden}
.history-round summary{list-style:none;cursor:pointer;padding:13px 14px;background:#f7faf8;font-weight:850;display:flex;justify-content:space-between;gap:8px}
.history-round summary::-webkit-details-marker{display:none}.history-body{padding:12px 14px}.history-court{padding:10px 0;border-top:1px solid #edf2ef}.history-court:first-child{border-top:0}
.history-court-title{font-size:12px;color:var(--muted);font-weight:800;margin-bottom:4px}.history-match{font-weight:750;line-height:1.45}.history-wait{margin-top:9px;color:var(--muted);font-size:13px}
.toast{position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom));transform:translate(-50%,20px);background:#14221e;color:#fff;padding:10px 14px;border-radius:999px;font-size:14px;opacity:0;pointer-events:none;transition:.2s ease;max-width:92%;text-align:center}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:520px){.player-list{grid-template-columns:1fr}.topbar{align-items:flex-start}.topbar .ghost{padding:9px 10px;font-size:12px}.round-heading{align-items:flex-start}.team{font-size:17px}}

/* v6: unmistakable team grouping in the current round */
.matchup-clear{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:14px;
  align-items:center;
  padding:18px 14px;
}
.team-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:20px;
  font-weight:850;
  white-space:nowrap;
}
.plus{color:var(--muted);font-weight:700}
.vs-clear{color:var(--muted);font-size:13px;font-weight:900}
@media(max-width:520px){
  .matchup-clear{gap:8px;padding:18px 10px}
  .team-line{font-size:18px;gap:6px}
}

/* v7 automatic partnership audit */
.audit-badge{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.04em;
}
.audit-pass{background:#e7f4ed;color:#225d42}
.audit-fail{background:#fae8e8;color:#8f2626}
.audit-summary{margin-top:0;line-height:1.45}
.audit-details{display:grid;gap:8px;margin-top:12px}
.audit-repeat-row{
  border:1px solid #efcaca;
  background:#fff7f7;
  color:#7e2424;
  border-radius:12px;
  padding:10px 12px;
  font-weight:750;
  line-height:1.35;
}


/* v8 court-style layout */
.court-visual{
  display:grid;
  grid-template-rows:auto 12px auto;
}
.court-side{
  padding:18px 14px;
}
.court-side-top{
  background:#f8fbfa;
}
.court-side-bottom{
  background:#d8e4df;
}
.court-net{
  background:#173f35;
  color:#fff;
  text-align:center;
  font-size:10px;
  font-weight:900;
  letter-spacing:.16em;
  line-height:12px;
}
.team-line{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:20px;
  font-weight:850;
  white-space:nowrap;
}
.plus{color:var(--muted);font-weight:700}

.history-court-card{
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
.history-court-visual{
  display:grid;
  grid-template-rows:auto 10px auto;
}
.history-court-side{
  text-align:center;
  font-weight:800;
  padding:10px 12px;
  line-height:1.4;
}
.history-court-side-top{background:#f8fbfa}
.history-court-side-bottom{background:#d8e4df}
.history-court-net{
  background:#173f35;
  color:#fff;
  text-align:center;
  font-size:9px;
  font-weight:900;
  letter-spacing:.12em;
  line-height:10px;
}

/* v8 waiting audit */
.wait-counts{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.wait-count-chip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#f8fbfa;
  padding:9px 11px;
}
.wait-count-chip strong{
  background:#173f35;
  color:#fff;
  border-radius:999px;
  min-width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
}
@media(max-width:520px){
  .team-line{font-size:18px;gap:6px}
  .wait-counts{grid-template-columns:1fr}
}


/* v9 two-page navigation */
.app-nav{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:16px;
}
.nav-link{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  color:var(--ink);
  text-decoration:none;
  font-weight:850;
}
.nav-link.active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}
.link-button{
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  min-height:48px;
}
.compact-setup-card{
  padding:14px 16px;
}
.compact-setup-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}
.compact-session-info{
  font-size:16px;
  font-weight:800;
}
.compact-court-control{
  display:flex;
  align-items:center;
  gap:8px;
}
.compact-court-control label{
  font-size:13px;
  color:var(--muted);
  font-weight:800;
}
.compact-court-control input{
  width:74px;
  text-align:center;
  font-weight:800;
  padding:10px 8px;
}


/* v10 groups, attendance, and court labels */
.section-heading-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}
.section-heading-row h2{margin-bottom:12px}
.compact-btn{padding:9px 12px;font-size:13px}

.select-input{
  width:100%;
  border:1px solid #cbd8d2;
  border-radius:13px;
  padding:13px 14px;
  color:var(--ink);
  background:#fff;
  font-size:16px;
}
.group-actions,.attendance-actions{
  display:flex;
  gap:8px;
  margin-top:10px;
}
.attendance-heading{align-items:center}
.attendance-list{
  display:grid;
  gap:8px;
  margin-top:14px;
}
.attendance-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--line);
  background:#f9fbfa;
  border-radius:13px;
  padding:9px 10px 9px 12px;
}
.attendance-check{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
  flex:1;
  font-weight:750;
}
.attendance-check input{
  width:22px;
  height:22px;
  margin:0;
  accent-color:var(--brand);
}
.attendance-check span{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.court-labels-wrap{
  display:grid;
  gap:8px;
  margin-top:16px;
}
.court-label-help{margin:0 0 2px}
.court-label-row{
  display:grid;
  grid-template-columns:1fr 110px;
  align-items:center;
  gap:12px;
  border:1px solid var(--line);
  border-radius:13px;
  padding:9px 10px 9px 13px;
  background:#f9fbfa;
  font-weight:750;
}
.court-label-row input{
  width:100%;
  text-align:center;
  padding:10px 8px;
  font-weight:800;
}
@media(max-width:520px){
  .group-actions,.attendance-actions{flex-wrap:wrap}
  .court-label-row{grid-template-columns:1fr 92px}
}


/* v11: compact court cards for more courts per iPhone screen */
.courts{
  gap:8px;
}
.court{
  border-radius:14px;
}
.court-title{
  padding:5px 10px;
  font-size:12px;
  line-height:1.15;
}
.court-visual{
  grid-template-rows:auto 6px auto;
}
.court-side{
  padding:7px 10px;
}
.court-net{
  font-size:7px;
  line-height:6px;
  height:6px;
  overflow:hidden;
}
.team-line{
  font-size:20px;
  line-height:1.05;
  min-height:24px;
}
.waiting-wrap{
  margin-top:10px;
  padding-top:9px;
}
.next-round{
  margin-top:12px;
  padding:13px;
  font-size:17px;
}
.round-heading{
  margin-bottom:-4px;
}
#currentSection.card{
  padding:14px;
}

/* v11: history rounds collapsed by default with rotating disclosure arrow */
.history-round summary{
  padding:11px 12px;
  align-items:center;
}
.history-summary-left{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.history-chevron{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  font-size:24px;
  line-height:1;
  color:var(--muted);
  transform:rotate(0deg);
  transition:transform .16s ease;
  transform-origin:center;
}
.history-round[open] .history-chevron{
  transform:rotate(90deg);
}
.history-body{
  padding:10px 12px;
}
.history-court{
  padding:6px 0;
}
.history-court-card{
  border-radius:11px;
}
.history-court-side{
  padding:6px 9px;
}
.history-court-visual{
  grid-template-rows:auto 5px auto;
}
.history-court-net{
  height:5px;
  line-height:5px;
  font-size:6px;
  overflow:hidden;
}

@media(max-width:520px){
  .court-side{padding:6px 8px}
  .team-line{font-size:20px}
  #currentSection.card{padding:12px}
}


/* v15: VS divider with a break in the dark line */
.court-net,
.history-court-net{
  display:flex;
  align-items:center;
  justify-content:center;
  background:none;
  overflow:visible;
  color:#fff;
  font-weight:900;
  letter-spacing:.08em;
}
.court-net::before,
.court-net::after,
.history-court-net::before,
.history-court-net::after{
  content:"";
  flex:1 1 auto;
  background:#173f35;
  border-radius:999px;
}
.court-net span,
.history-court-net span{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#173f35;
  color:#fff;
  border-radius:999px;
  margin:0 6px;
  white-space:nowrap;
}

.court-net{
  height:8px;
  line-height:8px;
  font-size:7px;
}
.court-net::before,
.court-net::after{
  height:2px;
}
.court-net span{
  min-width:28px;
  height:14px;
  font-size:8px;
  line-height:1;
  margin:0 5px;
}

.history-court-net{
  height:7px;
  line-height:7px;
  font-size:6px;
}
.history-court-net::before,
.history-court-net::after{
  height:2px;
}
.history-court-net span{
  min-width:22px;
  height:12px;
  font-size:7px;
  line-height:1;
  margin:0 5px;
}


/* v16: teammate names without plus signs, with wider spacing */
.team-line{
  gap:28px;
}
.history-court-side{
  word-spacing:0;
}
.history-name-gap{
  display:inline-block;
  width:28px;
}

/* v16: waiting names match court player names */
.waiter{
  font-size:20px;
  font-weight:850;
  line-height:1.05;
  padding:7px 12px;
}

@media(max-width:520px){
  .team-line{gap:24px}
  .history-name-gap{width:24px}
  .waiter{font-size:20px}
}


/* v17 offline status indicator */
.offline-status{
  margin-top:8px;
  font-size:12px;
  font-weight:750;
  text-align:center;
  color:var(--muted);
}
.offline-ready{
  color:#225d42;
}
.offline-online{
  color:var(--muted);
}
.offline-warn{
  color:#8f5f20;
}


/* v18 Done button */
.done-btn{
  background:var(--brand);
  color:#fff;
  border:1px solid var(--brand);
  padding:10px 16px;
  min-width:72px;
}
.done-btn:active{
  transform:scale(.99);
}


/* v19: audits run silently and only failures are displayed */
.audit-warning{
  margin:10px 0;
  padding:10px 12px;
  border:1px solid #c93434;
  border-radius:12px;
  background:#fdeaea;
  color:#9a1f1f;
  font-size:13px;
  font-weight:850;
  line-height:1.35;
}


/* v23: cleaner VS badge and wider teammate spacing */
.court-net,
.history-court-net{
  align-items:center;
}

.court-net::before,
.court-net::after,
.history-court-net::before,
.history-court-net::after{
  height:3px;
}

.court-net{
  height:18px;
  line-height:18px;
  margin:2px 0;
}

.court-net span{
  min-width:52px;
  height:24px;
  padding:0 12px;
  margin:0 10px;
  font-size:15px;
  font-weight:900;
  line-height:1;
  position:relative;
  z-index:1;
  box-shadow:0 0 0 3px #d8dfdc;
}

.history-court-net{
  height:15px;
  line-height:15px;
  margin:2px 0;
}

.history-court-net span{
  min-width:38px;
  height:20px;
  padding:0 9px;
  margin:0 8px;
  font-size:11px;
  font-weight:900;
  line-height:1;
  position:relative;
  z-index:1;
  box-shadow:0 0 0 3px #d8dfdc;
}

/* widen teammate names horizontally */
.team-line{
  gap:44px;
}

.history-name-gap{
  width:40px;
}

@media(max-width:700px){
  .team-line{
    gap:36px;
  }
  .history-name-gap{
    width:32px;
  }
  .court-net span{
    min-width:46px;
    height:22px;
    font-size:13px;
    margin:0 8px;
  }
  .history-court-net span{
    min-width:34px;
    height:18px;
    font-size:10px;
  }
}

@media(max-width:520px){
  .team-line{
    gap:32px;
  }
  .history-name-gap{
    width:28px;
  }
}


/* v24: dedicated VS band and wider teammate separation */
.court-visual{
  grid-template-rows:auto 34px auto;
}

.court-net{
  height:34px;
  min-height:34px;
  margin:0;
  line-height:34px;
  overflow:visible;
}

.court-net span{
  min-width:50px;
  height:24px;
  padding:0 12px;
  margin:0 12px;
  font-size:14px;
  line-height:1;
  box-shadow:none;
  flex:0 0 auto;
}

/* Keep the divider lines visually separate from the VS badge */
.court-net::before,
.court-net::after{
  height:3px;
}

/* Spread teammates across much more of the court width */
.team-line{
  width:76%;
  max-width:560px;
  margin:0 auto;
  gap:0;
  justify-content:space-between;
}

.team-line .player-name{
  flex:0 0 auto;
}

/* History version */
.history-court-visual{
  grid-template-rows:auto 26px auto;
}

.history-court-net{
  height:26px;
  min-height:26px;
  margin:0;
  line-height:26px;
}

.history-court-net span{
  min-width:40px;
  height:20px;
  padding:0 9px;
  margin:0 10px;
  font-size:11px;
  line-height:1;
  box-shadow:none;
  flex:0 0 auto;
}

.history-name-gap{
  width:52px;
}

@media(max-width:700px){
  .team-line{
    width:82%;
    max-width:none;
  }

  .court-visual{
    grid-template-rows:auto 32px auto;
  }

  .court-net{
    height:32px;
    min-height:32px;
  }

  .court-net span{
    min-width:46px;
    height:22px;
    font-size:13px;
    margin:0 10px;
  }

  .history-name-gap{
    width:44px;
  }
}

@media(max-width:520px){
  .team-line{
    width:86%;
  }

  .court-side{
    padding-left:12px;
    padding-right:12px;
  }

  .history-name-gap{
    width:38px;
  }
}


/* v25 player-list import / export */
.import-export-link{
  margin-top:12px;
}

.backup-intro{
  line-height:1.45;
}

.file-picker{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:50px;
  padding:13px 16px;
  border-radius:13px;
  background:var(--brand);
  color:#fff;
  font-weight:800;
  cursor:pointer;
  text-align:center;
}

.file-picker input{
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  opacity:0;
  pointer-events:none;
}

.import-preview{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--line);
}

.import-preview-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.import-preview-heading h3{
  margin-bottom:0;
}

.import-list{
  display:grid;
  gap:9px;
}

.import-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#f9fbfa;
  cursor:pointer;
}

.import-row input{
  width:20px;
  height:20px;
  flex:0 0 auto;
}

.import-row-text{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}

.import-row-text strong{
  font-size:16px;
}

.import-status{
  font-size:12px;
  font-weight:750;
}

.import-status.new{
  color:#225d42;
}

.import-status.replace{
  color:#9f2d2d;
}


/* v26: court count is configured only on the Players page */
.compact-setup-row{
  grid-template-columns:1fr;
}

.compact-session-info{
  width:100%;
}


/* v30: emphasize each court card */
.courts{
  gap:22px;
}

.court{
  border:2px solid #111;
  border-radius:24px;
  overflow:hidden;
}

.history-courts{
  gap:16px;
}

.history-court{
  border:2px solid #111;
  border-radius:20px;
  overflow:hidden;
}

@media(max-width:700px){
  .courts{
    gap:20px;
  }

  .history-courts{
    gap:14px;
  }
}


/* v32: move current-round court label above the border */
.court{
  border:0;
  border-radius:0;
  overflow:visible;
  background:transparent;
}

.court-title{
  background:transparent;
  padding:0 2px 8px 2px;
  font-size:14px;
  line-height:1.1;
  font-weight:900;
}

.court-visual{
  border:2px solid #111;
  border-radius:24px;
  overflow:hidden;
}

@media(max-width:700px){
  .court-title{
    padding:0 2px 7px 2px;
  }
  .court-visual{
    border-radius:22px;
  }
}


/* v33: Max courts button */
.max-courts-btn{
  width:auto;
  min-width:70px;
  padding:0 16px;
  font-size:16px;
  font-weight:850;
}

/* v33: team colors fill all the way to the center divider */
.court-visual{
  position:relative;
  display:grid;
  grid-template-rows:1fr 1fr;
}

.court-side{
  min-height:78px;
  display:flex;
  align-items:center;
}

.court-side-top{
  background:#f8fbfa;
}

.court-side-bottom{
  background:#c8d8d2;
}

/* Put the net/VS directly over the boundary between the two team bands. */
.court-net{
  position:absolute;
  left:0;
  right:0;
  top:50%;
  transform:translateY(-50%);
  z-index:3;
  height:32px;
  min-height:32px;
  margin:0;
  pointer-events:none;
}

.court-net span{
  position:relative;
  z-index:4;
}

/* Keep history visually consistent with the current matchup. */
.history-court-visual{
  position:relative;
  display:grid;
  grid-template-rows:1fr 1fr;
}

.history-court-side-top{
  background:#f8fbfa;
}

.history-court-side-bottom{
  background:#c8d8d2;
}

.history-court-net{
  position:absolute;
  left:0;
  right:0;
  top:50%;
  transform:translateY(-50%);
  z-index:3;
  height:24px;
  min-height:24px;
  margin:0;
  pointer-events:none;
}

@media(max-width:700px){
  .court-side{
    min-height:72px;
  }

  .court-net{
    height:30px;
    min-height:30px;
  }

  .max-courts-btn{
    min-width:66px;
    padding:0 14px;
    font-size:15px;
  }
}


/* v35: empty saved-roster state */
.group-empty-state{
  padding:8px 0 2px;
}
.group-empty-state .muted{
  margin:0 0 10px;
  font-size:15px;
}


/* v36: larger/bolder current-round court labels */
.court-title{
  font-size:20px !important;
  font-weight:850 !important;
  line-height:1.15;
  padding:0 2px 10px 2px !important;
}

/* v37: keep the Game title border, but restore the original text size */
#roundTitle{
  display:inline-block;
  margin:4px 0 0;
  padding:8px 16px;
  border:2px solid #111;
  border-radius:16px;
  background:#fff;
  line-height:1.05;
}

@media(max-width:700px){
  .court-title{
    font-size:20px !important;
    padding:0 2px 9px 2px !important;
  }
  #roundTitle{
    padding:7px 14px;
    border-radius:14px;
  }
}

@media(max-width:520px){
  .court-title{
    font-size:20px !important;
  }
  #roundTitle{
    padding:6px 12px;
    border-radius:13px;
  }
}


/* v38: center the Game heading and separate it from the Court label */
#roundTitle{
  display:table;
  margin:8px auto 18px auto !important;
}

@media(max-width:700px){
  #roundTitle{
    margin:8px auto 16px auto !important;
  }
}

@media(max-width:520px){
  #roundTitle{
    margin:8px auto 14px auto !important;
  }
}


/* v39: truly center Game title across the entire Current Round card */
#currentSection .round-heading{
  position:relative;
  display:block;
  min-height:104px;
  margin-bottom:8px;
}

#currentSection .round-heading > div:first-child{
  width:100%;
}

#currentSection .round-heading .stats{
  position:absolute;
  top:0;
  right:0;
}

#currentSection #roundTitle{
  position:absolute;
  left:50%;
  top:38px;
  transform:translateX(-50%);
  margin:0 !important;
}

@media(max-width:700px){
  #currentSection .round-heading{
    min-height:98px;
  }

  #currentSection #roundTitle{
    top:36px;
  }
}

@media(max-width:520px){
  #currentSection .round-heading{
    min-height:94px;
  }

  #currentSection #roundTitle{
    top:34px;
  }
}


/* v40: responsive current-court layout based on screen width and court count */

/* iPhone / narrow screens: progressively compact once more than 4 courts show */
@media(max-width:819px){
  #currentCourts.court-count-5{
    gap:12px;
  }

  #currentCourts.court-count-5 .court-title{
    font-size:18px !important;
    padding:0 2px 7px 2px !important;
  }

  #currentCourts.court-count-5 .court-visual{
    border-radius:20px;
  }

  #currentCourts.court-count-5 .court-side{
    min-height:60px;
    padding-top:4px;
    padding-bottom:4px;
    padding-left:11px;
    padding-right:11px;
  }

  #currentCourts.court-count-5 .team-line{
    width:84%;
  }

  #currentCourts.court-count-5 .court-net{
    height:28px;
    min-height:28px;
  }

  #currentCourts.court-count-5 .court-net span{
    min-width:42px;
    height:20px;
    font-size:12px;
    margin:0 8px;
  }

  #currentCourts.court-count-6plus{
    gap:10px;
  }

  #currentCourts.court-count-6plus .court-title{
    font-size:16px !important;
    padding:0 2px 6px 2px !important;
  }

  #currentCourts.court-count-6plus .court-visual{
    border-radius:18px;
  }

  #currentCourts.court-count-6plus .court-side{
    min-height:50px;
    padding-top:3px;
    padding-bottom:3px;
    padding-left:10px;
    padding-right:10px;
  }

  #currentCourts.court-count-6plus .team-line{
    width:88%;
    font-size:18px;
  }

  #currentCourts.court-count-6plus .court-net{
    height:24px;
    min-height:24px;
  }

  #currentCourts.court-count-6plus .court-net::before,
  #currentCourts.court-count-6plus .court-net::after{
    height:2px;
  }

  #currentCourts.court-count-6plus .court-net span{
    min-width:38px;
    height:18px;
    padding:0 8px;
    font-size:11px;
    margin:0 7px;
  }
}

/* iPad / wider screens: keep the courts roomier and use two columns for 5+ courts */
@media(min-width:820px){
  #currentCourts.court-count-5,
  #currentCourts.court-count-6plus{
    grid-template-columns:1fr 1fr;
    gap:16px 18px;
    align-items:start;
  }

  #currentCourts.court-count-5 .court,
  #currentCourts.court-count-6plus .court{
    margin:0;
  }

  #currentCourts.court-count-6plus .court-title{
    font-size:18px !important;
  }

  #currentCourts.court-count-6plus .court-side{
    min-height:58px;
  }

  #currentCourts.court-count-6plus .court-net{
    height:28px;
    min-height:28px;
  }

  #currentCourts.court-count-6plus .court-net span{
    font-size:12px;
    min-width:42px;
    height:20px;
  }
}


/* v41: ultra-compact 7+ court layout on narrow screens.
   Two columns keep 7–8 courts much shorter vertically while preserving legibility. */
@media(max-width:819px){
  #currentCourts.court-count-7plus{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    gap:8px 10px;
    align-items:start;
  }

  #currentCourts.court-count-7plus .court{
    min-width:0;
    margin:0;
  }

  #currentCourts.court-count-7plus .court-title{
    font-size:14px !important;
    line-height:1.05;
    padding:0 1px 4px 1px !important;
    text-align:left;
  }

  #currentCourts.court-count-7plus .court-visual{
    border-width:2px;
    border-radius:14px;
  }

  #currentCourts.court-count-7plus .court-side{
    min-height:34px;
    padding:2px 5px;
  }

  #currentCourts.court-count-7plus .team-line{
    width:96%;
    max-width:none;
    font-size:14px;
    line-height:1;
    gap:6px;
  }

  #currentCourts.court-count-7plus .player-name{
    min-width:0;
    max-width:47%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  #currentCourts.court-count-7plus .court-net{
    height:16px;
    min-height:16px;
  }

  #currentCourts.court-count-7plus .court-net::before,
  #currentCourts.court-count-7plus .court-net::after{
    height:2px;
  }

  #currentCourts.court-count-7plus .court-net span{
    min-width:28px;
    height:14px;
    padding:0 5px;
    margin:0 4px;
    font-size:9px;
    line-height:1;
  }

  /* Recover some vertical room in the current-game header for very large court sets */
  #currentSection:has(#currentCourts.court-count-7plus) .round-heading{
    min-height:86px;
    margin-bottom:4px;
  }

  #currentSection:has(#currentCourts.court-count-7plus) #roundTitle{
    top:30px;
    padding-top:5px;
    padding-bottom:5px;
  }
}

/* Wider screens keep the V40 two-column idea, but recognize the new 7+ class. */
@media(min-width:820px){
  #currentCourts.court-count-7plus{
    grid-template-columns:1fr 1fr;
    gap:14px 18px;
    align-items:start;
  }

  #currentCourts.court-count-7plus .court{
    margin:0;
  }

  #currentCourts.court-count-7plus .court-title{
    font-size:18px !important;
  }

  #currentCourts.court-count-7plus .court-side{
    min-height:54px;
  }

  #currentCourts.court-count-7plus .court-net{
    height:26px;
    min-height:26px;
  }

  #currentCourts.court-count-7plus .court-net span{
    min-width:40px;
    height:20px;
    font-size:12px;
  }
}


/* v60: compact current-game header.
   Removes the CURRENT ROUND eyebrow and places Partner cycle beside Game X. */
#currentSection .round-heading{
  position:static !important;
  display:flex !important;
  flex-direction:column;
  align-items:center !important;
  justify-content:center !important;
  min-height:0 !important;
  margin-bottom:14px !important;
  gap:5px;
}

#currentSection .round-mainline{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  width:100%;
}

#currentSection #roundTitle{
  position:static !important;
  left:auto !important;
  top:auto !important;
  transform:none !important;
  margin:0 !important;
  flex:0 0 auto;
}

#currentSection #partnerProgress{
  position:static !important;
  color:var(--muted);
  font-size:18px;
  white-space:nowrap;
}

#currentSection .waiting-progress{
  color:var(--muted);
  font-size:14px;
  min-height:0;
}

#currentSection .waiting-progress:empty{
  display:none;
}

@media(max-width:520px){
  #currentSection .round-heading{
    margin-bottom:12px !important;
    gap:4px;
  }

  #currentSection .round-mainline{
    gap:12px;
  }

  #currentSection #partnerProgress{
    font-size:15px;
  }
}

/* V41's special 7+ header compaction is superseded by the smaller V42 header. */
@media(max-width:819px){
  #currentSection:has(#currentCourts.court-count-7plus) .round-heading{
    min-height:0 !important;
    margin-bottom:8px !important;
  }

  #currentSection:has(#currentCourts.court-count-7plus) #roundTitle{
    position:static !important;
    top:auto !important;
    padding-top:5px;
    padding-bottom:5px;
  }
}


/* v60: cleaner app header and current-game heading */
#currentSection .round-heading{
  margin-bottom:12px !important;
}

#currentSection .round-mainline{
  position:relative;
  display:block;
  width:100%;
  min-height:58px;
}

#currentSection #roundTitle{
  position:absolute !important;
  left:50% !important;
  top:0 !important;
  transform:translateX(-50%) !important;
  margin:0 !important;
  font-size:20px !important;
  font-weight:850 !important;
  line-height:1.15;
  padding:7px 14px;
}

#currentSection #partnerProgress{
  position:absolute !important;
  right:0;
  top:50%;
  transform:translateY(-50%);
  font-size:15px !important;
  line-height:1.1;
  white-space:nowrap;
}

/* Keep Game X matched to the adaptive Court X label size. */
#currentSection:has(#currentCourts.court-count-5) #roundTitle{
  font-size:18px !important;
}

#currentSection:has(#currentCourts.court-count-6plus) #roundTitle{
  font-size:16px !important;
}

#currentSection:has(#currentCourts.court-count-7plus) #roundTitle{
  font-size:14px !important;
}

/* Supersede the earlier 7+ special positioning rules. */
@media(max-width:819px){
  #currentSection:has(#currentCourts.court-count-7plus) .round-heading{
    min-height:0 !important;
    margin-bottom:8px !important;
  }

  #currentSection:has(#currentCourts.court-count-7plus) #roundTitle{
    position:absolute !important;
    left:50% !important;
    top:0 !important;
    transform:translateX(-50%) !important;
    padding:5px 10px !important;
  }

  #currentSection:has(#currentCourts.court-count-7plus) .round-mainline{
    min-height:48px;
  }
}

@media(max-width:520px){
  #currentSection .round-mainline{
    min-height:54px;
  }

  #currentSection #partnerProgress{
    right:0;
    font-size:13px !important;
  }
}


/* v60 Settings branch: themes + settings gear */
:root{
  --surface-soft:#f9fbfa;
  --court-top:#f8fbfa;
  --court-bottom:#c8d8d2;
  --theme-ring:rgba(23,63,53,.18);
}

html[data-theme="blue"]{
  --bg:#f2f6fa;
  --card:#fff;
  --ink:#162330;
  --muted:#687787;
  --brand:#194b7a;
  --brand2:#2d73a8;
  --line:#d7e3ed;
  --shadow:0 8px 30px rgba(25,75,122,.09);
  --surface-soft:#f7fafe;
  --court-top:#f7fbfe;
  --court-bottom:#c9dcea;
  --theme-ring:rgba(25,75,122,.18);
}

html[data-theme="red"]{
  --bg:#faf4f3;
  --card:#fff;
  --ink:#2b1d1d;
  --muted:#806f6f;
  --brand:#7b2525;
  --brand2:#a74545;
  --line:#ecdada;
  --shadow:0 8px 30px rgba(123,37,37,.09);
  --surface-soft:#fdf8f7;
  --court-top:#fff9f8;
  --court-bottom:#ead0cd;
  --theme-ring:rgba(123,37,37,.18);
}

html[data-theme="purple"]{
  --bg:#f7f4fa;
  --card:#fff;
  --ink:#251d2c;
  --muted:#786d80;
  --brand:#51306f;
  --brand2:#7a4b9f;
  --line:#e4dbea;
  --shadow:0 8px 30px rgba(81,48,111,.09);
  --surface-soft:#fbf8fd;
  --court-top:#fcf9fe;
  --court-bottom:#ded0e8;
  --theme-ring:rgba(81,48,111,.18);
}

/* Apply the selected accent beyond buttons so the whole app feels themed. */
.attendance-row,
.player-chip,
.history-round summary{
  background:var(--surface-soft) !important;
}
.court-side-top{background:var(--court-top) !important}
.court-side-bottom{background:var(--court-bottom) !important}
.court-net{background:var(--brand) !important}
.court-title{background:var(--surface-soft) !important}
input,.select-input{border-color:var(--line) !important}
input[type="checkbox"]{accent-color:var(--brand)}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:9px;
}
.gear-button{
  width:46px;
  height:46px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 46px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#fff;
  color:var(--brand);
  text-decoration:none;
  box-shadow:0 2px 10px rgba(0,0,0,.03);
  -webkit-tap-highlight-color:transparent;
}
.gear-button.active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}
.gear-svg{
  width:25px;
  height:25px;
  fill:currentColor;
}

.settings-intro{margin-top:-5px}
.settings-copy{line-height:1.45}
.theme-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.theme-option{
  display:flex;
  align-items:center;
  gap:11px;
  min-height:58px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  font-weight:800;
  cursor:pointer;
}
.theme-option:has(input:checked){
  border-color:var(--brand);
  box-shadow:0 0 0 3px var(--theme-ring);
}
.theme-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.theme-swatch{
  width:28px;
  height:28px;
  border-radius:50%;
  display:inline-block;
  flex:0 0 28px;
  border:2px solid rgba(0,0,0,.08);
}
.theme-swatch-green{background:#173f35}
.theme-swatch-blue{background:#194b7a}
.theme-swatch-red{background:#7b2525}
.theme-swatch-purple{background:#51306f}
.setting-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:48px;
  font-weight:800;
}
.setting-value{
  color:var(--muted);
  font-size:14px;
  font-weight:750;
}

@media(max-width:520px){
  .gear-button{
    width:42px;
    height:42px;
    flex-basis:42px;
  }
  .gear-svg{width:23px;height:23px}
  .theme-options{grid-template-columns:1fr 1fr}
  .theme-option{min-height:54px;padding:10px}
}


/* v60: identical current-game header at every court count */
#currentSection .round-heading{
  position:static !important;
  display:block !important;
  min-height:0 !important;
  margin-bottom:12px !important;
}

#currentSection .round-mainline{
  position:relative !important;
  display:block !important;
  width:100% !important;
  min-height:58px !important;
}

#currentSection #roundTitle,
#currentSection:has(#currentCourts.court-count-5) #roundTitle,
#currentSection:has(#currentCourts.court-count-6plus) #roundTitle,
#currentSection:has(#currentCourts.court-count-7plus) #roundTitle{
  position:absolute !important;
  left:50% !important;
  top:0 !important;
  transform:translateX(-50%) !important;
  margin:0 !important;
  font-size:20px !important;
  font-weight:850 !important;
  line-height:1.15 !important;
  padding:7px 14px !important;
}

#currentSection #partnerProgress{
  position:absolute !important;
  right:0 !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  font-size:14px !important;
  line-height:1.1 !important;
  white-space:nowrap !important;
}

#currentSection #waitingProgress{
  display:none !important;
}

@media(max-width:819px){
  #currentSection:has(#currentCourts.court-count-7plus) .round-heading{
    min-height:0 !important;
    margin-bottom:12px !important;
  }

  #currentSection:has(#currentCourts.court-count-7plus) .round-mainline{
    min-height:58px !important;
  }

  #currentSection:has(#currentCourts.court-count-7plus) #roundTitle{
    position:absolute !important;
    left:50% !important;
    top:0 !important;
    transform:translateX(-50%) !important;
    font-size:20px !important;
    padding:7px 14px !important;
  }
}

@media(max-width:520px){
  #currentSection .round-mainline{
    min-height:54px !important;
  }

  #currentSection #partnerProgress{
    right:0 !important;
    font-size:12px !important;
  }
}

/* v60: remove the filled center band.
   The two team colors meet at the center; only the divider line and VS badge float above them. */
.court-net,
.history-court-net{
  background:transparent !important;
}

.court-net::before,
.court-net::after,
.history-court-net::before,
.history-court-net::after{
  background:#111 !important;
}

.court-net span,
.history-court-net span{
  background:var(--brand) !important;
  box-shadow:none !important;
}


/* v60: dedicated active-session attendance editor */
.session-summary-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.session-summary-row .compact-session-info{
  flex:1 1 auto;
  min-width:0;
}

.edit-attendees-btn{
  flex:0 0 auto;
  white-space:nowrap;
  text-decoration:none;
  padding:9px 12px;
  border-radius:11px;
  font-size:13px;
}

@media(max-width:520px){
  .session-summary-row{gap:8px}
  .edit-attendees-btn{
    padding:8px 9px;
    font-size:11px;
  }
}


/* v60: larger outlined gear inside the existing settings button */
.gear-svg{
  width:33px !important;
  height:33px !important;
  fill:none !important;
  stroke:currentColor;
  flex:0 0 auto;
}

@media(max-width:520px){
  .gear-svg{
    width:31px !important;
    height:31px !important;
  }
}

/* v60: history courts mirror the live court alignment */
.history-court{
  border:0 !important;
  border-radius:0 !important;
  overflow:visible !important;
  background:transparent !important;
  padding:6px 0 10px !important;
}

.history-court-title{
  display:block;
  margin:0 0 6px 2px !important;
  padding:0 !important;
  font-size:14px !important;
  line-height:1.1;
  font-weight:850 !important;
  color:var(--muted);
}

.history-court-visual{
  border:2px solid #111;
  border-radius:20px;
  overflow:hidden;
}

.history-court-side{
  display:flex;
  align-items:center;
  justify-content:center;
}

.history-team-line{
  width:76%;
  max-width:560px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  font-weight:800;
  line-height:1.05;
}

.history-player-name{
  flex:0 1 auto;
  min-width:0;
  text-align:center;
}

@media(max-width:700px){
  .history-team-line{
    width:82%;
  }
}

@media(max-width:520px){
  .history-team-line{
    width:86%;
    gap:12px;
  }
}


/* v60: fixed two-line session summary */
.compact-session-info{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:2px;
  line-height:1.12;
}

.session-group-line{
  display:block;
  font-weight:850;
  font-size:20px;
}

.session-count-line{
  display:block;
  font-weight:800;
  font-size:16px;
}

/* v60: on iPhone/narrow screens, keep live courts one per row.
   Use progressively shorter cards instead of switching 7+ courts to two columns. */
@media(max-width:819px){
  #currentCourts.court-count-7plus{
    grid-template-columns:1fr !important;
    gap:7px !important;
  }

  #currentCourts.court-count-7plus .court{
    width:100%;
    min-width:0;
  }

  #currentCourts.court-count-7plus .court-title{
    font-size:14px !important;
    line-height:1.05 !important;
    padding:0 1px 3px 1px !important;
  }

  #currentCourts.court-count-7plus .court-visual{
    border-radius:14px !important;
  }

  #currentCourts.court-count-7plus .court-side{
    min-height:31px !important;
    padding:1px 8px !important;
  }

  #currentCourts.court-count-7plus .team-line{
    width:84% !important;
    font-size:15px !important;
    line-height:1 !important;
  }

  #currentCourts.court-count-7plus .court-net{
    height:14px !important;
    min-height:14px !important;
  }

  #currentCourts.court-count-7plus .court-net::before,
  #currentCourts.court-count-7plus .court-net::after{
    height:2px !important;
  }

  #currentCourts.court-count-7plus .court-net span{
    min-width:30px !important;
    height:16px !important;
    padding:0 5px !important;
    margin:0 6px !important;
    font-size:9px !important;
  }
}

@media(max-width:520px){
  .session-group-line{
    font-size:18px;
  }

  .session-count-line{
    font-size:15px;
  }

  .session-summary-row{
    align-items:center;
  }
}


/* v60: Settings install/feedback sections and subtle page feedback links */
.settings-steps{
  margin:0 0 12px 22px;
  padding:0;
  line-height:1.5;
}
.settings-steps li{
  margin:5px 0;
}
.feedback-email-button{
  margin-top:8px;
}
.page-feedback-link{
  text-align:center;
  margin:4px 0 20px;
  font-size:13px;
}
.page-feedback-link a{
  color:var(--muted);
  text-decoration:underline;
  text-underline-offset:2px;
}
.page-feedback-link a:active{
  color:var(--brand);
}
#feedbackSection,
#installSection{
  scroll-margin-top:16px;
}


/* v60: make center divider lines touch the VS pill */
.court-net span,
.history-court-net span,
#currentCourts.court-count-5 .court-net span,
#currentCourts.court-count-6plus .court-net span,
#currentCourts.court-count-7plus .court-net span{
  margin-left:0 !important;
  margin-right:0 !important;
}

/* Keep the divider continuous right up to the badge edges. */
.court-net::before,
.court-net::after,
.history-court-net::before,
.history-court-net::after{
  border-radius:0 !important;
}

#offlineUseSection{
  scroll-margin-top:16px;
}


/* v60: optional Game 1 waiting preference */
.game1-wait-help{
  margin:10px 0 0;
}

.game1-wait-check{
  display:flex;
  align-items:center;
  gap:5px;
  flex:0 0 auto;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}

.game1-wait-check input{
  width:18px;
  height:18px;
  margin:0;
  accent-color:var(--brand);
}

.game1-wait-check input:disabled + span{
  opacity:.48;
}

@media(max-width:520px){
  .attendance-row{
    gap:7px;
  }

  .attendance-check{
    gap:8px;
  }

  .game1-wait-check{
    gap:4px;
    font-size:10px;
  }

  .game1-wait-check input{
    width:17px;
    height:17px;
  }
}


/* v60: optional court editing */
.setting-toggle-row{
  align-items:flex-start;
  gap:18px;
}
.setting-toggle-copy{
  flex:1;
  min-width:0;
}
.setting-toggle-copy .muted{
  margin-top:6px;
}
.switch-control{
  position:relative;
  display:inline-flex;
  flex:0 0 auto;
  width:52px;
  height:31px;
  margin-top:1px;
}
.switch-control input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.switch-slider{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:#cbd5d1;
  transition:.18s ease;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.07);
}
.switch-slider::after{
  content:"";
  position:absolute;
  width:25px;
  height:25px;
  left:3px;
  top:3px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 4px rgba(0,0,0,.22);
  transition:.18s ease;
}
.switch-control input:checked + .switch-slider{
  background:var(--brand);
}
.switch-control input:checked + .switch-slider::after{
  transform:translateX(21px);
}
.switch-control input:focus-visible + .switch-slider{
  outline:3px solid color-mix(in srgb,var(--brand) 28%,transparent);
  outline-offset:2px;
}

.round-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}
#editCourtsBtn{
  padding:7px 10px;
  min-height:34px;
}
#editCourtsBtn.editing-active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.court-edit-help{
  margin:-2px 0 10px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#f8fbfa;
  color:var(--muted);
  text-align:center;
  font-size:12px;
  font-weight:750;
}
.court-edit-player{
  appearance:none;
  -webkit-appearance:none;
  display:inline;
  width:auto;
  min-width:0;
  border:0;
  border-radius:9px;
  padding:3px 5px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:inherit;
  line-height:inherit;
  text-align:center;
}
.court-edit-player:disabled{
  opacity:1;
  cursor:default;
}
.court-edit-player:not(:disabled){
  cursor:pointer;
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:3px;
}
.court-edit-player.selected{
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  box-shadow:0 0 0 2px #fff,0 0 0 4px var(--brand);
}

@media(max-width:520px){
  .round-actions{gap:5px}
  #editCourtsBtn{
    padding:6px 8px;
    font-size:11px;
  }
  .court-edit-help{
    font-size:11px;
  }
  .court-edit-player{
    padding:2px 3px;
  }
}


/* v60: clearer edit controls and setting state */
.edit-action-btn{
  background:color-mix(in srgb,var(--brand) 11%,#fff);
  color:var(--brand);
  border:1px solid color-mix(in srgb,var(--brand) 55%,#fff);
  font-weight:850;
}
.edit-action-btn:active{
  background:color-mix(in srgb,var(--brand) 18%,#fff);
}
#editCourtsBtn.editing-active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.switch-with-state{
  display:flex;
  align-items:center;
  gap:9px;
  flex:0 0 auto;
}
.switch-state-label{
  min-width:24px;
  color:var(--ink);
  font-size:13px;
  font-weight:850;
}

.court-auto-help{
  margin:10px 0 0;
  text-align:center;
}

.court-edit-waiter{
  border:1px solid transparent;
  font:inherit;
}
button.court-edit-waiter{
  color:var(--ink);
  cursor:pointer;
  border-color:color-mix(in srgb,var(--brand) 35%,#fff);
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:3px;
}
.court-edit-waiter.selected{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
  text-decoration:none;
  box-shadow:0 0 0 2px #fff,0 0 0 4px var(--brand);
}


/* v60: queued interface polish */
#currentSection .round-mainline{
  position:relative !important;
  display:block !important;
  width:100% !important;
  min-height:48px !important;
}

#currentSection #partnerProgress{
  position:absolute !important;
  left:0 !important;
  right:auto !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  font-size:13px !important;
  line-height:1.1;
  white-space:nowrap;
}

#currentSection #roundTitle{
  position:absolute !important;
  left:50% !important;
  top:0 !important;
  transform:translateX(-50%) !important;
}

#currentSection #editCourtsBtn{
  position:absolute;
  right:0;
  top:50%;
  transform:translateY(-50%);
  margin:0;
}

#currentSection .round-actions{
  display:none !important;
}

/* Waiting names visually match the player names on the courts. */
#currentWaiting{
  justify-content:center;
  align-items:center;
  gap:12px;
}
#currentWaiting .waiter{
  background:transparent;
  border:0;
  border-radius:9px;
  padding:3px 5px;
  color:var(--ink);
  font-size:18px;
  line-height:1.1;
  font-weight:850;
}
#currentWaiting button.waiter{
  appearance:none;
  -webkit-appearance:none;
}
#currentWaiting button.court-edit-waiter{
  border:0;
  text-decoration:underline;
  text-decoration-style:dotted;
  text-underline-offset:3px;
}
#currentWaiting .court-edit-waiter.selected{
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  box-shadow:0 0 0 2px #fff,0 0 0 4px var(--brand);
}

/* Put the explicit state below the Court Editing switch. */
.switch-with-state{
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:4px;
}
.switch-state-label{
  min-width:0;
  text-align:center;
  line-height:1;
}

/* Make the court-label instruction easier to notice without adding much height. */
.court-label-help{
  font-size:15px !important;
  font-weight:750 !important;
  line-height:1.3;
  margin-bottom:4px;
}

/* Subtle beta/version treatment. */
.version{
  white-space:nowrap;
}

/* Settings copyright footer. */
.settings-footer{
  margin:22px 0 4px;
  text-align:center;
  color:var(--muted);
  font-size:11px;
  line-height:1.55;
}

@media(max-width:520px){
  #currentSection #partnerProgress{
    font-size:12px !important;
  }
  #currentSection #editCourtsBtn{
    font-size:11px;
    padding:6px 8px;
  }
  #currentWaiting .waiter{
    font-size:17px;
  }
}


/* v60: approved CourtFlow brand mark in the app header */
.brand-lockup{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.brand-mark{
  display:block;
  width:44px;
  height:44px;
  flex:0 0 44px;
  border-radius:12px;
  box-shadow:0 5px 14px rgba(17,48,40,.12);
}

/* v60: waiting names sit left beneath Waiting. */
#currentWaiting{
  justify-content:flex-start !important;
  align-items:center;
}
#currentWaiting .waiter{
  text-align:left;
  margin:0;
}

/* v60: copyright directly beneath Feedback on working pages. */
.page-copyright{
  margin-top:6px;
  color:var(--muted);
  font-size:10px;
  line-height:1.35;
}

@media(max-width:520px){
  .brand-mark{
    width:40px;
    height:40px;
    flex-basis:40px;
    border-radius:11px;
  }
}
