:root {
  --accent: #2f6b4e;
  --accent-deep: #1b3a2c;
  --accent-soft: #e8efe9;
  --bg: #faf8f4;
  --paper: #ffffff;
  --ink: #1c1b18;
  --ink-2: #4a4842;
  --ink-3: #8a8881;
  --line: #e6e3dc;
  --line-2: #efece5;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(28,27,24,.04), 0 0 0 1px rgba(28,27,24,.04);
  --shadow-md: 0 1px 2px rgba(28,27,24,.05), 0 8px 24px -12px rgba(28,27,24,.12);
  --font-jp: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "ヒラギノ角ゴ ProN W3", Meiryo, sans-serif;
  --font-en: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-num: "Helvetica Neue", "Inter", Helvetica, ui-sans-serif, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-jp);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  text-wrap: pretty;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

.app { min-height: 100vh; }

/* ============ Setup screen ============ */
.setup {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 24px 80px;
}
.setup-inner {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-en);
  letter-spacing: 0.04em;
  font-size: 13px;
  font-weight: 500;
}
.brand-mark { display: inline-flex; }
.brand-name { color: var(--ink-2); }

.setup-head { display: flex; flex-direction: column; gap: 18px; }
.setup-title {
  margin: 8px 0 0;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.setup-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.75;
}

.setup-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.setup-form-3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 720px) {
  .setup-form-3 { grid-template-columns: 1fr 1fr; }
}

.stepper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
}
.stepper-head { display: flex; flex-direction: column; gap: 4px; }
.stepper-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.stepper-hint {
  font-size: 11.5px;
  color: var(--ink-3);
}
.stepper-row {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
}
.step-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 18px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.step-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.step-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.step-value {
  text-align: center;
}
.step-num {
  font-family: var(--font-num);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.summary {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 18px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.summary-row:last-child { border-bottom: none; }
.summary-row--total .summary-val { color: var(--accent); font-weight: 600; }
.summary-key { font-size: 13px; color: var(--ink-2); }
.summary-val {
  font-family: var(--font-num);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.names { display: flex; flex-direction: column; gap: 12px; }
.names-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.names-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.name-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.name-input:focus-within {
  border-color: var(--accent);
}
.name-num {
  font-family: var(--font-num);
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 18px;
}
.name-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
  padding: 2px 0;
}

/* Primary button */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 18px 28px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.18s ease;
  width: 100%;
}
.primary-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}
.primary-btn svg { transition: transform 0.18s ease; }
.primary-btn:hover svg { transform: translateX(3px); }

/* ============ Results screen ============ */
.results {
  min-height: 100vh;
  padding-bottom: 80px;
}
.results-head {
  position: sticky;
  top: 0;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}
.results-head-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.results-meta {
  display: flex;
  gap: 6px;
}
.meta-pill {
  font-family: var(--font-num);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  color: var(--accent-deep);
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.15s ease;
}
.ghost-btn:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.results-title-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 28px 24px;
}
.results-title {
  margin: 6px 0 6px;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.results-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.rounds {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(440px, 1fr));
  gap: 14px;
}

