/* ==========================================================================
   RECORD CHART PAGE - advanced UI.
   Loaded ONLY by record.php ($extraStyles). The homepage never loads this
   file, so nothing here can affect the homepage. Every rule is scoped
   under .section--record to stay page-local.
   ========================================================================== */

/* ---------- Reading progress ---------- */
.record-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 120;
    width: 100%;
    height: 3px;
    background: transparent;
    pointer-events: none;
}
.record-progress__bar {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f5b301, #ff7847, #c62828);
    transform-origin: 0 50%;
    transform: scaleX(0);
}

/* ---------- Breadcrumb ---------- */
.section--record .crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.section--record .crumbs .crumbs__copy {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--weight-semibold);
    color: var(--ink-soft);
    cursor: pointer;
}
.section--record .crumbs .crumbs__copy:hover {
    border-color: var(--next);
    color: var(--next);
}
.section--record .crumbs .crumbs__copy .icon {
    width: 13px;
    height: 13px;
}

/* ---------- HERO : dark premium card ---------- */
.section--record .record-head {
    position: relative;
    overflow: hidden;
    border: 1px solid #2a3340;
    border-left: 5px solid var(--accent);
    border-radius: 14px;
    padding: 18px 16px;
    margin-bottom: 12px;
    background:
        radial-gradient(420px 160px at 88% -20%, rgba(245, 179, 1, .22), transparent 65%),
        radial-gradient(360px 200px at 8% 120%, rgba(11, 94, 168, .35), transparent 60%),
        linear-gradient(135deg, #141a23 0%, #1c2534 55%, #232f45 100%);
    box-shadow: 0 10px 30px rgba(10, 15, 25, .25);
    color: #eef2f7;
}
.section--record .record-head::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        -45deg,
        transparent 0 14px,
        rgba(255, 255, 255, .014) 14px 15px
    );
}
.section--record .record-head__brand {
    color: var(--accent);
}
/* 404 state still uses the plain meta line - keep it readable on dark. */
.section--record .record-head__meta {
    color: #b9c6d8;
}
.section--record .record-head__title {
    color: #fff;
    font-size: clamp(1.75rem, 5vw + 1rem, 2.75rem);
    text-transform: uppercase;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
    margin: 2px 0 0;
}
.section--record .record-head__kicker {
    background: var(--accent);
    color: #141414;
    border-radius: 999px;
    padding: 3px 12px;
    box-shadow: 0 2px 10px rgba(245, 179, 1, .45);
}

/* Live status pill in hero */
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 4px 13px 4px 10px;
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    border: 1px solid transparent;
}
.hero-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
.hero-pill--done {
    background: rgba(28, 122, 69, .18);
    border-color: rgba(46, 213, 115, .55);
    color: #5ef08f;
}
.hero-pill--live {
    background: rgba(198, 40, 40, .22);
    border-color: rgba(255, 110, 110, .6);
    color: #ff8f8f;
}
.hero-pill--live .hero-pill__dot {
    animation: hero-blink 1.1s ease-in-out infinite;
}
.hero-pill--upcoming {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .25);
    color: #cfd8e3;
}
@keyframes hero-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .35; transform: scale(.72); }
}

/* Meta chips */
.record-head__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}
.record-head__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    color: #dbe3ee;
    font-size: var(--font-size-xs);
    font-weight: var(--weight-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}
.record-head__chip .icon {
    width: 13px;
    height: 13px;
    color: var(--accent);
}
.section--record .record-head .last-updated {
    color: #9fb0c3;
}
.section--record .record-head .last-updated__time {
    color: #e8eef5;
}

