/**
 * League Manager — Components CSS
 *
 * League cards, browser lists, create form, tabs, standings,
 * teams, rules, join section, commissioner panel.
 */

/* ========================================================
   BROWSER SECTIONS
   ======================================================== */
.lm-browser__section {
  margin-bottom: var(--space-8);
}

.lm-browser__section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
  letter-spacing: var(--tracking-wide);
}

.lm-browser__list {
  display: grid;
  gap: var(--space-4);
}

/* ========================================================
   LEAGUE CARD
   ======================================================== */
.lm-league-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.lm-league-card:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
}

.lm-league-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.lm-league-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-500);
  margin: 0;
  letter-spacing: var(--tracking-wide);
}

.lm-league-card__meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.lm-league-card__footer {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.lm-league-card__action {
  width: 100%;
}

/* ========================================================
   CREATE FORM
   ======================================================== */
.lm-create__form {
  max-width: 860px;
}

/* ── Grid Layout ── */
.lm-create__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-6);
}

.lm-create__grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ── Radio Card Group ── */
.lm-radio-group--cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.lm-radio-group--wrap {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.lm-radio--card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.lm-radio--card:hover {
  border-color: var(--border-default);
  background: var(--bg-elevated);
}

.lm-radio--card:has(input:checked) {
  border-color: var(--gold-600);
  background: var(--gold-alpha-10);
  box-shadow: 0 0 0 1px var(--gold-600);
}

.lm-radio--card input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.lm-radio__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--white-alpha-5);
  color: var(--text-muted);
  font-size: var(--text-lg);
  flex-shrink: 0;
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.lm-radio--card:has(input:checked) .lm-radio__icon {
  color: var(--gold-500);
  background: var(--gold-alpha-15);
}

.lm-radio__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lm-radio__text strong {
  font-family: var(--font-button);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.2;
}

.lm-radio__text small {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.3;
}

.lm-radio--card:has(input:checked) .lm-radio__text strong {
  color: var(--gold-500);
}

/* ── Toggle Switches ── */
.lm-create__toggles {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.lm-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.lm-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.lm-toggle__track {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--white-alpha-8);
  border-radius: 11px;
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease-out);
}

.lm-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.lm-toggle input:checked + .lm-toggle__track {
  background: var(--gold-alpha-15);
}

.lm-toggle input:checked + .lm-toggle__track::after {
  transform: translateX(18px);
  background: var(--gold-500);
}

.lm-toggle__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.lm-toggle input:checked ~ .lm-toggle__label {
  color: var(--text-primary);
}

/* ── Accordion Sections ── */
.lm-create__section {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.lm-create__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-out);
}

.lm-create__section-header:hover {
  background: var(--bg-card);
}

.lm-create__section-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-primary);
  margin: 0;
  letter-spacing: var(--tracking-wide);
}

.lm-create__chevron {
  color: var(--text-muted);
  transition: transform var(--duration-fast) var(--ease-out);
}

.lm-create__section--open .lm-create__chevron {
  transform: rotate(180deg);
}

.lm-create__section-body {
  display: none;
  padding: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.lm-create__section--open .lm-create__section-body {
  display: block;
}

/* ── Preset Grid ── */
.lm-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--space-3);
}

.lm-preset-chip {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-button);
  font-size: var(--text-sm);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.lm-preset-chip:hover {
  border-color: var(--border-default);
  color: var(--text-primary);
}

.lm-preset-chip--active {
  border-color: var(--gold-600);
  color: var(--gold-500);
  background: var(--gold-alpha-10);
}

/* ── Create Actions ── */
.lm-create__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* ========================================================
   TABS
   ======================================================== */
.lm-tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lm-tabs__tab {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-button);
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.lm-tabs__tab:hover {
  color: var(--text-primary);
}

.lm-tabs__tab--active {
  color: var(--gold-500);
  border-bottom-color: var(--gold-500);
}

.lm-tab-panel {
  display: none;
}

.lm-tab-panel--active {
  display: block;
  animation: lmFadeIn var(--duration-fast) var(--ease-out);
}

/* ========================================================
   LEAGUE HOME — HEADER / META
   ======================================================== */
.lm-home__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.lm-home__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  color: var(--gold-500);
  margin: 0;
}

.lm-home__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

/* ========================================================
   TEAMS LIST
   ======================================================== */
