/* Heritage Fest results page */
:root {
    --hf-navy: #0b1178;
    --hf-navy-2: #1a2496;
    --hf-navy-3: #2c3aa8;
    --hf-ink: #0f1c3f;
    --hf-text: #1b2140;
    --hf-muted: #6b7280;
    --hf-line: #e6e9f2;
    --hf-field: #d5d9e4;
    --hf-gold: #f5b400;
    --hf-bg: #f3f5fa;
}

body.hf-results {
    font-family: 'Open Sans', sans-serif;
    background: var(--hf-bg);
    color: var(--hf-text);
}

/* ---------- Hero ---------- */
.hf-hero {
    position: relative;
    background:
        radial-gradient(circle at 85% 10%, rgba(80, 100, 230, .35) 0, transparent 45%),
        linear-gradient(120deg, var(--hf-navy) 0%, var(--hf-navy-2) 55%, var(--hf-navy-3) 100%);
    color: #fff;
    text-align: center;
    overflow: hidden;
}

.hf-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, transparent 28%, transparent 72%, #000 100%);
    mask-image: linear-gradient(90deg, #000 0, transparent 28%, transparent 72%, #000 100%);
    pointer-events: none;
}

.hf-hero-inner {
    position: relative;
    padding: clamp(36px, 3.2vw, 60px) 16px 8px;
}

.hf-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.hf-badge .fa {
    color: var(--hf-gold);
}

.hf-title {
    margin: 18px 0 0;
    font-weight: 700;
    font-size: clamp(28px, 3.3vw, 58px);
    line-height: 1.15;
    color: #fff;
}

.hf-title-bar {
    width: 70px;
    height: 4px;
    margin: 16px auto 0;
    border-radius: 4px;
    background: var(--hf-gold);
}

.hf-subtitle {
    margin: 18px 0 0;
    font-size: 17px;
    opacity: .95;
}

.hf-wave {
    position: relative;
    display: block;
    width: 100%;
    height: clamp(70px, 9vw, 150px);
    margin-top: 16px;
    margin-bottom: -1px;
}

/* ---------- Layout ---------- */
.hf-container {
    max-width: 1330px;
    margin: 0 auto;
    padding: 0 16px;
}

.hf-main {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * clamp(40px, 6vw, 110px));
    padding-bottom: 48px;
}

.hf-card {
    background: #fff;
    border: 1px solid var(--hf-line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 80, .07);
}

/* ---------- Search card ---------- */
.hf-search {
    padding: 22px 24px 24px;
}

.hf-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
}

.hf-search .hf-card-head {
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--hf-line);
}

.hf-card-title {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 700;
    color: var(--hf-text);
}

.hf-card-title .fa {
    color: var(--hf-navy-2);
    font-size: 18px;
}

.hf-card-hint {
    font-size: 13px;
    color: var(--hf-muted);
}

.hf-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr .62fr 90px;
    gap: 16px;
    align-items: end;
}

.hf-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hf-text);
}

.hf-input,
.hf-select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--hf-field);
    border-radius: 8px;
    background-color: #fff;
    font-size: 14px;
    color: var(--hf-text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.hf-input-wrap {
    position: relative;
}

.hf-input-wrap .fa {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    font-size: 15px;
}

.hf-input {
    padding-left: 38px;
}

.hf-select {
    padding-right: 34px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23555' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    text-overflow: ellipsis;
}

.hf-select.is-empty {
    color: #8a909c;
}

.hf-select option {
    color: var(--hf-text);
}

.hf-input:focus,
.hf-select:focus {
    border-color: #3b4cc0;
    box-shadow: 0 0 0 3px rgba(59, 76, 192, .12);
}

.hf-reset {
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--hf-ink);
    color: #fff;
    font-size: 17px;
    transition: background .15s;
}

.hf-reset:hover {
    background: var(--hf-navy-2);
}

/* ---------- Before-search prompt ---------- */
.hf-prompt {
    margin-top: 24px;
    padding: 46px 20px 48px;
    text-align: center;
    background: linear-gradient(180deg, #f9fafd 0%, #fff 30%);
    border: 1px dashed #cdd3e1;
    border-radius: 14px;
}

.hf-prompt-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8edfb;
    color: #2c4a9a;
    font-size: 24px;
}

.hf-prompt-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--hf-text);
}

.hf-prompt-text {
    max-width: 450px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.55;
    color: var(--hf-muted);
}

/* ---------- Stats ---------- */
.hf-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin: 24px 0;
}

.hf-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
}

