/* Badges & Awards page (badges.php). Loaded after topfrag-theme.css and uses its colour tokens. */

.ba-section { margin-top: 20px; }
.ba-section:first-of-type { margin-top: 4px; }

.ba-section-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 2px 10px;
    font-family: var(--font-cond);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--text-bright);
}
.ba-section-count {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--panel-2);
    font-size: 13px;
    color: var(--text-dim);
}

.ba-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 8px;
}

/* ---- badge cards ---- */
.ba-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 9px 11px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.ba-card:hover,
.ba-card:focus-within { background: var(--panel-2); border-color: var(--border-soft); }

.ba-card-image {
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    border-radius: 7px;
}
.ba-card-image--missing {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-2);
    color: var(--text-dim);
    font-size: 22px;
}

.ba-card-body { flex: 1 1 auto; min-width: 0; }
.ba-card-name {
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-bright);
}
.ba-card-desc {
    display: -webkit-box;
    margin: 2px 0 6px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    line-height: 1.3;
    color: var(--text-dim);
}
.ba-card-desc .highlight { color: var(--accent2); font-weight: 600; }

.ba-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    color: var(--accent);
    cursor: pointer;
    background: rgba(0, 245, 195, 0.08);
    border: 1px solid rgba(0, 245, 195, 0.25);
    border-radius: 999px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.ba-count:hover,
.ba-count:focus-visible { background: rgba(0, 245, 195, 0.16); border-color: var(--accent); outline: none; }
.ba-count[data-players="0"] { color: var(--text-dim); background: var(--panel-2); border-color: var(--border-soft); }

/* ---- exclusive ---- */
.ba-section--exclusive {
    padding: 12px;
    background: linear-gradient(135deg, rgba(245, 196, 81, 0.07), rgba(167, 139, 250, 0.05) 60%, transparent), var(--panel);
    border: 1px solid rgba(245, 196, 81, 0.28);
    border-radius: 13px;
}
.ba-section--exclusive .ba-section-title { color: var(--gold); }
.ba-section--exclusive .ba-section-count { background: rgba(245, 196, 81, 0.13); color: var(--gold); }
.ba-card--exclusive {
    background: linear-gradient(100deg, rgba(245, 196, 81, 0.08), rgba(13, 16, 32, 0.55));
    border-color: rgba(245, 196, 81, 0.32);
}
.ba-card--exclusive:hover,
.ba-card--exclusive:focus-within {
    background: linear-gradient(100deg, rgba(245, 196, 81, 0.13), rgba(13, 16, 32, 0.55));
    border-color: rgba(245, 196, 81, 0.6);
}
.ba-card--exclusive .ba-card-name { color: var(--gold); }
.ba-card--exclusive .ba-count { color: var(--gold); background: rgba(245, 196, 81, 0.09); border-color: rgba(245, 196, 81, 0.3); }
.ba-card--exclusive .ba-count:hover,
.ba-card--exclusive .ba-count:focus-visible { background: rgba(245, 196, 81, 0.18); border-color: var(--gold); }
.ba-card--exclusive .ba-count[data-players="0"] { color: var(--text-dim); background: var(--panel-2); border-color: var(--border-soft); }

