/* =========================================
   BUTTONS
   See docs/style-guide.html#buttons for the canonical reference.
   Pattern: .btn + variant modifier (.btn--primary, etc.).
   ========================================= */

/* ---------- Base ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.4rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
  width: fit-content;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Variants ---------- */
.btn--primary {
  background: var(--gold);
  color: var(--ink);
}
.btn--primary:hover { background: var(--gold-dark); }

.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}
.btn--secondary:hover {
  background: var(--bg-2);
  border-color: var(--ink-3);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
}
.btn--ghost:hover {
  background: var(--bg-2);
  color: var(--ink);
}

.btn--danger {
  background: var(--danger);
  color: white;
}
.btn--danger:hover { background: #d34646; }

.btn--link {
  background: transparent;
  padding: 0;
  border: 0;
  color: var(--ink-2);
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.btn--link:hover { color: var(--ink); }
.btn--link.btn--danger {
  color: var(--danger);
  background: transparent;
}
.btn--link.btn--danger:hover {
  color: #d34646;
  background: transparent;
}

/* ---------- Sizes ---------- */
.btn--sm {
  padding: 0.3rem 0.85rem;
  font-size: 0.92rem;
}
.btn--lg {
  padding: 0.7rem 1.6rem;
  font-size: 1.07rem;
}

/* ---------- Icon-only ---------- */
.btn--icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.95rem;
  line-height: 1;
}
.btn--icon > * { display: block; line-height: 1; }
.btn--sm.btn--icon { width: 30px; height: 30px; font-size: 0.95rem; padding: 0; }

/* ---------- Layout helpers ---------- */
/* Form footer: right-aligned button row with top border. Use inside <form>
   to wrap submit / cancel actions. */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* Inline button row (e.g. page-header action groups). No border/spacing. */
.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* ---------- Utilities ---------- */
.btn--hidden { display: none; }
.clearfix::after { content: ""; clear: both; display: table; }

/* ---------- Segmented control (replaces ad-hoc .games-view-switch
   / .ruleset-pill-group / .standings-aggregation-toggle). */
.segmented {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  width: max-content;
}
.segmented__btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0.3rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 700;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented__btn:hover { color: var(--ink); }
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
