/* =========================================================
   Resultados — Classic Super Nationals Dance 2026
   ========================================================= */

:root {
    --res-gold: #d4af37;
    --res-silver: #c9ced6;
    --res-bronze: #cd7f4a;
    --res-line: rgba(255, 255, 255, 0.08);
}

.res-page {
    padding: var(--spacing-lg) var(--spacing-sm) var(--spacing-xl);
}

/* Header stats */
.res-stats {
    list-style: none;
    padding: 0;
    margin: 28px auto 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.res-stats li {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 30px;
    padding: 8px 18px;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}
.res-stats strong {
    color: var(--res-gold);
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin-right: 4px;
}

.res-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--res-gold);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.85;
}
.res-back:hover { opacity: 1; }
.res-back svg { width: 14px; height: 14px; fill: currentColor; }

/* ---------- Grand Champions ---------- */
.res-champions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.res-champion {
    position: relative;
    text-align: center;
    padding: 32px 24px 26px;
    border-radius: 16px;
    background:
        radial-gradient(ellipse at top, rgba(212, 175, 55, 0.18), transparent 70%),
        var(--color-bg-secondary);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.res-champion-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gradient-gold);
    color: #000;
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.45);
}
.res-champion-icon svg { width: 26px; height: 26px; fill: currentColor; }
.res-champion-award {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    color: var(--res-gold);
    margin-bottom: 8px;
}
.res-champion-team {
    font-size: 1.2rem;
    line-height: 1.3;
    margin-bottom: 6px;
}
.res-champion-cat {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 14px;
}
.res-champion-score {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
}
.res-champion-pct {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.res-champion-pts { color: var(--color-text-muted); font-size: 0.85rem; }

/* ---------- Toolbar ---------- */
.res-toolbar {
    position: sticky;
    top: 70px;
    z-index: 50;
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--res-line);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.res-search {
    position: relative;
    display: flex;
    align-items: center;
}
.res-search > svg {
    position: absolute;
    left: 16px;
    color: var(--res-gold);
    pointer-events: none;
}
.res-search input {
    width: 100%;
    padding: 14px 48px;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.res-search input::placeholder { color: var(--color-text-muted); }
.res-search input:focus {
    outline: none;
    border-color: var(--res-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}
.res-search input::-webkit-search-cancel-button { display: none; }
.res-clear {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-primary);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}
.res-clear:hover { background: rgba(255, 255, 255, 0.16); }

.res-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}
.res-programs button {
    padding: 8px 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.res-programs svg { width: 14px; height: 14px; fill: currentColor; }
.res-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.res-chip {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
    color: var(--color-text-secondary);
    padding: 7px 14px;
    border-radius: 30px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.res-chip:hover { color: #fff; border-color: rgba(212, 175, 55, 0.6); }
.res-chip.active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--res-gold);
    color: var(--res-gold);
}

.res-summary {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
}
.res-summary[hidden] { display: none; }
.res-summary-title { font-weight: 600; color: #fff; }
.res-summary-medals { display: inline-flex; gap: 12px; color: var(--color-text-secondary); }
.res-summary-medals b { font-family: var(--font-heading); }
.res-summary .m1 { color: var(--res-gold); }
.res-summary .m2 { color: var(--res-silver); }
.res-summary .m3 { color: var(--res-bronze); }

/* ---------- Quick index ---------- */
.res-index {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 28px;
    margin-bottom: var(--spacing-md);
    font-size: 0.88rem;
}
.res-index-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}
.res-index-label {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.res-index a {
    color: var(--color-text-secondary);
    border-bottom: 1px dashed rgba(212, 175, 55, 0.4);
}
.res-index a:hover { color: var(--res-gold); }

/* ---------- Division / category ---------- */
.res-division {
    margin-bottom: var(--spacing-lg);
    scroll-margin-top: 240px;
}
.res-division-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}
.res-division-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.05));
    color: var(--res-gold);
    flex-shrink: 0;
}
.res-division-icon svg { width: 18px; height: 18px; fill: currentColor; }
.res-division-title {
    font-size: 1.6rem;
    margin: 0;
    flex: 1;
}
.res-division-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.res-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    align-items: start;
}
.res-cat {
    background: var(--color-bg-secondary);
    border: 1px solid var(--res-line);
    border-radius: 14px;
    padding: 18px;
    scroll-margin-top: 240px;
}
.res-cat-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.res-cat-title {
    font-size: 1.1rem;
    margin: 0;
    color: #fff;
}
.res-cat-meta { font-size: 0.78rem; color: var(--color-text-muted); }
.res-cat-note {
    font-size: 0.8rem;
    color: var(--res-gold);
    background: rgba(212, 175, 55, 0.07);
    border-radius: 8px;
    padding: 6px 10px;
    margin: -4px 0 12px;
}

