/* ============================================
   Thistle season attendance ledger
   ============================================ */

.thistle-page { padding-bottom: 2rem; }

.thistle-lead {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
}

.thistle-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
}

.thistle-total-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 0.85rem 1rem;
    text-align: center;
}

.thistle-total-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 0.2rem;
}

.thistle-total-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-heading);
    line-height: 1.2;
}

.thistle-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius);
    background: var(--color-card-bg);
    box-shadow: var(--card-shadow);
}

.thistle-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 640px;
}

.thistle-table th,
.thistle-table td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-card-border);
    vertical-align: middle;
}

.thistle-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-heading);
    background: color-mix(in srgb, var(--color-card-bg) 88%, var(--color-accent) 12%);
    position: sticky;
    top: 0;
    z-index: 1;
}

.thistle-table tbody tr:last-child td {
    border-bottom: none;
}

.thistle-table .col-game {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--color-card-bg);
    min-width: 9.5rem;
    font-weight: 600;
}

.thistle-table thead .col-game {
    z-index: 3;
    background: color-mix(in srgb, var(--color-card-bg) 88%, var(--color-accent) 12%);
}

.thistle-table .col-score {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ha-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: color-mix(in srgb, var(--color-accent) 18%, transparent);
    color: var(--color-heading);
}

.att-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
}

.att-yes {
    background: #1b7a3a;
    color: #f4fff7;
    border-color: #146330;
}

.att-no {
    background: #b42318;
    color: #fff5f4;
    border-color: #912018;
}

.att-unset {
    background: #6b7280;
    color: #f3f4f6;
    border-color: #4b5563;
}

[data-theme="dark"] .att-yes {
    background: #22c55e;
    color: #052e16;
    border-color: #16a34a;
}

[data-theme="dark"] .att-no {
    background: #f87171;
    color: #450a0a;
    border-color: #ef4444;
}

[data-theme="dark"] .att-unset {
    background: #9ca3af;
    color: #111827;
    border-color: #6b7280;
}

.thistle-note {
    margin-top: 0.9rem;
    font-size: 0.88rem;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .thistle-totals { gap: 0.5rem; }
    .thistle-total-value { font-size: 1.35rem; }
    .thistle-table { font-size: 0.88rem; }
}

.thistle-legend {
    margin: -0.5rem 0 1rem;
    font-size: 0.92rem;
    opacity: 0.9;
}

.thistle-total-label {
    line-height: 1.25;
    min-height: 2.4em;
}

.thistle-table .col-att {
    width: 3.6rem;
    text-align: center;
    white-space: nowrap;
}

.thistle-table th.col-att {
    text-align: center;
}

.thistle-counts-heading {
    font-size: 1.15rem;
    margin: 1rem 0 0.65rem;
    font-weight: 700;
}

.thistle-legend {
    margin: 0.85rem 0 1.15rem;
}
