/**
 * MatchDetails.css - копия дизайна MoreBetsPage
 * Prefix: md-
 */

/* ===== WRAPPER ===== */
.md-wrapper {
  display: flex;
  flex-direction: column;
  /* min-height убран - не нужен лишний скролл когда мало маркетов */
  background-color: var(--bg-primary);
}

.md-page {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}

.md-content .footer-container {
  margin-top: 20px;
}

/* ===== HEADER ===== */
.md-header {
  position: sticky;
  top: 36px;
  z-index: 2222;
  background-color: var(--bg-primary);
}

.md-back-info {
  align-items: center;
  display: flex;
  background-color: var(--bg-primary);
  gap: 15px;
  padding: 9px 8px 8px;
}

.md-star {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 6px 12px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.md-star svg {
  transition: transform 0.15s ease;
}

.md-star:hover svg {
  transform: scale(1.15);
}

.md-star:active svg {
  transform: scale(0.95);
}

.md-star-divider {
  width: 1px;
  height: 14px;
  background: var(--white-20);
  flex-shrink: 0;
  margin-right: 6px;
  position: sticky;
  left: 42px;
  z-index: 2;
}

.md-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #1a1a1a;
  background: var(--bg-secondary, #1a1a1a);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.md-back-button svg {
  width: 20px;
  height: 20px;
  color: var(--white-80);
}

.md-match-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1;
  min-width: 0;
}

.md-sport-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-70);
}

.md-league-icon {
  max-width: 50px;
  height: 33px;
  object-fit: contain;
}

.md-text-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.md-sport-name {
  font-weight: 900;
  font-style: italic;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 18px;
  line-height: 16px;
}

.md-league-name {
  color: var(--text-primary);
  font-family: Proxima Nova Cond, sans-serif;
  line-height: 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.md-league-name > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-country-flag {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== STICKY HEADER CONTAINER ===== */
.md-sticky-header {
  position: sticky;
  top: 89px;
  z-index: 100;
  background: var(--bg-primary);
  margin: 0 3px;
  padding-bottom: 5px;
}

@media (min-width: 1024px) {
  .md-sticky-header {
    top: 48px;
  }
}

/* ===== LIVE INFO BAR ===== */
.md-live-bar {
  background: var(--gradient-fixture);
  padding: 0px 10px;
  display: flex;
  flex-direction: column;
  border-radius: 5px 5px 0 0;
}

/* Sport-specific backgrounds - defined in sportColors.css */

.md-live-bar--no-tabs {
  border-radius: 5px;
}

.md-live-bar--stats {
  /* No extra padding for stats mode */
}

/* Header row: LIVE + Period + Timer + Stats icons (all on one line) */
.md-header-row {
  display: flex;
  align-items: center;
  padding: 7px 0px;
  border-bottom: 1px solid var(--white-10);
}

/* Left side: LIVE + period + timer */
.md-live-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1;
}

.md-live-badge {
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-hover) 100%);
  color: var(--text-on-accent);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  animation: md-pulse 2s ease-in-out infinite;
}

@keyframes md-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ENDED badge - gray, no animation */
.md-ended-badge {
  background: linear-gradient(135deg, var(--color-ended) 0%, var(--text-quaternary) 100%);
  color: var(--text-on-accent);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* SOON badge - orange, like fixture cards */
.md-soon-badge {
  background: var(--accent-blue);
  color: var(--text-on-accent);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* Period text (no background, like MoreBetsPage) */
.md-period-text {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-80);
}

/* Baseball BSO (Balls-Strikes-Outs) */
.md-baseball-bso {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--white-70);
  letter-spacing: 0.5px;
  background: var(--black-30);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Baseball bases indicator */
.md-baseball-bases {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: #f7be0f;
  letter-spacing: 1px;
  background: var(--black-30);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Timer text (all sports) */
.md-timer-text {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-80);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.md-timer-text.md-timer-stopped {
  color: var(--white-45);
}

/* Countdown timer (Basketball/Hockey) */
.md-countdown-timer {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-80);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.md-countdown-timer.md-timer-stopped {
  color: var(--white-45);
}

.md-pause-icon {
  color: var(--white-45);
  margin-left: 2px;
}

/* Basketball Timer (unified component) */
.md-basketball-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-90);
}