/* ---- recipients modal (the site's .modal / .modal-content) ---- */
.modal-content.ba-modal {
    display: flex;
    flex-direction: column;
    width: min(620px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    text-align: left;
    border-radius: 16px;
}
.ba-modal-close {
    position: absolute;
    top: 10px;
    right: 11px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    font-size: 15px;
    color: var(--text-bright);
    cursor: pointer;
    background: var(--panel-alt);
    border: 1px solid var(--border-soft);
    border-radius: 9px;
}
.ba-modal-close:hover,
.ba-modal-close:focus-visible { border-color: var(--accent); outline: none; }

.ba-modal-head {
    display: flex;
    flex-shrink: 0;
    gap: 14px;
    padding: 16px 50px 14px 16px;
    background: var(--panel-alt);
    border-bottom: 1px solid var(--border);
}
.ba-modal-image { flex-shrink: 0; object-fit: contain; border-radius: 9px; }
.ba-modal-info { min-width: 0; }
.modal-content .ba-modal-title {
    margin: 0;
    font-family: var(--font-head);
    font-size: 18px;
    line-height: 1.2;
    color: var(--text-bright);
}
.ba-modal--exclusive .ba-modal-title { color: var(--gold) !important; }
.ba-modal-desc { margin: 3px 0 6px; font-size: 12.5px; line-height: 1.4; color: var(--text); }
.ba-modal-desc .highlight { color: var(--accent2); font-weight: 600; }
.ba-modal-total { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.ba-modal--exclusive .ba-modal-total { color: var(--gold); }

.ba-modal-list { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 4px 8px; }
.ba-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 6px;
    border-bottom: 1px solid var(--border);
}
.ba-row:last-child { border-bottom: none; }
.ba-avatar {
    flex-shrink: 0;
    object-fit: cover;
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
    border-radius: 50%;
}
.ba-row-who { flex: 1 1 auto; min-width: 0; }
.ba-row-name {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-bright);
}
.ba-player-link { color: inherit; text-decoration: none; }
.ba-player-link:hover { color: var(--accent); text-decoration: underline; }
.ba-gone { font-weight: 500; font-style: italic; color: var(--text-dim); }
.ba-flag { width: 16px; height: auto; margin-bottom: -2px; border-radius: 2px; }
.ba-steam { font-size: 0.85em; color: var(--text-dim); }
.ba-row-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.ba-chip {
    padding: 0 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 17px;
    color: var(--accent2);
    text-decoration: none;
    white-space: nowrap;
    background: rgba(0, 200, 255, 0.09);
    border-radius: 5px;
}
a.ba-chip:hover { background: rgba(0, 200, 255, 0.2); }
.ba-chip--all { color: var(--accent); background: rgba(0, 245, 195, 0.1); }
.ba-chip--muted { color: var(--text-dim); background: var(--panel-2); }
.ba-row-date { flex-shrink: 0; font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--text-dim); }

.ba-modal-more {
    flex-shrink: 0;
    margin: 4px 14px 12px;
    padding: 7px;
    font-family: var(--font-cond);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    cursor: pointer;
    background: rgba(0, 245, 195, 0.08);
    border: 1px solid rgba(0, 245, 195, 0.3);
    border-radius: 8px;
}
.ba-modal-more:hover,
.ba-modal-more:focus-visible { background: rgba(0, 245, 195, 0.16); outline: none; }
.ba-modal-more:disabled { color: var(--text-dim); cursor: default; }

.ba-state { padding: 28px 12px; text-align: center; font-size: 13px; color: var(--text-dim); }
.ba-state button {
    display: block;
    margin: 10px auto 0;
    padding: 5px 16px;
    font: inherit;
    font-weight: 600;
    color: var(--text-bright);
    cursor: pointer;
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
    border-radius: 7px;
}

/* skeleton, only ever shown while a recipients request is really in flight */
.ba-skel-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; }
.ba-skel-avatar, .ba-skel-line {
    display: block;
    background: linear-gradient(90deg, var(--panel-2) 25%, #202844 50%, var(--panel-2) 75%);
    background-size: 200% 100%;
    animation: ba-shimmer 1.3s linear infinite;
}
.ba-skel-avatar { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; }
.ba-skel-line { height: 9px; border-radius: 4px; }
@keyframes ba-shimmer { to { background-position: -200% 0; } }

/* ---- phones ---- */
@media (max-width: 720px) {
    .ba-grid { grid-template-columns: minmax(0, 1fr); }
    .ba-section--exclusive { padding: 10px 8px; }
    .ba-modal-head { padding: 14px 46px 12px 12px; gap: 11px; }
    .ba-modal-image { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
    .ba-card, .ba-count, .ba-skel-avatar, .ba-skel-line { transition: none; animation: none; }
}