.lm-teams-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.lm-team-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.lm-team-row:hover {
  border-color: var(--border-default);
}

.lm-team-row__identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.lm-team-row__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.lm-team-row__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lm-team-row__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lm-team-row__coach {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.lm-team-row__stats {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.lm-team-row__pending {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ========================================================
   RULES
   ======================================================== */
.lm-rules__section {
  margin-bottom: var(--space-4);
}

.lm-rules__heading {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--gold-500);
  margin: 0 0 var(--space-2);
  letter-spacing: var(--tracking-wide);
}

.lm-rules__section p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-1);
}

.lm-rules__text {
  white-space: pre-line;
}

/* ========================================================
   JOIN SECTION
   ======================================================== */
.lm-join {
  padding: var(--space-4);
  background: var(--gold-alpha-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  margin-top: var(--space-6);
}

.lm-join__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-500);
  margin: 0 0 var(--space-4);
}

.lm-join__fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: flex-end;
  margin-bottom: var(--space-4);
}

.lm-join__fields .lm-field {
  margin-bottom: 0;
  flex: 1;
  min-width: 180px;
}

/* ========================================================
   COMMISSIONER PANEL
   ======================================================== */
.lm-commissioner {
  border: 1px solid var(--gold-alpha-20);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-top: var(--space-6);
  background: var(--gold-alpha-5);
}

.lm-commissioner__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-500);
  margin: 0 0 var(--space-4);
}

.lm-commissioner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ========================================================
   LOGIN GATE
   ======================================================== */
.lm-login-gate {
  text-align: center;
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}

.lm-login-gate p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-3);
}

/* ========================================================
   COMMISSIONER STATUS CONTROLS
   ======================================================== */
.lm-commissioner__status {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.lm-commissioner__status:empty {
  display: none;
}

/* ========================================================
   SCHEDULE
   ======================================================== */
.lm-schedule__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.lm-schedule__generate {
  margin-bottom: var(--space-4);
  text-align: center;
}

.lm-schedule__empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Round accordion */
.lm-schedule__round {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
}

.lm-schedule__round-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  user-select: none;
  transition: background var(--duration-fast) var(--ease-out);
}

.lm-schedule__round-header:hover {
  background: var(--bg-subtle);
}

.lm-schedule__round-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
  margin: 0;
}

.lm-schedule__round-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.lm-schedule__chevron {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-fast) var(--ease-out);
}

.lm-schedule__round--open .lm-schedule__chevron {
  transform: rotate(-135deg);
}

.lm-schedule__round-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-normal) var(--ease-out);
}

.lm-schedule__round--open .lm-schedule__round-body {
  max-height: 2000px;
}

.lm-schedule__games {
  padding: 0 var(--space-4) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Matchup card */
.lm-matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  gap: var(--space-3);
}

.lm-matchup--bye {
  opacity: 0.6;
}

.lm-matchup__team {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.lm-matchup__team--away {
  flex-direction: row-reverse;
  text-align: right;
}

.lm-matchup__logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.lm-matchup__name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-matchup__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
  min-width: 60px;
}

.lm-matchup__score {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-500);
  letter-spacing: var(--tracking-wider);
}

