:root {
    --ink: #e7e9ee;
    --blue-900: #e7e9ee;
    --blue-800: #1b1f26;
    --blue-700: #2a303a;
    --blue-100: #1b1f26;
    --line: #262b33;
    --muted: #9aa3ad;
    --bg: #0f1115;
    --white: #15181e;
    --live: #2bd68f;
    --scheduled: #ff9f2d;
    --finished: #9aa3ad;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}

.sports-strip {
    background: #13161c;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 20px;
}

.sports-strip-inner {
    justify-content: flex-start;
    padding-left: 20px;
    padding-right: 20px;
    width: max-content;
    min-width: 100%;
}

@media (min-width: 992px) {
    .sports-strip-inner {
        justify-content: center;
    }
}

.sport-pill {
    background: var(--blue-800);
    color: var(--ink);
    border-color: var(--line);
}

.sport-pill .sport-icon {
    background: transparent;
    color: #cdd5df;
}

.sport-pill.active {
    background: #202530;
    border-color: #3b424d;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.mode-tab,
.date-controls button,
.date-controls input,
.search-box,
.search-box input {
    background: var(--blue-800);
    color: var(--ink);
    border-color: var(--line);
}

.mode-tab.active {
    background: #e7e9ee;
    color: #0f1115;
    border-color: #e7e9ee;
}

.section-title {
    color: var(--muted);
}

.stage-card {
    background: var(--white);
    border-color: var(--line);
}

.stage-header {
    background: #1b1f26;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stage-header-link {
    width: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    text-decoration: none;
    gap: 12px;
}

.stage-header-link,
.stage-header-link:visited,
.stage-header-link:hover,
.stage-header-link:active {
    color: #fff;
    text-decoration: none;
}

.stage-header-link * {
    color: inherit;
    text-decoration: none;
}

.stage-header-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stage-header-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.stage-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stage-header-logo {
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.stage-header-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.stage-card .stage-title,
.stage-card .stage-country,
.stage-card .stage-link-arrow {
    color: #fff !important;
}

.stage-title {
    font-size: 14px;
    color: #fff !important;
}

.stage-country {
    color: #fff !important;
    opacity: 1;
}

.stage-link-arrow {
    font-size: 24px;
    line-height: 1;
    opacity: 1;
    color: #fff !important;
}

.stage-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.stage-odds-toggle-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.stage-odds-label {
    color: #fff;
}

/* =====================================================
   ODDS TOGGLE
   ===================================================== */

.odds-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.odds-toggle-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.odds-toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--line);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    padding: 0;
}

.odds-toggle::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.odds-toggle.active {
    background: var(--blue-700);
}

.odds-toggle.active::after {
    transform: translateX(18px);
}

/* =====================================================
   ODDS DISPLAY BAR
   ===================================================== */

.odds-bar {
    display: none;
    grid-template-columns: auto 1fr 1fr 1fr;
    gap: 2px;
    background: #0d1117;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    margin-top: -1px;
}

.odds-bar.show {
    display: grid;
}

.odds-bar.two-way {
    grid-template-columns: auto 1fr 1fr;
}

.odds-market-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    background: #161b22;
    font-size: 11px;
    font-weight: 600;
    color: #8b949e;
    text-transform: capitalize;
    white-space: nowrap;
}

.odds-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: #161b22;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
    cursor: pointer;
}

.odds-item:hover {
    background: #21262d;
}

.odds-item.suspended {
    opacity: 0.5;
    pointer-events: none;
}

