/* Team Hall of Fame — th-panel */

.th-panel.team-hall-of-fame {
    --th-accent: var(--accent-color, #7c4dff);
    --th-border: var(--border-color, #dee2e6);
    --th-gold: #ff9800;
    --th-gold-light: #ffd700;
    --th-silver: #9e9e9e;
    --th-bronze: #cd7f32;
    margin: 12px 0 16px;
    padding: 14px 12px 12px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--th-gold) 28%, var(--th-border));
    background:
        radial-gradient(ellipse 90% 70% at 0% 0%, color-mix(in srgb, var(--th-gold) 10%, transparent), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 0%, color-mix(in srgb, var(--th-accent) 6%, transparent), transparent 50%),
        var(--card-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
    max-width: 100%;
}

.th-panel__header {
    margin-bottom: 12px;
}

.th-panel__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--th-gold);
}

.th-panel__icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.th-panel__desc,
.team-hall-of-fame-subtitle {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--text-secondary);
}

.th-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.th-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--th-accent) 12%, var(--th-border));
    background: color-mix(in srgb, var(--th-accent) 3%, var(--card-bg));
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.th-item:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--th-accent) 28%, var(--th-border));
    background: color-mix(in srgb, var(--th-accent) 6%, var(--card-bg));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--th-accent) 8%, transparent);
}

.th-item--gold {
    border-color: color-mix(in srgb, var(--th-gold-light) 45%, var(--th-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--th-gold-light) 12%, transparent), transparent 55%),
        color-mix(in srgb, var(--th-accent) 3%, var(--card-bg));
}

.th-item--gold:hover {
    border-color: color-mix(in srgb, var(--th-gold-light) 55%, var(--th-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--th-gold-light) 16%, transparent), transparent 55%),
        color-mix(in srgb, var(--th-accent) 5%, var(--card-bg));
}

.th-item--silver {
    border-color: color-mix(in srgb, var(--th-silver) 35%, var(--th-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--th-silver) 10%, transparent), transparent 55%),
        color-mix(in srgb, var(--th-accent) 3%, var(--card-bg));
}

.th-item--bronze {
    border-color: color-mix(in srgb, var(--th-bronze) 35%, var(--th-border));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--th-bronze) 10%, transparent), transparent 55%),
        color-mix(in srgb, var(--th-accent) 3%, var(--card-bg));
}

.th-item__rank,
.team-hof-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border-radius: 9px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--th-accent);
    background: color-mix(in srgb, var(--th-accent) 10%, var(--card-bg));
    border: 1px solid color-mix(in srgb, var(--th-accent) 18%, var(--th-border));
    flex-shrink: 0;
}

.th-item--gold .th-item__rank {
    color: #5d4037;
    background: linear-gradient(135deg, #ffe082, var(--th-gold-light));
    border-color: color-mix(in srgb, var(--th-gold-light) 60%, #fff);
}

.th-item--silver .th-item__rank {
    color: #424242;
    background: linear-gradient(135deg, #eeeeee, #bdbdbd);
    border-color: color-mix(in srgb, var(--th-silver) 50%, #fff);
}

.th-item--bronze .th-item__rank {
    color: #4e342e;
    background: linear-gradient(135deg, #ffcc80, var(--th-bronze));
    border-color: color-mix(in srgb, var(--th-bronze) 50%, #fff);
}

.th-item__player,
.team-hof-player {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.th-item__flag,
.team-hof-flag {
    width: 22px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--th-border) 80%, transparent);
}

.th-item__name,
.team-hof-name {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-item__name:hover,
.team-hof-name:hover {
    color: var(--th-accent);
}

.th-item__trophies,
.team-hof-wins {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
    line-height: 1;
    white-space: nowrap;
    color: #e65100;
    background: color-mix(in srgb, var(--th-gold) 14%, var(--card-bg));
    border: 1px solid color-mix(in srgb, var(--th-gold) 32%, var(--th-border));
    flex-shrink: 0;
}

.th-item__trophy-icon,
.team-hof-wins .trophy-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    flex-shrink: 0;
}

.th-item__trophy-count {
    min-width: 1ch;
    text-align: center;
}

.th-panel__view-all,
.team-hof-view-all-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    border: 1px solid color-mix(in srgb, var(--th-gold) 30%, var(--th-border));
    border-radius: 10px;
    background:
        radial-gradient(ellipse 80% 100% at 0% 50%, color-mix(in srgb, var(--th-gold) 10%, transparent), transparent 70%),
        color-mix(in srgb, var(--th-gold) 6%, var(--card-bg));
    color: var(--th-gold);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.th-panel__view-all::after,
.team-hof-view-all-btn::after {
    content: "→";
    font-size: 0.95rem;
    line-height: 1;
    opacity: 0.75;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.th-panel__view-all:hover,
.team-hof-view-all-btn:hover {
    border-color: color-mix(in srgb, var(--th-gold) 48%, var(--th-border));
    background:
        radial-gradient(ellipse 80% 100% at 0% 50%, color-mix(in srgb, var(--th-gold) 14%, transparent), transparent 70%),
        color-mix(in srgb, var(--th-gold) 10%, var(--card-bg));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--th-gold) 16%, transparent);
    transform: translateY(-1px);
    color: var(--th-gold);
}

.th-panel__view-all:hover::after,
.team-hof-view-all-btn:hover::after {
    opacity: 1;
    transform: translateX(3px);
}

/* Modal */

.th-modal-overlay,
.team-hof-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.th-modal-overlay[hidden],
.team-hof-modal-overlay[hidden] {
    display: none !important;
}

.th-modal,
.team-hof-modal {
    background: var(--card-bg);
    color: var(--text-color);
    width: 100%;
    max-width: 560px;
    max-height: min(85vh, 720px);
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--th-gold) 22%, var(--th-border));
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.th-modal__header,
.team-hof-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--th-accent) 12%, var(--th-border));
    flex-shrink: 0;
    background:
        radial-gradient(ellipse 80% 100% at 0% 0%, color-mix(in srgb, var(--th-gold) 8%, transparent), transparent 60%),
        var(--card-bg);
}

