/* Extracted from templates/components/_tournament_history_css.html (Phase 3.1). Page-local styles; global rules belong in the design system sheets. */
  .th-section { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: 12px; margin-bottom: 1.25rem; overflow: hidden; }
  .th-hint { padding: 0.55rem 1.1rem; font-size: 0.75rem; color: var(--t-text-muted); font-style: italic; background: var(--t-surface-elevated, #f4f5f7); border-bottom: 1px solid var(--t-border-soft, rgba(0,0,0,0.05)); }
  .th-empty { padding: 1.5rem 1.1rem; color: var(--t-text-muted); font-size: 0.9rem; text-align: center; margin: 0; }

  details.th-row { border-bottom: 1px solid var(--t-border-soft, rgba(0,0,0,0.05)); }
  details.th-row[open] { background: var(--t-surface-elevated, #f4f5f7); }
  details.th-row:last-child { border-bottom: 0; }
  details.th-row > summary {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    padding: 0.7rem 1.1rem;
    cursor: pointer; list-style: none; font-weight: 500;
  }
  details.th-row > summary::-webkit-details-marker { display: none; }
  details.th-row > summary::before {
    content: '›'; color: var(--t-text-muted);
    font-size: 1.1rem; line-height: 1;
    transition: transform 150ms; width: 14px;
  }
  details.th-row[open] > summary::before { transform: rotate(90deg); }
  details.th-row:hover { background: var(--t-surface-elevated, #f4f5f7); }
  .th-row__date { color: var(--t-text-muted); font-size: 0.82rem; flex: 0 0 auto; }
  .th-row__name { flex: 1 1 200px; font-weight: 600; min-width: 0; }
  .th-row__name-link { color: inherit; text-decoration: none; }
  .th-row__name-link:hover { color: var(--mint); }
  .th-row__div { color: var(--t-text-muted); font-size: 0.82rem; font-weight: 400; }
  .th-row__inprogress {
    margin-left: 0.4rem;
    font-size: 0.7rem; font-weight: 600;
    padding: 0.1rem 0.45rem; border-radius: 999px;
    background: rgba(139, 92, 246, 0.14); color: #6d28d9;
  }
  .th-row__results {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.78rem; font-weight: 600;
    color: var(--t-text-secondary);
  }
  .th-row__pips { display: inline-flex; gap: 2px; }
  .th-row__pip { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.18); }
  .th-row__pip--gold   { background: linear-gradient(135deg, #fde68a 0%, #d4a017 100%); }
  .th-row__pip--silver { background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%); }
  .th-row__pip--bronze { background: linear-gradient(135deg, #fcd5b5 0%, #a05a2c 100%); }
  .th-row__div-count {
    background: var(--t-surface, #fff); color: var(--t-text-muted);
    padding: 0.1rem 0.5rem; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
    border: 1px solid var(--t-border);
  }

  .th-expand { padding: 0.25rem 0 0.5rem; border-top: 1px dashed var(--t-border-soft, rgba(0,0,0,0.05)); }

  .th-division {
    padding: 0.75rem 1.1rem 0.75rem 2.55rem;
    border-bottom: 1px dashed var(--t-border-soft, rgba(0,0,0,0.05));
  }
  .th-division:last-child { border-bottom: 0; }
  .th-division--single { padding-left: 1.1rem; } /* don't deep-indent when there's only one */
  .th-division__head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.4rem;
    margin-bottom: 0.3rem;
    border-bottom: 1px solid var(--t-border-soft, rgba(0,0,0,0.05));
  }
  .th-division__left { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
  .th-division__name { font-size: 0.88rem; font-weight: 700; color: var(--t-text); }
  .th-division__date {
    font-size: 0.74rem; color: var(--t-text-muted);
    font-variant-numeric: tabular-nums;
    background: var(--t-surface, #fff);
    padding: 0.06rem 0.45rem; border-radius: 999px;
    border: 1px solid var(--t-border);
  }
  .th-division__finish {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.74rem; font-weight: 600;
    padding: 0.14rem 0.5rem; border-radius: 999px;
    background: var(--t-surface, #fff); color: var(--t-text-secondary);
    border: 1px solid var(--t-border);
  }
  .th-division__finish-pip { width: 10px; height: 10px; border-radius: 50%; }
  .th-division__finish--gold .th-division__finish-pip { background: linear-gradient(135deg, #fde68a 0%, #d4a017 100%); }
  .th-division__finish--silver .th-division__finish-pip { background: linear-gradient(135deg, #e5e7eb 0%, #9ca3af 100%); }
  .th-division__finish--bronze .th-division__finish-pip { background: linear-gradient(135deg, #fcd5b5 0%, #a05a2c 100%); }
  .th-division__finish--unplaced { color: var(--t-text-muted); }

  .th-partner {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--t-text-secondary);
    padding: 0.2rem 0 0.35rem;
  }
  .th-partner__lbl { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--t-text-muted); font-weight: 700; }
  .th-partner__link { color: var(--brand-1, #2d8a7e); text-decoration: none; border-bottom: 1px dotted; font-weight: 600; }
  .th-partner__link:hover { color: var(--mint); }
  .th-partner--solo { color: var(--t-text-muted); font-style: italic; font-size: 0.78rem; }

  .th-group { margin-top: 0.4rem; }
  .th-group__label {
    font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--t-text-muted); font-weight: 700;
    padding: 0.3rem 0 0.15rem;
    border-bottom: 1px solid var(--t-border-soft, rgba(0,0,0,0.05));
    margin-bottom: 0.15rem;
  }
  .th-group__label--front, .th-group__label--back, .th-group__label--grand_finals { color: var(--brand-1, #2d8a7e); }
  .th-group__summary { font-size: 0.7rem; color: var(--t-text-muted); font-weight: 500; margin-left: 0.5rem; text-transform: none; letter-spacing: 0; }

  /* Match row — grid with opp-wrap that flexes to hold round + opponents + game pills */
  .th-match {
    display: grid;
    grid-template-columns: 1fr auto auto;
    column-gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.83rem;
    border-bottom: 1px dotted var(--t-border-soft, rgba(0,0,0,0.05));
    align-items: start;
  }
  .th-match:last-child { border-bottom: 0; }
  .th-match__opp-wrap {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem;
    min-width: 0;
    line-height: 1.35;
  }
  .th-match__round {
    color: var(--t-text-muted); font-weight: 700;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
    white-space: nowrap;
  }
  .th-match__opp { color: var(--t-text); }
  .th-match__opp .th-partner__link, .th-match__opp > span { color: var(--brand-1, #2d8a7e); }
  .th-match__result {
    text-align: center; font-weight: 700; font-size: 0.76rem;
    padding: 0.1rem 0.3rem; border-radius: 4px; width: 26px;
    margin-top: 1px;
  }
  .th-match__result--w { background: rgba(34,197,94,0.15); color: #15803d; }
  .th-match__result--l { background: rgba(220,38,38,0.12); color: #b91c1c; }
  .th-match__score {
    color: var(--t-text-muted); font-variant-numeric: tabular-nums;
    text-align: right; font-size: 0.82rem;
    margin-top: 1px;
  }
  .th-match__score--series { font-weight: 700; color: var(--t-text-secondary); }

  .th-match__games {
    display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center;
  }
  .th-game {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.05rem 0.4rem;
    background: var(--t-surface, #fff);
    border: 1px solid var(--t-border);
    border-radius: 6px;
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
  }
  .th-game__pip { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
  .th-game__pip--w { background: rgba(21,128,61,0.55); }
  .th-game__pip--l { background: rgba(185,28,28,0.55); }
  .th-game__score { color: var(--t-text); font-weight: 600; }

  /* Auto-truncate marker — JS adds .th-truncated when a row was reduced to initials */
  .th-match__opp-wrap.th-truncated::after { content: ''; }

  @media (max-width: 600px) {
    .th-division { padding-left: 1.1rem; }
    .th-match__round { font-size: 0.65rem; }
  }
