:root {
    --history-bg: #080a0f;
    --history-panel: #10131a;
    --history-panel-hover: #12161e;
    --history-card: rgba(16, 19, 26, 0.84);
    --history-input: #0b0e14;
    --history-border: rgba(255, 255, 255, 0.09);
    --history-border-strong: rgba(255, 255, 255, 0.14);
    --history-text: #f4f5f7;
    --history-muted: #8d95a5;
    --history-muted-soft: #69717f;
    --history-orange: #ff6b00;
    --history-orange-soft: rgba(255, 148, 24, 0.12);
    --history-green: #42d695;
    --history-red: #ff7078;
    --history-warning: #f5a51c;
    --font-family: Montserrat, "Montserrat", sans-serif;
}

body.verified-history-page, 
body.prediction-details-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 2%, rgba(255, 148, 24, 0.08), transparent 28rem),
        linear-gradient(180deg, #090b10 0%, var(--history-bg) 100%);
    color: var(--history-text);
    font-family: var(--font-family);
}

.verified-history-page .header,
.prediction-details-page .header {
    border-bottom: 1px solid var(--history-border);
    background: rgba(8, 10, 15, 0.82);
    backdrop-filter: blur(18px);
}

.verified-history-page .header__container,
.history-shell, 
.prediction-details-page .header__container, 
.details-shell {
    width: min(1280px, calc(100% - 40px));
    margin-inline: auto;
}

.history-shell,
.details-shell {
    padding: 30px 0 80px;
}

.history-topbar, 
.details-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
}

.history-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: #aab1bf;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 160ms ease;
}

.history-link:hover,
.history-link--analytics {
    color: #fff;
}

.history-hero,
.history-card,
.history-filter-bar,
.history-row {
    border: 1px solid var(--history-border);
    border-radius: 8px;
    background: var(--history-panel);
}

.header__logo {
    border: none;
    outline: none;
    cursor: pointer;
}

.history-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: center;
    gap: 48px;
    min-height: 230px;
    margin-bottom: 16px;
    padding: 38px 42px;
    overflow: hidden;
}

.history-hero::after {
    position: absolute;
    top: -120px;
    right: -70px;
    width: 330px;
    height: 330px;
    border: 1px solid rgba(255, 148, 24, 0.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 54px rgba(255, 148, 24, 0.025),
        0 0 0 108px rgba(255, 148, 24, 0.018);
    content: "";
    pointer-events: none;
}

.history-hero__copy,
.history-hero__spotlight {
    position: relative;
    z-index: 1;
}

.history-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    color: #bdc3cf;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.history-eyebrow i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--history-green);
    box-shadow: 0 0 0 5px rgba(66, 214, 149, 0.1);
}

.history-hero h1 {
    /* max-width: 780px; */
    margin: 0 0 14px;
    font-size: clamp(34px, 4.2vw, 56px);
    font-weight: 700;
    line-height: 0.98;
    overflow-wrap: anywhere;
}

.history-hero p {
    max-width: 670px;
    margin: 0;
    color: #9ca4b3;
    font-size: 15px;
    line-height: 1.4;
}

.history-hero__spotlight {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--history-border);
    padding-left: 38px;
}

.history-hero__spotlight span,
.history-hero__spotlight small {
    color: var(--history-muted);
    font-size: 12px;
}

.history-hero__spotlight strong {
    margin: 8px 0 7px;
    color: var(--history-orange);
    font-size: 46px;
    line-height: 1;
}

/* Stats */
.history-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.history-stat {
    position: relative;
    min-height: 118px;
    border: 1px solid var(--history-border);
    border-radius: 8px;
    background: var(--history-card);
    padding: 14px 20px;
    overflow: hidden;
}

.history-stat::before {
    position: absolute;
    top: 0;
    left: 20px;
    width: 24px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: #747c8a;
    content: "";
}

.history-stat--wins::before {
    background: var(--history-green);
}