.th-modal__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 4px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-color);
}

.th-modal__subtitle,
.team-hof-modal-subtitle {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.th-modal__close,
.team-hof-modal-close {
    width: 36px;
    height: 36px;
    border: 1px solid color-mix(in srgb, var(--th-accent) 14%, var(--th-border));
    border-radius: 10px;
    background: color-mix(in srgb, var(--th-accent) 5%, var(--card-bg));
    color: var(--text-color);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.th-modal__close:hover,
.team-hof-modal-close:hover {
    background: color-mix(in srgb, var(--th-accent) 10%, var(--card-bg));
    border-color: color-mix(in srgb, var(--th-accent) 28%, var(--th-border));
}

.th-modal__body,
.team-hof-modal-body {
    padding: 12px 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.th-modal__section,
.team-hof-modal-section {
    margin-bottom: 16px;
}

.th-modal__section:last-child,
.team-hof-modal-section:last-child {
    margin-bottom: 0;
}

.th-modal__section-title,
.team-hof-modal-section-title {
    margin: 0 0 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.th-modal__section--coaches .th-modal__section-title,
.team-hof-modal-section--coaches .team-hof-modal-section-title {
    color: var(--th-accent);
}

.th-modal__section--coaches .th-item,
.team-hof-modal-section--coaches .team-hall-of-fame-item {
    border-color: color-mix(in srgb, var(--th-accent) 24%, var(--th-border));
    background: color-mix(in srgb, var(--th-accent) 4%, var(--card-bg));
}

.th-list--modal {
    gap: 5px;
}

.th-list--modal .th-item {
    padding: 9px 10px;
}

.team-hof-modal-list {
    margin: 0;
}

@media (max-width: 639px) {
    .th-panel.team-hall-of-fame {
        margin-left: 0;
        margin-right: 0;
        padding: 10px 8px 8px;
    }

    .th-item {
        padding: 9px 10px;
        gap: 8px;
    }

    .th-item__rank {
        min-width: 30px;
        height: 30px;
        font-size: 0.68rem;
    }

    .th-item__name {
        font-size: 0.84rem;
    }

    .th-item__trophies {
        padding: 4px 8px;
        font-size: 0.78rem;
    }

    .th-modal-overlay,
    .team-hof-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .th-modal,
    .team-hof-modal {
        max-width: 100%;
        max-height: 88vh;
        border-radius: 16px 16px 0 0;
    }
}

@media (min-width: 769px) {
    .th-panel.team-hall-of-fame {
        padding: 16px 14px 14px;
    }

    .th-list {
        gap: 7px;
    }
}

[data-theme="dark"] .th-item__trophies {
    color: #ffb74d;
}

[data-theme="dark"] .th-panel__view-all,
[data-theme="dark"] .team-hof-view-all-btn {
    background:
        radial-gradient(ellipse 80% 100% at 0% 50%, color-mix(in srgb, var(--th-gold) 14%, transparent), transparent 70%),
        color-mix(in srgb, var(--th-gold) 10%, var(--header-bg, var(--card-bg)));
}
