/* =========================================================
   PREDICTION HISTORY
   ========================================================= */

.history-page {
    min-height: 100vh;
    background: #f5f7fb
}

.history-hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at 70% 18%, rgba(37, 124, 235, .30), transparent 30%), radial-gradient(ellipse at 78% 82%, rgba(22, 196, 143, .25), transparent 35%), linear-gradient(135deg, #06172d 0%, #082b4b 52%, #063b46 100%);
    color: #fff;
}

.history-hero::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    right: -220px;
    top: -300px;
    border-radius: 50%;
    background: rgba(255,255,255,.035);
}

.history-hero::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    left: -170px;
    bottom: -210px;
    border-radius: 50%;
    background: rgba(23,105,213,.10);
}

.history-hero-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 0px 52px;
    position: relative;
    z-index: 1;
}

.history-hero h1 {
    margin: 18px 0 16px;
    max-width: 760px;
    font-size: clamp(36px, 5vw, 48px);
    line-height: 1.05;
    font-weight: bold;
    font-family: 'yt_bold';
}

.history-hero h1 strong {
    display: block;
    color: #39d89c;
}

.history-hero p {
    max-width: 700px;
    margin: 18px 0 0;
    color: rgba(255,255,255,.7);
    font-size: 14px;
    line-height: 1.75;
}

.history-stats {
    width: min(1160px, calc(100% - 32px)) !important;
    margin: -28px auto 0 !important;
    position: relative;
    z-index: 5
}

.history-container {
    width: min(1160px, calc(100% - 32px));
    margin: auto;
    padding: 40px 0 0px
}

.history-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px
}



.history-toolbar h2 {
    margin: 5px 0 0;
    color: #071b33;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: -.03em
}

.history-today-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    height: 38px;
    padding: 0 15px;
    border-radius: 9px;
    background: #1769d5;
    color: #fff;
    text-decoration: none;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em
}

.history-workspace {
    display: grid;
    grid-template-columns: minmax(220px, .72fr) minmax(500px, 1.55fr);
    gap: 22px;
    align-items: start;
}

.history-side {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(7, 27, 51, .045);
}

.history-side-head span {
    color: #1769d5;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .14em;
}

.history-side-head h2 {
    margin: 5px 0 20px;
    color: #071b33;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -.025em;
}

.history-filters {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin: 0
}

.history-filter label {
    display: block;
    margin: 0 0 6px 2px;
    color: #7d8997;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}

.history-filter select {
    display: block;
    width: 100%;
    height: 44px;
    padding: 0 34px 0 12px;
    border: 1px solid #dfe5ed;
    border-radius: 9px;
    background: #fff;
    color: #26394d;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
}

.history-filter select:focus {
    border-color: #1769d5;
    box-shadow: 0 0 0 3px rgba(23, 105, 213, .08)
}

.history-clear-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 38px;
    margin-top: 16px;
    border: 1px solid #dfe5ed;
    border-radius: 9px;
    color: #68788a;
    background: #f8fafc;
    text-decoration: none;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .1em;
    box-sizing: border-box;
}

.history-clear-filters:hover {
    border-color: #1769d5;
    color: #1769d5;
    background: #fff
}

.history-calendar-column {
    min-width: 0
}

.history-calendar {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(7, 27, 51, .045);
}

.history-calendar-head {
    display: grid;
    grid-template-columns: 100px 1fr 100px;
    align-items: center;
    min-height: 78px;
    padding: 0 14px;
    background: #071b33;
    color: #fff;
}

.history-calendar-arrows {
    display: flex;
    align-items: center;
    gap: 5px
}

.history-calendar-arrows-right {
    justify-content: flex-end
}

.history-calendar-arrows a {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 21px;
    line-height: 1;
}

.history-calendar-arrows a:hover {
    background: rgba(255, 255, 255, .08)
}

.history-calendar-title {
    text-align: center
}

.history-calendar-title span {
    display: block;
    margin-bottom: 2px;
    color: #7fa8d2;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: .13em;
}

.history-calendar-title strong {
    display: block;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.15
}

.history-calendar-title b {
    display: block;
    margin-top: 2px;
    color: #b7cce1;
    font-size: 11px;
    font-weight: 800
}

.history-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    padding: 12px 14px 5px;
}

.history-weekdays span {
    text-align: center;
    color: #8996a5;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .05em;
}