/* Score tiles : glass */
.section--record .record-score {
    position: relative;
    z-index: 1;
    gap: 10px;
}
.section--record .record-score__cell {
    min-width: 92px;
    padding: 10px 16px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.section--record .record-score__cell em {
    color: #9fb0c3;
}
.section--record .record-score__cell strong {
    color: #fff;
    font-size: clamp(1.6rem, 4vw + 1rem, 2.3rem);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}
.section--record .record-score__cell--today {
    background: linear-gradient(135deg, rgba(245, 179, 1, .25), rgba(198, 40, 40, .28));
    border-color: rgba(245, 179, 1, .55);
    box-shadow: 0 4px 18px rgba(245, 179, 1, .25);
}
.section--record .record-score__cell--today strong {
    color: var(--accent);
}
.section--record .record-score__cell--today em {
    color: #ffd97a;
}
.record-score__date {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: var(--weight-medium);
    color: #8d9eb2;
    letter-spacing: var(--tracking-wide);
}
.section--record .record-score__cell--today .record-score__date {
    color: #e9c46a;
}

/* ---------- Quick section nav (sticky chips) ---------- */
.record-quicknav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 2px;
    margin: 0 -2px 4px;
    background: linear-gradient(#fffbea 82%, rgba(255, 251, 234, 0));
}
.record-quicknav::-webkit-scrollbar {
    display: none;
}
.record-quicknav a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    font-size: var(--font-size-sm);
    font-weight: var(--weight-semibold);
    color: var(--ink-soft);
    white-space: nowrap;
}
.record-quicknav a .icon {
    width: 14px;
    height: 14px;
    color: var(--next);
}
.record-quicknav a:hover {
    border-color: var(--ink);
    color: var(--ink);
    text-decoration: none;
    transform: translateY(-1px);
}

/* ---------- Controls card ---------- */
.section--record .chart-controls {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 14px 12px;
}
.section--record .chart-controls__fields .field__input {
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--ground);
    font-weight: var(--weight-semibold);
}
.section--record .chart-controls__fields .field__input:focus {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-color: var(--accent);
    background: #fff;
}
.section--record .chart-controls .btn {
    border-radius: 8px;
}
.section--record .chart-controls__nav .btn {
    border-radius: 999px;
}
.section--record .chart-controls__current {
    background: var(--brand);
    color: var(--accent);
    border-radius: 999px;
    padding: 6px 18px;
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
}

/* ---------- Section headings ---------- */
.section--record .subheading,
.section--record .combo-title {
    position: relative;
    padding-left: 12px;
    margin-top: 20px;
}
.section--record .subheading::before,
.section--record .combo-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    bottom: 2px;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(var(--accent), #ff7847);
}
.section--record .combo-title {
    font-size: var(--h2-size);
    font-weight: var(--weight-bold);
    line-height: var(--line-heading);
    margin-bottom: 10px;
}
.section--record .chart-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--paper);
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 3px 13px;
    box-shadow: var(--shadow);
}

/* ---------- Tables as cards ---------- */
.section--record .table-wrap,
.section--record .chart-table-wrapper {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    background: var(--paper);
    box-shadow: 0 4px 16px rgba(16, 20, 24, .06);
}
.section--record .table-wrap table,
.section--record .chart-table-wrapper table {
    margin: 0;
}
.section--record .data-table thead th {
    background: var(--brand);
    color: #fff;
    font-size: var(--font-size-th);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    white-space: nowrap;
}
.section--record .data-table thead th:first-child {
    border-top-left-radius: 11px;
}
.section--record .data-table thead th:last-child {
    border-top-right-radius: 11px;
}
.section--record .data-table tbody tr {
    transition: background .15s ease;
}
.section--record .data-table tbody tr:hover {
    background: #fff8e1;
}
.section--record .data-table--record tr.is-done {
    background: linear-gradient(90deg, rgba(28, 122, 69, .06), transparent 55%);
}
.section--record .data-table--record tr.is-future {
    opacity: .62;
}

/* Badges */
.section--record .badge {
    border-radius: 999px;
    padding: 3px 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    white-space: nowrap;
}
.section--record .badge.is-done {
    background: var(--done-bg);
    color: var(--done);
    border: 1px solid #bfe6cd;
}
.section--record .badge.is-live {
    background: var(--live-bg);
    color: var(--live);
    border: 1px solid #f3c9c9;
    animation: hero-blink 1.6s ease-in-out infinite;
}
.section--record .badge.is-upcoming {
    background: var(--upcoming-bg);
    color: var(--upcoming);
    border: 1px solid var(--line);
}