.history-stat--losses::before {
    background: var(--history-red);
}

.history-stat--pending::before {
    background: var(--history-orange);
}

.history-stat span {
    display: block;
    color: #7f8796;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-stat strong {
    display: block;
    margin-top: 10px;
    color: var(--history-text);
    font-size: 28px;
    line-height: 1;
}

.history-stat small {
    display: block;
    margin-top: 9px;
    color: #686f7d;
    font-size: 12px;
}

/* Filters */
.history-filter-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, auto);
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    padding: 0;
}

.history-filter-bar {
    border: none;
    outline: none;
    background: none;
}

.history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.history-filter {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 8px 14px;
    color: #858d9c;
    background: #34363a5a;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    transform: skew(-15deg);
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.history-filter:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.045);
}

.history-filter.is-active {
    border-color: rgba(255, 148, 24, 0.2);
    color: #ffad4d;
    background: var(--history-orange-soft);
    transform: skew(-15deg);
}

.history-search {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
    min-width: 0;
}

.history-search__field {
    position: relative;
    display: block;
}

.history-search__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 12px;
    height: 12px;
    border: 1.5px solid #7d8593;
    border-radius: 50%;
    transform: translateY(-58%);
}

.history-search__icon::after {
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 5px;
    height: 1.5px;
    background: #7d8593;
    content: "";
    transform: rotate(45deg);
}

.history-search input {
    width: 100%;
    min-height: 38px;
    min-width: 0;
    border: 1px solid var(--history-border);
    border-radius: 4px;
    background: var(--history-input);
    color: var(--history-text);
    padding: 0 14px 0 38px;
    font-size: 12px;
    font-family: var(--font-family);
    outline: none;
}

::placeholder {
    font-family: var(--font-family);
}

.history-search input:focus {
    border-color: rgba(255, 148, 24, 0.55);
}

.history-search button,
.history-page-link {
    min-height: 38px;
    border: 0;
    border-radius: 4px;
    background: var(--history-orange);
    color: #fff;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    font-family: var(--font-family);
    cursor: pointer;
}

/* Layout */
.history-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.8fr);
    gap: 22px;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-section-heading,
.history-card__heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.history-section-heading {
    margin: 0 2px 14px;
}

.history-card__heading {
    margin-bottom: 16px;
}