.lm-matchup__vs {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Game status badges */
.lm-game-status {
  display: inline-block;
  font-size: var(--text-xs);
  font-family: var(--font-button);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.lm-game-status--scheduled {
  background: var(--bg-subtle);
}

.lm-game-status--completed {
  background: rgba(72, 187, 120, 0.2);
  color: #48bb78;
}

.lm-game-status--pending_verification {
  background: rgba(237, 137, 54, 0.2);
  color: #ed8936;
}

.lm-game-status--bye {
  background: rgba(160, 174, 192, 0.15);
  color: var(--text-muted);
}

.lm-matchup__actions {
  flex-shrink: 0;
}

/* ========================================================
   STANDINGS TABLE
   ======================================================== */
.lm-standings__empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.lm-standings__wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lm-standings__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.lm-standings__table th,
.lm-standings__table td {
  padding: var(--space-2) var(--space-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--border-subtle);
}

.lm-standings__table th {
  font-family: var(--font-button);
  text-transform: uppercase;
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
  text-align: left;
}

.lm-standings__th--sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.lm-standings__th--sortable:hover {
  color: var(--gold-500);
}

.lm-standings__th--active {
  color: var(--gold-500);
}

.lm-standings__sort-arrow {
  font-size: 0.65em;
  margin-left: 2px;
}

.lm-standings__table td {
  color: var(--text-secondary);
}

/* Position column */
.lm-standings__table td:first-child {
  color: var(--text-muted);
  font-weight: 600;
  text-align: center;
  width: 2em;
}

/* Points column — bold gold */
.lm-standings__pts {
  font-weight: 700;
  color: var(--gold-500) !important;
}

/* TD diff coloring */
.lm-standings__positive {
  color: #48bb78 !important;
}

.lm-standings__negative {
  color: #fc8181 !important;
}

/* Team cell with logo */
.lm-standings__team-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lm-standings__team-logo {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
}

.lm-standings__team-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lm-standings__team-name {
  font-family: var(--font-display);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-standings__coach {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ========================================================
   RESULT ENTRY MODAL
   ======================================================== */
.lm-result-modal {
  max-width: 420px;
}

.lm-result-modal__teams {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-4);
  margin: var(--space-4) 0;
}

.lm-result-modal__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
}

.lm-result-modal__name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-primary);
  letter-spacing: var(--tracking-wide);
  text-align: center;
}

.lm-result-modal__scores {
  display: flex;
  gap: var(--space-3);
}

.lm-result-modal__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.lm-result-modal__input {
  width: 56px;
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 700;
}

.lm-result-modal__vs {
  font-size: var(--text-lg);
  color: var(--text-muted);
  align-self: center;
  padding-top: var(--space-6);
}

/* ================================================================
   Bracket Visualization
   ================================================================ */

.lm-bracket {
  padding: var(--space-4) 0;
}

.lm-bracket__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold-500);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lm-bracket__grid {
  display: grid;
  grid-template-columns: repeat(var(--bracket-cols, 3), 1fr);
  gap: var(--space-4);
  align-items: start;
}

.lm-bracket__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.lm-bracket__col-title {
  font-family: var(--font-button);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-subtle);
}

.lm-bracket__games {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  justify-content: space-around;
  min-height: 100%;
}

/* ── Bracket Game Card ── */

.lm-bracket-game {
  background: var(--bg-card, rgba(47, 38, 56, 0.6));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.lm-bracket-game--champion {
  border-color: var(--gold-500);
  box-shadow: 0 0 12px rgba(201, 173, 106, 0.3);
}

.lm-bracket-game__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.lm-bracket-game__row:last-of-type {
  border-bottom: none;
}

.lm-bracket-game__row--winner {
  background: rgba(201, 173, 106, 0.1);
}

.lm-bracket-game__row--winner .lm-bracket-game__name {
  color: var(--gold-500);
  font-weight: 600;
}

.lm-bracket-game__name {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-bracket-game__tbd {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
}

.lm-bracket-game__seed {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  font-weight: 600;
}

.lm-bracket-game__score {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  min-width: 20px;
  text-align: center;
}

.lm-bracket-game .lm-matchup__logo {
  width: 24px;
  height: 24px;
}

.lm-bracket-game__enter {
  display: block;
  width: 100%;
  text-align: center;
  border-radius: 0;
  padding: var(--space-1);
  font-size: var(--text-xs);
}

/* ── Third-place section ── */

.lm-bracket__third {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.lm-bracket__actions {
  text-align: center;
  margin-top: var(--space-6);
}

/* ================================================================
   Season Completion Overlay
   ================================================================ */

.lm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: none;
  align-items: center;
  justify-content: center;
}

.lm-overlay--visible {
  display: flex;
}

.lm-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.lm-overlay__content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 90%;
}

.lm-completion__inner {
  background: var(--bg-card, rgba(47, 38, 56, 0.95));
  border: 2px solid var(--gold-500);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}

.lm-completion__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--gold-500);
  margin-bottom: var(--space-6);
}

.lm-completion__champion {
  margin-bottom: var(--space-6);
}

.lm-completion__crown {
  font-size: 48px;
  display: block;
  margin-bottom: var(--space-2);
}