.history-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    padding: 4px 14px 13px;
}

.history-day {
    position: relative;
    min-width: 0;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: #f7f9fd;
    color: #1769d5;
    text-decoration: none;
    box-sizing: border-box;
}

.history-day.empty {
    background: transparent;
    border-color: transparent;
    pointer-events: none
}

.history-day strong {
    font-size: 12px;
    font-weight: 800;
    line-height: 1
}

.history-day-count {
    min-width: 20px;
    padding: 2px 4px;
    border-radius: 999px;
    background: #e8eef9;
    color: #58708d;
    font-size: 6px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}

.history-day i {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #28dba8;
    box-shadow: 0 0 0 2px rgba(40, 219, 168, .10);
}

.history-day.selected {
    background: #1769d5;
    border-color: #1769d5;
    color: #fff;
    box-shadow: 0 6px 15px rgba(23, 105, 213, .18)
}

.history-day.selected .history-day-count {
    background: #fff;
    color: #fff
}

.history-day.selected i {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .12)
}

.history-calendar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 0 14px 13px;
    color: #8a96a4;
    font-size: 8px;
    font-weight: 700;
}

.history-calendar-footer>a {
    color: #1769d5;
    text-decoration: none;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .07em
}

.history-calendar-footer span {
    text-align: right
}

.history-day-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 42px 0 15px
}

.history-day-heading h2 {
    margin: 6px 0 0;
    color: #071b33;
    font-size: 24px;
    font-weight: 900
}

.history-day-nav {
    display: flex;
    gap: 7px
}

.history-day-nav a {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 11px;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    background: #fff;
    color: #617083;
    text-decoration: none;
    font-size: 8px;
    font-weight: 900
}

.history-table {
    overflow: hidden;
    background: #fff;
    border: 1px solid #e1e6ed;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(7, 27, 51, .045)
}

.history-table-head,
.history-row {
    display: grid;
    grid-template-columns: minmax(260px, 2.2fr) minmax(180px, 1.35fr) minmax(150px, 1.15fr) 90px 125px;
    align-items: center
}

.history-table-head {
    min-height: 45px;
    padding: 0 17px;
    background: #071b33;
    color: rgba(255, 255, 255, .65);
    font-size: 8px
}

.history-row {
    min-height: 72px;
    padding: 0 17px;
    border-bottom: 1px solid #edf0f4;
    color: #172536;
    text-decoration: none
}

.history-row:last-child {
    border-bottom: 0
}

.history-row:hover {
    background: #f8fbff;
    box-shadow: inset 3px 0 0 #1769d5
}

.history-match {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 18px minmax(0, 1fr);
    align-items: center;
    gap: 7px
}

.history-match>span {
    color: #1769d5;
    font-size: 10px;
    font-weight: 900
}

.history-match strong {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 12px;
    font-weight: 900
}

.history-match small {
    color: #a0aab6;
    font-size: 8px;
    font-weight: 800;
    text-align: center
}

.history-league span,
.history-league strong {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}

.history-league span,
.history-prediction span {
    color: #8d99a7;
    font-size: 8px;
    font-weight: 700
}

.history-league strong {
    margin-top: 3px;
    color: #344a61;
    font-size: 10px;
    font-weight: 900
}

.history-prediction strong {
    display: block;
    margin-top: 3px;
    color: #1769d5;
    font-size: 12px;
    font-weight: 900
}

.history-result {
    color: #071b33;
    font-size: 14px;
    font-weight: 900
}

.history-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: max-content;
    min-width: 91px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 8px;
    font-weight: 900
}

.history-status b {
    font-size: 12px
}

.history-status.won {
    background: #e8f8f1;
    color: #0d9d68
}

.history-status.lost {
    background: #fff0f0;
    color: #d34d4d
}

.history-status.pending {
    background: #f1f4f7;
    color: #7a8795
}

.history-empty {
    padding: 45px 20px;
    background: #fff;
    border: 1px dashed #ccd8e6;
    border-radius: 15px;
    text-align: center
}

.history-empty div {
    color: #1769d5;
    font-size: 32px
}

.history-empty h3 {
    margin: 8px 0 4px;
    color: #172536;
    font-size: 17px
}

.history-empty p {
    margin: 0;
    color: #8794a3;
    font-size: 11px
}






/* =========================================================
   HISTORY EYEBROW
   ========================================================= */