.res-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.res-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid transparent;
    transition: opacity var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}
.res-place {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    background: rgba(255, 255, 255, 0.06);
}
.res-row.is-p1 .res-place { background: linear-gradient(135deg, #f5d66b, #b8901f); color: #1a1405; box-shadow: 0 0 12px rgba(212, 175, 55, 0.35); }
.res-row.is-p2 .res-place { background: linear-gradient(135deg, #eef1f5, #9aa1ab); color: #16181b; }
.res-row.is-p3 .res-place { background: linear-gradient(135deg, #e7a273, #9a5a2e); color: #1d0f05; }

.res-team { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.res-team-name {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
    color: var(--color-text-primary);
    overflow-wrap: anywhere;
}
.res-bar {
    display: block;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
}
.res-bar > span {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
}
.res-row.is-p1 .res-bar > span { background: var(--res-gold); }
.res-row.is-p2 .res-bar > span { background: var(--res-silver); }
.res-row.is-p3 .res-bar > span { background: var(--res-bronze); }
.res-team-meta { font-size: 0.75rem; color: var(--color-text-muted); }
.res-ded { color: #e57373; }
.res-tie { color: var(--res-gold); font-weight: 600; }

.res-score {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    text-align: right;
    white-space: nowrap;
}
.res-score small {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin-left: 3px;
}

/* Search state: highlight the team, dim the rest so context stays visible */
.is-searching .res-row { opacity: 0.4; }
.is-searching .res-row.is-match {
    opacity: 1;
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.55);
}
.res-hidden { display: none !important; }

.res-empty {
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: var(--color-text-secondary);
}
.res-empty p { margin-bottom: 16px; }

/* ---------- Help / download ---------- */
.res-help {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.res-help-list {
    margin: 0;
    padding-left: 18px;
    color: var(--color-text-secondary);
    line-height: 1.7;
}
.res-help-list li { margin-bottom: 6px; }
.res-help-list strong { color: #fff; }
.res-download-btn {
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 14px;
}
.res-download-btn svg { width: 16px; height: 16px; fill: currentColor; }
.res-contact { font-size: 0.85rem; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .res-help { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    /* Not sticky on phones: it would cover half the screen. */
    .res-toolbar { position: static; padding: 12px; border-radius: 14px; }
    .res-filters { flex-direction: column; align-items: stretch; }
    .res-programs button { padding: 8px 10px; letter-spacing: 1px; }
    .res-programs svg { display: none; }
    .res-chips {
        max-width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .res-chips::-webkit-scrollbar { display: none; }
    .res-chip { flex-shrink: 0; }
    .res-index { display: none; }
    .res-grid { grid-template-columns: 1fr; }
    .res-division-title { font-size: 1.3rem; }
    .res-division, .res-cat { scroll-margin-top: 80px; }
}
@media (max-width: 420px) {
    .res-row { grid-template-columns: 34px 1fr auto; gap: 10px; padding: 9px 10px; }
    .res-place { width: 32px; height: 32px; font-size: 0.85rem; }
    .res-score { font-size: 1.1rem; }
    .res-cat { padding: 14px; }
}

@media print {
    .res-toolbar, .res-index, .res-back, .res-download { display: none !important; }
    .res-row { opacity: 1 !important; }
}
