*{box-sizing:border-box}
body{margin:0;background:#f4f7fb;color:#162337;font-family:"Segoe UI",Arial,sans-serif}
.history-wrap{max-width:1240px;margin:auto;padding:10px 16px 12px}
.history-top,.timeline-heading,.timeline-footer,.panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.history-top a{color:#1769c8;text-decoration:none;font-weight:600}
.history-top-actions{display:flex;align-items:center;gap:8px}
.odds-history-open{display:inline-flex;align-items:center;gap:7px;border-color:#1769c8;color:#1769c8;font-weight:600;padding:6px 11px}
.odds-history-open svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
button,select{border:1px solid #cfd9e4;border-radius:5px;background:white;color:#26384d;padding:4px 8px;font:inherit;font-size:12px;cursor:pointer}
button:disabled{opacity:.4;cursor:default}
button:hover:not(:disabled){background:#edf5ff}
button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #1769c8;outline-offset:3px}
#message{min-height:16px;color:#687789;font-size:11px;margin:4px 0}
#message.error{color:#b03128}
.scoreboard,.timeline,.panel{border:1px solid #dce4ed;border-radius:8px;background:#fff;padding:10px 12px}
.match-controls{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:10px;margin:6px 0 10px}
.scoreboard{text-align:center;display:flex;flex-direction:column;justify-content:center;min-width:0}
.muted{color:#687789;font-size:11px}
#league{height:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
h1{display:grid;grid-template-columns:1fr 120px 1fr;align-items:center;gap:10px;font-size:18px;margin:4px 0;min-height:36px}
#home,#away{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#score{font-size:26px;font-variant-numeric:tabular-nums;white-space:nowrap}
.moment{display:flex;justify-content:center;align-items:center;gap:10px;min-height:20px;font-size:12px}
#minute{font-size:15px;color:#1769c8}
.status-with-marker{display:inline-flex;align-items:center;gap:5px}
.incomplete-marker{display:inline-block;width:9px;height:9px;flex:none;border:1px solid #b98500;border-radius:1px;background:#ffd43b;box-shadow:0 0 0 1px rgba(255,212,59,.2)}
.incomplete-marker[hidden]{display:none}
.halves{display:flex;justify-content:center;gap:16px;font-size:11px;min-height:16px;margin-top:2px}
.halves b{font-variant-numeric:tabular-nums}
.timeline{margin:0;min-width:0}
h2{font-size:14px;margin:0}
.slider-row{display:flex;align-items:center;gap:8px;margin-top:34px;margin-bottom:28px}
.slider-row>button{width:28px;font-size:18px;padding:0}
.timeline-track{position:relative;flex:1;min-width:0}
#timeline{display:block;width:100%;min-width:0;margin:0;accent-color:#1769c8;cursor:pointer}
.event-markers{position:absolute;left:8px;right:8px;top:50%;height:0;pointer-events:none;z-index:2}
.slider-row .match-event-marker{position:absolute;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;width:28px;height:24px;border:0;border-radius:5px;background:transparent;padding:0;pointer-events:auto;overflow:visible}
.slider-row .match-event-marker.team-1{bottom:calc(5px + var(--event-lane-offset, 0px))}
.slider-row .match-event-marker.team-2{top:calc(5px + var(--event-lane-offset, 0px))}
.slider-row .match-event-marker.selected{background:#e8f2ff}
.slider-row .match-event-marker::after{content:"";position:absolute;left:50%;height:calc(6px + var(--event-lane-offset, 0px));border-left:1px solid #abb9c9;z-index:-1}
.slider-row .match-event-marker.team-1::after{top:100%}
.slider-row .match-event-marker.team-2::after{bottom:100%}
.event-icon{display:inline-flex;align-items:center;justify-content:center;position:relative;z-index:1}
.event-goal .event-icon{font-size:18px;line-height:1}
.event-yellow-card .event-icon,.event-red-card .event-icon{width:10px;height:15px;border:1px solid rgba(22,35,55,.38);border-radius:2px;box-shadow:0 1px 2px rgba(22,35,55,.18)}
.event-yellow-card .event-icon{background:#ffd323}
.event-red-card .event-icon{background:#e53935}
.event-count{position:absolute;left:18px;top:0;min-width:13px;height:13px;padding:0 3px;border-radius:7px;background:#26384d;color:#fff;font-size:9px;font-weight:700;line-height:13px}
.halftime-marker{position:absolute;top:50%;z-index:4;transform:translate(-50%,-50%);width:auto!important;min-width:26px;height:20px;padding:0 4px!important;border:0!important;border-radius:4px!important;background:#fff!important;color:#162337;font-size:11px!important;font-weight:800;line-height:20px;box-shadow:0 0 0 2px #fff;pointer-events:auto}
.halftime-marker:hover:not(:disabled){background:#edf5ff!important}
.event-detail{margin-top:3px;color:#26384d;font-size:11px;line-height:1.35}
.event-detail[hidden]{display:none}
.ticks{position:relative;height:19px;margin:0 43px 2px;color:#687789;font-size:10px}
.tick{position:absolute;transform:translateX(-50%);white-space:nowrap;padding-top:7px}
.tick:before{content:"";position:absolute;top:0;left:50%;height:5px;border-left:1px solid #abb9c9}
.timeline-footer{min-height:24px}
.hint{color:#758294;font-size:10px;line-height:1.3;margin:5px 0 0}
.history-grid{display:grid;grid-template-columns:1.2fr 1fr;gap:10px;align-items:start}
.panel{min-width:0}
.panel-heading{min-height:26px}
.odds-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:5px 0 8px}
.odds-grid>div{display:flex;align-items:center;justify-content:center;gap:10px;background:#f3f7fc;border:1px solid #e0e8f1;border-radius:5px;padding:5px 8px;font-size:11px}
.odds-grid strong{display:block;font-size:18px;line-height:23px;height:23px;font-variant-numeric:tabular-nums}
table{width:100%;border-collapse:collapse;table-layout:fixed;font-variant-numeric:tabular-nums;font-size:12px}
th{font-size:10px;color:#687789;background:#f8fafd}
td,th{height:24px;padding:3px 5px;border-bottom:1px solid #e8edf3;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.totals-grid{display:grid;grid-template-columns:repeat(var(--total-columns,2),minmax(0,1fr));gap:8px;align-items:start;margin-top:5px}
.totals-grid table{border:1px solid #e0e8f1}
.main-star{display:inline-block;width:12px;color:#d39008}
.stats-table{margin-top:5px}
.stats-table th:first-child,.stats-table td:first-child{text-align:left;width:60%}
.stats-table td{height:27px}
.archive-panel{border:1px solid #dce4ed;border-radius:8px;background:#fff;padding:10px 12px;margin-top:10px}
.archive-grid{display:grid;grid-template-columns:1fr;gap:10px;margin-top:7px}
.archive-card{border:1px solid #e0e8f1;border-radius:6px;min-width:0;padding:7px 8px;background:#fbfcfe}
.archive-card h3{font-size:12px;margin:0 0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.archive-h2h{grid-column:auto}
.archive-table-wrap{overflow-x:auto}
.archive-table{width:100%;min-width:1000px;table-layout:fixed;font-size:11px}
.archive-table th,.archive-table td{height:23px;padding:2px 4px}
.archive-table th:nth-child(1),.archive-table td:nth-child(1){width:86px}
.archive-table th:nth-child(2),.archive-table td:nth-child(2){width:65px}
.archive-table th:nth-child(3),.archive-table td:nth-child(3){width:230px;text-align:left}
.archive-table th:nth-child(4),.archive-table td:nth-child(4){text-align:left}
.archive-table th:nth-child(5),.archive-table td:nth-child(5){width:165px}
.archive-table th:nth-child(6),.archive-table td:nth-child(6){width:90px}
.archive-score{position:relative;font-weight:600;white-space:nowrap;overflow:visible}
.archive-score-special{cursor:help}
.archive-score-special::after{content:attr(data-tooltip);position:absolute;display:block;left:50%;top:calc(100% + 5px);z-index:20;min-width:105px;padding:5px 7px;border-radius:5px;background:#253142;color:#fff;font-size:10px;font-weight:500;line-height:1.25;white-space:nowrap;opacity:0;visibility:hidden;transform:translateX(-50%);transition:opacity .12s ease;pointer-events:none;box-shadow:0 3px 10px rgba(0,0,0,.18)}
.archive-score-special:hover::after,.archive-score-special:focus::after,.archive-score-special.is-open::after{opacity:1;visibility:visible}
.archive-status{font-size:10px;font-weight:600;white-space:nowrap}
.archive-status-final{color:#2f6b3b}
.archive-status-interrupted,.archive-status-unverified_nonfinal{color:#a35b00}
.archive-status-postponed_cancelled{color:#9a3b3b}
body.odds-history-opened{overflow:hidden}
.odds-history-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:22px;background:rgba(28,48,73,.56);backdrop-filter:blur(2px)}
.odds-history-modal[hidden]{display:none}
.odds-history-dialog{display:flex;flex-direction:column;width:min(1040px,100%);max-height:min(760px,calc(100vh - 44px));overflow:hidden;border:1px solid #dbe5f0;border-radius:17px;background:#fff;box-shadow:0 24px 70px rgba(13,38,68,.28)}
.odds-history-header{display:flex;align-items:flex-start;gap:12px;padding:20px 22px 14px;border-bottom:1px solid #e4ebf3}
.odds-history-icon{display:flex;align-items:center;justify-content:center;flex:none;width:38px;height:38px;border-radius:10px;background:#eaf3ff;color:#1769c8}
.odds-history-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linejoin:round}
.odds-history-title-wrap{min-width:0;flex:1}
.odds-history-title-line{display:flex;align-items:center;flex-wrap:wrap;gap:9px;min-height:28px}
.odds-history-title-line h2{font-size:22px;line-height:1.2}
.odds-history-title-wrap p{margin:3px 0 0;font-size:12px}
.odds-history-status{display:inline-flex;align-items:center;gap:5px;border-radius:999px;background:#eef3f8;color:#617083;padding:4px 10px;font-size:11px;font-weight:700}
.odds-history-status.ready{background:#e8f8ed;color:#168342}
.odds-history-status.ready::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.odds-history-status.error{background:#fff0f1;color:#c82838}
.odds-history-close{flex:none;width:38px;height:38px;padding:0;border:0;border-radius:50%;background:#f1f5fa;color:#718197;font-size:25px;line-height:38px}
.odds-history-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:330px;color:#516176}
.odds-history-loading[hidden],.odds-history-content[hidden]{display:none}
.odds-history-loading strong{font-size:15px}
.odds-history-spinner{width:32px;height:32px;border:3px solid #dce9f7;border-top-color:#1769c8;border-radius:50%;animation:odds-history-spin .8s linear infinite}
.odds-history-loading.failed .odds-history-spinner{animation:none;border-color:#f1c8ce;border-top-color:#c82838}
@keyframes odds-history-spin{to{transform:rotate(360deg)}}
.odds-history-content{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden;padding:16px 22px 18px}
.odds-history-controls{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,1fr) minmax(310px,1.35fr);gap:12px;margin-bottom:14px}
.odds-history-controls label{display:flex;align-items:center;gap:8px;min-width:0;border:1px solid #d5e0ec;border-radius:8px;padding-left:12px;color:#607086;font-size:12px;font-weight:600}
.odds-history-controls select{min-width:0;flex:1;border:0;padding:9px 11px 9px 2px;background:transparent;color:#1e3350;font-weight:600}
.odds-history-controls select:focus-visible{outline:0}
.odds-history-mode{display:grid;grid-template-columns:1fr 1fr;border:1px solid #d5e0ec;border-radius:8px;overflow:hidden;background:#f5f8fc}
.odds-history-mode button{border:0;border-radius:0;padding:9px 12px;background:transparent;color:#607086;font-weight:600}
.odds-history-mode button+button{border-left:1px solid #d5e0ec}
.odds-history-mode button.active{background:#1769c8;color:#fff;box-shadow:0 2px 7px rgba(23,105,200,.22)}
.odds-history-table-wrap{position:relative;flex:1 1 auto;min-height:190px;max-height:410px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;border:1px solid #dbe5ef;border-radius:8px}
.odds-history-table{min-width:820px;table-layout:auto;font-size:12px}
.odds-history-table th{position:sticky;top:0;z-index:1;height:35px;padding:6px 9px;background:#f3f7fc;color:#61738b;font-size:11px}
.odds-history-table td{height:34px;padding:5px 9px;color:#162b49}
.odds-history-table th:first-child,.odds-history-table td:first-child{padding-left:14px}
.odds-history-table .history-price{font-weight:700}
.odds-history-table .history-change{font-weight:700;white-space:nowrap}
.odds-history-table .history-change-up{color:#119b46}
.odds-history-table .history-change-down{color:#ec3444}
.odds-history-table .history-change-none{color:#8a99ab}
.odds-history-table .history-market-closed td{background:#fafbfd;color:#7d8ca0}
.odds-history-table .history-market-closed:hover td{background:#f2f6fa}
.odds-history-table .history-prematch td{background:#f4f8ff}
.odds-history-table .history-prematch:hover td{background:#eaf3ff}
.odds-history-table .history-prematch td:nth-child(3){color:#1769c8;font-weight:700}
.odds-history-empty{margin:0;padding:70px 20px;text-align:center;color:#718197;font-size:13px}
.odds-history-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:45px;padding-top:10px}
.odds-history-footer .hint{margin:0}
@media(max-width:760px){.match-controls,.history-grid,.archive-grid{grid-template-columns:1fr}.archive-h2h{grid-column:auto}h1{grid-template-columns:1fr 90px 1fr;font-size:15px}#score{font-size:23px}.scoreboard,.timeline,.panel,.archive-panel{padding:8px 10px}.moment{font-size:11px;gap:8px}.panel-heading select{max-width:175px}#position{font-size:10px}.halves{gap:12px}.totals-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.history-top{align-items:flex-start}.history-top-actions{flex-wrap:wrap;justify-content:flex-end}.odds-history-modal{align-items:stretch;padding:8px}.odds-history-dialog{max-height:calc(100vh - 16px);border-radius:12px}.odds-history-header{padding:14px}.odds-history-title-line h2{font-size:18px}.odds-history-content{padding:12px 14px 14px}.odds-history-controls{grid-template-columns:1fr 1fr}.odds-history-mode{grid-column:1/-1}.odds-history-footer{align-items:flex-start}.odds-history-footer .hint{max-width:65%}}
@media(max-width:480px){.history-top{gap:8px}.history-top-actions{gap:5px}.odds-history-open{padding:5px 8px}.odds-history-open span{max-width:126px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.odds-history-controls{grid-template-columns:1fr}.odds-history-mode{grid-column:auto}.odds-history-title-wrap p{font-size:10px}.odds-history-icon{width:34px;height:34px}.odds-history-close{width:34px;height:34px}.odds-history-footer .hint{display:none}.odds-history-footer{justify-content:flex-end}}
