/* Great Trove — App-specific style overrides
   Base styles provided by great-apps/framework.css via CDN */

/* ── Year badge in list items ────────────────────────── */
.year-badge {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(124, 111, 255, 0.12);
  color: rgba(124, 111, 255, 0.9);
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Winner pill on list rows */
.winner-pill {
  flex-shrink: 0;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(124, 111, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* ── Entity links ────────────────────────────────────── */
.entity-link {
  color: rgba(124, 111, 255, 0.85);
  text-decoration: underline;
  text-decoration-color: rgba(124, 111, 255, 0.3);
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.entity-link:hover {
  color: rgba(124, 111, 255, 1);
  text-decoration-color: rgba(124, 111, 255, 0.7);
}

/* ── Source link button ──────────────────────────────── */
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 16px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(124, 111, 255, 0.1);
  color: rgba(124, 111, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}
.source-link:hover {
  background: rgba(124, 111, 255, 0.2);
}

/* ── Contest note ────────────────────────────────────── */
.contest-note {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  padding: 8px 12px;
  border-left: 3px solid rgba(124, 111, 255, 0.3);
  margin-bottom: 16px;
}

/* ── Scores table ────────────────────────────────────── */
.scores-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px;
}
.scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}
.scores-table th {
  text-align: left;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scores-table th.col-num {
  text-align: right;
  min-width: 40px;
}
.scores-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
}
.scores-table td.col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.scores-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.scores-table tbody tr:hover {
  background: rgba(124, 111, 255, 0.06);
}

/* Placement styling */
.pl-gold { color: #d4a017; font-weight: 700; }
.pl-silver { color: #a8a8a8; font-weight: 700; }
.pl-bronze { color: #c4915c; font-weight: 700; }

/* Songs cell */
.songs-cell {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 200px;
}

/* Song arranger in scores table */
.song-arranger {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Round sections (multi-round event detail) ──────── */
.round-section {
  margin-bottom: 2rem;
}
.round-header {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}
.round-header:first-child {
  margin-top: 0;
}
.round-source-link {
  font-size: 0.8rem;
  font-weight: 400;
  margin-left: 0.5rem;
  color: rgba(124, 111, 255, 0.7);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.round-source-link:hover {
  opacity: 1;
}
.round-judges,
.round-annotations {
  margin-top: 1rem;
}

/* ── Collapsible sections ────────────────────────────── */
.collapsible-section summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  padding: 10px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.collapsible-section summary::before {
  content: "▸";
  font-size: 0.75rem;
  transition: transform 0.15s;
}
.collapsible-section[open] summary::before {
  transform: rotate(90deg);
}
.collapsible-section summary::-webkit-details-marker {
  display: none;
}

/* Judges list */
.judge-role-group {
  margin-bottom: 12px;
}
.judge-role-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.judge-entry {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  padding: 3px 0;
}
.judge-district {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  margin-left: 4px;
}

/* Annotations */
.annotation-item {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  padding: 4px 0;
}
.annotation-marker {
  color: rgba(124, 111, 255, 0.7);
  font-weight: 600;
  margin-right: 4px;
}

/* Appearances table */
.appearances-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.appearances-table th {
  text-align: left;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  padding: 4px 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.appearances-table td {
  padding: 5px 8px;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* ── Group detail ────────────────────────────────────── */
.group-type-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(124, 111, 255, 0.12);
  color: rgba(124, 111, 255, 0.85);
}
.group-location {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Group members roster */
.group-members-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.group-members-list {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.8;
}
.member-part-tag {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

/* Stats summary */
.stats-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stat-item {
  text-align: center;
}
.stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(124, 111, 255, 0.9);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* History table (shared by group + judge) */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.history-table th {
  text-align: left;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  padding: 6px 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.history-table td {
  padding: 7px 8px;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.history-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.history-table tbody tr:hover {
  background: rgba(124, 111, 255, 0.08);
}

/* ── Arranger detail ─────────────────────────────────── */
.arranger-song-group {
  margin-bottom: 20px;
}
.arranger-song-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
  padding-left: 2px;
}

/* ── Judge detail ────────────────────────────────────── */
.judge-district-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
}

/* ── Member detail ───────────────────────────────────── */
.member-part-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(124, 111, 255, 0.12);
  color: rgba(124, 111, 255, 0.85);
}
.member-group-section {
  margin-bottom: 20px;
}
.member-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 6px;
  padding-left: 2px;
}

/* Member names in scores table */
.score-members {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
  line-height: 1.4;
}
.score-members .member-name {
  font-size: 0.68rem;
}

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
}

/* ── Loading state ───────────────────────────────────── */
.loading-state {
  text-align: center;
  padding: 64px 16px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .scores-table {
    font-size: 0.74rem;
  }
  .scores-table th,
  .scores-table td {
    padding: 5px 4px;
  }
  .scores-table th.col-num,
  .scores-table td.col-num {
    min-width: 32px;
  }
  .songs-cell {
    max-width: 140px;
    font-size: 0.65rem;
  }
  .winner-pill {
    max-width: 100px;
    font-size: 0.65rem;
  }
  .stats-row {
    gap: 12px;
  }
  .history-table {
    font-size: 0.74rem;
  }
  .history-table th,
  .history-table td {
    padding: 5px 4px;
  }
}
