/* ================================================
   UNIFIED FIXTURE SKELETON STYLES
   Используется на: BetsPage, LandingUpcomingPage, LivePage
   ================================================ */

/* Container для списка скелетонов */
.fixture-skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 2px;
}

/* Карточка фикстуры - скелетон */
.fixture-skeleton-card {
  background-color: var(--bg-elevated);
  padding: 8px 10px;
  border-radius: 4px;
  margin: 0 2px;
  box-shadow: 3px 2px 4px var(--black-50);
}

/* Header карточки (время + заголовки колонок) */
.fixture-skeleton-header {
  display: grid;
  grid-template-columns: 4fr 1fr 1fr 1fr;
  grid-gap: 4px;
  gap: 4px;
  align-items: center;
  padding-top: 3px;
  padding-bottom: 3px;
  margin-bottom: 4px;
}

/* Время и дата в header */
.fixture-skeleton-time {
  display: flex;
  gap: 2px;
  align-items: center;
}

/* Строка с командой */
.fixture-skeleton-row {
  display: grid;
  grid-template-columns: 4fr 1fr 1fr 1fr;
  grid-gap: 4px;
  gap: 4px;
  align-items: center;
  padding: 2px 0;
  min-height: 35px;
}

/* Команда (иконка + название) */
.fixture-skeleton-team {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Footer карточки */
.fixture-skeleton-footer {
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-top: 8px;
  margin-top: 10px;
  height: 17px;
}

/* ===== Shimmer элементы ===== */
.fixture-shimmer {
  background: linear-gradient(90deg, var(--shimmer-base) 25%, var(--shimmer-highlight) 50%, var(--shimmer-base) 75%);
  background-size: 200% 100%;
  animation: fixture-shimmer-anim 1.2s infinite linear;
  border-radius: 4px;
}

/* Иконка команды */
.fixture-shimmer-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* Название команды */
.fixture-shimmer-team-name {
  height: 16px;
  width: 100%;
  max-width: 140px;
}

/* Кнопка ставки */
.fixture-shimmer-button {
  height: 36px;
  border-radius: 6px;
}

/* Заголовок колонки (1X2, Spread, Total) */
.fixture-shimmer-header {
  height: 12px;
  width: 90%;
  margin: 0 auto;
}

/* Время/дата в header */
.fixture-shimmer-date {
  width: 60px;
  height: 18px;
  border-radius: 2px;
}

.fixture-shimmer-time {
  width: 45px;
  height: 18px;
  border-radius: 2px;
}

/* Кнопка "больше ставок" в footer */
.fixture-shimmer-more {
  width: 60px;
  height: 14px;
  border-radius: 2px;
}

/* Анимация */
@keyframes fixture-shimmer-anim {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* ===== Layout варианты (для разного количества колонок) ===== */

/* Layout 3: 1X2 + Spread + Total */
.fixture-skeleton-header.layout-3,
.fixture-skeleton-row.layout-3 {
  grid-template-columns: 4fr 1fr 1fr 1fr;
}

/* Layout 2: только 2 маркета */
.fixture-skeleton-header.layout-2,
.fixture-skeleton-row.layout-2 {
  grid-template-columns: 4fr 1fr 1fr;
}

/* Layout 1: только 1 маркет */
.fixture-skeleton-header.layout-1,
.fixture-skeleton-row.layout-1 {
  grid-template-columns: 4fr 1fr;
}

.footer-container {
  border-top: 1px solid var(--separator);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-top: auto;
  padding: 0px 10px 10px 10px;
  flex-shrink: 0;
}

/* Legal links (Terms, Rules) */
.footer-legal-links {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-top: 6px;
  text-align: start;
}

.footer-link {
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* SEO content block */
.footer-seo {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 10px;
  text-align: left;
}

.footer-seo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

.footer-seo p {
  color: var(--text-tertiary);
  font-size: 11.5px;
  line-height: 1.7;
  margin: 0 0 10px 0;
}

/* Links grid */
.footer-links-grid {
  display: flex;
  gap: 40px;
  margin-top: 16px;
}

.footer-links-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.footer-links-heading {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-nav-link {
  color: var(--text-tertiary);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
  padding: 2px 0;
}

.footer-nav-link:hover {
  color: var(--text-primary);
}

/* Bottom section */
.footer-bottom {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 16px 10px 0;
  border-top: 1px solid var(--separator);
  text-align: center;
}

.footer-support {
  color: var(--text-tertiary);
  font-size: 11.5px;
  margin: 0 0 12px 0;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0;
}

.footer-icon {
  width: 40px;
  height: 40px;
}

.tether-icon {
  width: 40px;
}

.footer-responsible {
  color: var(--text-tertiary);
  font-size: 11px;
  margin: 6px 0 0 0;
  text-align: center;
}

.footer-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Proxima Nova', sans-serif;
  text-decoration: none;
  text-align: center;
  margin-top: 8px;
}

.footer-logo span {
  color: var(--link-blue);
  font-family: 'Proxima Nova', sans-serif;
  font-weight: 500;
  font-size: 15px;
}

.footer-legal {
  font-size: 11px;
  color: var(--text-quaternary);
  margin: 4px 0 0 0;
}

.by-icon {
  width: 65px;
  height: auto;
}

.by-icons {
  display: flex;
  justify-content: center;
  margin: 10px 0px 0px 0px;
}

/* Mobile: space for BottomNav + Safari toolbar */
@media (max-width: 1023px) {
  .footer-container {
    padding-bottom: 90px;
  }

  /* Casino has no BottomNav — minimal padding */
  .casino-page-grid .footer-container {
    padding-bottom: 10px;
  }
}

@media (max-width: 600px) {
  .footer-links-grid {
    flex-direction: column;
    gap: 20px;
  }

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

  .footer-nav-link:hover {
    color: var(--text-tertiary);
  }
}

@media (min-width: 1024px) {
  .by-icons {
    margin: 10px 0px 0;
  }
}

/* ========== FIXTURE CARD - LivePage design ========== */

.fc-fixture {
  background: var(--gradient-fixture);
  border-radius: 0;
  margin: 1px 3px 10px 3px;
  overflow: hidden;
  border-radius: 5px;
}

.fc-fixture:last-child {
  margin-bottom: 0;
}

/* ========== HEADER ========== */
/* Sport-specific colors are in /styles/sportColors.css */
.fc-header {
  display: grid;
  grid-gap: 0;
  gap: 0;
  align-items: center;
  color: var(--white-70);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  padding: 8px 0 8px 12px;
  background: var(--gradient-odds-header);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--white-15);
}

/* Grid layouts */
.fc-header.layout-3 {
  grid-template-columns: 4fr 1fr 1fr 1fr;
}

.fc-header.layout-2 {
  grid-template-columns: 3fr 1fr 1fr;
}

/* ========== TIME SECTION ========== */
.fc-time {
  text-align: start;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-star {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  margin-right: 4px;
}

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

.fc-live-badge {
  background-color: #e53935;
  background-color: var(--accent-red, #e53935);
  border-radius: 2px;
  color: var(--text-on-accent);
  font-size: 10px;
  font-weight: bold;
  padding: 1px 3px;
  line-height: 1;
  text-transform: capitalize;
}

/* Status badge variants */
.fc-live-badge.live {
  background-color: var(--color-live);
}
.fc-live-badge.soon {
  background-color: var(--accent-blue);
}
.fc-live-badge.prematch {
  background-color: transparent;
  color: var(--white-90);
  font-weight: 500;
  letter-spacing: 0.3px;
}
.fc-live-badge.ended {
  background-color: var(--color-ended);
}
.fc-live-badge.postponed {
  background-color: var(--accent-orange);
}
.fc-live-badge.cancelled {
  background-color: var(--text-tertiary);
}
.fc-live-badge.interrupted,
.fc-live-badge.abandoned {
  background-color: var(--accent-red);
}

.fc-period-info {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.fc-period {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1;
}

/* Unified timer style for all sports (MM:SS) */
.fc-timer {
  color: var(--text-primary);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.fc-timer-stopped {
  color: var(--white-50);
}

.fc-pause-icon {
  color: var(--white-50);
}

/* Basketball Timer */
.fc-basketball-timer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fc-basketball-timer .basketball-quarter {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1;
}

.fc-basketball-timer .basketball-time {
  color: var(--text-primary);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

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

.fc-basketball-timer .basketball-pause-icon {
  color: var(--white-50);
}

.fc-basketball-timer.halftime,
.fc-basketball-timer.break,
.fc-basketball-timer.fulltime {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hockey timer styles */
.fc-hockey-timer {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fc-hockey-timer .hockey-period {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1;
}

.fc-hockey-timer .hockey-time {
  color: var(--text-primary);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

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

.fc-hockey-timer .hockey-pause-icon {
  color: var(--white-50);
}

.fc-hockey-timer.pause,
.fc-hockey-timer.fulltime,
.fc-hockey-timer.shootout {
  color: var(--text-primary);
  font-weight: 600;
}

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

/* Legacy minute style (fallback) */
.fc-minute {
  color: var(--text-primary);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Legacy countdown style (for backwards compat) */
.fc-countdown {
  color: var(--text-primary);
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.fc-countdown.fc-stopped {
  color: var(--white-50);
}

.fc-stopped-badge {
  display: flex;
  align-items: center;
  color: var(--white-50);
}

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

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

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

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

.fc-baseball-bases {
  display: flex;
  align-items: center;
  margin-left: 4px;
}

/* Baseball Info Row - BSO + bases + extra info */
.fc-baseball-info-row {
  background: linear-gradient(90deg, rgba(74, 14, 20, 0.4) 0%, rgba(74, 14, 20, 0.25) 100%);
  border-bottom: 1px solid rgba(122, 30, 36, 0.3);
  padding: 6px 12px;
}

.fc-baseball-info-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--white-80);
}

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

.fc-bso {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Proxima Nova', monospace;
  font-weight: 600;
}

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

.fc-baseball-extra {
  color: var(--accent-yellow);
  font-size: 10px;
  font-weight: 500;
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

/* Cricket overs display */
.fc-overs {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
}

/* ========== ODDS ROWS ========== */
.fc-row {
  display: grid;
  /* grid-gap: 1px; */
  grid-gap: 1px;
  gap: 1px;
  min-height: 40px;
  align-items: center;
  padding: 0 0 0 10px;
  background: var(--gradient-fixture);
  border-bottom: 1px solid var(--black-25);
}

.fc-row:last-of-type {
  border-bottom: none;
}

/* Draw label styling */
.fc-draw-label {
  color: #888 !important;
  color: var(--text-secondary, #888) !important;
  /* font-weight: 500 !important; */
  margin-left: 24px;
}

/* Empty cell placeholder */
.fc-bet-button.fc-empty {
  pointer-events: none;
}

.fc-row.layout-3 {
  grid-template-columns: 4fr 1fr 1fr 1fr;
}

.fc-row.layout-2 {
  grid-template-columns: 3fr 1fr 1fr;
}

/* ========== TEAM SECTION ========== */
.fc-team {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  cursor: pointer;
}

.fc-team-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex: 1 1;
  min-width: 0;
  overflow: hidden;
}

.fc-team-content > svg {
  flex-shrink: 0;
}

.fc-team-name {
  flex-grow: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  color: var(--text-primary, #fff);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.fc-red-card,
.fc-event-badge {
  background: var(--accent-red);
  color: var(--text-on-accent);
  font-size: 10px;
  padding: 2px 3px;
  border-radius: 2px;
  font-weight: 600;
  margin-left: 6px;
  flex-shrink: 0;
  min-width: 7px;
  text-align: center;
}

.fc-score {
  flex-shrink: 0;
  color: var(--score-color);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  padding: 0 3px;
  min-width: 15px;
  text-align: center;
}

/* ========== BET BUTTONS ========== */
.fc-bet-button {
  align-items: center;
  font-family: 'Proxima Nova', sans-serif;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 700;
  height: 100%;
  line-height: 13px;
  justify-content: center;
  min-height: 40px;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease;
}

@media (min-width: 1024px) {
  .fc-fixture {
    border-radius: 5px;
  }
  .fc-bet-button:hover:not(:disabled) {
    background: var(--hover-bg);
  }
}

.fc-bet-button.fc-locked {
  pointer-events: none;
  opacity: 0.3;
}

/* Suspended - коэффициент видно, но кнопка заблокирована */
.fc-bet-button.fc-suspended {
  pointer-events: none;
  opacity: 0.5;
  /* background: var(--white-10); */
}

.fc-bet-button.fc-suspended .fc-value {
  color: var(--text-tertiary);
}

/* Active state - bet is in slip */
.fc-bet-button.fc-active {
  background: var(--active-bg);
}

.fc-btn-lock {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fc-hdp {
  color: var(--accent-blue-hover);
  font-size: 11px;
  font-weight: 600;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.fc-value {
  font-size: 13px;
  font-weight: 700;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  color: var(--white-95);
}

/* ========== MOBILE ========== */
@media (max-width: 480px) {
  .fc-header {
    padding: 6px 0 6px 10px;
    font-size: 10px;
  }

  .fc-row {
    min-height: 36px;
    padding: 0 0 0 8px;
  }

  .fc-team-name {
    font-size: 12px;
  }

  .fc-score {
    font-size: 13px;
  }

  .fc-bet-button {
    height: 36px;
    min-height: 36px;
  }

  .fc-hdp {
    font-size: 10px;
  }

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

/* ========== TENNIS POINTS ========== */
.fc-tennis-points {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.fc-serving {
  color: #f5c542;
  filter: drop-shadow(0 0 2px rgba(245, 197, 66, 0.5));
}

.fc-points {
  color: rgb(245, 197, 66);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.fc-set-games {
  color: rgb(111, 177, 249);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 600;
  min-width: 12px;
  text-align: center;
  padding-left: 3px;
  padding-left: 3px;
}

/* ========== FLASH ANIMATIONS ========== */
/* Flash up (green) - odds increased */
.fc-value.flash-up {
  animation: fcGlowGreen 1.5s ease-out forwards;
}

/* Flash down (red) - odds decreased */
.fc-value.flash-down {
  animation: fcGlowRed 1.5s ease-out forwards;
}

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

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

/* InboxPage.css */

.inbox-page {
  background-color: var(--bg-primary);
  min-height: calc(100vh - 96px);
}

/* Sticky header - stays in document flow */
.inbox-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--separator);
  z-index: 90;
  height: 44px;
  box-sizing: border-box;
}

.inbox-back-btn,
.inbox-compose-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .inbox-back-btn:hover,
  .inbox-compose-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
  }
}

.inbox-back-btn:active,
.inbox-compose-btn:active {
  background-color: var(--bg-tertiary);
}

.inbox-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.inbox-header-actions {
  display: flex;
  gap: 4px;
}

.inbox-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.inbox-action-btn.reply {
  color: var(--accent-blue);
}

@media (hover: hover) {
  .inbox-action-btn:hover {
    background-color: var(--bg-tertiary);
  }
  .inbox-action-btn.delete:hover {
    color: var(--accent-red);
  }
}

.inbox-action-btn:active {
  background-color: var(--bg-tertiary);
}

/* Body */
.inbox-body {
  padding-bottom: 70px;
}

/* Loading */
.inbox-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

.inbox-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty state */
.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
}

.inbox-empty svg {
  margin-bottom: 16px;
  opacity: 0.4;
}

.inbox-empty p {
  font-size: 14px;
  margin-bottom: 20px;
}

.inbox-compose-btn-empty {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .inbox-compose-btn-empty:hover {
    filter: brightness(1.1);
  }
}

/* Message list */
.inbox-list {
  padding: 0;
}

.inbox-item {
  display: flex;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--separator);
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .inbox-item:hover {
    background-color: var(--bg-secondary);
  }
}

.inbox-item:active {
  background-color: var(--bg-secondary);
}

.inbox-item.unread {
  background-color: rgba(0, 122, 255, 0.06);
}

.inbox-item-indicator {
  width: 18px;
  display: flex;
  align-items: flex-start;
  padding-top: 5px;
  flex-shrink: 0;
}

.unread-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-blue);
  border-radius: 50%;
}

.inbox-item-content {
  flex: 1 1;
  min-width: 0;
}

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.inbox-item-sender {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.inbox-item-sender.admin {
  color: var(--accent-blue);
}

.inbox-item-sender.user {
  color: var(--text-tertiary);
}

.inbox-item-date {
  font-size: 11px;
  color: var(--text-tertiary);
}

.inbox-item-subject {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-item.unread .inbox-item-subject {
  font-weight: 600;
}

.inbox-item-preview {
  font-size: 13px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* Message content */
.message-content {
  padding: 16px;
}

.message-subject {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--separator);
}

.message-sender {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.message-sender.admin {
  color: var(--accent-blue);
}

.message-sender.user {
  color: var(--text-tertiary);
}

.message-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.message-body {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.message-reply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 24px;
  padding: 12px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .message-reply-btn:hover {
    filter: brightness(1.1);
  }
}

/* Compose */
.compose-replying-to {
  padding: 10px 16px;
  background-color: var(--bg-tertiary);
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--separator);
}

.compose-error {
  margin: 12px 16px;
  padding: 10px 12px;
  background-color: rgba(255, 59, 48, 0.1);
  border: 1px solid var(--accent-red);
  border-radius: 8px;
  color: var(--accent-red);
  font-size: 13px;
}

.compose-form {
  padding: 16px;
}

.compose-input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.compose-input:focus {
  border-color: var(--accent-blue);
}

.compose-textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--separator);
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  resize: none;
  min-height: 150px;
  font-family: inherit;
  box-sizing: border-box;
  -webkit-appearance: none;
  line-height: 1.5;
}

.compose-textarea:focus {
  border-color: var(--accent-blue);
}

.compose-send-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .compose-send-btn:hover:not(:disabled) {
    filter: brightness(1.1);
  }
}

.compose-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Desktop */
@media (min-width: 1024px) {
  .inbox-body {
    padding-bottom: 40px;
  }
}

@media (max-width: 1024px) {
  .inbox-header {
      top: 36px;
  }
  .inbox-item:hover {
    background-color: transparent;
  }
}
.horses-page {
  padding: 0;
  max-width: 800px;
  margin: 0 auto;
}

.horses-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 0px 0px 16px 0px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.horses-icon {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
}

.horses-header h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #fff;
  color: var(--text-primary, #fff);
  flex: 1 1;
}

.horses-count {
  font-size: 0.875rem;
  color: #888;
  color: var(--text-secondary, #888);
  background: #1a1a1a;
  background: var(--bg-secondary, #1a1a1a);
  padding: 4px 10px;
  border-radius: 12px;
}

.horses-cache-info {
  font-size: 0.75rem;
  color: #666;
  color: var(--text-secondary, #666);
  text-align: center;
  padding: 4px 16px;
  margin-bottom: 8px;
}

.horses-loading,
.horses-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #888;
  color: var(--text-secondary, #888);
}

.horses-error button {
  margin-top: 16px;
  padding: 10px 24px;
  background: #f5a623;
  background: var(--accent-color, #f5a623);
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.horses-regions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.horses-region {
  background: var(--gradient-fixture);
  border-radius: 12px;
  overflow: hidden;
}

.horses-region-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-elevated); /* Darker background for region header */
  border: none;
  color: #fff;
  color: var(--text-primary, #fff);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

/* Desktop only hover */
@media (hover: hover) and (pointer: fine) {
  .horses-region-header:hover {
    background: var(--bg-elevated);
  }
}

.region-flag {
  font-size: 1.5rem;
}

.region-flag-img {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px var(--black-30);
}

.region-name {
  flex: 1 1;
  text-align: left;
  font-weight: 600;
}

.region-count {
  font-size: 0.8rem;
  color: #888;
  color: var(--text-secondary, #888);
}

.region-arrow {
  font-size: 0.75rem;
  color: #888;
  color: var(--text-secondary, #888);
  transition: transform 0.2s;
}

.horses-region-header.expanded .region-arrow {
  transform: rotate(0deg);
}

.horses-leagues {
  border-top: 1px solid #2a2a2a;
  border-top: 1px solid var(--border-color, #2a2a2a);
}

.horses-league-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 22px;
  color: #fff;
  color: var(--text-primary, #fff);
  text-decoration: none;
  transition: background 0.2s;
  border-bottom: 1px solid var(--bg-tertiary);
}

.horses-league-item:last-child {
  border-bottom: none;
}

/* Desktop only hover */
@media (hover: hover) and (pointer: fine) {
  .horses-league-item:hover {
    background: var(--hover-bg);
  }
}

.league-flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 1px 2px var(--black-30);
  flex-shrink: 0;
}

.hp-league-name {
  flex: 1 1;
  font-weight: 600;
  color: var(--text-primary) !important;
  font-family: Proxima Nova, sans-serif;
  line-height: 16px;
  font-size: 14px;
  padding: 0 !important;
}

.league-info {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #888;
  color: var(--text-secondary, #888);
}

.league-next {
  color: #f5a623;
  color: var(--accent-color, #f5a623);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  width: 50px;
  text-align: right;
}

.league-races {
  width: 55px;
  text-align: right;
}

.league-next.urgent {
  color: var(--accent-red);
  font-weight: 600;
}

.league-next.critical {
  color: #ef4444;
  font-weight: 600;
  animation: pulse-urgent 1s ease-in-out infinite;
}

.league-arrow {
  color: #888;
  color: var(--text-secondary, #888);
}

/* Race Page Styles */
.horses-race-page {
  padding: 0;
  padding-bottom: 140px; /* Space for bottom nav + betslip */
  max-width: 900px;
  margin: 0 auto;
}

/* Sticky header container for race page */
.race-sticky-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  margin: 0 0 16px 0;
  padding: 0;
}

.race-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 5px;
}

.race-horse-icon {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

.race-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.race-title-main {
  font-size: 0.75rem;
  color: #888;
  color: var(--text-secondary, #888);
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.race-title-track {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  color: var(--text-primary, #fff);
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
}

.region-flag-icon {
  width: 20px;
  height: 15px;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  border-radius: 2px;
  box-shadow: 0 1px 2px var(--black-30);
}

.hp-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;
  color: #fff;
  color: var(--text-primary, #fff);
  font-size: 1.2rem;
  cursor: pointer;
}

.race-page-header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
  color: var(--text-primary, #fff);
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
}

.race-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0px 0px 10px 0px;
  border-bottom: 1px solid #2a2a2a;
  border-bottom: 1px solid var(--border-color, #2a2a2a);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.race-tab {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 14px;
  background: #1a1a1a;
  background: var(--bg-secondary, #1a1a1a);
  border: none;
  border-radius: 8px;
  color: #888;
  color: var(--text-secondary, #888);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

/* Desktop only hover */
@media (hover: hover) and (pointer: fine) {
  .race-tab:hover {
    background: var(--bg-tertiary);
  }
}

.race-tab.active {
  background: var(--accent-warning);
  color: var(--text-on-accent);
  font-weight: 600;
}

.race-tab.finished {
  opacity: 0.5;
  background: var(--white-20);
}

.race-tab.finished.active {
  opacity: 1;
  background: var(--white-30);
  color: var(--text-secondary);
}

.race-tab.started {
  background: var(--white-10);
  border: 1px solid var(--white-15);
  opacity: 0.7;
  color: var(--text-tertiary);
}

.race-tab.started.active {
  background: var(--white-15);
  opacity: 1;
  color: var(--text-secondary);
}

.race-tab.canceled {
  opacity: 0.5;
  background: var(--white-10);
  border: 1px solid var(--white-15);
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.race-tab.canceled.active {
  opacity: 0.8;
  background: var(--white-15);
}

.race-tab-num {
  font-size: 0.75rem;
  font-weight: 500;
}

.race-tab-time {
  font-weight: 600;
  font-size: 0.9rem;
}

.race-details {
  border-radius: 12px;
  overflow: hidden;
}

.race-info-bar {
  display: flex;
  justify-content: space-between;
  min-height: 22px;
  align-items: center;
  padding: 16px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid #2a2a2a;
  border-bottom: 1px solid var(--border-color, #2a2a2a);
}

.race-name-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f59e0b;
  color: var(--accent-color, #f59e0b);
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.03) 100%);
  border-bottom: 1px solid #2a2a2a;
  border-bottom: 1px solid var(--border-color, #2a2a2a);
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
}

.race-info-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.race-number {
  font-weight: 600;
  font-size: 0.75rem;
  color: #fff;
  color: var(--text-primary, #fff);
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
}

.race-datetime {
  font-size: 0.75rem;
  color: #aaa;
  color: var(--text-secondary, #aaa);
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
}

.countdown {
  font-size: 0.75rem;
  color: #4ade80;
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  min-width: 100px;
  display: inline-block;
}

.countdown.warning {
  color: #ef4444;
}

.countdown.urgent {
  color: #ef4444;
  animation: pulse-urgent 1s ease-in-out infinite;
}

.countdown.started {
  color: #ef4444;
}

.countdown.canceled {
  color: #9ca3af;
  font-style: italic;
}

@keyframes pulse-urgent {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.race-ew-terms {
  font-size: 0.7rem;
  color: #888;
  color: var(--text-secondary, #888);
  padding: 4px 10px;
  background: #1a1a1a;
  background: var(--bg-secondary, #1a1a1a);
  border-radius: 3px;
  font-family: 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
  white-space: nowrap;
}

.horses-table {
  width: 100%;
}

.horse-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  padding: 5px 10px;
  min-height: 50px;
  border-bottom: 1px solid var(--bg-tertiary);
  grid-gap: 12px;
  gap: 12px;
  background: var(--gradient-fixture);
}

/* Hover only on devices that support it (not touch) */
@media (hover: hover) {
  .horse-row:hover {
    background: var(--hover-bg);
  }
}

.horse-row:last-child {
  border-bottom: none;
}

.horse-position {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #222;
  background: var(--bg-tertiary, #222);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  color: var(--text-secondary, #888);
}

/* Removed yellow highlight for first horse - all positions now same style */

.horse-name {
  flex: 1 1;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  color: var(--text-primary, #fff);
  font-family: Proxima Nova Cond, sans-serif;
}

.horse-country-flag {
  width: 16px;
  height: 12px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
  object-fit: cover;
}

.horse-odds {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.odds-buttons-row {
  display: flex;
  gap: 8px;
}

.odds-button {
  min-width: 65px;
  padding: 6px 5px;
  background: #222;
  background: var(--bg-tertiary, #222);
  border: 1px solid #2a2a2a;
  border: 1px solid var(--border-color, #2a2a2a);
  border-radius: 6px;
  color: #fff;
  color: var(--text-primary, #fff);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

/* Desktop only hover - keep text white */
@media (hover: hover) and (pointer: fine) {
  .odds-button:hover {
    background: #f5a623;
    background: var(--accent-color, #f5a623);
    border-color: #f5a623;
    border-color: var(--accent-color, #f5a623);
  }

  .odds-button:hover .odds-label {
    color: #888;
    color: var(--text-secondary, #888);
  }
}

.odds-button.active {
  background: #f5a623;
  background: var(--accent-color, #f5a623);
  border-color: #f5a623;
  border-color: var(--accent-color, #f5a623);
}

.odds-button.disabled,
.odds-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--white-20);
}

.odds-button.win-odds {
  background: var(--bg-elevated);
}

.odds-button.place-odds {
  background: var(--bg-primary);
  font-size: 0.8rem;
}

.odds-button .odds-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: #888;
  color: var(--text-secondary, #888);
  margin-bottom: 2px;
}

.no-place-odds {
  min-width: 60px;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: #666;
  color: var(--text-secondary, #666);
  text-align: center;
}

/* SP (Starting Price) odds - not yet available */
.odds-button.sp-odds {
  min-width: 43px;
  padding: 5px 10px;
  background: #1a1a1a;
  background: var(--bg-tertiary, #1a1a1a);
  border: 1px dashed #333;
  border: 1px dashed var(--border-color, #333);
  border-radius: 6px;
  color: #666;
  color: var(--text-secondary, #666);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  cursor: not-allowed;
  opacity: 0.7;
}

.odds-button.sp-odds .odds-label {
  color: #555;
  color: var(--text-secondary, #555);
}

/* Flash animation for odds changes */
.odds-button.up {
  animation: flash-up 1.5s ease-out;
}

.odds-button.down {
  animation: flash-down 1.5s ease-out;
}

@keyframes flash-up {
  0% {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  }
  100% {
    background: #222;
    background: var(--bg-tertiary, #222);
    box-shadow: none;
  }
}

@keyframes flash-down {
  0% {
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
  }
  100% {
    background: #222;
    background: var(--bg-tertiary, #222);
    box-shadow: none;
  }
}

@media (max-width: 600px) {
  .horses-race-page {
    padding: 0;
  }

  .race-info-bar {
    padding: 10px 12px;
  }

  .horses-race-page {
    padding: 0;
  }

  .race-details {
    border-radius: 0px;
  }

  .race-sticky-header {
    margin-bottom: 0;
  }
}
/* Mobile adjustments */
@media (max-width: 1023px) {
  .horses-page {
    padding: 0 12px;
  }

  .race-sticky-header {
    top: 37px;
    padding: 10px 0px 0px 0px;
  }

  .horses-race-page {
    padding-bottom: 120px;
  }

  .horses-header h1 {
    font-size: 1.25rem;
  }

  .horses-header {
    top: 37px;
  }

  .horses-league-item {
    padding-left: 16px;
  }

  .league-info {
    flex-direction: row;
    gap: 4px;
    align-items: flex-end;
  }

  .horse-odds {
    gap: 4px;
  }

  .odds-button {
    min-width: 65px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .race-tab {
    padding: 6px 12px;
  }
}

/* Scratched horses styling */
.horse-row.scratched {
  opacity: 0.5;
  background: rgba(128, 128, 128, 0.1);
}

.horse-row.scratched .horse-name {
  color: var(--text-tertiary);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 71, 87, 0.6);
}

.scratched-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  vertical-align: middle;
  filter: grayscale(50%);
}

.scratched-label {
  color: #ff4757;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 16px;
  background: rgba(255, 71, 87, 0.1);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Win Only badge */
.race-ew-terms.win-only {
  background: rgba(255, 165, 0, 0.15);
  color: #ffa500;
  border: 1px solid rgba(255, 165, 0, 0.3);
  font-weight: 600;
}

/* B365 TEST - Expanded horse row */
.horse-row.expanded {
  background: rgba(74, 222, 128, 0.05);
  box-shadow: inset 3px 0 0 #4ade80; /* Use inset shadow instead of border to avoid layout shift */
}

/* Info button for spotlight - gray and subtle */
.horse-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0;
  background: var(--white-10);
  border: none;
  border-radius: 50%;
  color: var(--text-quaternary);
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
  flex-shrink: 0;
}

.horse-info-btn:hover {
  background: var(--white-20);
  color: var(--text-secondary);
}

.horse-row.expanded .horse-info-btn {
  background: var(--text-quaternary);
  color: var(--text-secondary);
}

/* Form display (race history) */
.horse-form {
  display: inline-block;
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.7rem;
  color: #f5a623;
  background: rgba(245, 166, 35, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 1px;
  vertical-align: middle;
}

/* Jockey/Trainer row */
.horse-jt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* Analysis section (spotlight/lastRun) - full width of horse-row */
.horse-analysis {
  grid-column: 1 / -1; /* Span all grid columns */
  margin-top: 8px;
  margin-left: -10px;
  margin-right: -10px;
  margin-bottom: -5px;
  padding: 10px 12px;
  background: var(--black-30);
  border-top: 1px solid var(--white-5);
  font-size: 0.65rem;
  line-height: 1.4;
}

.analysis-section {
  margin-bottom: 4px;
}

.analysis-section:last-child {
  margin-bottom: 0;
}

.analysis-label {
  font-weight: 600;
  color: #4ade80;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-bottom: 2px;
}

.analysis-text {
  margin: 0;
  color: #999;
  color: var(--text-secondary, #999);
  font-size: 0.62rem;
  line-height: 1.35;
}

/* Track dropdown navigation */
.race-title-track-wrapper {
  position: relative;
}

.race-title-track.clickable {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.race-title-track.clickable:hover {
  opacity: 0.8;
}

.track-dropdown-arrow {
  font-size: 0.6rem;
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.track-dropdown-arrow.open {
  transform: rotate(180deg);
}

.track-dropdown-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
}

.track-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #1a1a1a;
  background: var(--bg-secondary, #1a1a1a);
  border: 1px solid var(--white-8);
  border-radius: 8px;
  min-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 20px var(--black-50);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

@media (max-width: 1023px) {
  .track-dropdown {
    position: fixed;
    left: 16px;
    right: 16px;
    top: 100px;
    min-width: 0;
    min-width: initial;
    width: auto;
    max-height: 60vh;
  }
}

/* Region header in dropdown - NOT sticky to avoid stacking */
.track-dropdown-header {
  padding: 8px 16px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 1px solid rgba(74, 222, 128, 0.3);
  border-bottom: 1px solid rgba(74, 222, 128, 0.15);
  margin-top: 4px;
}

.track-dropdown-header:first-child {
  margin-top: 0;
  border-top: none;
}

.track-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--white-5);
}

.track-dropdown-item:last-child {
  border-bottom: none;
}

/* Hover only on devices that support it (not touch) */
@media (hover: hover) {
  .track-dropdown-item:hover {
    background: #222;
    background: var(--bg-tertiary, #222);
  }
}

.track-dropdown-item.active {
  background: #222;
  background: var(--bg-tertiary, #222);
}

.track-flag-small {
  width: 20px;
  height: 15px;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  border-radius: 2px;
}

.track-dropdown-item .track-name {
  flex: 1 1;
  font-size: 0.8rem;
  color: var(--text-primary);
}

.track-dropdown-item .track-next-race {
  font-size: 0.8rem;
  color: #888;
  color: var(--text-secondary, #888);
  font-weight: 500;
}

/* Race extra info (distance, conditions, prize) */
.race-extra-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: var(--white-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.race-extra-info span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #888;
  color: var(--text-secondary, #888);
  background: var(--white-5);
  padding: 4px 10px;
  border-radius: 4px;
}

.race-info-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: middle;
  opacity: 0.85;
}

.weather-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: middle;
  opacity: 0.85;
}

.race-distance {
  color: #4ecdc4 !important;
}

.race-condition {
  color: #9d88b3 !important;
}

.race-prize {
  color: #f5a623 !important;
}

.race-weather {
  color: #87ceeb !important;
}

.race-age-restriction {
  color: #7ec8e3 !important;
}

/* Countdown finished state - thin like started */
.countdown.finished {
  color: var(--text-tertiary);
}

/* Horse info with jockey */
.horse-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1;
}

.horse-jockey {
  font-size: 0.7rem;
  color: #666;
  color: var(--text-secondary, #666);
  /* Allow wrapping on mobile instead of truncating */
  white-space: normal;
  word-wrap: break-word;
}

/* Jockey/Trainer with badges */
.horse-jockey-trainer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  color: #888;
  color: var(--text-secondary, #888);
}

.jt-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.jt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  background: #333;
  background: var(--bg-tertiary, #333);
  border-radius: 3px;
  font-size: 8px;
  font-weight: 600;
  color: #888;
  color: var(--text-secondary, #888);
}

.jt-name {
  font-size: 10px;
  color: #888;
  color: var(--text-secondary, #888);
}

/* Horse details - age and weight */
.horse-details-row {
  display: flex;
  gap: 6px;
  font-size: 0.7rem;
  color: #888;
  color: var(--text-muted, #888);
  margin-top: 1px;
}

.horse-age {
  color: #aaa;
  color: var(--text-secondary, #aaa);
}

.horse-weight {
  color: #f5a623;
  color: var(--accent-color, #f5a623);
  font-weight: 500;
}

.horse-form-inline {
  color: #888;
  color: var(--text-secondary, #888);
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

/* Odds history - under odds buttons */
.odds-history-row {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  width: 138px; /* Match WIN + PLACE buttons width (65 + 8 + 65) */
  min-height: 16px; /* Reserve space even when empty */
}

.odds-change {
  flex: 1 1;
  padding: 1px 2px;
  border-radius: 2px;
  color: #888;
  color: var(--text-muted, #888);
  background: var(--white-8);
  white-space: nowrap;
  text-align: center;
  font-size: 0.6rem;
}

.odds-change.up {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.odds-change.down {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

/* Saddle number before horse name */
.horse-saddle-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  height: 10px;
  padding: 2px 3px;
  margin-right: 6px;
  background: var(--white-10);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  color: #aaa;
  color: var(--text-secondary, #aaa);
  text-align: center;
}

/* Winner badge */
.winner-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  background: linear-gradient(135deg, #ffd700, #f5a623);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Finished race styling */

.horse-row.finished-race .horse-position {
  display: none;
}

/* Finish result display */
.finish-result {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.finish-position {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  width: 60px;
  text-align: center;
  box-sizing: border-box;
}

.finish-position.pos-1 {
  background: linear-gradient(135deg, #ffd700, #f5a623);
  color: #000;
}

.finish-position.pos-2 {
  background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
  color: #000;
}

.finish-position.pos-3 {
  background: linear-gradient(135deg, #cd7f32, #b87333);
  color: #000;
}

.finish-position.pos-4 {
  background: var(--white-10);
  color: #888;
  color: var(--text-secondary, #888);
}

.finish-position.nr {
  background: rgba(255, 100, 100, 0.15);
  color: #ff6b6b;
  font-weight: 600;
}

.finish-position.waiting {
  background: var(--white-10);
  color: #888;
  color: var(--text-secondary, #888);
}

.finish-distance {
  font-size: 0.75rem;
  color: #888;
  color: var(--text-secondary, #888);
}

.finish-odds {
  font-size: 0.8rem;
  color: #888;
  color: var(--text-secondary, #888);
  background: var(--white-8);
  padding: 3px 6px;
  border-radius: 4px;
  width: 60px;
  text-align: center;
  box-sizing: border-box;
}

.no-result {
  color: var(--text-quaternary);
  font-size: 0.9rem;
}

.no-result {
  color: var(--text-quaternary);
  font-size: 1rem;
}

.race-in-progress {
  display: flex;
  align-items: center;
  justify-content: center;
}

.in-progress-label {
  color: #4caf50;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 12px;
  background: rgba(76, 175, 80, 0.2);
  border-radius: 4px;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

/* BookiesAPI country grouping styles */
.bookies-country {
  border-bottom: 1px solid #2a2a2a;
  border-bottom: 1px solid var(--border-color, #2a2a2a);
}

.bookies-country:last-child {
  border-bottom: none;
}

.bookies-country-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--white-3);
}

.bookies-country-name {
  flex: 1 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  color: var(--text-primary, #fff);
}

.bookies-country-count {
  font-size: 0.75rem;
  color: #888;
  color: var(--text-secondary, #888);
}

.bookies-country-tracks {
  padding-left: 8px;
}

.horses-league-item.bookies-track {
  padding-left: 48px;
}

.horses-league-item.bookies-track .hp-league-name {
  font-size: 14px;
}

/* Joker Poker - Only Joker-specific styles */
/* All game UI uses VideoPoker.css (vp-* classes) */

/* Override vp-container max-width/margin when in modal */
.vp-container.joker-poker-game.vp-in-modal {
  max-width: 100%;
  margin: 0;
}

/* Joker card face - purple color */
.vp-card .card-front.joker {
  color: #7b1fa2;
}

/* Joker card winner outline (uses VP gold color) */
.vp-card .card-front.joker.winner {
  outline: 4px solid #FFD700;
  outline-offset: -4px;
}

/* ========== JOKER CARD CONTENT ========== */
.joker-card-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Center: jester icon — large, almost fills card */
.joker-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1;
  width: 100%;
  padding: 2px 4px 0;
}

.joker-center .joker-icon {
  width: 90%;
  height: auto;
  max-height: 85%;
  object-fit: contain;
}

/* Bottom: JOKER text, horizontal, bold, right under the jester */
.joker-text-bottom {
  font-size: 14px;
  font-weight: 800;
  color: #db2627;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: -4px;
  padding-bottom: 8px;
  line-height: 1;
}

/* Health Indicator Container */
.health-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.health-indicator.compact {
  gap: 4px;
}

/* Health Dots (main indicators) */
.health-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.health-dots:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Individual Health Dot */
.health-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  transition: all 0.3s ease;
  position: relative;
}

/* Status Colors */
.health-ok {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.health-down {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  animation: health-pulse-red 2s ease-in-out infinite;
}

.health-error {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.health-unknown {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  box-shadow: 0 0 8px rgba(107, 114, 128, 0.4);
}

.health-loading {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  animation: health-loading-pulse 1.5s ease-in-out infinite;
}

/* Pulsing animations */
@keyframes health-pulse-red {
  0%, 100% {
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.8);
  }
}

@keyframes health-loading-pulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Critical Badge */
.health-critical-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  animation: health-pulse-red 2s ease-in-out infinite;
  margin-left: 2px;
}

/* Details Panel */
.health-details {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;  /* Changed from right: 0 - opens to the right on desktop */
  width: 380px;
  max-width: 90vw;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  overflow: hidden;
  animation: health-details-slide-in 0.2s ease;
}

@keyframes health-details-slide-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Details Header */
.health-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #252525;
  border-bottom: 1px solid #333;
}

.health-details-title {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #e5e5ea;
}

.health-details-close {
  background: transparent;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.health-details-close:hover {
  color: #e5e5ea;
}

/* Details Content */
.health-details-content {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Health Item */
.health-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a2a2a;
}

.health-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.health-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.health-item-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-item-name {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #e5e5ea;
  flex: 1 1;
}

.health-item-status {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.health-item-status.health-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.health-item-status.health-down {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.health-item-status.health-error {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

/* Health Item Details */
.health-item-details {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
  color: #999;
}

.health-item-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.health-item-row span:first-child {
  color: #666;
}

.health-item-row span:last-child {
  color: #e5e5ea;
  font-weight: 500;
}

.health-item-error {
  margin-top: 8px;
  padding: 8px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: 4px;
  font-size: 11px;
  color: #ef4444;
  font-family: 'Monaco', 'Courier New', monospace;
}

/* Warnings Section */
.health-warnings {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a;
}

.health-warnings-title {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #e5e5ea;
  margin-bottom: 8px;
}

.health-warning {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 12px;
}

.health-warning-critical {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.health-warning-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
}

.health-warning-severity {
  font-size: 10px;
  font-weight: 700;
  color: #999;
  text-transform: uppercase;
}

.health-warning-message {
  color: #e5e5ea;
  line-height: 1.4;
}

/* Details Footer */
.health-details-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  color: #666;
}

.health-refresh-btn {
  background: #10b981;
  border: none;
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.health-refresh-btn:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.health-refresh-btn:active {
  transform: translateY(0);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .health-details {
    width: 320px;
    top: calc(100% + 4px);
    left: auto;  /* Reset left */
    right: 0;    /* Align to right on mobile (header is on right side) */
  }

  .health-dot {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }

  .health-details-content {
    padding: 12px;
  }
}