/* Result value pills */
.section--record .value--current {
    display: inline-block;
    min-width: 54px;
    text-align: center;
    padding: 4px 14px;
    border-radius: 9px;
    background: var(--brand);
    color: var(--accent);
    font-weight: var(--weight-bold);
    font-size: var(--font-size-lg);
    font-variant-numeric: tabular-nums;
    letter-spacing: var(--tracking-wide);
    box-shadow: 0 2px 8px rgba(16, 20, 24, .25);
}
.section--record .value--previous {
    display: inline-block;
    min-width: 44px;
    text-align: center;
    padding: 2px 10px;
    border-radius: 7px;
    background: var(--ground);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    font-weight: var(--weight-semibold);
    font-variant-numeric: tabular-nums;
}
.section--record .record-na {
    font-style: italic;
}

/* ---------- Combined chart polish ---------- */
.section--record .section--record-combo {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(16, 20, 24, .06);
    padding: 14px 12px 12px;
    margin-top: 14px;
}
.section--record .section--record-combo .combo-title {
    margin-top: 0;
}
.section--record .combo-table thead th {
    background: var(--brand);
    color: #fff;
    white-space: nowrap;
}
.section--record .combo-table thead th:first-child {
    border-top-left-radius: 8px;
}
.section--record .combo-table thead th:last-child {
    border-top-right-radius: 8px;
}
.section--record .combo-table tbody th.chart-table__date {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 1px 0 0 var(--line);
}
.section--record .combo-table td.is-filled {
    font-weight: var(--weight-bold);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.section--record .combo-nav__current {
    background: var(--brand);
    color: var(--accent);
    border-radius: 999px;
    padding: 6px 18px;
    font-weight: var(--weight-bold);
}

/* ---------- Latest results rows ---------- */
.section--record .record-recent {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

/* ---------- Stats : gradient cards ---------- */
.section--record .record-summary {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(16, 20, 24, .06);
    padding: 14px 12px;
}
.section--record .record-summary .subheading {
    margin-top: 0;
}
.section--record .record-stats {
    gap: 10px;
}
.section--record .record-stats__item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--line);
    border-left: 0;
    border-top: 4px solid var(--accent);
    box-shadow: var(--shadow);
    transition: transform .16s ease, box-shadow .16s ease;
}
.section--record .record-stats__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 20, 24, .12);
}
.section--record .record-stats__item--done {
    border-top-color: var(--done);
    background: linear-gradient(180deg, var(--done-bg), #fff 70%);
}
.section--record .record-stats__item--pending {
    border-top-color: var(--live);
    background: linear-gradient(180deg, var(--live-bg), #fff 70%);
}
.record-stats__head {
    display: flex;
    align-items: center;
    gap: 7px;
}
.record-stats__icon {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--accent);
    flex: 0 0 auto;
}
.record-stats__icon .icon {
    width: 14px;
    height: 14px;
}
.section--record .record-stats__item--done .record-stats__icon {
    background: var(--done);
    color: #fff;
}
.section--record .record-stats__item--pending .record-stats__icon {
    background: var(--live);
    color: #fff;
}
.section--record .record-stats__value {
    font-size: clamp(1.3rem, 3vw + 1rem, 1.8rem);
}

/* ---------- Related cards ---------- */
.section--record .record-related__card {
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.section--record .record-related__card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(11, 94, 168, .18);
}
.section--record .record-related__card:hover .record-related__go {
    transform: translateX(3px);
    color: var(--next);
}
.section--record .record-related__go {
    transition: transform .16s ease;
}

/* ---------- Suggestions banner ---------- */
.section--record .section--record-suggestions {
    margin-top: 20px;
    border-top: 0;
    padding-top: 0;
}
.suggest-banner {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 12px;
    background:
        radial-gradient(300px 120px at 92% 0%, rgba(245, 179, 1, .28), transparent 65%),
        linear-gradient(120deg, #141a23, #24344d 70%, #2c3f5e);
    border: 1px solid #2a3340;
    border-left: 5px solid var(--accent);
    box-shadow: 0 10px 26px rgba(10, 15, 25, .22);
    color: #fff;
}
.suggest-banner__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--accent);
    color: #141414;
    box-shadow: 0 4px 14px rgba(245, 179, 1, .5);
}
.suggest-banner__icon .icon {
    width: 24px;
    height: 24px;
}
.suggest-banner__body {
    min-width: 0;
    flex: 1 1 auto;
}
.suggest-banner__title {
    margin: 0;
    font-size: var(--h2-size);
    font-weight: var(--weight-bold);
    line-height: var(--line-tight);
    color: #fff;
}
.suggest-banner__title::before {
    content: none;
}
.suggest-banner__sub {
    margin: 3px 0 0;
    font-size: var(--font-size-sm);
    color: #b9c6d8;
}
.suggest-banner__count {
    flex: 0 0 auto;
    text-align: center;
    background: rgba(245, 179, 1, .14);
    border: 1px solid rgba(245, 179, 1, .5);
    border-radius: 12px;
    padding: 6px 14px;
}
.suggest-banner__count strong {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: var(--weight-bold);
    color: var(--accent);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.suggest-banner__count span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider);
    color: #cdd8e6;
    font-weight: var(--weight-semibold);
}