.md-basketball-timer .basketball-quarter {
  color: var(--white-90);
}

.md-basketball-timer .basketball-time {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.md-basketball-timer .basketball-time.stopped {
  color: var(--white-50);
}

.md-basketball-timer.halftime,
.md-basketball-timer.break,
.md-basketball-timer.fulltime {
  color: var(--white-70);
}

/* Hockey timer styles */
.md-hockey-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-90);
}

.md-hockey-timer .hockey-period {
  color: var(--white-90);
}

.md-hockey-timer .hockey-time {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.md-hockey-timer .hockey-time.stopped {
  color: var(--white-50);
}

.md-hockey-timer.pause,
.md-hockey-timer.fulltime,
.md-hockey-timer.shootout {
  color: var(--white-70);
}

.md-hockey-timer.overtime .hockey-period {
  color: #ffa500;
}

/* Hockey power play indicator */
.md-power-play {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: rgba(220, 80, 80, 0.5);
  border-radius: 3px;
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Futsal game format (2x20) */
.md-game-format {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: rgba(100, 150, 255, 0.2);
  border-radius: 3px;
  color: rgba(150, 200, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Volleyball timeout */
.md-timeout {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: rgba(255, 180, 50, 0.3);
  border-radius: 3px;
  color: #ffb832;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Added time (injury time) */
.md-added-time {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--white-80);
  font-size: 11px;
  font-weight: 600;
}

.md-prematch-time {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--white-80);
}

/* Stats icons in header row */
.md-stats-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-stats-icon img {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.md-stats-half-header {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--white-90);
  text-align: center;
}

.md-stats-score-header {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-80);
}

/* Team rows */
.md-team-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
}

/* Separator line between home and away teams */
.md-team-home {
  border-bottom: 1px solid var(--white-5);
}

.md-team-row--stats {
  display: grid;
  grid-template-columns: 1fr repeat(auto-fit, minmax(20px, 25px)) 30px;
  align-items: center;
}

.md-team-info {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1;
}

.md-team-name {
  color: var(--text-secondary);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  margin-left: 10px;
}

.md-team-score {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
}

/* PEN/VAR indicators - match FixtureCard style */
.md-indicator {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
  flex-shrink: 0;
  margin-left: 6px;
}

/* First indicator pushes to the right */
.md-indicator:first-of-type {
  margin-left: auto;
}

.md-indicator--pen {
  background: var(--accent-red);
  color: var(--text-on-accent);
}

.md-indicator--var {
  background: var(--accent-red);
  color: var(--text-on-accent);
}

/* Stats values */
.md-stats-value {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 500;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--white-60);
  text-align: center;
}

.md-stats-half-value {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 500;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--white-60);
  text-align: center;
}

.md-period-win { color: var(--white-90); }
.md-period-lose { color: var(--white-50); }

/* Overtime header/value - highlighted in yellow */
.md-ot-header {
  color: #f59e0b !important;
}

.md-ot-value {
  color: rgba(245, 158, 11, 0.9) !important;
  font-weight: 600;
}

.md-stats-score {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-align: center;
}

.md-score-win { color: rgba(255, 255, 255, 1); }
.md-score-lose { color: var(--white-70); }

/* OT winner/loser (yellow palette) */
.md-ot-value.md-period-win { color: rgba(245, 158, 11, 1) !important; }
.md-ot-value.md-period-lose { color: rgba(245, 158, 11, 0.5) !important; }

/* Tennis/Volleyball specific */
.md-sets-points {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: #f7be0f !important; /* Yellow like ball */
}