.lm-completion__label {
  font-family: var(--font-button);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.lm-completion__team {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.lm-completion__coach {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.lm-completion__awards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.lm-completion__award {
  padding: var(--space-3);
  background: var(--bg-dark);
  border-radius: var(--radius-md);
}

.lm-completion__award-label {
  font-family: var(--font-button);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-500);
  margin-bottom: var(--space-1);
}

.lm-completion__award-team {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 600;
}

.lm-completion__award-stat {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Gold button variant ── */

.lm-btn--gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600, #B89D5A));
  color: var(--bg-dark);
  font-weight: 700;
  border: none;
}

.lm-btn--gold:hover {
  filter: brightness(1.1);
}

/* ── Start Game button spacing ── */

.lm-matchup__start,
.lm-bracket-game__start {
  margin-right: var(--space-2);
}


/* ═══════════════════════════════════════════════════
   STREAK BADGES (standings Form column)
   ═══════════════════════════════════════════════════ */

.lm-streak {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-button);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
}

.lm-streak--win {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.lm-streak--loss {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.lm-streak--draw {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.lm-streak--none {
  color: var(--text-muted);
}

.lm-standings__cell--form {
  white-space: nowrap;
  text-align: center;
}


/* ═══════════════════════════════════════════════════
   HEAD-TO-HEAD BADGE (matchup cards)
   ═══════════════════════════════════════════════════ */

.lm-matchup__h2h {
  display: inline-block;
  margin-top: var(--space-1);
  padding: 2px 8px;
  background: var(--gold-alpha-10);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-button);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  letter-spacing: 0.03em;
}


/* ═══════════════════════════════════════════════════
   SEASON HISTORY & ARCHIVE
   ═══════════════════════════════════════════════════ */

.lm-standings__history-link {
  text-align: center;
  margin-top: var(--space-4);
}

.lm-season-history__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.lm-season-history__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-500);
  margin: 0;
}

.lm-season-archive {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.lm-season-archive__header {
  font-family: var(--font-display);
  font-size: var(--text-md);
  color: var(--gold-500);
  margin: 0 0 var(--space-3);
}

.lm-season-archive__header i {
  margin-right: var(--space-2);
  color: var(--gold-600);
}

.lm-season-archive__awards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.lm-season-archive__details {
  margin-top: var(--space-2);
}

.lm-season-archive__details summary {
  cursor: pointer;
  font-family: var(--font-button);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
}

.lm-season-archive__details summary:hover {
  color: var(--gold-500);
}

.lm-standings--archive {
  font-size: var(--text-xs);
  margin-top: var(--space-2);
}

.lm-standings--archive th,
.lm-standings--archive td {
  padding: var(--space-1) var(--space-2);
}


/* ═══════════════════════════════════════════════════
   AWARD CARDS
   ═══════════════════════════════════════════════════ */

.lm-award-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-3);
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: var(--space-1);
}

.lm-award-card__icon {
  font-size: var(--text-lg);
  color: var(--gold-500);
}

.lm-award-card__title {
  font-family: var(--font-button);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-600);
}

.lm-award-card__team {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: 600;
}

.lm-award-card__coach {
  font-size: var(--text-xs);
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════
   COMMISSIONER — NUDGE, SEASON, TEMPLATES
   ═══════════════════════════════════════════════════ */

.lm-commish__nudge-desc,
.lm-commish__season-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.lm-commish__nudge-status {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--status-success);
}

.lm-commish__template-actions {
  margin-bottom: var(--space-3);
}

.lm-commish__templates-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.lm-template-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 4px);
}

.lm-template-row__name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.lm-template-row__format {
  font-family: var(--font-button);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.lm-btn--xs {
  padding: 2px 8px;
  font-size: var(--text-xs);
}

/* ════════════════════════════════════════════════════
   League Graveyard
   ════════════════════════════════════════════════════ */

.lm-graveyard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.lm-graveyard__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lm-graveyard__title i {
  color: var(--error-500, #e74c3c);
}

.lm-graveyard__count {
  font-family: var(--font-button);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ── Filter pills ── */
.lm-graveyard__filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.lm-graveyard__filter-btn {
  font-family: var(--font-button);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lm-graveyard__filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--gold-500);
}

.lm-graveyard__filter-btn--active {
  background: var(--gold-500);
  color: var(--bg-dark);
  border-color: var(--gold-500);
}

/* ── Card grid ── */
.lm-graveyard__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}

.lm-graveyard__card {
  background: linear-gradient(180deg, rgba(40, 30, 50, 0.9), rgba(30, 22, 38, 0.95));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-4);
  position: relative;
  filter: saturate(0.6);
  transition: filter 0.3s ease;
}