.history-hero .x2-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 30px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #b9d3e8;
    font-size: 10px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}

.history-hero .x2-eyebrow span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #28dba8;
    box-shadow: 0 0 0 5px rgba(40, 219, 168, .12);
}

.history-hero .x2-eyebrow span {
    width: 7px !important;
    height: 7px !important;
    flex: 0 0 7px !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #28dba8 !important;
    box-shadow: 0 0 0 5px rgba(40, 219, 168, .12) !important;
}

@media(max-width:760px) {

    .history-hero-inner,
    .history-container {
        width: calc(100% - 24px)
    }

    .history-hero-inner {
        padding: 20px 0 30px
    }


    .history-hero p {
        font-size: 13px;
    }

    .history-stats {
        width: calc(100% - 24px) !important;
        margin-top: -18px !important
    }

    .history-container {
        padding-top: 20px
    }

    .history-toolbar {
        align-items: center
    }

    .history-toolbar h2 {
        font-size: 23px
    }

    .history-today-button {
        min-width: 74px;
        height: 36px;
        font-size: 9px
    }

    .history-workspace {
        grid-template-columns: 1fr;
        gap: 16px
    }

    .history-side {
        padding: 17px;
        border-radius: 14px
    }

    .history-side-head h2 {
        font-size: 21px;
        margin-bottom: 16px
    }

    .history-filters {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px
    }

    .history-filter select {
        height: 44px;
        font-size: 10px
    }

    .history-clear-filters {
        margin-top: 12px;
        height: 36px
    }

    .history-calendar-head {
        grid-template-columns: 88px 1fr 88px;
        min-height: 74px;
        padding: 0 10px
    }

    .history-calendar-arrows {
        gap: 4px
    }

    .history-calendar-arrows a {
        width: 31px;
        height: 31px;
        font-size: 20px
    }

    .history-calendar-title strong {
        font-size: 16px
    }

    .history-calendar-title b {
        font-size: 11px
    }

    .history-weekdays {
        gap: 4px;
        padding: 11px 9px 5px
    }

    .history-weekdays span {
        font-size: 8px
    }

    .history-calendar-grid {
        gap: 4px;
        padding: 4px 9px 12px
    }

    .history-day {
        min-height: 48px;
        border-radius: 50%
    }

    .history-day strong {
        font-size: 12px
    }

    .history-day-count {
        min-width: 19px;
        font-size: 6px
    }

    .history-day i {
        right: 6px;
        bottom: 6px
    }

    .history-calendar-footer {
        padding: 0 11px 11px;
        font-size: 9px
    }

    .history-calendar-footer>a {
        font-size: 9px
    }

    .history-day-heading {
        display: block;
        margin: 32px 0 16px
    }

    .history-day-heading h2 {
        font-size: 25px
    }

    .history-day-nav {
        margin-top: 12px;
        gap: 8px
    }

    .history-day-nav a {
        height: 38px;
        padding: 0 13px;
        font-size: 9px
    }

    .history-table-head {
        display: none
    }

    .history-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 16px 14px;
        min-height: 0
    }

    .history-match {
        grid-column: 1/-1;
        grid-template-columns: 48px minmax(0, 1fr) 18px minmax(0, 1fr);
        gap: 8px
    }

    .history-match>span {
        font-size: 11px
    }

    .history-match strong {
        font-size: 14px
    }

    .history-match small {
        font-size: 9px
    }

    .history-league,
    .history-prediction {
        grid-column: 1
    }

    .history-league span,
    .history-prediction span {
        font-size: 9px
    }

    .history-league strong {
        font-size: 11px
    }

    .history-prediction strong {
        font-size: 14px
    }

    .history-result {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        font-size: 17px
    }

    .history-status {
        grid-column: 2;
        grid-row: 3;
        justify-self: end;
        min-width: 94px;
        padding: 8px 10px;
        font-size: 9px
    }

    .history-status b {
        font-size: 13px
    }

    .history-empty {
        padding: 50px 20px
    }

    .history-empty div {
        font-size: 38px
    }

    .history-empty h3 {
        font-size: 19px
    }

    .history-empty p {
        font-size: 12px
    }

    .history-hero .x2-eyebrow {
        padding: 7px 12px !important;
        font-size: 10px !important
    }
}