.odds-team-name {
    font-size: 10px;
    color: #8b949e;
    text-align: center;
    line-height: 1.2;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.odds-value {
    font-size: 14px;
    font-weight: 700;
    color: #f0f6fc;
}

.odds-value.up {
    color: #3fb950;
}

.odds-value.down {
    color: #f85149;
}

.odds-item.up .odds-trend {
    color: #3fb950;
}

.odds-item.down .odds-trend {
    color: #f85149;
}

.odds-trend {
    font-size: 10px;
    margin-left: 4px;
    font-weight: 700;
}

.odds-market-name {
    font-size: 8px;
    color: #6e7681;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Match wrapper for odds integration */
.match-wrapper {
    border-radius: 8px;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 4px;
    background: var(--white);
}

.match-wrapper .match-row {
    border-top: none;
    border-radius: 0;
}

.match-wrapper:first-child .match-row {
    border-top: none;
}

/* Loading state for odds */
.odds-bar.loading {
    min-height: 50px;
    position: relative;
}

.odds-bar.loading::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: odds-spin 0.8s linear infinite;
}

@keyframes odds-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.odds-bar.locked {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.odds-bar.locked .odds-market-label {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #8b949e);
    font-size: 12px;
    width: 100%;
}

/* Odds bar in stage card context */
.stage-card .odds-bar {
    border-radius: 0;
}

/* Mobile adjustments for odds */
@media (max-width: 600px) {
    .odds-bar {
        gap: 1px;
    }

    .odds-item {
        padding: 8px 4px;
    }

    .odds-team-name {
        font-size: 9px;
    }

    .odds-value {
        font-size: 12px;
    }

    .odds-market-label {
        padding: 8px 8px;
        font-size: 10px;
    }

    .odds-toggle-container {
        margin-left: 8px;
    }

    .odds-toggle {
        width: 36px;
        height: 20px;
    }

    .odds-toggle::after {
        width: 16px;
        height: 16px;
    }

    .odds-toggle.active::after {
        transform: translateX(16px);
    }

    .stage-odds-toggle-wrap {
        gap: 4px;
        font-size: 10px;
    }

    .stage-odds-label {
        font-size: 10px;
    }

    .stage-header-right {
        gap: 8px;
    }
}

.stage-link {
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stage-link-arrow {
    font-size: 20px;
    line-height: 1;
    opacity: 0.9;
    color: var(--white);
}

.stage-country {
    color: var(--white);
}

.match-row {
    border-top-color: var(--line);
}

.match-row:hover {
    background: #1a1f27;
}

.match-time,
.status,
.score-header,
.match-note,
.page-toggle,
.h2h-stage-country,
.h2h-date,
.h2h-status {
    color: var(--muted);
}

.team-logos {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.team-name.team-winner {
    color: #ffffff;
    font-weight: 600;
}

.team-name.team-loser {
    color: #b0b7c3;
    font-weight: 500;
}

/* Team link styling - inherit color, no underline */
.team-link {
    color: inherit;
    text-decoration: none;
}

.team-link:hover {
    text-decoration: underline;
}

.team-link:visited {
    color: inherit;
}

.team-score-winner span {
    color: var(--ink);
}

.team-score-loser span {
    color: #7f8896;
}

.score-line,
.team span {
    color: var(--ink);
}


/* Stage header overrides */
.stage-header,
.stage-header-link,
.stage-header-link *,
.stage-title,
.stage-country,
.stage-link-arrow {
  color: #fff !important;
}

.stage-header .stage-title,
.stage-header .stage-link-arrow {
  color: #fff !important;
  opacity: 1;
}

.stage-header .stage-country {
  color: #cfd6df !important;
  opacity: 1;
}

.stage-header .stage-link-arrow {
  font-size: 26px;
}

/* Live identifier */
.match-row.is-live {
  border-left: 3px solid #e03a3a;
  padding-left: 9px;
}

.status:empty {
  display: none;
}

/* Stage header final overrides */
.stage-header-link,
.stage-header-link *,
.stage-header .stage-title,
.stage-header .stage-country,
.stage-header .stage-link-arrow {
  color: #fff !important;
}

.stage-header .stage-country {
  color: #cfd6df !important;
}

.stage-header-top {
  align-items: center;
}

.stage-link-arrow {
  font-size: 26px;
}

.search-tabs {
    display: flex;
    gap: 8px;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: #101318;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    width: min(420px, 92vw);
    max-height: 360px;
    overflow: auto;
    z-index: 60;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) rgba(255, 255, 255, 0.08);
}

.search-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-panel[hidden],
.search-dropdown[hidden] {
    display: none !important;
}

.search-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    text-decoration: none;
    color: #ffffff;
}

.search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 999px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-item.search-category {
    width: 100%;
    justify-content: space-between;
    border: none;
    cursor: pointer;
}

.search-item-arrow {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
}

.search-back {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    cursor: pointer;
}

.search-back:hover {
    background: rgba(255, 255, 255, 0.12);
}

.search-back-icon {
    font-size: 18px;
    opacity: 0.7;
}

.search-item-logo img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

.search-item-text {
    display: flex;
    flex-direction: column;
}

.search-item-title {
    font-size: 13px;
    font-weight: 600;
}

.search-item-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.search-empty {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
    .search-tabs {
        flex-wrap: wrap;
    }
    .search-item {
        padding: 10px;
    }
}