.lm-graveyard__card:hover {
  filter: saturate(0.85);
}

.lm-graveyard__card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 6px,
    rgba(255, 255, 255, 0.015) 6px,
    rgba(255, 255, 255, 0.015) 7px
  );
  pointer-events: none;
}

.lm-graveyard__card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.lm-graveyard__skull {
  font-size: var(--text-lg);
  color: var(--error-500, #e74c3c);
  opacity: 0.8;
}

.lm-graveyard__identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lm-graveyard__player-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-graveyard__team-tag {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.lm-graveyard__team-logo {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ── Cause of death ── */
.lm-graveyard__cause {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  margin-bottom: var(--space-2);
  border-top: 1px solid rgba(231, 76, 60, 0.2);
  font-size: var(--text-xs);
  color: var(--error-500, #e74c3c);
  opacity: 0.9;
}

.lm-graveyard__cause-vs {
  font-style: italic;
}

.lm-graveyard__cause-date {
  color: var(--text-muted);
}

/* ── Career stats ── */
.lm-graveyard__stats {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.lm-graveyard__stat {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.lm-graveyard__stat strong {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-family: var(--font-button);
}

/* ── Season archive graveyard ── */
.lm-season-archive__graveyard {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}

.lm-season-archive__grave {
  font-size: var(--text-xs);
  color: var(--text-muted);
  padding: var(--space-1) var(--space-2);
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: var(--radius-sm, 4px);
}

.lm-season-archive__grave small {
  opacity: 0.7;
}

/* ================================================================
   TOURNAMENT — Double-Elim Bracket Sections
   ================================================================ */
.lm-bracket--double-elim {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.lm-bracket__section {
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: rgba(47, 38, 56, 0.25);
}

.lm-bracket__section--winners {
  border-color: rgba(201, 173, 106, 0.25);
}

.lm-bracket__section--losers {
  border-color: rgba(231, 76, 60, 0.25);
}

.lm-bracket__section--grand-final {
  max-width: 320px;
  margin: 0 auto;
  border-color: var(--gold-500);
  background: rgba(201, 173, 106, 0.08);
}

.lm-bracket__section-title {
  font-family: var(--font-button);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  text-align: center;
}

.lm-bracket__section--winners .lm-bracket__section-title {
  color: var(--gold-500);
}

.lm-bracket__section--losers .lm-bracket__section-title {
  color: var(--error-text, #e74c3c);
}

.lm-bracket__section--grand-final .lm-bracket__section-title {
  color: var(--gold-500);
  font-size: var(--text-base);
  font-family: var(--font-display);
  letter-spacing: var(--tracking-wide);
}

/* ================================================================
   TOURNAMENT — Create Form Section
   ================================================================ */
.lm-create__section--tournament {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
  margin-top: var(--space-2);
}

/* ================================================================
   TOURNAMENT — Seeding Modal
   ================================================================ */
.lm-seeding-modal {
  max-width: 400px;
}

.lm-seeding-modal__hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.lm-seeding-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  counter-reset: seed;
}

.lm-seeding-list li {
  counter-increment: seed;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card, rgba(47, 38, 56, 0.6));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: grab;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.lm-seeding-list li:active {
  cursor: grabbing;
}

.lm-seeding-list li.dragging {
  opacity: 0.4;
  border-color: var(--gold-500);
}

.lm-seeding-list li .seed-number {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gold-500);
  background: var(--bg-dark);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  min-width: 28px;
  text-align: center;
}

.lm-seeding-list li .seed-name {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.lm-seeding-list li .seed-tv {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.lm-seeding-list li .seed-drag {
  color: var(--text-muted);
  font-size: var(--text-sm);
  cursor: grab;
}

/* ================================================================
   TOURNAMENT — Round Timer
   ================================================================ */
.lm-round-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(201, 173, 106, 0.1);
  border: 1px solid rgba(201, 173, 106, 0.3);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.lm-round-timer__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-button);
}

.lm-round-timer__countdown {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gold-500);
  font-family: var(--font-button);
  letter-spacing: 0.1em;
}

.lm-round-timer__countdown--expired {
  color: var(--error-text, #e74c3c);
  animation: lm-timer-pulse 1s ease-in-out infinite;
}

@keyframes lm-timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ================================================================
   TOURNAMENT — Timer Modal
   ================================================================ */
.lm-timer-modal__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ================================================================
   TOURNAMENT — Walk-in
   ================================================================ */
.lm-join__walk-in-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.lm-bracket-game__walk-in {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

/* ================================================================
   COLLEGE — Challenge Cards
   ================================================================ */
.lm-challenge-card {
  background: var(--bg-card, rgba(47, 38, 56, 0.6));
  border: 1px solid var(--border-subtle, rgba(201, 173, 106, 0.15));
  border-radius: var(--radius-md, 8px);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  transition: border-color 0.2s;
}
.lm-challenge-card:hover {
  border-color: var(--gold-500, #C9AD6A);
}
.lm-challenge-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.lm-challenge-card__teams {
  font-family: var(--font-display, 'VarsityTeam', sans-serif);
  font-size: var(--text-lg, 1.125rem);
  color: var(--text-primary, #fff);
}
.lm-challenge-card__badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lm-challenge-card__badge--pending  { background: rgba(201, 173, 106, 0.2); color: var(--gold-500, #C9AD6A); }
.lm-challenge-card__badge--accepted { background: rgba(76, 175, 80, 0.2);   color: #4caf50; }
.lm-challenge-card__badge--declined { background: rgba(244, 67, 54, 0.15);  color: #ef5350; }
.lm-challenge-card__badge--cancelled { background: rgba(158, 158, 158, 0.2); color: #9e9e9e; }
.lm-challenge-card__badge--friendly { background: rgba(33, 150, 243, 0.2);  color: #42a5f5; }
.lm-challenge-card__message {
  font-size: var(--text-sm, 0.875rem);
  color: var(--text-muted, rgba(255,255,255,0.6));
  margin: var(--space-1) 0;
  font-style: italic;
}
.lm-challenge-card__date {
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-muted, rgba(255,255,255,0.5));
}
.lm-challenge-card__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* ================================================================
   COLLEGE — Challenge Filters
   ================================================================ */
.lm-challenges__filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.lm-challenges__filter {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle, rgba(201, 173, 106, 0.2));
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, rgba(255,255,255,0.6));
  font-size: var(--text-sm, 0.875rem);
  cursor: pointer;
  transition: all 0.2s;
}
.lm-challenges__filter:hover,
.lm-challenges__filter--active {
  background: var(--gold-500, #C9AD6A);
  color: var(--bg-dark, #241C2D);
  border-color: var(--gold-500, #C9AD6A);
}

/* ================================================================
   COLLEGE — Challenge Modal
   ================================================================ */
.lm-challenge-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 1000);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}
.lm-challenge-modal__inner {
  background: var(--bg-primary, #2F2638);
  border: 1px solid var(--border-subtle, rgba(201, 173, 106, 0.2));
  border-radius: var(--radius-lg, 12px);
  padding: var(--space-6);
  width: min(90vw, 460px);
  max-height: 85vh;
  overflow-y: auto;
}
.lm-challenge-modal__title {
  font-family: var(--font-display, 'VarsityTeam', sans-serif);
  font-size: var(--text-xl, 1.25rem);
  color: var(--gold-500, #C9AD6A);
  margin-bottom: var(--space-4);
}
.lm-challenge-modal__actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
  justify-content: flex-end;
}

/* ================================================================
   COLLEGE — ELO Badge
   ================================================================ */
.lm-elo-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm, 4px);
  background: rgba(201, 173, 106, 0.15);
  color: var(--gold-500, #C9AD6A);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lm-standings__cell--elo {
  text-align: center;
}

/* ================================================================
   COLLEGE — Activity Badge
   ================================================================ */
.lm-activity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  text-transform: uppercase;
}
.lm-activity-badge--warned   { background: rgba(255, 152, 0, 0.2); color: #ffa726; }
.lm-activity-badge--inactive { background: rgba(244, 67, 54, 0.15); color: #ef5350; }

/* ================================================================
   COLLEGE — Create Form Section
   ================================================================ */
.lm-create__section--college .lm-create__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.lm-create__section--college .lm-create__hint {
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-muted, rgba(255,255,255,0.5));
  margin-top: var(--space-1);
}