.history-section-heading span,
.history-card__heading span {
    display: block;
    margin-bottom: 5px;
    color: #727a89;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.history-section-heading h2,
.history-card__heading h2 {
    margin: 0;
    font-size: 19px;
}

.history-card__heading h2 {
    font-size: 16px;
}

.history-section-heading > strong,
.history-card__heading small {
    color: #777f8d;
    font-size: 11px;
    font-weight: 700;
}

/* Rows */
.history-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    align-items: center;
    gap: 22px;
    min-width: 0;
    padding: 21px 22px;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.history-row:hover {
    border-color: var(--history-border-strong);
    background: var(--history-panel-hover);
}

.history-row > div {
    min-width: 0;
}

.history-row__league {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #818998;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-league-mark {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--history-orange);
}

.history-row h2 {
    margin: 8px 0 17px;
    color: var(--history-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.history-row__details {
    display: grid;
    grid-template-columns: minmax(150px, 1.2fr) 90px minmax(175px, 1fr);
    gap: 18px;
}

.history-row__details > div {
    min-width: 0;
}

.history-row__details span {
    display: block;
    margin-bottom: 5px;
    color: var(--history-muted-soft);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.history-row__details strong {
    display: block;
    color: #446f03;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.history-row__result {
    display: flex;
    min-height: 96px;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    border-left: 1px solid var(--history-border);
    padding-left: 20px;
}

.history-status {
    display: inline-flex;
    min-height: 25px;
    min-width: 62px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--history-text);
    font-size: 9px;
    font-weight: 600;
    transform: skew(-15deg);
    text-transform: uppercase;
}

.history-status--won {
    color: #89f2bd;
    background: rgba(137, 242, 189, 0.1);
}

.history-status--lost {
    color: #ff9a9a;
    background: rgba(255, 154, 154, 0.1);
}

.history-status--pending {
    color: var(--history-warning);
    background: rgba(255, 213, 138, 0.1);
}

.history-status--void {
    color: #c6d1e4;
    background: rgba(198, 209, 228, 0.1);
}

.history-score {
    display: block;
    margin-top: 12px;
    color: var(--history-text);
    text-align: right;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.history-analysis-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    color: #8f97a5;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.history-analysis-link:hover {
    color: var(--history-orange);
}

/* Cards / Charts */
.history-card {
    padding: 20px;
    overflow: hidden;
}

.history-chart {
    display: block;
    width: 100%;
    height: auto;
    min-height: 145px;
    border: 0;
    border-radius: 10px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        var(--history-input);
    background-size: 100% 33.333%;
}

.history-chart path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.history-chart polyline {
    fill: none;
    stroke: var(--history-orange);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.history-chart circle {
    fill: var(--history-orange);
    stroke: var(--history-input);
    stroke-width: 4;
}

.history-chart text {
    fill: #9ca4b2;
    font-size: 15px;
    font-weight: 900;
}

.history-months {
    display: grid;
    gap: 12px;
}

.history-month {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 72px;
    gap: 10px;
    align-items: center;
    color: #858d9b;
    font-size: 11px;
}

.history-month-bar {
    display: flex;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #242933;
}

.history-month-bar i {
    display: block;
    height: 100%;
}

.history-month-bar .wins {
    background: #57e389;
}

.history-month-bar .losses {
    background: #ff6b6b;
}

.history-month-bar .pending {
    background: var(--history-orange);
}

.history-month > strong {
    color: #a9b0bc;
    font-size: 10px;
    text-align: right;
}

.history-empty {
    margin: 0;
    color: var(--history-muted);
    line-height: 1.55;
}

/* Pagination */
.history-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 18px;
    color: var(--history-muted);
    font-size: 12px;
}

.history-page-link {
    display: inline-flex;
    align-items: center;
}

.history-page-link[aria-disabled="true"] {
    opacity: 0.45;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1050px) {
    .history-layout {
        grid-template-columns: 1fr;
    }

    .history-layout > aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-layout > aside .history-card:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .history-hero {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 32px;
    }

    .history-hero__spotlight {
        min-height: auto;
        border-top: 1px solid var(--history-border);
        border-left: 0;
        padding: 22px 0 0;
    }

    .history-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .history-filter-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .history-shell,
    .verified-history-page .header__container {
        width: min(calc(100% - 24px), 1180px);
    }

    .history-topbar {
        align-items: flex-start;
    }

    .history-link {
        max-width: 46%;
        font-size: 11px;
        line-height: 1.35;
    }

    .history-hero {
        padding: 27px 22px;
    }

    .history-hero h1 {
        font-size: 38px;
    }

    .history-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-stat {
        min-height: 108px;
        padding: 17px;
    }

    .history-search {
        grid-template-columns: 1fr;
    }

    .history-search button {
        min-height: 40px;
    }

    .history-row {
        grid-template-columns: 1fr;
    }

    .history-row__details {
        grid-template-columns: 1fr 1fr;
    }

    .history-row__details > div:last-child {
        grid-column: 1 / -1;
    }

    .history-row__result {
        min-height: auto;
        align-items: flex-start;
        border-top: 1px solid var(--history-border);
        border-left: 0;
        padding: 17px 0 0;
    }

    .history-score {
        text-align: left;
    }

    .history-layout > aside {
        grid-template-columns: 1fr;
    }

    .history-layout > aside .history-card:last-child {
        grid-column: auto;
    }

    .history-month {
        grid-template-columns: 1fr;
    }

    .history-month > strong {
        text-align: left;
    }
}