/* Suggestion group heads pop a little more on record page */
.section--record-suggestions .board-group__head {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: var(--shadow);
}
.section--record-suggestions .board-card {
    transition: transform .16s ease, box-shadow .16s ease;
}
.section--record-suggestions .board-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(16, 20, 24, .14);
}

/* ---------- CTA buttons ---------- */
.section--record .chart-toggle .btn,
.section--record .chart-note .btn {
    border-radius: 999px;
    font-weight: var(--weight-bold);
    box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.section--record .chart-toggle .btn:hover,
.section--record .chart-note .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 20, 24, .16);
}
.section--record .chart-note {
    text-align: center;
    margin-top: 16px;
}

/* ---------- Back to top ---------- */
.record-top {
    position: fixed;
    right: 12px;
    bottom: 16px;
    z-index: 110;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(245, 179, 1, .55);
    background: var(--brand);
    color: var(--accent);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.record-top.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.record-top .icon {
    width: 20px;
    height: 20px;
}
.record-top:hover {
    background: #232f45;
}

/* ---------- Entrance animation ---------- */
@keyframes record-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.section--record .record-head,
.section--record .record-quicknav,
.section--record .chart-controls,
.section--record .section--record-combo,
.section--record .record-summary,
.section--record .record-related,
.section--record .section--record-suggestions {
    animation: record-rise .45s ease both;
}
.section--record .section--record-combo { animation-delay: .05s; }
.section--record .record-summary { animation-delay: .1s; }
.section--record .record-related { animation-delay: .14s; }
.section--record .section--record-suggestions { animation-delay: .18s; }

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
    .section--record .record-head {
        padding: 24px 22px;
        border-radius: 18px;
    }
    .section--record .chart-controls {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 14px;
        padding: 16px;
    }
    .section--record .section--record-combo,
    .section--record .record-summary {
        padding: 18px 16px;
    }
    .section--record .record-score__cell {
        min-width: 110px;
    }
}
@media (max-width: 480px) {
    .section--record .record-head {
        padding: 16px 13px;
    }
    .section--record .record-score {
        width: 100%;
    }
    .section--record .record-score__cell {
        flex: 1 1 0;
    }
    .suggest-banner {
        padding: 13px 12px;
        gap: 10px;
    }
    .suggest-banner__icon {
        width: 40px;
        height: 40px;
    }
    .suggest-banner__count {
        padding: 5px 10px;
    }
    .section--record .crumbs .crumbs__copy {
        margin-left: 0;
    }
}

/* ---------- Status Badge placements (component CSS stays untouched) ---------- */
.section--record .record-head .status-badge {
    margin: 8px 0 0 6px;
}
.section--record .subheading .status-badge {
    margin-left: 8px;
}
.section--record .status-announcement {
    margin: 18px 0 4px;
    box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
    .section--record .record-head,
    .section--record .record-quicknav,
    .section--record .chart-controls,
    .section--record .section--record-combo,
    .section--record .record-summary,
    .section--record .record-related,
    .section--record .section--record-suggestions {
        animation: none;
    }
    .section--record .badge.is-live,
    .hero-pill--live .hero-pill__dot {
        animation: none;
    }
    .record-progress__bar {
        transform: scaleX(1);
    }
}