/* ============ Round card ============ */
.round {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.round-collapsed {
  gap: 0;
}
.round:hover {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.round-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.round-open .round-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-2);
}
.round-head-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.round-head-toggle:hover .round-num-val {
  color: var(--accent-deep);
}
.round-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.round-num {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}
.round-num-lbl {
  font-family: var(--font-en);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.round-num-val {
  font-family: var(--font-num);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.rest {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rest-lbl {
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.rest-list {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.rest-list .chip-sm {
    padding: 0;
    box-sizing: border-box;
}

.courts {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.court {
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.court-head {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.court-tag {
  font-family: var(--font-en);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  font-weight: 600;
}
.court-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.team {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.team-b { justify-content: center; }
.vs {
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-align: center;
  padding: 0 4px;
}

/* Player chip */
.chip {
  /* display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink); */
}
.chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-num);
  font-size: 16px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  padding: 1px 5px 0;
}
.chip-name { padding-right: 2px; }
.chip-sm { font-size: 11.5px; padding: 3px 8px 3px 3px; }
.chip-sm .chip-num { min-width: 17px; height: 17px; font-size: 12px; }

/* ============ Stats ============ */
.stats {
  max-width: 1080px;
  margin: 32px auto 0;
  padding: 24px 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-left: 28px;
  margin-right: 28px;
}
@media (min-width: 1136px) {
  .stats { margin-left: auto; margin-right: auto; }
}
.stats-head { margin-bottom: 18px; }
.stats-head h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}
.stats-sub {
  margin: 0;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.stats-legend {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12px;
  color: var(--ink-3);
}
.stats-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.stats-legend-swatch {
  width: 14px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}
.stats-legend-swatch--all { opacity: 0.35; }
.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 24px;
}
.stat-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.stat-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-num {
  font-family: var(--font-num);
  font-size: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 14px;
}
.stat-bar {
  position: relative;
  height: 6px;
  background: var(--line-2);
  border-radius: 999px;
  overflow: hidden;
}
.stat-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.stat-bar-fill--all {
  z-index: 1;
  opacity: 0.35;
}
.stat-bar-fill--done { z-index: 2; }
.stat-done { color: var(--accent-deep); }
.stat-val {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-rest { color: var(--ink-3); }

.results-foot {
  max-width: 480px;
  margin: 40px auto 0;
  padding: 0 28px;
}

/* ============ Completion checkbox ============ */
.round-head-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: 65%;
}

.done-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: all 0.15s ease;
}
.done-check:hover { border-color: var(--ink); }
.done-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.done-check-box {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--ink-3);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s ease;
}
.done-check-lbl {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
}
.done-check input:checked + .done-check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.done-check input:checked ~ .done-check-lbl {
  color: var(--accent-deep);
  font-weight: 600;
}

/* Completed round visual */
.round-done {
  background: var(--bg);
  border-style: dashed;
  opacity: 0.78;
}
.round-done .court {
  background: var(--line-2);
}
.round-done .court-tag {
  color: var(--ink-3);
}
.round-done .vs {
  color: var(--ink-3);
}
.round-done .chip {
  color: var(--ink-2);
}
.round-done .chip-num {
  background: var(--ink-3);
}
.round-done .round-num-val {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--ink-3);
  text-decoration-thickness: 1.5px;
}

/* Next round highlight */
.round-next {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.round-next .round-num-lbl {
  color: var(--accent);
  font-weight: 700;
}
.round-next .round-num-val {
  color: var(--accent-deep);
}

/* Highlighted (priority) chip */
.chip-hi {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.chip-hi .chip-num {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ============ Accordion (shared) ============ */
.accordion-chev {
  flex-shrink: 0;
  color: var(--ink-3);
  transition: transform 0.2s ease;
}
.round-open .accordion-chev,
.selector-open .accordion-chev,
.weights-open .accordion-chev {
  transform: rotate(180deg);
}

/* ============ Player selector (priority / rest) ============ */
.selector {
  max-width: 1080px;
  margin: 0 28px 12px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.selector:first-of-type { margin-top: 20px; }
@media (min-width: 1136px) {
  .selector { margin-left: auto; margin-right: auto; }
}
.selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0px;
  padding: 14px 14px;
}
.selector-head-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.selector-head-toggle:hover .selector-title {
  color: var(--accent-deep);
}
.selector-head-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.selector-body {
  padding: 0 22px 18px;
  border-top: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.selector-body .selector-sub {
  margin-top: 14px;
}
.selector-sub-collapsed {
  margin: 0;
  color: var(--ink-3);
}
.selector-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.selector-target {
  color: var(--accent);
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  margin-left: 2px;
}
.selector-rest .selector-target { color: var(--ink-2); }
.selector-sub {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.selector-warn {
  color: #b85432;
  font-weight: 500;
}
.selector-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.selector-count {
  font-family: var(--font-num);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.selector-rest .selector-count {
  color: #4a4842;
  background: var(--line-2);
}
.selector-clear {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.selector-clear:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 6px;
}
.selector-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  transition: all 0.12s ease;
  min-height: 40px;
}
.selector-btn:hover:not(:disabled):not(.active) {
  border-color: var(--ink);
  color: var(--ink);
}
.selector-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.selector-btn-num {
  font-family: var(--font-num);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.selector-btn-name {
  font-size: 10.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.selector-priority .selector-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.selector-priority .selector-btn.active .selector-btn-name {
  color: rgba(255, 255, 255, 0.85);
}
.selector-rest .selector-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.selector-rest .selector-btn.active .selector-btn-name {
  color: rgba(255, 255, 255, 0.7);
}
.selector-rest-all .selector-count {
  background: var(--accent-soft);
  color: var(--accent-deep);
}
.selector-rest-all .selector-btn.active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--bg);
}
.selector-rest-all .selector-btn.active .selector-btn-name {
  color: rgba(255, 255, 255, 0.75);
}

/* Rested chip indicator (force-rest in next round) */
.chip-rested {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.chip-rested .chip-num {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
/* Permanent rest across remaining rounds */
.chip-rested-permanent {
  background: var(--accent-deep);
  background: var(--accent-soft);
  border-color: var(--accent-deep);
  color: var(--bg);
}
.chip-rested-permanent .chip-num {
  background: rgba(255, 255, 255, 0.22);
  color: var(--accent-deep);
}

/* ============ Weights section ============ */
.weights {
  max-width: 1080px;
  margin: 0 28px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (min-width: 1136px) {
  .weights { margin-left: auto; margin-right: auto; }
}
.weights-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  padding: 14px 22px;
  text-align: left;
  gap: 12px;
  transition: background 0.12s ease;
}
.weights-head:hover { background: var(--bg); }
.weights-head-text { display: flex; flex-direction: column; gap: 2px; }
.weights-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.weights-sub {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}
.weights-head-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-3);
}
.weights-reset {
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  cursor: pointer;
}
.weights-reset:hover { color: var(--ink); }
.weights-chev {
  transition: transform 0.2s ease;
}
.weights-open .weights-chev {
  transform: rotate(180deg);
}
.weights-body {
  padding: 4px 22px 20px;
  border-top: 1px solid var(--line-2);
}
.weights-help {
  margin: 16px 0 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.weights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 24px;
}
.weight-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.weight-row-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weight-row-num {
  font-family: var(--font-num);
  font-size: 15px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  min-width: 14px;
}
.weight-seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  gap: 0;
}
.weight-seg-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all 0.12s ease;
  cursor: pointer;
}
.weight-seg-btn:hover:not(.active) {
  color: var(--ink);
}
.weight-seg-btn.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .selector { margin-left: 16px; margin-right: 16px; padding: 0px; }
  .selector-head { flex-direction: column; align-items: stretch; }
  .weights { margin-left: 16px; margin-right: 16px; }
  .weights-head { padding: 14px 16px; }
  .weights-body { padding: 4px 16px 16px; }
  .weights-grid { grid-template-columns: 1fr; }
}

/* Header — progress pill and primary regen */
.meta-pill-prog {
  background: var(--ink);
  color: var(--bg);
}

/* Rounds adjuster (inline stepper in header) */
.meta-rounds {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.meta-rounds-btn {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.meta-rounds-btn:hover:not(:disabled) {
  background: var(--bg);
}
.meta-rounds-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.meta-rounds-val {
  font-family: var(--font-num);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  padding: 0 8px;
  white-space: nowrap;
}

.ghost-btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.ghost-btn-primary:hover:not(:disabled) {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.ghost-btn:disabled,
.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Compact mode */
.compact .rounds { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.compact .round { padding: 14px; gap: 10px; }
.compact .round-num-val { font-size: 22px; }
.compact .court { padding: 10px 12px; }
.compact .chip { font-size: 12px; }

/* Responsive */
@media (max-width: 640px) {
  .setup { padding: 32px 18px 60px; }
  .setup-title { font-size: 30px; }
  .setup-form { grid-template-columns: 1fr; }
  .stepper-head { align-items: center; gap: 20px; }
  .names-grid { grid-template-columns: 1fr; }
  .rounds { grid-template-columns: 1fr; padding: 0 16px; gap: 10px; }
  .results-title-wrap { padding: 0px 18px 10px; }
  .results-head-inner { padding: 12px 18px; }
  .results-meta { flex-wrap: wrap; }
  .meta-pill:nth-of-type(1) { display: none; }
  .stats { margin-left: 16px; margin-right: 16px; padding: 18px; }
  /* .court-body { grid-template-columns: 1fr; gap: 6px; } */
  /* .team-b { justify-content: flex-start; } */
  .vs { text-align: left; }
  .ghost-btn span { display: none; }
  .ghost-btn-primary span { display: inline; }
}

.brand-image {
    border-radius: 4px;
}