.md-sets-serve {
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-curling-serve {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== TABS ===== */
.md-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
  overflow-x: auto;
  padding: 0;
  background: linear-gradient(135deg, #1a3f1f, #28542c);
  border-top: 1px solid var(--white-5);
}

.md-tabs::-webkit-scrollbar {
  display: none;
}

.md-tab {
  background-color: transparent;
  font-family: Proxima Nova, sans-serif;
  color: var(--white-70);
  border: none;
  border-right: 1px solid var(--white-5);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 14px;
  white-space: nowrap;
  flex: 1 1;
  text-align: center;
}

.md-tab:last-child {
  border-right: none;
}

.md-tab--active {
  font-family: Proxima Nova, sans-serif;
  background-color: var(--white-5);
  border-radius: 0;
  color: var(--text-primary);
  font-weight: 700;
}

/* ===== PERIOD TABS ===== */
.md-period-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  border-radius: 0 0 5px 5px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.md-period-tabs::-webkit-scrollbar {
  display: none;
}

.md-period-tab {
  background-color: transparent;
  font-family: Proxima Nova, sans-serif;
  color: var(--white-50);
  border: none;
  border-bottom: 4px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px 4px 10px;
  white-space: nowrap;
  text-align: center;
  text-transform: capitalize;
  transition: all 0.35s ease;
  margin-bottom: -1px;
}

.md-period-tab.active {
  color: var(--text-primary);
  border-bottom: 4px solid var(--accent-blue);
}

@media (min-width: 1024px) {
  .md-period-tab:hover:not(.active) {
    color: var(--white-80);
  }
}

/* ===== STATISTICS HEADER (STATISTICS title + Collapse All) ===== */
.md-stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0px 10px 12px;
  margin: 0 3px;
  border-bottom: 1px solid var(--white-15);
}

.md-stats-header-title {
  color: var(--white-95);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.md-stats-collapse-all-btn {
  background: transparent;
  border: none;
  color: var(--white-70);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.md-stats-collapse-all-btn:hover {
  background: var(--white-8);
  color: var(--white-90);
}

/* ===== STATISTICS CATEGORY (inside Statistics tab) ===== */
.md-stats-category {
  margin-bottom: 8px;
}

.md-stats-category.collapsed {
  margin-bottom: 0;
}

.md-stats-category-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 3px;
  border-bottom: 1px solid var(--white-10);
  cursor: pointer;
  -webkit-user-select: none;
          user-select: none;
  /* Sticky header */
  position: sticky;
  top: 168px;
  background: var(--bg-body);
  z-index: 10;
}

@media (max-width: 768px) {
  .md-stats-category-header {
    top: 215px;
  }
}

.md-stats-category-name {
  color: var(--white-90);
  font-size: 15px;
  font-weight: 600;
  text-transform: capitalize;
}

/* Hover only on name, desktop only */
@media (hover: hover) {
  .md-stats-category-name:hover {
    color: var(--text-primary);
  }
}

.md-stats-category-score {
  color: var(--accent-blue-hover);
  font-size: 16px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.md-stats-category-caret {
  color: var(--white-50);
  transition: transform 0.2s ease;
  margin-left: auto;
}

.md-stats-category-caret.collapsed {
  transform: rotate(-90deg);
}

/* ===== MARKETS ===== */
.md-markets {
  display: flex;
  flex-direction: column;
}

.md-market-section {
  margin: 0 3px;
}

.md-market-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 10px 10px 5px;
  text-align: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.md-market-header:active {
  opacity: 0.8;
}

.md-market-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.md-market-toggle svg {
  width: 16px;
  height: 16px;
  color: var(--white-50);
}

.md-market-section.collapsed .md-market-toggle {
  transform: rotate(-90deg);
}

.md-market-section.collapsed .md-ml-wrapper {
  display: none;
}

.md-market-section.collapsed::after {
  content: '';
  display: block;
  height: 1px;
  background: var(--border-dark);
  margin: 0 3px;
}

.md-market-title {
  color: var(--text-secondary);
  font-family: Proxima Nova, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.md-market-count {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-left: 6px;
}

/* ===== ML WRAPPER - контейнер для labels + grid ===== */
.md-ml-wrapper {
  background: var(--bg-odds-btn);
  border-radius: 5px;
  overflow: hidden;
}

/* ===== LABELS ROW ===== */
.md-labels {
  display: grid;
  grid-gap: 0;
  gap: 0;
  align-items: center;
  height: 35px;
  background: var(--black-20);
  margin-bottom: 1px;
}

.md-labels.cols-1 {
  grid-template-columns: 1fr;
}

.md-labels.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.md-labels.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.md-label {
  color: var(--text-secondary);
  font-family: Proxima Nova, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 13px;
  margin: 5px 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-feature-settings: "smcp", "c2sc";
  font-variant: all-small-caps;
}

/* ===== ODDS GRID - gap creates permanent dividers via background ===== */
.md-odds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 1px;
  gap: 1px;
  background: var(--black-30);
}

/* Reset old box-shadow dividers */
.md-odds-grid > div {
  box-shadow: none;
}

/* ===== SPREADS GRID - 2 columns for Handicap/Totals ===== */
.md-spreads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 1px;
  gap: 1px;
  background: var(--black-30);
}

.md-spreads-grid > div {
  box-shadow: none;
}

/* ===== GAME/POINT GRID - 3 columns (label | player1 | player2) ===== */
.md-game-labels {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  grid-gap: 0;
  gap: 0;
  align-items: center;
  height: 38px;
  background: var(--black-20);
  margin-bottom: 1px;
}

.md-game-label-empty {
  /* Empty first column for alignment */
}

.md-game-grid {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  grid-gap: 1px;
  gap: 1px;
  background: var(--black-30);
}

.md-game-grid > div {
  box-shadow: none;
  background: #3d3d44;
  background: var(--bg-odds-btn, #3d3d44);
}

/* Team Totals - two separate blocks side-by-side on desktop, stacked on mobile */
.md-ml-wrapper.md-team-totals-no-bg {
  background: transparent;
}

.md-team-totals-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .md-team-totals-wrapper {
    flex-direction: row;
    align-items: flex-start;
  }
}

.md-team-totals-block {
  flex: 1 1;
  min-width: 0;
  background: #3d3d44;
  background: var(--bg-odds-btn, #3d3d44);
  border-radius: 5px;
  overflow: hidden;
}

.md-team-totals-header {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  grid-gap: 0;
  gap: 0;
  align-items: center;
  height: 38px;
  background: var(--black-20);
  margin-bottom: 1px;
}

.md-team-totals-name {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  color: var(--text-secondary);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-feature-settings: "smcp", "c2sc";
  font-variant: all-small-caps;
  line-height: 13px;
}

.md-team-totals-header .md-label {
  display: flex;
  align-items: center;
  justify-content: center;
}

.md-team-totals-grid {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  grid-gap: 1px;
  gap: 1px;
  background: var(--black-30);
}

.md-team-totals-grid > div {
  box-shadow: none;
  background: #3d3d44;
  background: var(--bg-odds-btn, #3d3d44);
}

.md-team-totals-line {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  height: 38px;
  color: var(--accent-blue-hover);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.md-game-row-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 10px;
  height: 38px;
  color: var(--accent-blue-hover);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== SPREAD BUTTON - with label + value ===== */
.md-spread-btn {
  width: 100%;
  align-items: center;
  font-family: 'Proxima Nova', sans-serif;
  background: #3d3d44;
  background: var(--bg-odds-btn, #3d3d44);
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  height: 38px;
  min-height: 38px;
  padding: 0 10px;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
  transition: background 0.15s ease;
}

.md-spread-label {
  color: var(--accent-blue-hover);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.md-spread-value {
  color: var(--white-95);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@media (min-width: 1024px) {
  .md-spread-btn:hover {
    background: var(--hover-bg);
  }
}

.md-spread-btn.active {
  background: var(--active-bg);
}

.md-spread-btn.locked {
  pointer-events: none;
  opacity: 0.3;
}

/* ===== ODD BUTTON - копия ml-button ===== */
.md-odd-btn {
  width: 100%;
  align-items: center;
  font-family: 'Proxima Nova', sans-serif;
  background: #3d3d44;
  background: var(--bg-odds-btn, #3d3d44);
  border: none;
  border-radius: 0;
  color: var(--white-95);
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  height: 38px;
  line-height: 14px;
  justify-content: center;
  min-height: 38px;
  padding: 2px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
  transition: background 0.15s ease;
}

/* Hover state - desktop only */
@media (min-width: 1024px) {
  .md-odd-btn:hover {
    background: var(--hover-bg);
  }
}

/* Active/selected state */
.md-odd-btn.active {
  background: var(--active-bg);
}

@media (min-width: 1024px) {
  .md-odd-btn:hover.active {
    background: var(--active-bg);
  }
}

/* V8 BetSlip active state - bet is in slip */
.md-odd-btn.md-active,
.md-spread-btn.md-active {
  background: var(--active-bg);
}

/* Locked state */
.md-odd-btn.locked {
  pointer-events: none;
  opacity: 0.3;
}

/* Suspended state - odds locked by provider */
.md-odd-btn.md-suspended,
.md-spread-btn.md-suspended {
  pointer-events: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.md-odd-btn.md-suspended,
.md-spread-btn.md-suspended .md-spread-value {
  color: var(--text-tertiary);
}

.md-odd-selection {
  color: var(--accent-blue-hover);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: center;
  margin-bottom: 1px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.md-odd-value {
  color: var(--white-95);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ===== FLASH ANIMATIONS ===== */
/* Flash on text color, not background - like FBLivePage */
.md-odd-btn.flash-up {
  animation: md-flash-green 1.5s ease-out forwards;
}

.md-odd-btn.flash-down {
  animation: md-flash-red 1.5s ease-out forwards;
}

/* For spread/totals buttons - flash only the value, not the label */
.md-spread-btn.flash-up .md-spread-value {
  animation: md-flash-green 1.5s ease-out forwards;
}

.md-spread-btn.flash-down .md-spread-value {
  animation: md-flash-red 1.5s ease-out forwards;
}

@keyframes md-flash-green {
  0% {
    color: #4caf50;
    font-weight: 800;
  }
  40% {
    color: #4caf50;
    font-weight: 800;
  }
  100% {
    color: var(--white-95);
    font-weight: 700;
  }
}

@keyframes md-flash-red {
  0% {
    color: #f44336;
    font-weight: 800;
  }
  40% {
    color: #f44336;
    font-weight: 800;
  }
  100% {
    color: var(--white-95);
    font-weight: 700;
  }
}

/* Score flash animation */
.md-team-score.score-flash,
.md-stats-score.score-flash {
  animation: md-score-flash 1s ease-out;
}

@keyframes md-score-flash {
  0% {
    color: #4ade80;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
    transform: scale(1.2);
  }
  100% {
    color: white;
    text-shadow: none;
    transform: scale(1);
  }
}

/* ===== NO MARKETS ===== */
.md-no-markets {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.md-no-markets-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white-10);
  color: var(--white-60);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.md-no-markets-icon svg {
  width: 24px;
  height: 24px;
}

.md-no-markets-text {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== EVENT ENDED STATE ===== */
.md-event-ended {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.md-event-ended-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white-10);
  color: var(--white-60);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.md-event-ended-icon svg {
  width: 24px;
  height: 24px;
}

.md-event-ended-text {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ===== ERROR STATE ===== */
.md-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.md-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white-10);
  color: var(--white-60);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.md-error-text {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.md-error-btn {
  background: var(--white-15);
  color: var(--text-primary);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.md-error-btn:hover {
  background: var(--white-20);
}

/* ===== SKELETON ===== */
.md-sk {
  background: linear-gradient(90deg, var(--shimmer-base) 25%, var(--shimmer-highlight) 50%, var(--shimmer-base) 75%);
  background-size: 200% 100%;
  animation: md-shimmer 1.5s infinite linear;
  border-radius: 3px;
}
@keyframes md-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
/* Header */
.md-skel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 8px 8px;
}
.md-skel-back { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
.md-skel-icon { width: 33px; height: 33px; border-radius: 6px; flex-shrink: 0; }
.md-skel-text { display: flex; flex-direction: column; gap: 5px; flex: 1 1; }
.md-skel-sport { width: 80px; height: 14px; }
.md-skel-league { width: 150px; height: 12px; }
/* Live bar */
.md-skel-livebar {
  background: var(--gradient-fixture);
  padding: 0 10px;
  margin: 0 3px;
  border-radius: 5px 5px 0 0;
}
.md-skel-livebar-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--white-10);
}
.md-skel-badge { width: 36px; height: 14px; border-radius: 3px; }
.md-skel-period { width: 50px; height: 12px; }
.md-skel-timer { width: 40px; height: 12px; }
.md-skel-team-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 6px 0;
  grid-gap: 10px;
  gap: 10px;
}
.md-skel-team-row + .md-skel-team-row { border-top: 1px solid var(--white-5); }
.md-skel-team-name { height: 13px; }
.md-skel-scores {
  display: flex;
  gap: 8px;
  align-items: center;
}
.md-skel-score { width: 18px; height: 16px; border-radius: 3px; }
.md-skel-score-total { width: 22px; height: 18px; border-radius: 3px; }
/* Period tabs */
.md-skel-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 3px;
  border-radius: 0 0 5px 5px;
  overflow: hidden;
}
.md-skel-star { width: 18px; height: 18px; border-radius: 3px; margin: 0 12px; flex-shrink: 0; }
.md-skel-divider { width: 1px; height: 14px; background: var(--white-15); flex-shrink: 0; margin-right: 6px; }
.md-skel-tab { height: 12px; border-radius: 3px; margin: 8px 10px; flex-shrink: 0; }
/* Market section */
.md-skel-market { margin: 0 3px; }
.md-skel-market-title {
  padding: 10px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.md-skel-mtitle { height: 12px; border-radius: 3px; }
.md-skel-chevron { width: 16px; height: 16px; border-radius: 3px; }
.md-skel-wrapper {
  background: var(--bg-odds-btn);
  border-radius: 5px;
  overflow: hidden;
}
.md-skel-labels {
  display: grid;
  grid-gap: 0;
  gap: 0;
  align-items: center;
  height: 35px;
  background: var(--black-20);
}
.md-skel-labels.cols-3 { grid-template-columns: repeat(3, 1fr); }
.md-skel-labels.cols-2 { grid-template-columns: repeat(2, 1fr); }
.md-skel-lbl { height: 11px; width: 60%; margin: 0 auto; border-radius: 3px; }
.md-skel-odds {
  display: grid;
  grid-gap: 1px;
  gap: 1px;
  background: var(--black-30);
}
.md-skel-odds.cols-3 { grid-template-columns: repeat(3, 1fr); }
.md-skel-odds.cols-2 { grid-template-columns: repeat(2, 1fr); }
.md-skel-odd {
  height: 38px;
  background: #3d3d44;
  background: var(--bg-odds-btn, #3d3d44);
}
@media (max-width: 480px) {
  .md-skel-odd { height: 34px; }
}

/* ===== DEBUG ===== */
.md-debug {
  margin: 20px 10px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  color: var(--text-tertiary);
}

.md-debug div {
  margin-bottom: 4px;
}

/* ===== 1 COLUMN GRID ===== */
.md-odds-grid.cols-1 {
  grid-template-columns: 1fr;
}

/* ===== 2 COLUMN GRID ===== */
.md-odds-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

/* ===== BASEBALL SPECIFIC ===== */
.md-baseball-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-90);
}

.md-inning-header {
  font-size: 10px !important;
  min-width: 18px;
}

.md-inning-value {
  font-size: 10px !important;
}

/* Baseball Bases + BSO Bar */
.md-baseball-bar {
  border-top: 1px solid var(--white-10);
  padding: 8px 12px;
}

.md-baseball-bar-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  color: var(--white-90);
}

.md-baseball-bases-icon {
  display: flex;
  align-items: center;
}

.md-bso {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.md-bso-item {
  color: var(--white-90);
}

.md-baseball-extra {
  color: var(--accent-yellow);
  font-size: 11px;
  font-weight: 500;
  margin-left: auto;
}

/* ========== CRICKET STYLES ========== */
.md-cricket-header {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.md-cricket-overs {
  color: var(--white-70);
  font-size: 11px;
  font-weight: 500;
}

.md-cricket-score {
  color: var(--text-primary);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  padding-right: 8px;
}

/* ========== DESKTOP STYLES ========== */
@media (min-width: 1024px) {
  /* Header positioning for desktop */
  .md-header {
    top: 0px;
  }

  .md-back-info {
    padding: 2px 0px 10px;
  }

  /* Market grids - overflow hidden for clean edges */
  .md-odds-grid {
    border-radius: 0;
    overflow: hidden;
  }

  /* Hover on back button */
  .md-back-button:hover {
    background: #2a2a2a;
    background: var(--bg-quaternary, #2a2a2a);
  }
}

/* Legal Popup Overlay */
.legal-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Popup Container */
.legal-popup-container {
  background: #29292c;
  background: var(--bg-primary, #29292c);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px var(--black-60);
  border: 1px solid #38383A;
  border: 1px solid var(--separator, #38383A);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.legal-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #38383A;
  border-bottom: 1px solid var(--separator, #38383A);
  background: #2C2C2E;
  background: var(--bg-tertiary, #2C2C2E);
}

.legal-popup-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  color: var(--text-primary, #fff);
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-popup-header h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 24px;
  background: #0A84FF;
  background: var(--accent-blue, #0A84FF);
  border-radius: 2px;
}

.legal-popup-close {
  background: var(--white-5);
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8E8E93;
  color: var(--text-tertiary, #8E8E93);
  transition: all 0.2s ease;
}

.legal-popup-close:hover {
  background: var(--white-12);
  color: #fff;
  color: var(--text-primary, #fff);
}

/* Body */
.legal-popup-body {
  flex: 1 1;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: #48484A transparent;
  scrollbar-color: var(--separator-light, #48484A) transparent;
}

.legal-popup-body::-webkit-scrollbar {
  width: 6px;
}

.legal-popup-body::-webkit-scrollbar-track {
  background: transparent;
}

.legal-popup-body::-webkit-scrollbar-thumb {
  background: #48484A;
  background: var(--separator-light, #48484A);
  border-radius: 3px;
}

.legal-popup-body::-webkit-scrollbar-thumb:hover {
  background: #8E8E93;
  background: var(--text-tertiary, #8E8E93);
}

/* Legal Content */
.legal-content {
  color: #E5E5EA;
  color: var(--text-secondary, #E5E5EA);
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal-content p {
  margin: 0 0 12px 0;
}

.legal-content ul {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.legal-content li {
  margin-bottom: 8px;
  color: var(--white-70);
}

.legal-content strong {
  color: #0A84FF;
  color: var(--accent-blue, #0A84FF);
  font-weight: 600;
}

.legal-content a {
  color: #0A84FF;
  color: var(--accent-blue, #0A84FF);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-content a:hover {
  color: #409CFF;
  color: var(--accent-blue-hover, #409CFF);
  text-decoration: underline;
}

/* Accordion Sections */
.legal-accordion-section {
  margin-bottom: 8px;
  border-radius: 10px;
  overflow: hidden;
  background: #2C2C2E;
  background: var(--bg-tertiary, #2C2C2E);
  border: 1px solid #38383A;
  border: 1px solid var(--separator, #38383A);
  transition: all 0.2s ease;
}

.legal-accordion-section:hover {
  border-color: #48484A;
  border-color: var(--separator-light, #48484A);
}

.legal-accordion-header {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #fff;
  color: var(--text-primary, #fff);
  font-size: 1rem;
  font-weight: 500;
  text-align: left;
  transition: all 0.2s ease;
}

.legal-accordion-header:hover {
  background: var(--white-3);
}

.legal-accordion-header.open {
  background: var(--white-3);
  border-bottom: 1px solid #38383A;
  border-bottom: 1px solid var(--separator, #38383A);
}

.accordion-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3D3D42;
  background: var(--bg-secondary, #3D3D42);
  border-radius: 6px;
  color: #8E8E93;
  color: var(--text-tertiary, #8E8E93);
  font-size: 1.2rem;
  font-weight: 300;
  transition: all 0.2s ease;
}

.legal-accordion-header.open .accordion-icon {
  background: rgba(10, 132, 255, 0.15);
  background: var(--accent-blue-muted, rgba(10, 132, 255, 0.15));
  color: #0A84FF;
  color: var(--accent-blue, #0A84FF);
}

.legal-accordion-content {
  padding: 16px 20px;
  animation: expandContent 0.2s ease-out;
}

.legal-accordion-content h4 {
  color: #0A84FF;
  color: var(--accent-blue, #0A84FF);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 20px 0 8px 0;
}

.legal-accordion-content h4:first-child {
  margin-top: 0;
}

@keyframes expandContent {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.legal-popup-footer {
  padding: 16px 24px;
  border-top: 1px solid #38383A;
  border-top: 1px solid var(--separator, #38383A);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #8E8E93;
  color: var(--text-tertiary, #8E8E93);
}

.legal-popup-footer p {
  margin: 0;
}

.legal-popup-footer a {
  color: #0A84FF;
  color: var(--accent-blue, #0A84FF);
  text-decoration: none;
}

.legal-popup-footer a:hover {
  text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .legal-popup-overlay {
    padding: 10px;
  }

  .legal-popup-container {
    max-height: 90vh;
    border-radius: 12px;
  }

  .legal-popup-header {
    padding: 16px 18px;
  }

  .legal-popup-header h2 {
    font-size: 1.2rem;
  }

  .legal-popup-body {
    padding: 16px 18px;
  }

  .legal-accordion-header {
    padding: 14px 16px;
    font-size: 0.95rem;
  }

  .legal-accordion-content {
    padding: 14px 16px;
  }

  .legal-content {
    font-size: 0.9rem;
  }

  .legal-popup-footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 14px 18px;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .legal-popup-header h2::before {
    display: none;
  }

  .accordion-icon {
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }
}

.login-container {
  background: var(--bg-elevated);
  border-radius: 10px;
  color: var(--text-primary);
  margin: 20px auto;
  max-width: 400px;
  padding: 20px;
  padding-top: 10px;
}

.login-container h2 {
  text-align: center;
  margin: 10px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-input-group {
  display: flex;
  flex-direction: column;
}

.login-label {
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--text-tertiary);
}

.input-with-icon {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: 5px;
  padding: 8px;
}

.input-with-icon svg {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  stroke: var(--text-tertiary);
  fill: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-with-icon input {
  flex: 1 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  font-size: 16px; /* предотвращает zoom на iOS */
}

.forgot-password {
  text-align: right;
  font-size: 13px;
  color: var(--text-tertiary);
}

.forgot-password a {
  color: var(--text-tertiary);
  text-decoration: none;
}

.login-button {
  background: var(--btn-auth-bg);
  border: none;
  border-radius: 5px;
  color: var(--link-blue-hover);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 10px;
}


.login-button:hover {
  background: var(--btn-auth-bg-hover);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
}

.login-footer a {
  color: var(--link-blue-hover);
  text-decoration: none;
}

/* Forgot Password Styles */
.forgot-subtitle {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.5;
}

.forgot-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 0;
}

.forgot-success-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.forgot-success-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-on-accent);
}

.forgot-error-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-hover) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.forgot-error-icon svg {
  width: 32px;
  height: 32px;
  color: var(--text-on-accent);
}

.forgot-success-text {
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 300px;
}