/* =========================================================
   HISTORY MATCH ROWS - ONE MATCH / ONE ROW
   ========================================================= */
.history-table-head {
    grid-template-columns: minmax(230px, 1.15fr) minmax(145px, .72fr) minmax(0, 2.45fr) 72px !important;
    align-items: center !important;
}

.history-row {
    grid-template-columns: minmax(230px, 1.15fr) minmax(145px, .72fr) minmax(0, 2.45fr) 72px !important;
    min-height: 76px !important;
    padding: 10px 17px !important;
    gap: 14px !important;
}

.history-match {
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 9px !important;
}

.history-match>span {
    color: #1769d5 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
}

.history-teams {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.history-teams strong {
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    color: #172536 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
}

.history-country {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.history-country .flag-icon {
    flex: 0 0 24px !important;
    width: 24px !important;
    height: 11px !important;
    object-fit: contain !important;
}

.history-league span,
.history-league strong {
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
}

.history-predictions {
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
}

.history-predictions::-webkit-scrollbar {
    display: none !important
}

.history-tip-box {
    flex: 0 0 auto !important;
    min-width: 82px !important;
    min-height: 44px !important;
    padding: 6px 9px !important;
    border: 1px solid transparent !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    box-sizing: border-box !important;
}

.history-tip-box span {
    font-size: 6px !important;
    font-weight: 900 !important;
    letter-spacing: .06em !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.history-tip-box strong {
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
}

.history-tip-box.hit {
    background: #e8f8f1 !important;
    border-color: #c8efdf !important;
    color: #0d9d68 !important;
}

.history-tip-box.miss {
    background: #fff0f0 !important;
    border-color: #f6d1d1 !important;
    color: #d34d4d !important;
}

.history-tip-box.pending {
    background: #f1f4f7 !important;
    border-color: #e3e8ed !important;
    color: #7a8795 !important;
}

.history-row-result {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    color: #071b33 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

/* old status column is no longer used */
.history-status {
    display: none !important
}

/* =========================================================
   COMPACT CALENDAR
   ========================================================= */
.history-calendar-head {
    min-height: 64px !important;
    grid-template-columns: 78px 1fr 78px !important;
    padding: 0 10px !important;
}

.history-calendar-arrows {
    gap: 4px !important
}

.history-calendar-arrows a {
    width: 30px !important;
    height: 30px !important;
    font-size: 19px !important;
}

.history-calendar-title span {
    font-size: 6px !important
}

.history-calendar-title strong {
    font-size: 14px !important
}

.history-calendar-title b {
    font-size: 10px !important
}

.history-weekdays {
    gap: 3px !important;
    padding: 8px 12px 3px !important;
}

.history-weekdays span {
    font-size: 7px !important
}

.history-calendar-grid {
    gap: 3px !important;
    row-gap: 3px !important;
    grid-auto-rows: 42px !important;
    padding: 3px 12px 9px !important;
}

.history-day {
    height: 42px !important;
    min-height: 42px !important;
    gap: 2px !important;
}

.history-day strong {
    font-size: 11px !important
}

.history-day-count {
    min-width: 18px !important;
    padding: 1px 3px !important;
    font-size: 5px !important
}

.history-day i {
    right: 5px !important;
    bottom: 5px !important;
    width: 4px !important;
    height: 4px !important
}

.history-calendar-footer {
    padding: 0 12px 9px !important;
    font-size: 7px !important
}

.history-calendar-footer>a {
    font-size: 7px !important
}

@media(max-width:760px) {
    .history-table-head {
        display: none !important
    }

    .history-row {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 56px !important;
        align-items: center !important;
        gap: 8px !important;
        min-height: 76px !important;
        padding: 10px !important;
    }

    .history-match {
        grid-column: 1 / 3 !important;
        grid-row: 1 !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        gap: 7px !important;
    }

    .history-match>span {
        font-size: 9px !important
    }

    .history-teams strong {
        font-size: 11px !important
    }

    .history-league {
        display: none !important
    }

    .history-predictions {
        grid-column: 2 !important;
        grid-row: 2 !important;
        max-width: 100% !important;
        gap: 4px !important;
    }

    .history-tip-box {
        min-width: 66px !important;
        min-height: 38px !important;
        padding: 5px 6px !important;
        border-radius: 7px !important;
    }

    .history-tip-box span {
        font-size: 5px !important
    }

    .history-tip-box strong {
        font-size: 10px !important
    }

    .history-row-result {
        grid-column: 3 !important;
        grid-row: 1 / 3 !important;
        align-self: center !important;
        font-size: 14px !important;
    }

    .history-calendar-head {
        min-height: 62px !important;
        grid-template-columns: 70px 1fr 70px !important;
    }

    .history-calendar-arrows a {
        width: 28px !important;
        height: 28px !important;
        font-size: 18px !important;
    }

    .history-weekdays {
        gap: 2px !important;
        padding: 7px 8px 2px !important;
    }

    .history-weekdays span {
        font-size: 6px !important
    }

    .history-calendar-grid {
        gap: 2px !important;
        row-gap: 2px !important;
        grid-auto-rows: 40px !important;
        padding: 2px 8px 7px !important;
    }

    .history-day {
        height: 40px !important;
        min-height: 40px !important;
    }

    .history-day strong {
        font-size: 10px !important
    }

    .history-day-count {
        min-width: 17px !important;
        font-size: 5px !important
    }

    .history-day i {
        right: 4px !important;
        bottom: 4px !important
    }

    .history-calendar-footer {
        padding: 0 9px 8px !important;
        font-size: 7px !important;
    }
}


/* =========================================================
   FINAL HISTORY CALENDAR + RESULT COLUMN FIX
   ========================================================= */
@media (min-width:761px) {
    .history-calendar {
        width: 420px !important;
        max-width: 420px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    .history-calendar-head {
        min-height: 58px !important;
    }

    .history-weekdays {
        padding: 7px 10px 3px !important;
        gap: 2px !important;
    }

    .history-calendar-grid {
        grid-auto-rows: 42px !important;
        gap: 2px !important;
        row-gap: 2px !important;
        padding: 3px 10px 8px !important;
    }

    .history-day {
        width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        justify-self: center !important;
    }

    .history-calendar-footer {
        padding: 0 10px 9px !important;
    }
}

.history-table-head .history-result-head {
    text-align: right !important;
    padding-right: 2px !important;
}

.history-row-result {
    text-align: right !important;
    justify-self: end !important;
    color: #071b33 !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    white-space: nowrap !important;
}

@media(max-width:760px) {
    .history-calendar {
        width: 100% !important;
        max-width: none !important;
    }

    .history-calendar-grid {
        grid-auto-rows: 40px !important;
        gap: 2px !important;
        row-gap: 2px !important;
        padding: 3px 8px 9px !important;
    }

    .history-day {
        width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        justify-self: center !important;
    }
}

/* =========================================================
   MOBILE HISTORY - HEADERS + PREDICTIONS UNDER TIME
   ========================================================= */
@media (max-width:760px) {
    .history-table-head {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 56px !important;
        min-height: 34px !important;
        padding: 0 10px !important;
        gap: 8px !important;
        align-items: center !important;
        background: #071b33 !important;
        color: rgba(255, 255, 255, .68) !important;
        font-size: 7px !important;
        letter-spacing: .12em !important;
    }

    .history-table-head>div:nth-child(1) {
        display: block !important;
        grid-column: 1 !important;
        text-align: left !important;
    }

    .history-table-head>div:nth-child(2) {
        display: none !important;
    }

    .history-table-head>div:nth-child(3) {
        display: block !important;
        grid-column: 2 !important;
        text-align: left !important;
    }

    .history-table-head>div:nth-child(4) {
        display: block !important;
        grid-column: 3 !important;
        text-align: right !important;
        padding-right: 0 !important;
    }

    .history-row {
        grid-template-columns: 42px minmax(0, 1fr) 56px !important;
        grid-template-rows: auto auto !important;
        column-gap: 8px !important;
        row-gap: 7px !important;
        min-height: 0 !important;
        padding: 10px !important;
    }

    .history-match {
        grid-column: 1 / 3 !important;
        grid-row: 1 !important;
        grid-template-columns: 42px minmax(0, 1fr) !important;
        gap: 7px !important;
    }

    .history-predictions {
        grid-column: 1 / 3 !important;
        grid-row: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
    }

    .history-row-result {
        grid-column: 3 !important;
        grid-row: 1 / 3 !important;
        align-self: center !important;
        justify-self: end !important;
    }
}

/* =========================================================
   MOBILE PREMIUM HISTORY ROW
   Top line: TIME + TEAMS + RESULT
   Divider
   Full-width prediction boxes
   ========================================================= */
@media (max-width:760px) {
    .history-table-head {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 58px !important;
        min-height: 32px !important;
        padding: 0 12px !important;
        gap: 8px !important;
        align-items: center !important;
        background: #071b33 !important;
        color: rgba(255, 255, 255, .66) !important;
        font-size: 7px !important;
        letter-spacing: .12em !important;
    }

    .history-table-head>div:nth-child(1) {
        display: block !important;
        grid-column: 1 !important;
        text-align: left !important;
    }

    .history-table-head>div:nth-child(2),
    .history-table-head>div:nth-child(3) {
        display: none !important;
    }

    .history-table-head>div:nth-child(4) {
        display: block !important;
        grid-column: 2 !important;
        text-align: right !important;
        padding: 0 !important;
    }

    .history-row {
        position: relative !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 58px !important;
        grid-template-rows: auto 1px auto !important;
        column-gap: 8px !important;
        row-gap: 9px !important;
        min-height: 0 !important;
        padding: 12px 12px 13px !important;
        align-items: center !important;
    }

    /* Top line: time + teams */
    .history-match {
        grid-column: 1 !important;
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: 40px minmax(0, 1fr) !important;
        gap: 7px !important;
        min-width: 0 !important;
        align-items: center !important;
    }

    .history-match>span {
        color: #1769d5 !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        align-self: center !important;
    }

    .history-teams {
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 3px !important;
    }

    .history-teams strong {
        display: block !important;
        min-width: 0 !important;
        overflow: hidden !important;
        white-space: nowrap !important;
        text-overflow: ellipsis !important;
        color: #172536 !important;
        font-size: 14px !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
    }

    .history-league {
        display: none !important;
    }

    /* Result stays on the same horizontal line */
    .history-row-result {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: center !important;
        justify-self: end !important;
        margin: 0 !important;
        color: #071b33 !important;
        font-size: 15px !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    /* Elegant separator between match header and tips */
    .history-row::before {
        content: "" !important;
        grid-column: 1 / -1 !important;
        grid-row: 2 !important;
        display: block !important;
        width: 100% !important;
        height: 1px !important;
        background: rgba(7, 27, 51, .08) !important;
    }

    /* Predictions use the entire row width */
    .history-predictions {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: stretch !important;
        gap: 6px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .history-tip-box {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 41px !important;
        padding: 6px 5px !important;
        border-radius: 8px !important;
        box-sizing: border-box !important;
        gap: 3px !important;
    }

    .history-tip-box span {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: 5.5px !important;
        letter-spacing: .05em !important;
    }

    .history-tip-box strong {
        font-size: 11px !important;
        font-weight: 950 !important;
        line-height: 1 !important;
    }
}

/* =========================================================
   FINAL PREMIUM MATCH CARDS
   Each match is a separate card. Prediction types use full width.
   ========================================================= */
.history-table {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.history-table-head {
    margin-bottom: 10px !important;
    border-radius: 12px !important;
}

.history-row {
    background: #fff !important;
    border: 1px solid #e5eaf0 !important;
    border-radius: 14px !important;
    margin: 0 0 10px !important;
    overflow: hidden !important;
    box-shadow: 0 7px 22px rgba(7, 27, 51, .055) !important;
}

.history-row:last-child {
    margin-bottom: 0 !important;
}

.history-row:hover {
    background: #fff !important;
    box-shadow: 0 10px 28px rgba(7, 27, 51, .09), inset 3px 0 0 #1769d5 !important;
}

.history-tip-box.hit {
    background: #e9f9f0 !important;
    border-color: #bcebd0 !important;
    color: #087443 !important;
}

.history-tip-box.miss {
    background: #fff0f0 !important;
    border-color: #f2c7c7 !important;
    color: #c52f38 !important;
}

.history-tip-box.pending {
    background: #f3f5f7 !important;
    border-color: #e0e5ea !important;
    color: #718096 !important;
}

@media(max-width:760px) {
    .history-table-head {
        margin-bottom: 8px !important;
        border-radius: 10px !important;
    }

    .history-row {
        margin: 0 0 9px !important;
        border-radius: 13px !important;
        padding: 12px 12px 13px !important;
        box-shadow: 0 6px 18px rgba(7, 27, 51, .055) !important;
    }

    .history-predictions {
        display: flex !important;
        width: 100% !important;
        gap: 5px !important;
        overflow: hidden !important;
    }

    .history-tip-box {
        flex: 1 1 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 42px !important;
        padding: 6px 4px !important;
    }

    .history-tip-box span {
        font-size: 5.5px !important;
        letter-spacing: .04em !important;
    }

    .history-tip-box strong {
        font-size: 11px !important;
    }
}

/* =========================================================
   DESKTOP WORKSPACE - COMPACT FILTER + CALENDAR
   ========================================================= */
@media (min-width:761px) {
    .history-workspace {
        display: grid !important;
        grid-template-columns: 367px 420px !important;
        column-gap: 18px !important;
        row-gap: 0 !important;
        width: max-content !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        justify-content: start !important;
        align-items: start !important;
    }

    .history-side {
        width: 367px !important;
        box-sizing: border-box !important;
        padding: 20px !important;
    }

    .history-calendar-column {
        width: 420px !important;
        min-width: 420px !important;
    }

    .history-calendar {
        width: 420px !important;
        max-width: 420px !important;
        margin: 0 !important;
    }
}

/* =========================================================
   DESKTOP WORKSPACE - FULL FILTER / RIGHT CALENDAR
   ========================================================= */
@media (min-width:761px) {
    .history-workspace {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 420px !important;
        column-gap: 18px !important;
        row-gap: 0 !important;
        align-items: stretch !important;
    }

    /* Remove the small FILTER PREDICTIONS kicker on desktop only */
    .history-side-head span {
        display: none !important;
    }

    .history-side {
        width: 100% !important;
        height: 100% !important;
        box-sizing: border-box !important;
        padding: 20px !important;
    }

    .history-side-head h2 {
        margin-top: 0 !important;
    }

    .history-calendar-column {
        width: 420px !important;
        min-width: 420px !important;
        height: 100% !important;
    }

    .history-calendar {
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
}


/* =========================================================
   FINAL: HALF-TIME RESULT BEFORE FULL-TIME RESULT
   ========================================================= */
@media (min-width:761px) {
    .history-table-head {
        grid-template-columns: minmax(230px, 1.15fr) minmax(145px, .72fr) minmax(0, 2.15fr) 72px 72px !important;
    }

    .history-row {
        grid-template-columns: minmax(230px, 1.15fr) minmax(145px, .72fr) minmax(0, 2.15fr) 72px 72px !important;
    }

    .history-ht-head,
    .history-result-head {
        text-align: right !important;
        padding-right: 2px !important;
    }

    .history-row-ht-result,
    .history-row-result {
        justify-self: end !important;
        text-align: right !important;
        white-space: nowrap !important;
        color: #071b33 !important;
        font-size: 14px !important;
        font-weight: 900 !important;
    }
}

@media (max-width:760px) {
    .history-table-head {
        grid-template-columns: minmax(0, 1fr) 42px 42px !important;
        padding: 0 10px !important;
        gap: 6px !important;
    }

    .history-table-head>div:nth-child(1) {
        grid-column: 1 !important;
        display: block !important;
        text-align: left !important;
    }

    .history-table-head>div:nth-child(2),
    .history-table-head>div:nth-child(3) {
        display: none !important;
    }

    .history-table-head>.history-ht-head {
        display: block !important;
        grid-column: 2 !important;
        text-align: right !important;
        padding: 0 !important;
    }

    .history-table-head>.history-result-head {
        display: block !important;
        grid-column: 3 !important;
        text-align: right !important;
        padding: 0 !important;
    }

    .history-row {
        grid-template-columns: minmax(0, 1fr) 42px 42px !important;
        column-gap: 6px !important;
        grid-template-rows: auto 1px auto !important;
    }

    .history-match {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .history-row-ht-result {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: center !important;
        justify-self: end !important;
        margin: 0 !important;
        color: #607083 !important;
        font-size: 12px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    .history-row-result {
        grid-column: 3 !important;
        grid-row: 1 !important;
        align-self: center !important;
        justify-self: end !important;
        margin: 0 !important;
        color: #071b33 !important;
        font-size: 14px !important;
        font-weight: 950 !important;
        line-height: 1 !important;
        white-space: nowrap !important;
        text-align: right !important;
    }

    .history-predictions {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
    }
}