.hf-stat-icon {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.hf-stat-icon.total  { background: #e8edfb; color: #3b5bb5; }
.hf-stat-icon.first  { background: #fdf3d6; color: #d4a106; }
.hf-stat-icon.second { background: #eef0f3; color: #8a94a6; }
.hf-stat-icon.third  { background: #f8e6dc; color: #b8652e; }
.hf-stat-icon.consolation { background: #def4e8; color: #23845a; }

.hf-stat-num {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--hf-text);
}

.hf-stat-label {
    margin-top: 4px;
    font-size: 13px;
    color: var(--hf-muted);
}

/* ---------- Winners list ---------- */
.hf-list {
    overflow: hidden;
}

.hf-list .hf-card-head {
    padding: 18px 22px;
}

.hf-count {
    padding: 4px 12px;
    border-radius: 999px;
    background: #e8eefc;
    color: #2c3e94;
    font-size: 13px;
    font-weight: 600;
}

.hf-table-wrap {
    overflow-x: auto;
}

.hf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.hf-table thead tr {
    background: linear-gradient(90deg, #0b1f4d 0%, #1f3570 45%, #3d5aa8 100%);
}

.hf-table thead th {
    padding: 16px 20px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: left;
}

.hf-table tbody td {
    padding: 14px 20px;
    border-bottom: 1px solid #eef0f5;
    vertical-align: middle;
}

.hf-table tbody tr:last-child td {
    border-bottom: 0;
}

.hf-table tbody tr:hover td {
    background: #f7f9fe;
}

.hf-table .col-index {
    width: 56px;
    color: var(--hf-muted);
    font-weight: 600;
}

.hf-table .col-name {
    font-weight: 600;
}

.hf-table .col-nowrap {
    white-space: nowrap;
}

.hf-table mark {
    padding: 0 1px;
    background: #fff1b8;
    border-radius: 2px;
}

.hf-empty td {
    padding: 44px 20px !important;
    text-align: center;
    color: #4b5563;
    font-size: 15px;
}

.hf-award {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.hf-award.rank-1 { background: #fff4d1; color: #8a6000; border: 1px solid #f1d98a; }
.hf-award.rank-2 { background: #eceff4; color: #4b5565; border: 1px solid #d3d8e1; }
.hf-award.rank-3 { background: #f9e3d4; color: #93461a; border: 1px solid #ecc3a6; }
.hf-award.rank-4 { background: #e2f5ea; color: #1d6e48; border: 1px solid #b7e2c9; }
.hf-award.rank-5 { background: #e3ebff; color: #2340a8; border: 1px solid #c3d1fb; }

/* ---------- List / Grid toggle ---------- */
.hf-head-tools {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hf-view-toggle {
    display: inline-flex;
    padding: 4px;
    gap: 2px;
    border: 1px solid var(--hf-line);
    border-radius: 10px;
    background: #eef1f8;
}

.hf-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--hf-muted);
    font-size: 13px;
    font-weight: 600;
    transition: background .15s, color .15s, box-shadow .15s;
}

.hf-view-btn:hover {
    color: var(--hf-text);
}

.hf-view-btn.is-active {
    background: #fff;
    color: var(--hf-navy-2);
    box-shadow: 0 1px 4px rgba(15, 23, 80, .12);
}

.hf-swipe-hint {
    display: none;
    padding: 0 16px 10px;
    text-align: right;
    font-size: 12px;
    color: var(--hf-muted);
}

.hf-swipe-hint .fa {
    margin-right: 4px;
}

/* ---------- Grid view ---------- */
.hf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    padding: 20px 22px 24px;
    border-top: 1px solid var(--hf-line);
    background: #f8f9fc;
}

.hf-grid.d-none {
    display: none;
}

.hf-gcard {
    display: flex;
    flex-direction: column;
    padding: 16px 16px 14px;
    background: #fff;
    border: 1px solid var(--hf-line);
    border-top: 4px solid #c8cedb;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(15, 23, 80, .05);
    transition: transform .15s, box-shadow .15s;
}

.hf-gcard:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15, 23, 80, .09);
}

.hf-gcard.rank-1 { border-top-color: #e0b100; }
.hf-gcard.rank-2 { border-top-color: #9aa3b2; }
.hf-gcard.rank-3 { border-top-color: #c0692f; }
.hf-gcard.rank-4 { border-top-color: #2f8f62; }

.hf-gcard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hf-gcard-no {
    font-size: 13px;
    font-weight: 600;
    color: var(--hf-muted);
}

.hf-gcard-name {
    margin: 12px 0 2px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--hf-text);
}

.hf-gcard-name mark,
.hf-gcard-meta mark {
    padding: 0 1px;
    background: #fff1b8;
    border-radius: 2px;
}

.hf-gcard-event {
    font-size: 14px;
    font-weight: 600;
    color: var(--hf-navy-2);
}

.hf-gcard-meta {
    margin: 12px 0 0;
    padding: 12px 0 0;
    list-style: none;
    border-top: 1px dashed #d8dce6;
    font-size: 14px;
    color: #374151;
}

.hf-gcard-meta li {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 6px;
}

.hf-gcard-meta .fa {
    flex: 0 0 16px;
    text-align: center;
    color: #7b8394;
}

.hf-gcard-cat {
    align-self: flex-start;
    margin-top: auto;
    padding: 3px 10px;
    border-radius: 6px;
    background: #e8eefc;
    color: #2c3e94;
    font-size: 12px;
    font-weight: 600;
}

.hf-gcard-meta + .hf-gcard-cat {
    margin-top: 6px;
}

.hf-grid-empty {
    grid-column: 1 / -1;
    padding: 30px 10px;
    text-align: center;
    color: #4b5563;
    font-size: 15px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .hf-filters {
        grid-template-columns: 1fr 1fr;
    }
    .hf-filters .hf-field-name {
        grid-column: 1 / -1;
    }
    .hf-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .hf-badge {
        font-size: 11px;
        letter-spacing: .1em;
        padding: 6px 14px;
    }
    .hf-subtitle {
        font-size: 15px;
    }
    .hf-search {
        padding: 18px 16px 18px;
    }
    .hf-filters {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .hf-stats {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin: 16px 0;
    }
    .hf-stat {
        padding: 14px;
        gap: 10px;
    }
    .hf-stat-icon {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    .hf-stat-num {
        font-size: 22px;
    }
    .hf-list .hf-card-head {
        padding: 16px;
    }
    .hf-stats .hf-stat:first-child {
        grid-column: 1 / -1;
    }
    .hf-table thead th,
    .hf-table tbody td {
        padding: 12px 14px;
    }
    .hf-head-tools {
        gap: 8px;
    }
    .hf-view-btn {
        padding: 6px 10px;
    }
    .hf-view-btn span {
        display: none;
    }
    .hf-swipe-hint {
        display: block;
    }
    .hf-swipe-hint.is-hidden {
        display: none;
    }
    .hf-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px;
    }
}
