/* ========================================
   Diamond Exchange Theme Overrides
   Premium betting exchange UI refinements
   Applied on top of existing style.css
   ======================================== */

/* --- Odds Button Dimensions --- */
.coupon-table button,
.main-market .table-row .back,
.main-market .table-row .back1,
.main-market .table-row .back2,
.main-market .table-row .lay,
.main-market .table-row .lay1,
.main-market .table-row .lay2,
.reference-market-quote {
  height: 28px !important;
  border-radius: 0 !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  cursor: pointer;
}

.main-market .table-row .back span,
.main-market .table-row .lay span {
  font-size: 16px;
}

/* --- Market Title --- */
.market-title {
  background: rgba(44, 62, 80, 0.85);
  color: #fff;
  padding: 4px;
  font-size: 14px;
  font-weight: bold;
  overflow: hidden;
  margin-top: 4px;
}

/* D247 parity: Min/Max as separate line below title */
.market-title-sub {
  background: #f0f0f0;
  padding: 2px 8px;
  font-size: 12px;
  border-bottom: 1px solid #dee2e6;
}

.market-limits-text {
  color: #0088cc;
  font-weight: 400;
  font-size: 12px;
}

/* Min/Max in header country-name column: flush LEFT like D247 (was flex-centered) */
.main-market .table-header .country-name,
.sports-wrapper .main-market .table-header .country-name {
  justify-content: flex-start !important;
}

.table-header .country-name .market-limits-text {
  display: block;
  text-align: left;
  font-size: 11px !important;
  color: #0088cc !important;
  font-weight: 400 !important;
  padding: 0 !important;
  margin: 0 !important;
  white-space: nowrap;
}

/* Khado markets: Min/Max at extreme left edge */
.khado-market .table-header .country-name {
  padding-left: 0 !important;
}
.khado-market .table-header .country-name .market-limits-text {
  padding-left: 4px !important;
}


.market-title span {
  text-transform: uppercase;
}

.market-title .float-right {
  float: right;
  font-size: 12px;
  opacity: 0.9;
}

.market-title span {
  text-transform: uppercase;
}

.market-title .btn-success.btn-sm {
  background: #28a745;
  border: 0;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  opacity: 0.8;
}

/* --- Market Header: Back | Lay columns --- */
.table-header {
  display: flex;
  align-items: center;
  background: #f7f7f7;
  border-bottom: 1px solid #dee2e6;
  font-size: 12px;
}

.table-header .back,
.table-header .lay {
  text-align: center;
  padding: 2px 0;
  font-size: 11px;
  color: #555;
  font-weight: 500;
}

.table-header .back b,
.table-header .lay b {
  font-weight: 500;
  text-transform: none;
  font-size: 11px;
  color: #555;
}

/* --- Table Row --- */
.table-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
  margin: 0 0 4px;
  min-height: 34px;
}

.table-row .country-name {
  width: 35%;
  min-width: 35%;
  max-width: 35%;
  padding-left: 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.table-row .country-name .team-name b {
  font-size: 13px;
  font-weight: 500;
  color: #000;
}

.table-row .country-name p {
  margin-left: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* --- Back/Lay cell layout --- */
.main-market .table-row .back,
.main-market .table-row .back1,
.main-market .table-row .back2,
.main-market .table-row .lay,
.main-market .table-row .lay1,
.main-market .table-row .lay2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
  border-left: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
}

.main-market .table-row .back,
.main-market .table-row .back1,
.main-market .table-row .back2 {
  background-color: #72bbef !important;
}

.main-market .table-row .lay,
.main-market .table-row .lay1,
.main-market .table-row .lay2 {
  background-color: #faa9ba !important;
}

.main-market .table-row .back:hover,
.main-market .table-row .back1:hover,
.main-market .table-row .back2:hover {
  background-color: #5aabe5 !important;
}

.main-market .table-row .lay:hover,
.main-market .table-row .lay1:hover,
.main-market .table-row .lay2:hover {
  background-color: #f899b0 !important;
}

/* --- Fancy Market --- */
.fancy-market .table-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dee2e6;
  padding: 2px 0;
}

.fancy-market .table-row .country-name {
  width: auto;
  flex: 1;
  font-size: 13px;
  padding-left: 8px;
}

.fancy-market .table-row .back,
.fancy-market .table-row .lay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-left: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  min-width: 60px;
}

.fancy-market .table-row .back {
  background-color: #72bbef !important;
}

.fancy-market .table-row .lay {
  background-color: #faa9ba !important;
}

.fancy-min-max {
  font-size: 10px;
  color: #666;
  padding: 0 8px;
  line-height: 1.3;
}

/* --- Game Icons Row (per match: TV, Fancy, Bookmaker, Virtual, E-Games) --- */
.game-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  width: 210px;
  flex-wrap: wrap;
}

.game-icons .game-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
}

/* d247 sizes slot images by height only (`img { height: 12px }`, no width
   cap). Its fancy/bookmaker bitmaps are 30x20, so they land at 18x12 with
   their own aspect ratio instead of being squashed into a 18x12 box. */
.game-icons .game-icon i {
  display: block;
}

.game-icons .game-icon img {
  display: block;
  height: 12px;
  width: auto;
  max-height: none;
  max-width: none;
}

.game-icons .game-icon i.icon-tv {
  font-family: 'dfont' !important;
  content: '\e901' !important;
  font-size: 14px;
  color: #333;
  font-style: normal;
}

/* d247 parity: the e-games badge (small grey circle with "e") shown for
   virtual/e-sports matches named "(e)" on the coupon */
.game-icons .game-icon.e-games {
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-icons .game-icon.e-games span {
  display: inline-block;
  background-color: #d1d1d1;
  color: #202020;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  line-height: 20px;
  text-transform: lowercase;
}

/* ================================================================
   d247 parity: TV icon glyph. d247 renders the coupon TV icon from
   its own icomoon "dfont" (content: "\e901"), NOT the FontAwesome
   fa-tv glyph. The element is <i class="fas fa-tv icon-tv">; loading
   dfont here and overriding .icon-tv:before makes the same element
   draw d247's exact TV icon. Ported verbatim from d247's style.css.
   ================================================================ */
@font-face {
  font-family: "dfont";
  src: url("font/dfont.woff") format("woff"),
    url("font/dfont.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

[class^="icon-"],
[class*=" icon-"] {
  /* use !important to prevent issues with browser extensions that change fonts */
  font-family: "dfont" !important;
  speak: never;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  /* Better Font Rendering =========== */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-tv:before {
  content: "\e901";
}

/* d247 parity: virtual-cricket sim matches (team names carry "XI") show the
   ic_vir.png icon on the coupon — same 12px slot size as fancy/bookmaker. */
.bet-nation-name .game-icons .game-icon img.virtual-icon {
  height: 12px;
}

/* --- Latest Events strip (d247/tridev desktop parity) --- */
.latest-event {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
  background-color: transparent;
}

.latest-events-container {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.latest-event .latest-event-item {
  flex: 1;
  min-width: calc(20% - 4px);
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  margin-bottom: 0;
  padding: 4px;
  border-radius: 0;
  background: #f5f5f5;
  color: #333;
}

.latest-event .latest-event-item a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

.latest-event .latest-event-item a i.d-icon {
  display: inline-block;
  width: auto;
  height: auto;
  margin-right: 5px;
  color: inherit;
  font-family: 'dfont' !important;
  font-size: 16px;
  font-style: normal;
  line-height: 1;
}

.latest-event .latest-event-item a span {
  width: 100%;
  max-width: calc(100% - 42px);
  margin-left: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes scrollTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* --- Blink animation (d247: 1s linear infinite, fully transparent midpoint) --- */
.blink_me {
  animation: blinker 1s linear infinite;
}

@keyframes blinker {
  50% { opacity: 0; }
}

/* --- Fix table-header: preserve float layout but align items --- */
.table-header {
  display: block;
  overflow: hidden;
}

.table-header .back,
.table-header .lay {
  text-align: center;
  padding: 2px 0;
  font-size: 11px;
  color: #555;
  font-weight: 500;
}

.table-header .back b,
.table-header .lay b {
  font-weight: 500;
  text-transform: none;
  font-size: 11px;
  color: #555;
}

/* --- Sport Icons using Font Awesome --- */
.sport-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.sport-icon.cricket {
  background: #20327b;
}

.sport-icon.tennis {
  background: #f18521;
}

.sport-icon.football {
  background: #03b37f;
}

.sport-icon.table-tennis {
  background: #db2752;
}

.sport-icon.basketball {
  background: #fbb03b;
}

.sport-icon.hockey {
  background: #3d2b58;
}

.sport-icon.baseball {
  background: #c06c84;
}

.sport-icon.golf {
  background: #015900;
}

/* --- Match List Card (compact layout) --- */
.matchlist .card-content {
  background-color: #f2f2f2;
  margin-bottom: 4px;
  border-radius: 0;
}

.matchlist .coupon-table {
  border-spacing: 0 4px;
}


/* d247 parity: row cards get vertical breathing room like d247's bet-table-row */
.matchlist .coupon-table tbody tr td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.matchlist .coupon-table tbody tr td:first-child {
  padding-top: 8px;
  padding-bottom: 8px;
}

/* d247 parity: each coupon row is a distinct card with a border under it */
.matchlist .coupon-table tbody tr {
  background: #fff;
}

.matchlist .coupon-table tbody tr td {
  border-bottom: 1px solid #e8e8e8;
}

.matchlist .coupon-table tbody tr:last-child td {
  border-bottom: 0;
}

.matchlist .coupon-table tr td:first-child {
  padding-left: 8px;
}

.matchlist .coupon-table .match-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.matchlist .coupon-table .match-name-cell .match-info {
  flex: 1;
}

.matchlist .coupon-table .match-name-cell .match-info .match-name {
  font-size: 13px;
  font-weight: 500;
  color: #000;
}

.matchlist .coupon-table .match-name-cell .match-info .match-time {
  font-size: 10px;
  color: #666;
}

/* --- Sidebar Refinements --- */
/* D247 sidebar-title: 30px height, flex, bg-primary background */
.sidebar-title {
  background-color: var(--bg-primary, #0088cc);
  color: var(--text-primary, #fff);
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0;
  margin-bottom: 0;
  margin-top: 1px;
  cursor: pointer;
}

/* D247: button is transparent, sidebar-title div has the color */
.sidebar-title .accordion-button {
  background-color: transparent !important;
  border: none;
  padding: 5px;
  box-shadow: none !important;
  color: var(--text-primary, #fff) !important;
  font-size: 14px;
  font-weight: bold;
  width: 100%;
  text-align: left;
  line-height: 1.4;
}

.sidebar-title .accordion-button:hover,
.sidebar-title .accordion-button:focus,
.sidebar-title .accordion-button:active {
  box-shadow: none !important;
  outline: none !important;
  background-color: transparent !important;
}

/* --- Header Refinements --- */
.header-top {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  min-height: 73px;
  margin-top: 0;
  background-color: var(--theme1-bg);
  color: var(--primary-color);
}

.header-top .flex05 {
  display: flex;
  align-items: center;
}

.header-top .logo img {
  max-height: 65px;
  width: auto;
}

.header-top .search .fa-search-plus {
  font-size: 24px;
  margin-left: 8px;
}

/* --- Marquee --- */
.news marquee {
  display: block;
  width: 100%;
  font-size: 13px;
  font-style: italic;
  color: #fff;
  padding: 2px 0;
  position: relative;
  bottom: auto;
  right: auto;
}

.header-top .news {
  width: 50%;
  overflow: hidden;
}

/* --- Footer --- */
/* Reference geometry (measured on tridev's live DOM at 1600): the bar is
   1600x48 with `padding: 4px 8px`; .footer-top is 1584x40, a flex row with
   space-between; the links are its own <nav> of 40px-tall 16px/700 links; the
   support heading is 24px; the social box is flex-end. The 100% SAFE strip
   (.footer-bottom, 1600x58, `padding: 4px 8px`) and the copyright line
   (.footer-text, 1600x24, centred) sit BELOW the blue bar, not inside it. */
.footer {
  padding: 4px 8px;
}

.footer .footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  min-height: 40px;
}

.footer .footer-top .footer-links {
  flex: 1;
}

.footer .footer-links nav {
  display: flex;
  align-items: center;
}

.footer .footer-links ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer .footer-links .nav-link {
  padding: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #fffefe;
}

.footer .footer-links .nav-link:hover {
  text-decoration: underline;
}

.footer .footer-top .support-detail {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer .footer-top .support-detail h2 {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 0;
  line-height: 1.2;
}

.footer .social-icons-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.footer .social-icons-box .social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer .social-icons-box .social-icon img {
  width: 30px;
  height: 30px;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  min-height: 58px;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom .secure-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: normal;
}

.footer-bottom .secure-logo img {
  height: 50px;
  width: auto;
}

.footer-bottom .ml-2 {
  margin-left: 8px;
  font-size: 16px;
  line-height: normal;
}

/* The 18+ / GamCare / Gambling Therapy badges: 32x32 each, right-aligned. */
.footer-bottom > .d-inline-block img {
  width: 32px;
  height: 32px;
  margin-left: 4px;
}

.footer-bottom .footer-brand {
  flex: 1;
  text-align: center;
}

.footer-text {
  text-align: center;
  font-size: 16px;
  line-height: 24px;
}

.footer-text p {
  margin-bottom: 0;
}

/* The 18+ tile in .footer-bottom is a button (the reference's own markup), and
   it opens the "Over 18s only" dialog. Its badge is 30px inside the modal,
   against 32px in the footer strip itself. */
.footer-bottom .btn.p-0 {
  padding: 0;
  line-height: normal;
}

.modal-18plus img {
  height: 30px;
  width: auto;
}

/* --- Responsive: hide latest-event on mobile --- */
@media (max-width: 1199.98px) {
  .latest-event {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .latest-event {
    display: flex !important;
  }
}


/* ========================================
   d247 coupon parity — div-flex bet-table
   d247's sports coupon is NOT an HTML table. It is
   .bet-table > .bet-table-header + .bet-table-body
   > .bet-table-row, where each row is .bet-nation-name
   (match name + game icons) + three .bet-nation-odd
   cells (1/X/2), each holding a .back odd-box and a
   .lay odd-box. Ported from d247's style.css verbatim
   so row height, column widths and cell padding match.
   ======================================== */
.bet-table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background-color: #f7f7f7;
  align-content: flex-start;
}

.bet-table-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-bottom: 1px solid #c7c8ca;
  border-top: 1px solid #c7c8ca;
  padding: 2px 0;
  line-height: 21px;
}

.bet-table-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.bet-table-row {
  width: 100%;
  border-bottom: 1px solid #c7c8ca;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  background-color: #f2f2f2;
}

.bet-nation-name {
  width: 64%;
  padding: 0 5px;
  font-size: 14px;
  line-height: 21px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bet-nation-name .bet-nation-game-name {
  max-width: calc(100% - 210px);
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
}

.bet-nation-name .game-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  width: 210px;
}

.bet-nation-name .game-icons .game-icon {
  width: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bet-nation-name .game-icons .game-icon .active {
  background-color: #28a745;
  height: 12px;
  width: 12px;
  display: inline-block;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
}

.bet-nation-name .game-icons .game-icon img {
  height: 12px;
}

.bet-nation-odd {
  width: 12%;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 14px;
  line-height: 21px;
}

.bet-nation-odd .odd-box {
  width: 50%;
  padding: 1px;
}

.bet-nation-odd .odd-box .bet-odd {
  font-size: 14px;
  color: #273a47;
}

.bet-nation-odd .odd-box.back {
  background-color: #72bbef;
}

.bet-nation-odd .odd-box.lay {
  background-color: #faa9ba !important;
}

.bet-nation-odd .odd-box.back .bet-odd,
.bet-nation-odd .odd-box.lay .bet-odd {
  display: block;
  line-height: 21px;
  color: #273a47;
}

.suspended-box {
  position: relative;
  pointer-events: none;
  cursor: none;
}

.suspended-box::before {
  background-image: url("../img/icons/lock.svg");
  background-size: 17px 17px;
  filter: invert(1);
  -webkit-filter: invert(1);
  background-repeat: no-repeat;
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  pointer-events: none;
}

.suspended-box::after {
  content: "";
  background-color: #373636d6;
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  cursor: not-allowed;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

/* d247 responsive (max-width 1199px): header hidden, name 100%, odds 33.33% */
@media only screen and (max-width: 1199px) {
  .bet-table {
    padding: 4px;
  }
  .home-page .bet-table {
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .bet-table-header {
    display: none;
  }
  .bet-table-row {
    padding-bottom: 5px;
  }
  .bet-nation-name {
    width: 100%;
  }
  .bet-nation-odd {
    width: 33.33%;
  }
  .bet-nation-name .bet-nation-game-name {
    max-width: calc(100% - 120px);
  }
  .bet-nation-game-name span:first-child {
    font-weight: bold;
  }
  .bet-nation-game-name span:last-child {
    font-size: 12px;
  }
  .bet-nation-name .game-icons {
    width: 120px;
  }
  .bet-nation-name .game-icons .game-icon {
    width: 20px;
  }
  .bet-nation-name .game-icons .game-icon img {
    height: 10px;
  }
  .bet-nation-name .game-icons .game-icon i {
    font-size: 10px;
  }
  .bet-nation-name .game-icons .game-icon .active {
    height: 10px;
    width: 10px;
  }
}

/* keep the compact "e" badge inside the 35px game-icon slot */
.bet-nation-name .game-icons .game-icon.e-games {
  width: 35px;
}

/* ========================================
   Casino Game Page Shell — d247 parity
   (game-header + game-market + odds-box)
   Ported from d247's style.css: .game-header
   (bg #2C3E50) & .market-title (bg #2C3E50D9)
   ======================================== */

/* --- Main game header (d247 .game-header) --- */
.casino-container-box .card-header.casino.casino-game-header {
  background-color: #2c3e50;
  color: #fff;
  padding: 4px 8px;
  border-radius: 2px 2px 0 0;
  border: 0;
}

.casino-container-box .card-header.casino.casino-game-header h6.card-title {
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
  margin: 0;
  width: 100%;
}

/* --- Market title bars (d247 .market-title) --- */
.casino-container-box .card-header.casino {
  background-color: #2c3e50;
  color: #fff;
  padding: 4px 8px;
  border-radius: 0;
  border: 0;
}

.casino-container-box .card-header.casino h6.card-title {
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
  margin: 0;
  width: 100%;
}

/* --- Header meta: Round ID, RULES, limits --- */
.casino-container-box .card-header.casino .casino-round-id {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  margin-left: 12px;
  text-transform: none;
}

.casino-container-box .card-header.casino .casino-rules-link {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.75;
  cursor: pointer;
  text-transform: none;
}

.casino-container-box .card-header.casino .market-limits {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.9;
  text-transform: none;
}

/* --- Odds rows: compact d247 density --- */
.casino-container-box .main-market .table-row {
  min-height: 28px;
  margin: 0;
  border-bottom: 1px solid #c7c8ca;
}

/* Bookmaker: 2 wide odds columns (d247 market-2) — scoped to the bookmaker
   market only so fancy rows keep their narrow 13% boxes (box-1). */
.casino-container-box .bookmaker-market .table-header .back,
.casino-container-box .bookmaker-market .table-header .lay,
.casino-container-box .bookmaker-market .table-row .back,
.casino-container-box .bookmaker-market .table-row .lay {
  width: 30%;
  min-width: 30%;
  max-width: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Footer responsive — match d247.com
   ======================================== */
@media (max-width: 767.98px) {
  /* Reference phone rules (d247 responsive): the top is a centred column, the
     two page links stay visible as a two-up underlined pair, and the badges
     move to their own centred row under the secure logo. */
  .footer .footer-top {
    flex-direction: column;
    text-align: center;
    gap: 0;
  }
  .footer .footer-top .footer-links,
  .footer .footer-top .support-detail,
  .footer .social-icons-box {
    flex: unset;
    width: 100%;
  }
  .footer .footer-links ul {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }
  .footer .footer-links ul li {
    width: 49%;
  }
  .footer .footer-links .nav-link {
    padding: 3px;
    text-decoration: underline;
    font-size: 12px;
  }
  .footer .social-icons-box {
    justify-content: center;
    margin-top: 15px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0;
  }
  .footer-bottom .secure-logo {
    justify-content: center;
    width: 100%;
  }
  .footer-bottom > .d-inline-block {
    width: 100%;
    text-align: center;
    margin-top: 10px;
  }
  .footer-text {
    margin-top: 5px;
  }
}

/* ========================================
   Header parity — match tridevexch.com
   Balance + Exp on same line, marquee text
   ======================================== */

.ballance .mby-5 {
  margin-bottom: 0 !important;
}
.ballance .mty-5 {
  margin-top: 0 !important;
}

/* Marquee: static on mobile, scrolling on desktop */
.marqueeheader {
  overflow: hidden;
  white-space: nowrap;
}
.marquee-text {
  display: inline-block;
}

/* ========================================
   D247 header parity — using D247 class names
   ======================================== */

/* Header news banner — match D247: 720px wide, right side of header */


/* Balance items — inline, matching D247 */
.balance-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  font-size: 14px;
  color: #fff;
  white-space: nowrap;
}
.balance-item a {
  color: #fff;
  text-decoration: none;
}

/* Mobile: no banner text, compact layout */
@media (max-width: 1199.98px) {
  .header-news {
    display: none !important;
  }
}

/* Profile section — clean dropdown toggle */
.profile-section {
  cursor: pointer;
  margin-left: 12px;
  color: #fff;
  font-size: 14px;
  white-space: nowrap;
}

/* Rules link styling */
.rules-link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.rules-link:hover {
  color: #fff;
  text-decoration: none;
}

/* APK link styling */
.download-apk-link {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
}
.download-apk-link:hover {
  color: #fff;
  text-decoration: none;
}

/* Search input — collapsed by default, expands on click */
.search-input-show {
  display: none;
  width: 200px;
}
.search-input-show.show {
  display: inline-block;
}
.search-input {
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
}

/* ========================================
   D247 header parity — fix wrapping issues
   ======================================== */

/* Header top row: match D247 — 73px height, 4px 8px padding */
.header-top { flex-wrap: wrap; }

/* Header news: inline, no wrap, right-aligned */
.header-news {
  display: flex !important;
  align-items: center !important;
  margin-left: auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  max-width: 720px !important;
  flex-shrink: 1 !important;
  flex-basis: 0 !important;
}

/* Profile right side: match D247 user-details layout */



/* Balance items: inline, no wrap */
.balance-item {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-left: 8px !important;
  font-size: 14px !important;
  color: #fff !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Ballance container: flex row */
.ballance {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0 !important;
  flex-shrink: 0 !important;
}

/* Account section */
.account {
  flex-shrink: 0 !important;
  font-size: 16px !important;
  color: #fff !important;
}

/* Mobile header: compact single row */
@media (max-width: 1199.98px) {
  .header-top {
    height: auto !important;
    padding: 6px 8px !important;
  }
  .flex05 {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }
  .profile-right-side {
    gap: 4px !important;
    margin-left: auto !important;
  }
  .balance-item {
    font-size: 12px !important;
    margin-left: 4px !important;
  }
  .account .profile-section {
    font-size: 12px !important;
  }
  .rules-link, .download-apk-link {
    display: none !important;
  }
}

/* Mobile: hide search row completely to save space */
@media (max-width: 1199.98px) {
  .mobile-search-row {
    display: none !important;
  }
}

/* Fix: header-news must have min-width so it doesn't collapse */


/* Override Bootstrap col-md-12 on header-top */
.header-top.col-md-12 {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  flex-basis: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
}

/* CRITICAL: header-top must be FULL width so banner fits on one row */
.header-top {
  width: 100% !important;
  max-width: 100% !important;
  flex-basis: 100% !important;
  min-height: 73px !important;
  padding: 4px 8px !important;
  margin-top: 0 !important;
  position: relative;
  flex-wrap: wrap;
}


/* ========================================
   D247 header classes — exact match
   ======================================== */

.user-details {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: normal;
  flex: 1;
}

.user-balance {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-left: 16px;
}

.user-balance div {
  line-height: 1.3;
}

.header-rules {
  display: flex;
  flex-direction: column;
  margin-left: 16px;
}

.header-rules a {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.header-rules div {
  line-height: 1.3;
}

.search-box-container {
  display: flex;
  align-items: center;
}

.search-box {
  display: flex;
  align-items: center;
  position: relative;
}

.search-box i {
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  margin-left: 10px;
}

.news {
  position: absolute;
  bottom: -3px;
  right: 0;
  width: 50%;
  font-size: 13px;
  font-style: italic;
  overflow: hidden;
  color: #fff;
}

.user-name {
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
}

.user-name:hover {
  color: #fff;
  text-decoration: none;
}

/* ===== User-frontend dropdown styles (scoped to NOT affect admin) ===== */
/* The admin uses CSS hover-based dropdowns via .btco-hover-menu.
   These rules must NOT apply on admin pages or they break the nav. */
body:not(.admin-portal) .dropdown-menu {
  background-color: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.175);
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  min-width: 170px;
  padding: 5px 0;
  margin: 2px 0 0;
  display: none;
}

body:not(.admin-portal) .dropdown-menu.show {
  display: block;
}

body:not(.admin-portal) .dropdown-item {
  padding: 5px 15px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

body:not(.admin-portal) .dropdown-item:hover {
  background-color: #f5f5f5;
  color: #16181b;
  text-decoration: none;
}

.ms-1 { margin-left: 0.25rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-xl-3 { margin-left: 1rem !important; }
.ms-1 { margin-left: 0.25rem !important; }

/* ========================================
   Layout: main-container, sidebar, center
   ======================================== */
.main-container {
  display: flex;
  min-height: calc(100vh - 200px);
}

.left-sidebar {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  flex-shrink: 0;
  /*
   * Match the reference's sidebar, which is content-height and lets the
   * Racing Sports dropdown float over the board. The old 100vh scroll pane
   * (from `.sidebar`) clipped that dropdown at the 280px column, so clicking
   * Horse Racing or Greyhound Racing rendered an invisible menu.
   */
  height: auto;
  min-height: 0;
  overflow: visible;
}

/*
 * The reference caps the racing menu's race list at viewport height minus
 * 210px (695px total menu at an 852px viewport) and scrolls the races inside
 * it. Without this cap our list made the menu taller than the screen.
 */
.racing-sport .horse-list-box {
  max-height: calc(100vh - 210px);
  overflow-x: hidden;
  overflow-y: auto;
}

.center-main-container {
  flex: 1;
  min-width: 0;
  padding: 10px;
}

@media (max-width: 1199px) {
  .left-sidebar {
    display: none;
  }
}


/* ========================================
   CRITICAL FIX: Header layout overrides
   ======================================== */
.header-top { flex-wrap: wrap; }
.user-details {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex: 1 !important;
  gap: 0 !important;
}
.user-details .search-box-container {
  margin-right: 10px !important;
}
.user-details .header-rules {
  display: flex !important;
  flex-direction: column !important;
  margin-left: 16px !important;
}
.header-rules a {
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}
.header-rules div {
  line-height: 1.2 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.user-balance {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  margin-left: 16px !important;
}
.user-balance div {
  line-height: 1.2 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.news {
  position: absolute !important;
  bottom: -3px !important;
  right: 0 !important;
  width: 50% !important;
  font-size: 13px !important;
  font-style: italic !important;
  overflow: hidden !important;
  color: #fff !important;
  line-height: 20px !important;
  background: transparent !important;
}
.marqueeheader {
  margin: 0 !important;
  padding: 0 !important;
  height: 18px !important;
  overflow: hidden !important;
}
.marqueeN {
  margin: 0 !important;
  padding: 0 !important;
  height: 18px !important;
  line-height: 18px !important;
}
.marquee-text {
  margin: 0 !important;
  padding: 1px 8px !important;
  line-height: 16px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
}

.user-name {
  color: #fff !important;
  font-size: 16px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  padding: 0 8px !important;
}
.dropdown {
  position: relative !important;
}
.dropdown .dropdown-menu {
  background-color: #fff !important;
  border: 1px solid rgba(0,0,0,0.15) !important;
  border-radius: 4px !important;
  box-shadow: 0 6px 12px rgba(0,0,0,0.175) !important;
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  z-index: 1000 !important;
  min-width: 170px !important;
  padding: 5px 0 !important;
  margin: 2px 0 0 !important;
  display: none !important;
}
.dropdown .dropdown-menu.show {
  display: block !important;
}
.dropdown-item {
  padding: 5px 15px !important;
  font-size: 14px !important;
  color: #333 !important;
  cursor: pointer !important;
  display: block !important;
  width: 100% !important;
  text-align: left !important;
  background: none !important;
  border: none !important;
}
.dropdown-item:hover {
  background-color: #f5f5f5 !important;
  color: #16181b !important;
  text-decoration: none !important;
}

/* Remove duplicate chevron from dropdown-toggle */
.dropdown-toggle::after {
  display: none !important;
}
/* Fix dropdown menu - don't go off right edge */
.dropdown .dropdown-menu {
  right: 0 !important;
  left: auto !important;
}

/* ========================================
   Nav bar: match D247 exactly
   ======================================== */
.header-bottom .navbar-nav .nav-item {
  white-space: nowrap !important;
}
.header-bottom .navbar-expand .navbar-nav .nav-link,
.header-bottom .nav-link,
.header-bottom li a {
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  padding: 5px 15px !important;
  display: flex !important;
  align-items: center !important;
  height: 100% !important;
  line-height: 21px !important;
  text-transform: uppercase !important;
  -webkit-transform: translateZ(0) !important;
  transform: translateZ(0) !important;
  position: relative !important;
}
.header-bottom .navbar-nav .nav-link:first-child {
  padding-left: 0 !important;
}
.header-bottom .navbar-nav .nav-link::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  left: 50% !important;
  right: 50% !important;
  bottom: 0 !important;
  height: 2px !important;
  background-color: #fff !important;
  transition: all 0.3s ease !important;
}
.header-bottom .navbar-nav .nav-link:hover {
  text-decoration: none !important;
  background-color: transparent !important;
  color: inherit !important;
}

.header-bottom .navbar-nav .nav-link:hover::before,
.header-bottom .navbar-nav .nav-link:focus::before,
.header-bottom .navbar-nav .nav-link:active::before {
  left: 0 !important;
  right: 0 !important;
}

/* Bootstrap responsive utility classes - matching D247 */
.d-none { display: none !important; }
.d-inline-block { display: inline-block !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
@media (min-width: 1200px) {
  .d-xl-none { display: none !important; }
  .d-xl-block { display: block !important; }
  .d-xl-flex { display: flex !important; }
}
@media (max-width: 1199.98px) {
  .d-xl-none { display: block !important; }
  .d-xl-block { display: none !important; }
}

/* Mobile header-top - match D247 flex-wrap: wrap */
@media (max-width: 1199.98px) {
  .header-top {
    flex-wrap: wrap !important;
    height: auto !important;
  }
  .header-top .search-box-container.d-xl-none {
    width: 100% !important;
    flex: 0 0 100% !important;
  }
}

/* ===== Mobile header fixes - match D247 pixel-perfect ===== */
@media (max-width: 1199.98px) {
  .header-top {
    flex-wrap: wrap !important;
    height: auto !important;
    min-height: 82px !important;
    overflow: visible !important;
  }
  
  /* Logo - smaller on mobile like D247 */
  .header-top .flex05 {
    flex: 0 0 auto !important;
    height: 32px !important;
  }
  .header-top .flex05 .logo {
    height: 32px !important;
  }
  .header-top .flex05 .logo img,
  .header-top .flex05 .brand-logo {
    height: 32px !important;
  }
  .header-top .flex05 .brand-logo__name {
    font-size: 14px !important;
    line-height: 32px !important;
  }
  
  /* user-details - position relative like D247 */
  .header-top .user-details {
    position: relative !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    height: auto !important;
    min-height: 38px !important;
  }
  
  /* News marquee - position static on mobile like D247 */
  .header-top .news {
    position: static !important;
  }
  
  /* Mobile search row - flex display like D247 */
  .header-top .search-box-container.d-xl-none {
    display: flex !important;
    width: 100% !important;
    height: 30px !important;
    flex: 0 0 100% !important;
    align-items: center !important;
    padding: 0 8px !important;
  }
  .header-top .search-box-container.d-xl-none .search-box {
    width: 100% !important;
    height: 28px !important;
  }
  .header-top .search-box-container.d-xl-none .news {
    flex: 1 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
}

/* ===== Mobile search row: search icon + marquee side by side (D247 match) ===== */
@media (max-width: 1199.98px) {
  .header-top .search-box-container.d-xl-none {
    display: flex !important;
    width: 100% !important;
    height: 26px !important;
    flex: 0 0 100% !important;
    align-items: center !important;
    padding: 0 4px !important;
    gap: 4px !important;
  }
  .header-top .search-box-container.d-xl-none .search-box {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    height: 26px !important;
    flex: 0 0 22px !important;
    display: flex !important;
    align-items: center !important;
  }
  .header-top .search-box-container.d-xl-none .search-box .search-input-show {
    display: none !important;
  }
  .header-top .search-box-container.d-xl-none .news {
    flex: 1 !important;
    width: auto !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    height: 26px !important;
    line-height: 26px !important;
    font-size: 12px !important;
    display: block !important;
  }
  
  /* Balance/Exp/Demo - stack vertically like D247 */
  .header-top .user-details .user-balance {
    flex-direction: column !important;
    align-items: flex-start !important;
    height: auto !important;
    min-height: 38px !important;
  }
  .header-top .user-details .user-balance > div {
    line-height: 1.2 !important;
    height: auto !important;
  }
  
  /* Mobile Demo - inline with Exp */
  .header-top .user-details .dropdown.d-inline-block.d-xl-none {
    display: inline-block !important;
    margin-left: 4px !important;
  }
}

/* ===== Mobile: marquee overlay background matching D247 ===== */
@media (max-width: 1199.98px) {
  .header-top .search-box-container.d-xl-none .news {
    background-color: rgba(255, 255, 255, 0.27) !important;
    padding: 4px 6px !important;
    margin: 0 0 0 10px !important;
    display: flex !important;
    border-radius: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }
  .header-top .search-box-container.d-xl-none .news marquee {
    width: auto !important;
    height: auto !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 400 !important;
  }
  .header-top .search-box-container.d-xl-none .search-box {
    flex: 0 0 22px !important;
    width: 22px !important;
    min-width: 22px !important;
    width: 22px !important;
    z-index: 1 !important;
    position: relative !important;
  }
}

/* ===== Mobile: remove gap between header-top and header-mobile ===== */
@media (max-width: 1199.98px) {
  .header-top {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  .header-mobile {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  .header-bottom {
    display: none !important;
  }
}

/* Match D247: no gap between header and favourite matches */
.favourite {
  margin-top: 0 !important;
}

/* d247 blinks the whole favourite item (anchor + icon + label) with its
   `blinker` keyframes. The label's own legacy `new-launch` animation is
   switched off so the two don't run on top of each other. */
.favourite li a span {
  animation: none !important;
}

/* d247/tridev favourites strip: the dfont sport glyph (`icon-<sportId>`) sits
   before the match name, where we used to draw a FontAwesome ribbon. */
.favourite li a i.d-icon {
  display: inline-block;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
  margin-right: 5px;
  color: inherit;
}

/* Remove grey scroll shadow/line on favourite matches (mobile) */
@media (max-width: 1199.98px) {
  .favourite {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }
  .favourite::-webkit-scrollbar {
    display: none !important;
  }
  .favourite::after {
    display: none !important;
  }
}

/* === D247 Sidebar Accordion Arrows === */
.left-sidebar .accordion-button::after {
  font-family: "Font Awesome 5 Free" !important;
  content: "\f107" !important;
  font-weight: 700 !important;
  float: right !important;
  margin-left: auto;
  padding-right: 3px;
}
.left-sidebar .accordion-button:not(.collapsed)::after {
  font-family: "Font Awesome 5 Free" !important;
  content: "\f106" !important;
  font-weight: 700 !important;
  float: right !important;
  margin-left: auto;
  padding-right: 3px;
  transform: none !important;
  -webkit-transform: none !important;
}
.left-sidebar .accordion-button {
  background-color: var(--bg-primary, #0088cc) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: none !important;
  padding: 5px !important;
  /* The reference's section header button is 16px/400 (measured), not bold. */
  font-size: 16px !important;
  font-weight: 400 !important;
  text-align: left;
}
.left-sidebar .accordion-button:focus,
.left-sidebar .accordion-button:hover,
.left-sidebar .accordion-button:active {
  box-shadow: none !important;
  outline: none !important;
}
.left-sidebar .accordion-item {
  border: 0;
  background-color: transparent;
}
.left-sidebar .accordion-body {
  padding: 0;
}

/* ========================================
   Override style.css sidebar rules
   (style.css loads AFTER diamond-theme.css so needs !important)
   ======================================== */

/* Hide :before icons from style.css that create extra icons on accordion titles */
.sidebar-title h5::before,
.sidebar-title::before,
.left-sidebar .sidebar-title h5::before,
.left-sidebar .sidebar-title::before {
  display: none !important;
  content: none !important;
}

.left-sidebar .accordion-button::before {
  display: none !important;
  content: none !important;
  background-image: none !important;
}

/* Reference nav-link (tridev, re-measured 2026-10-27 against the live DOM):
   280x26, `padding: 2px 15px`, 14px/21px, #bbbbbb, and a 1px `#9e9e9e`
   BOTTOM RULE on every row — top level and every nested level alike.
   (`border: 0 0 1px 0 solid rgb(158,158,158)` on the reference's own rows.) The
   earlier pass removed that rule; the rows now carry it again, and the padding
   plus 21px line box keeps them at exactly 26px with the border included. The
   column's own 1px right border stays off: it is what kept every row at 279px
   against the reference's 280. */
.sidebar {
  border-right: 0 !important;
}

.sidebar .nav-item .nav-link {
  background: #bbbbbb !important;
  color: #000000 !important;
  border-bottom: 1px solid #9e9e9e !important;
  padding: 2px 15px !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  line-height: 21px !important;
  min-height: 26px;
  box-sizing: border-box;
  display: block;
}

.sidebar .nav-item .nav-link.dropdown-toggle {
  padding-right: 15px !important;
}

.sidebar .nav-item .nav-link i {
  margin-right: 4px;
  font-size: 14px;
}

.sidebar .nav-item .nav-link.active {
  background: #0470a5 !important;
  color: #ffffff !important;
}

.sidebar .nav-item .nav-link span {
  white-space: normal !important;
}

/* Remove mtree-main padding — keep items aligned same as Racing/Others */
.sidebar .mtree-main,
.sidebar .menu-box,
.sidebar .menu-box > ul {
  padding: 0 !important;
  margin: 0 !important;
}

.sidebar .menu-box > ul > li {
  position: relative;
}


/* === D247 Nav Bar Spacing === */
.header-bottom .navbar-nav .nav-item .nav-link {
  padding: 5px 15px !important;
  letter-spacing: 0.5px;
}


/* ========================================
   Sidebar trees (Sport → League → Match) — the reference renders these as
   inline Bootstrap dropdown-menus: `padding: 8px 0` with the nested link
   indented to `2px 15px 2px 25px`, NOT as its own .mtree list.
   ======================================== */
/* Same `!important` contest as the racing menu below: the header's dropdown
   block would otherwise make every nested tree menu absolute at `right: 0`. */
.sidebar .menu-box ul.dropdown-menu {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  display: none !important;
  min-width: 0 !important;
  width: 100% !important;
  /* The reference's expanded panel is part of the same ladder: `padding: 0`, no
     background of its own, its rows indented inside it. This was `8px 0`, which
     printed a band of the sidebar's own colour between the sport row and its
     options — the "box with two colours and a gap" the user reported. */
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

.sidebar .menu-box ul.dropdown-menu.show {
  display: block !important;
}

.sidebar .menu-box ul.dropdown-menu .nav-item .nav-link {
  padding: 2px 15px 2px 25px !important;
  font-size: 14px !important;
}

/* Reference indents: sport at 15px, league at 25px, match at 35px — the
   reference's own `padding: 2px 15px 2px 25px` / `2px 15px 2px 35px`. */
.sidebar .menu-box ul.dropdown-menu ul.dropdown-menu .nav-item .nav-link {
  padding: 2px 15px 2px 35px !important;
}

/* Loading / empty state */
.sidebar .menu-box .nav-link[style] {
  color: #999 !important;
  font-style: italic;
}

/* ========================================
   Racing Sports dropdown — the reference's race list. Measured on tridev:
   the menu sits at the sidebar's right edge, top-aligned with its own row,
   285 wide, `padding: 8px 0`, radius 4, white; a 20px/700 `<h5>` heading at
   `5px 20px`; a `.horse-list-box` that scrolls at `calc(100vh - 210px)`; and
   40px rows at `8px 16px`, 16px/24px.
   ======================================== */
.racing-sport .nav-item.dropdown {
  position: relative;
}

/* The header's user-menu block above states its dropdown geometry with
   `!important` on the plain `.dropdown` / `.dropdown-item` selectors, so every
   value that block sets has to be restated here with `!important` too — and
   with a higher-specificity selector, which `.racing-sport …` is. Without this
   the menu lands at `right: 0` (so it draws *left* of the sidebar, x=-6) and its
   rows take the header menu's 5px 15px / 14px / #333 instead of the
   reference's 8px 16px / 16px / #000. */
.racing-sport .nav-item .dropdown-menu {
  position: absolute !important;
  top: 0 !important;
  left: 100% !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1001 !important;
  display: block !important;
  width: 285px !important;
  min-width: 285px !important;
  max-width: 285px !important;
  padding: 8px 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 4px !important;
  background-color: #ffffff !important;
  color: #212529 !important;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175) !important;
}

.racing-sport .nav-item .dropdown-menu h5 {
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 24px !important;
  padding: 5px 20px !important;
  margin: 0 !important;
  color: #212529 !important;
}

.racing-sport .horse-list-box {
  max-height: calc(100vh - 210px) !important;
  overflow-y: auto !important;
}

.racing-sport .horse-list-box .dropdown-item {
  display: block !important;
  padding: 8px 16px !important;
  font-size: 16px !important;
  line-height: 24px !important;
  color: #000000 !important;
  background: none !important;
  white-space: normal !important;
}

.racing-sport .horse-list-box .dropdown-item:hover,
.racing-sport .horse-list-box .dropdown-item:focus {
  background-color: #f8f9fa !important;
  color: #16181b !important;
}

/* The reference's toggle carries Bootstrap's caret; the arrow on our section
   headers must not leak onto these rows. */
.racing-sport .nav-link.dropdown-toggle::after {
  display: inline-block;
  vertical-align: 0.15em;
  margin-left: 0.255em;
}


/* ========================================
   Crash/Aviator icon blink (D247 match)
   ======================================== */
.header-bottom .navbar-expand .navbar-nav .nav-link svg .cls-1 {
  animation: blinkmenu 1s infinite ease-in-out;
}

@keyframes blinkmenu {
  0% { fill: #e40539; }
  100% { opacity: 0.1; }
}


/* ========================================
   Crash/Aviator icon - blink + size (D247 match)
   ======================================== */
.header-bottom .nav-link svg {
  height: 25px !important;
  width: auto !important;
  transform: rotate(10deg);
}

.header-bottom .nav-link svg .cls-1 {
  animation: blinkmenu 1s infinite ease-in-out !important;
  -webkit-animation: blinkmenu 1s infinite ease-in-out !important;
}

@keyframes blinkmenu {
  0% { fill: #e40539; }
  100% { opacity: 0.1; }
}

@-webkit-keyframes blinkmenu {
  0% { fill: #e40539; }
  100% { opacity: 0.1; }
}

/* --- Login footer --- */
/* The login footer is NOT a centred stack. The reference's /login renders the
   same three-cell row as its site footer (measured on tridev's logged-out
   page, 1600x1000):
     .footer-links       flex 1   — Terms and Conditions at x=8, Responsible
                                    Gaming at x=164, i.e. flush left
     .support-detail     flex 1   — x=536, width 528, text centred (centre 800)
     .social-icons-box   flex 1   — present but empty, the cell that keeps the
                                    support line in the middle
   This block used to override that with `flex-direction: column;
   justify-content: center`, which stacked the two links and the heading and
   centred all three — the "everything is in the centre" report. The shared
   `.footer .footer-top` rules above already describe the reference, so the
   login page now inherits them, and the markup carries the empty spacer. */
.footer.footer-login .footer-top .support-detail h2 {
  color: #fff;
}


/* ================================================================
   D247 VISUAL ALIGNMENT PASS
   Visual-only changes: layout, sizing, spacing, alignment, typography
   No business logic changes
   ================================================================ */

/* ---- 1. BACK/LAY HEADER: clean neutral label area above odds cells ---- */
.table-header {
  display: flex !important;
  align-items: center;
  background: #f7f7f7;
  border-bottom: 1px solid #c7c8ca;
  border-top: 1px solid #c7c8ca;
  min-height: 28px;
  margin: 0;
}

.table-header > div {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 !important;
  border: none !important;
  margin: 0;
  min-height: 24px;
}

.table-header .back,
.table-header .lay {
  /* background handled by colored rules below */
  color: #555 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table-header .back b,
.table-header .lay b {
  font-weight: 700 !important;
  font-size: 11px !important;
  color: #555 !important;
}

/* Desktop header: Back/Lay labels centered above center columns */
.main-market .table-header .back.box-1,
.main-market .table-header .lay.box-1 {
  width: 10.25% !important;
  min-width: 10.25% !important;
  max-width: 10.25% !important;
  flex: 0 0 10.25% !important;
  background-color: #72bbef !important;
  color: #fff !important;
  font-size: 10px !important;
}

.main-market .table-header .lay.box-1 {
  background-color: #faa9ba !important;
  color: #333 !important;
}

.main-market .table-header .back.box-1 b,
.main-market .table-header .lay.box-1 b {
  color: inherit !important;
}

/* D247 parity: Back/Lay header labels - colored backgrounds for centered labels */

/* ---- 2. FIXED ODDS GRID: ensure Back/Lay columns never shift ---- */
.main-market .table-header,
.main-market .table-row {
  display: flex !important;
  flex-wrap: nowrap;
}

/* Team name column: fixed width */
.main-market .table-header .country-name {
  width: 35% !important;
  min-width: 35% !important;
  max-width: 35% !important;
  flex: 0 0 35% !important;
  padding-left: 8px !important;
}

.main-market .table-row .country-name {
  width: 35% !important;
  min-width: 35% !important;
  max-width: 35% !important;
  flex: 0 0 35% !important;
}

/* Row odds cells: fixed width, never grows or shrinks */
.main-market .table-row .box-1,
.main-market .table-row [class*="back"],
.main-market .table-row [class*="lay"] {
  width: 10.25% !important;
  min-width: 10.25% !important;
  max-width: 10.25% !important;
  flex: 0 0 10.25% !important;
}

/* Header odds cells (non-spanning): 10.25% */
.main-market .table-header .box-1,
.main-market .table-header .box-2 {
  width: 10.25% !important;
  min-width: 10.25% !important;
  max-width: 10.25% !important;
  flex: 0 0 10.25% !important;
}

/* D247 parity: Back/Lay labels positioned above center columns only */

/* Mobile: D247 parity - still show all 3 back + 3 lay, compressed */
@media (max-width: 768px) {
  .main-market .table-header .country-name,
  .main-market .table-row .country-name {
    width: 30% !important;
    min-width: 30% !important;
    max-width: 30% !important;
    flex: 0 0 30% !important;
  }

  .main-market .table-row .box-1,
  .main-market .table-row [class*="back"],
  .main-market .table-row [class*="lay"] {
    width: 11.67% !important;
    min-width: 11.67% !important;
    max-width: 11.67% !important;
    flex: 0 0 11.67% !important;
  }

  .main-market .table-header .box-1,
  .main-market .table-header .box-2,
  .main-market .table-header .box-3,
  .main-market .table-header [class*="back"],
  .main-market .table-header [class*="lay"] {
    width: 11.67% !important;
    min-width: 11.67% !important;
    max-width: 11.67% !important;
    flex: 0 0 11.67% !important;
  }

  .main-market .table-header .back.box-1,
  .main-market .table-header .lay.box-1 {
    width: 17.5% !important;
    min-width: 17.5% !important;
    max-width: 17.5% !important;
    flex: 0 0 17.5% !important;
  }

  .main-market .table-row .back,
  .main-market .table-row .back1,
  .main-market .table-row .back2,
  .main-market .table-row .lay,
  .main-market .table-row .lay1,
  .main-market .table-row .lay2 {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }

  .main-market .table-row .back span,
  .main-market .table-row .lay span {
    font-size: 13px !important;
  }

  .main-market .table-row .back span.odd,
  .main-market .table-row .lay span.odd {
    font-size: 14px !important;
  }
}

/* ---- 3. ODDS CELL GEOMETRY: match D247 dimensions ---- */
.main-market .table-row .back,
.main-market .table-row .back1,
.main-market .table-row .back2,
.main-market .table-row .lay,
.main-market .table-row .lay1,
.main-market .table-row .lay2 {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0 !important;
  border-left: 1px solid rgba(255,255,255,0.3);
  cursor: pointer;
  overflow: hidden;
}

.main-market .table-row .back,
.main-market .table-row .back1,
.main-market .table-row .back2 {
  background-color: #72bbef !important;
}

.main-market .table-row .lay,
.main-market .table-row .lay1,
.main-market .table-row .lay2 {
  background-color: #faa9ba !important;
}

/* Cell content typography */
.main-market .table-row .back span,
.main-market .table-row .back1 span,
.main-market .table-row .back2 span,
.main-market .table-row .lay span,
.main-market .table-row .lay1 span,
.main-market .table-row .lay2 span {
  font-size: 15px !important;
  line-height: 1.1 !important;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-market .table-row .back span.odd,
.main-market .table-row .back1 span.odd,
.main-market .table-row .back2 span.odd,
.main-market .table-row .lay span.odd,
.main-market .table-row .lay1 span.odd,
.main-market .table-row .lay2 span.odd {
  font-size: 16px !important;
  font-weight: 700;
}

/* ---- 4. TABLE ROW: clean boundaries, no protrusion ---- */
.table-row {
  display: flex !important;
  align-items: center;
  min-height: 34px;
  background-color: #f2f2f2;
  border-bottom: 1px solid #fff;
  margin: 0;
  overflow: hidden;
}

.table-row .country-name {
  padding: 4px 6px !important;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.table-row .country-name .team-name {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-row .country-name .team-name b {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

/* ---- 5. BOOKMAKER HEADER: match Odds header style ---- */
.main-market .table-header .box-4,
.main-market .table-header .box-6 {
  width: 35% !important;
  min-width: 35% !important;
  max-width: 35% !important;
  flex: 0 0 35% !important;
}

.main-market .table-header .box-2,
.main-market .table-header .box-1 {
  width: 10.25% !important;
  min-width: 10.25% !important;
  max-width: 10.25% !important;
  flex: 0 0 10.25% !important;
}

/* ---- 6. SUSPENDED CELLS: D247 parity - dark overlay across odds area only ---- */
.table-row.suspended {
  position: relative;
  min-height: 34px;
}

/* Dark overlay covering odds columns (not team name) */
.table-row.suspended::after {
  content: '';
  position: absolute;
  top: 0;
  left: 35%;
  right: 0;
  bottom: 0;
  background-color: rgba(55, 54, 54, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

/* Override style.css suspended:after rules that show garbled red text */
/* Higher specificity: 0,5,0 beats style.css 0,4,0 */
.sports-wrapper .main-market .table-row.suspended::after {
  content: 'SUSPENDED' !important;
  position: absolute;
  top: 0;
  left: 35%;
  right: 0;
  bottom: 0;
  background-color: rgba(55, 54, 54, 0.85);
  color: #fff !important;
  font-size: 14px !important;
  font-weight: bold !important;
  font-family: Arial, Verdana, Helvetica, sans-serif !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: none;
  z-index: 2;
  width: 65% !important;
  text-align: center;
}

.bookmaker-market .table-row.suspended::after {
  content: 'SUSPENDED' !important;
  position: absolute;
  top: 0;
  left: 35%;
  right: 0;
  bottom: 0;
  background-color: rgba(55, 54, 54, 0.85);
  color: #fff !important;
  font-size: 14px !important;
  font-weight: bold !important;
  font-family: Arial, Verdana, Helvetica, sans-serif !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: none;
  z-index: 2;
  width: 65% !important;
  text-align: center;
}

/* Lower markets grid suspended override */
.lower-markets-grid .sports-wrapper .main-market .table-row.suspended::after,
.lower-markets-grid .bookmaker-market .table-row.suspended::after {
  content: 'SUSPENDED' !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(55, 54, 54, 0.85);
  color: #fff !important;
  font-size: 14px !important;
  font-weight: bold !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  pointer-events: none;
  z-index: 2;
  width: 100% !important;
}

/* SUSPENDED text: rendered by React component, no CSS duplicate needed */

/* THE KHADO ROW KEEPS ITS VEIL.

   These three rule groups used to suppress the suspended veil on khado rows
   (`content: none !important; display: none !important; background: none
   !important`), on the claim of "D247 parity: Khado - hide ALL overlays, show
   only lock icons". That claim is wrong, and the pair must not be split: on the
   reference a suspended odds box ALWAYS carries lock + veil together —
   `.suspended-box::before` is the 17px lock and `.suspended-box::after` is the
   `#373636d6` veil, and its khado-shaped market (`.market-9`) keeps BOTH, only
   re-bounding them to the 80px odds column (`.market-9 .suspended-box::after
   { width: 80px; right: 0 }`, and the same box for `::before`).

   Ours kept the cell lock (`.khado-market .table-row.suspended .back::after`,
   16px, z-index 10) and hid the row veil, so a suspended khado entry rendered
   as a white padlock floating on the light row with nothing under it — the
   "padlock but no overlay" report on the 2nd Inn 6/10 Over markets. With the
   veil restored the lock sits ON the dark band, which is what every other
   suspended row in this app already looks like. */


/* Reference market suspended (cricket compact).

   d247 veils ONLY the quote boxes — the runner name stays readable and the
   Min/Max column stays visible. We used to put `.suspended` on the whole grid
   pane, and the veil therefore sat across the runner name ("50 over run NZ
   adv"). The veil is now a real grid item pinned to the quote columns, so it
   cannot creep over the name. */
.reference-market-pane {
  position: relative;
}

.reference-market-pane__veil {
  position: absolute;
  grid-column: 2 / span 2;
  grid-row: 1;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #373636d6;
  pointer-events: none;
}

/* The label is the runner's own state (SUSPENDED / BALL RUNNING / REMOVED),
   carried on the veil's data-title — the same text d247 prints. */
.reference-market-pane__veil::after {
  content: attr(data-title);
  color: #ff0000;
  font-family: Arial, Verdana, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}

/* Back-only (khado / "1st Inn 45 Over") entries: d247 shows the padlock alone,
   never the SUSPENDED wording. */
.reference-market-pane__veil--lock {
  grid-column: 2;
}

.reference-market-pane__veil--lock::after {
  content: '';
  width: 17px;
  height: 17px;
  background-image: url("../img/icons/lock.svg");
  background-size: 17px 17px;
  background-repeat: no-repeat;
  background-position: center;
  filter: invert(1);
  -webkit-filter: invert(1);
}

/* Exchange/fancy rows: d247 anchors the veil to the odds columns
   (`.suspended-row::after { right: 0; width: 60% }`), so the runner name is
   never covered. `!important` because admin-style.css loads after this sheet
   and carries the old full-width 510px veil. */
.sports-wrapper .main-market .table-row.suspended::after,
.sports-wrapper .main-market .market-1-item.suspended::after,
.main-market .table-row.suspended::after,
.main-market .market-1-item.suspended::after {
  content: attr(data-title) !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  width: 60% !important;
  height: 100% !important;
  background-color: #373636d6 !important;
  color: #ff0000 !important;
  font-family: Arial, Verdana, Helvetica, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  text-transform: uppercase !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important;
  z-index: 2;
}

/* d247 prints the suspended wording in red, never white. */
.sports-wrapper .main-market .suspended::after,
.main-market .suspended::after,
.main-market .suspended-row::after,
.main-market .suspended-table::after {
  color: #ff0000 !important;
}

/* Coupon odds flash — the "ball running" blink. d247 flashes the box yellow
   for 300ms when its price moves (`.blink { animation: blinking 300ms;
   background-color: #ffc01a }`), then the back/lay colour returns. The coupon
   never had it; every per-side keyframe ends on that side's own colour so the
   box cannot be left yellow when the class stays on. */
.bet-nation-odd .odd-box.back.blink {
  animation: coupon-flash-back 300ms ease-out !important;
}

@keyframes coupon-flash-back {
  0%, 50% { background-color: #ffc01a !important; }
  100% { background-color: #72bbef !important; }
}

.bet-nation-odd .odd-box.lay.blink {
  animation: coupon-flash-lay 300ms ease-out !important;
}

@keyframes coupon-flash-lay {
  0%, 50% { background-color: #ffc01a !important; }
  100% { background-color: #faa9ba !important; }
}



/* ---- 6b. PADLOCK ICONS: D247 parity for suspended number/khado entries ---- */
.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lock-icon::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}
/* ---- 7. LOWER MARKET GRID: 2-column layout on desktop ---- */
/* Wraps each pair of non-match-odds, non-bookmaker markets in a 2-col grid */
.markets .main-market > div > .market-title + .table-header ~ .table-row {
  /* keep individual rows clean */
}

/* Target the markets container for 2-column grid of lower markets */
.main-market {
  display: block;
}

/* Market blocks after match odds and bookmaker get 2-col grid */
/* We use the generic-market wrapper which renders each market block */
/* The rendering loop puts them sequentially; CSS grid on the parent */
.markets > .main-market > div:not(.market-title):not(.table-header) {
  /* each market block stays full width by default */
}

/* ---- 8. REFERENCE MARKET (Cricket Specific Compact): fix grid ---- */
.reference-market-grid__header {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  background: #eef3f8;
}

.reference-market-half-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 78px 78px 76px !important;
  min-height: 28px !important;
}

/* D247 parity: compact Back/Lay/No/Yes header text */

.reference-market-pane {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 78px 78px 76px !important;
  min-height: 30px !important;
  background: #f2f2f2;
  border-bottom: 1px solid #dee2e6;
}

.reference-market-quote {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 30px !important;
  padding: 2px 4px !important;
  border-left: 1px solid #fff;
  overflow: hidden;
}

.reference-market-quote .odd {
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.reference-market-header-cell--back {
  background: #72bbef !important;
}

.reference-market-header-cell--lay {
  background: #faa9ba !important;
}

.reference-market-header-cell {
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  color: #555;
}

/* ---- 9. MOBILE RESPONSIVE: same grid principles ---- */
@media (max-width: 768px) {
  .table-header {
    min-height: 24px;
  }

  .table-header .back,
  .table-header .lay {
    font-size: 10px !important;
  }

  .table-row {
    min-height: 32px;
  }

  .main-market .table-row .back,
  .main-market .table-row .back1,
  .main-market .table-row .back2,
  .main-market .table-row .lay,
  .main-market .table-row .lay1,
  .main-market .table-row .lay2 {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
  }

  .table-row .country-name .team-name b {
    font-size: 12px;
  }

  .main-market .table-row .back span,
  .main-market .table-row .lay span {
    font-size: 14px !important;
  }

  .reference-market-grid__header {
    grid-template-columns: 1fr 1fr !important;
  }

  .reference-market-half-header {
    grid-template-columns: minmax(0, 1fr) 65px 65px !important;
  }

  .reference-market-half-header:nth-child(2) {
    display: none !important;
  }

  .reference-market-grid__row {
    grid-template-columns: 1fr !important;
  }

  .reference-market-pane {
    grid-template-columns: minmax(0, 1fr) 65px 65px !important;
  }

  .reference-market-pane__limits,
  .reference-market-pane__limits--header {
    display: none !important;
  }

  .reference-market-quote .odd {
    font-size: 13px !important;
  }
}



/* ---- D247 parity: Padlock icon for suspended khado entries ---- */
/* ---- D247 parity: Khado market 2-column grid (3rd Inn markets side by side) ---- */
.khado-market-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.khado-market-pair__column {
  min-width: 0;
  border: 1px solid #dee2e6;
  overflow: hidden;
}

/* D247 parity: Khado markets - ONLY show best back (back) column, hide everything else */
/* ============================================ */
/* KHADO MARKET: Hide ALL cells except best back */
/* Using max specificity to override style.css    */
/* ============================================ */
.sports-wrapper .main-market .khado-market .table-row .lay,
.sports-wrapper .main-market .khado-market .table-row .lay1,
.sports-wrapper .main-market .khado-market .table-row .lay2,
.sports-wrapper .main-market .khado-market .table-row .back1,
.sports-wrapper .main-market .khado-market .table-row .back2,
.main-market .khado-market .table-row .lay,
.main-market .khado-market .table-row .lay1,
.main-market .khado-market .table-row .lay2,
.main-market .khado-market .table-row .back1,
.main-market .khado-market .table-row .back2 {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
}

/* Ensure back cell and its children are ALWAYS visible */
.sports-wrapper .main-market .khado-market .table-row .back,
.main-market .khado-market .table-row .back {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 100px !important;
  min-width: 100px !important;
  flex: 0 0 100px !important;
}

/* D247 parity: Khado Back header positioned on right side */
.khado-market .table-header {
  display: flex !important;
  justify-content: flex-end !important;
}

.khado-market .table-header .back {
  width: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;
  flex: 0 0 100px !important;
  text-align: center;
  background: #72bbef;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 0;
}

/* (Veil intentionally NOT suppressed here — see the note above: the lock and
   the veil are one marking, and dropping the veil is what left a bare padlock.) */

/* Hide any SUSPENDED text in khado cells */
.khado-market .table-row .back .odd {
  color: inherit !important;
}

/* D247 parity: Khado row layout - number name left, Back odds right */
.khado-market .table-row {
  display: flex !important;
  align-items: center;
}

.khado-market .table-row .country-name {
  flex: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

.khado-market .table-row .back {
  width: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;
  flex: 0 0 100px !important;
}

/* D247 parity: Khado title bar compact */
.khado-market .market-title {
  font-size: 12px !important;
  padding: 3px 6px !important;
  background: #2c3e50;
  color: #fff;
  text-align: left !important;
}

.khado-market .table-header {
  justify-content: flex-start !important;
}

.khado-market .market-title-sub {
  padding: 1px 6px !important;
}

/* Padlock container positioning - only applied via .khado-market below */

.khado-market .table-row {
  position: relative;
}
.khado-market .table-row .back {
  position: relative !important;
  overflow: visible !important;
}

.sports-wrapper .main-market .khado-market .table-row.suspended .back::after,
.main-market .khado-market .table-row.suspended .back::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  z-index: 10;
}

/* ---- D247 parity: hide fancy tab bar and Session Market ---- */
/* D247 shows all markets inline in the main list; tab bar and Session Market are extra */
.fancy-group {
  display: none !important;
}
/* Hide the entire Session Market / Fancy section — SPORTS PAGE ONLY.
   This must NOT be a bare `.fancy-market` selector: casino boards render their
   rows as `.fancy-market` (tridev's own class for them), so a bare rule hid
   all 72 goal2 rows (and the goal / lucky15 / generic casino boards) while
   leaving the market titles visible — i.e. "market names show, odds never
   load". Scoped to the sports Session Market wrapper in
   pages/odds/components/fancy.tsx. */
.session-market-block {
  display: none !important;
}
/* ---- 10. BACK/CELL COLORS: D247 exact opacity gradient ---- */
.back {
  background-color: #72bbef !important;
}

.back1 {
  background-color: #72bbefbf !important;
}

.back2 {
  background-color: #72bbef7f !important;
}

.lay {
  background-color: #faa9ba !important;
}

.lay1 {
  background-color: #faa9babf !important;
}

.lay2 {
  background-color: #faa9ba7f !important;
}

/* ---- 11. BLINK ANIMATION: match D247 yellow flash ---- */
/* D247's own rule, copied from its stylesheet (captured d247 style.css:1961):

     .blink {
       animation: blinking 300ms !important;
       -webkit-animation: blinking 300ms !important;
       background-color: #ffc01a !important;
     }

   The cell is yellow for exactly as long as the class is on, and the frontend
   drops the class 300ms later (pages/odds/components/odds-flash.ts), so this is a
   flash rather than a colour change. Two deliberate departures:

   - `.blink.blink` doubles the class on purpose. The yellow has to outrank the
     `.back` / `.lay` `background-color: ... !important` cells, and admin-style.css
     — the last sheet in index.html — re-declares those at the same specificity, so
     a single-class `.blink` here loses the cascade and never paints on a ladder
     cell.
   - a private keyframe name. `@keyframes blinking` is declared again in style.css
     and admin-style.css, both fading to `transparent`, and keyframes are global:
     whichever sheet loads last wins by name. This rule must not depend on
     stylesheet order. */
.blink.blink {
  background-color: #ffc01a !important;
  animation: odds-cell-blink 300ms !important;
  -webkit-animation: odds-cell-blink 300ms !important;
}

@keyframes odds-cell-blink {
  0% { background-color: #ffc01a !important; }
  100% { background-color: #ffc01a !important; }
}

/* ---- 12. BOX SIZING FIX: prevent overflow ---- */
.main-market .table-row > div {
  box-sizing: border-box;
  overflow: hidden;
}

.main-market .table-row .country-name p {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 13. MARKET PAIR: bookmaker side-by-side on desktop ---- */
.reference-market-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.reference-market-pair__column {
  min-width: 0;
  overflow: hidden;
}

/* Tridev player parity: Bookmaker and Tied Match share one row. Measured at
   1600px on tridev 2026-11-11: Bookmaker 601px = 121px name + 6x80px quotes;
   Tied Match 255px = 95px name + 2x80px quotes. The rest of the board keeps
   its existing 60px quote cells. Anchor these rules to #root because the later
   .main-market ladder rules otherwise tie on specificity and force 60px. */
.reference-market-pair--bookmaker-tied {
  grid-template-columns: minmax(0, 70fr) minmax(0, 30fr);
  gap: 4px;
}

#root
  .reference-market-pair--bookmaker-tied
  .reference-market-pair__column--bookmaker
  .country-name {
  width: calc(100% - 480px) !important;
  min-width: calc(100% - 480px) !important;
  max-width: calc(100% - 480px) !important;
  flex: 0 0 calc(100% - 480px) !important;
}

#root
  .reference-market-pair--bookmaker-tied
  .reference-market-pair__column--bookmaker
  .box-1 {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

#root
  .reference-market-pair--bookmaker-tied
  .reference-market-pair__column--tied
  .country-name {
  width: calc(100% - 160px) !important;
  min-width: calc(100% - 160px) !important;
  max-width: calc(100% - 160px) !important;
  flex: 0 0 calc(100% - 160px) !important;
}

#root
  .reference-market-pair--bookmaker-tied
  .reference-market-pair__column--tied
  .box-1 {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

@media (max-width: 768px) {
  .reference-market-pair {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* ---- 14. LOWER MARKETS 2-COLUMN GRID ---- */
.lower-markets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Odd last child gets full width */
.lower-markets-grid > *:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* Each market block inside the grid */
.lower-markets-grid > div {
  min-width: 0;
  border: 1px solid #dee2e6;
  margin: 0;
  overflow: hidden;
}

/* Market title inside grid needs to be compact */
.lower-markets-grid .market-title {
  font-size: 12px;
  padding: 3px 6px;
}

.lower-markets-grid .market-title-sub {
  padding: 1px 6px;
}

@media (max-width: 768px) {
  .lower-markets-grid {
    grid-template-columns: 1fr;
  }

  .lower-markets-grid > *:last-child:nth-child(odd) {
    grid-column: 1;
  }
}

/* ---- 15. ODDS BLINK: yellow flash when odds change (D247 parity) ---- */
/* The .blink class is added by the frontend when runner.ex changes.
   It overrides the cell background to yellow briefly, then lets
   the original .back/.lay color show through after animation ends. */
.main-market .table-row .back.blink,
.main-market .table-row .back1.blink,
.main-market .table-row .back2.blink,
.main-market .table-row .lay.blink,
.main-market .table-row .lay1.blink,
.main-market .table-row .lay2.blink {
  animation: odds-flash 300ms ease-out !important;
  /* The yellow has to be declared HERE, not only on `.blink`. The cell's own
     colour comes from `.main-market .table-row .back { background-color: #72bbef
     !important }` — specificity (0,3,0) — which outranks a plain `.blink` or even a
     doubled `.blink.blink` (0,2,0), so the class was on the cell and nothing
     painted: measured on the live board 2026-10-16, a `.table-row .back` with
     `.blink` forced on it still computed rgb(114, 187, 239). Same specificity as
     that rule and declared after it, so the flash wins; the per-side keyframes
     below then hand the cell back its own colour when the 300ms is up. */
  background-color: #ffc01a !important;
}

@keyframes odds-flash {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: inherit !important; }
}

/* Specific colors to return to after flash */
.main-market .table-row .back.blink {
  animation: odds-flash-back 300ms ease-out !important;
}
@keyframes odds-flash-back {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: #72bbef !important; }
}

.main-market .table-row .back1.blink {
  animation: odds-flash-back1 300ms ease-out !important;
}
@keyframes odds-flash-back1 {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: #72bbefbf !important; }
}

.main-market .table-row .back2.blink {
  animation: odds-flash-back2 300ms ease-out !important;
}
@keyframes odds-flash-back2 {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: #72bbef7f !important; }
}

.main-market .table-row .lay.blink {
  animation: odds-flash-lay 300ms ease-out !important;
}
@keyframes odds-flash-lay {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: #faa9ba !important; }
}

.main-market .table-row .lay1.blink {
  animation: odds-flash-lay1 300ms ease-out !important;
}
@keyframes odds-flash-lay1 {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: #faa9babf !important; }
}

.main-market .table-row .lay2.blink {
  animation: odds-flash-lay2 300ms ease-out !important;
}
@keyframes odds-flash-lay2 {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: #faa9ba7f !important; }
}

/* Also handle the reference market (cricket compact) cells. Their colour rule
   (`.reference-market-quote--back` / `--lay`) is not `!important`, so a plain
   `!important` here is enough to outrank it. */
.reference-market-quote.blink {
  animation: ref-odds-flash 300ms ease-out !important;
  background-color: #ffc01a !important;
}
@keyframes ref-odds-flash {
  0% { background-color: #ffc01a !important; }
  50% { background-color: #ffc01a !important; }
  100% { background-color: inherit !important; }
}


/* ============================================ */
/* COMPREHENSIVE KHADO MARKET FIX (D247 parity) */
/* ============================================ */

/* Hide lay, back1, back2 for khado - uses :after to match style.css */
.sports-wrapper .main-market .khado-market .table-row .lay,
.sports-wrapper .main-market .khado-market .table-row .lay1,
.sports-wrapper .main-market .khado-market .table-row .lay2,
.sports-wrapper .main-market .khado-market .table-row .back1,
.sports-wrapper .main-market .khado-market .table-row .back2 {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex: 0 0 0 !important;
}

/* Back cell: visible, fixed width, position:relative for lock icon */
.sports-wrapper .main-market .khado-market .table-row .back {
  display: flex !important;
  visibility: visible !important;
  width: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;
  flex: 0 0 100px !important;
  position: relative !important;
  overflow: visible !important;
  align-items: center;
  justify-content: center;
}

/* Back cell children always visible */
.sports-wrapper .main-market .khado-market .table-row .back span {
  display: block !important;
  visibility: visible !important;
}

/* The khado suspended VEIL is not suppressed — see the pair note further up:
   lock + veil are one marking on the reference, and hiding only the veil is what
   left a bare padlock on a light row. */

/* Lock icon INSIDE back cell when suspended */
.sports-wrapper .main-market .khado-market .table-row.suspended .back::after,
.sports-wrapper .main-market .khado-market .table-row.suspended .back:after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 16px !important;
  height: 16px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z'/%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  z-index: 10 !important;
}

/* Header: Min/Max left, Back right */
.sports-wrapper .main-market .khado-market .table-header {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center;
}

.sports-wrapper .main-market .khado-market .table-header .country-name {
  padding-left: 4px !important;
}

.sports-wrapper .main-market .khado-market .table-header .back {
  width: 100px !important;
  min-width: 100px !important;
  flex: 0 0 100px !important;
  background: #72bbef;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* Khado title: dark background, left aligned */
.sports-wrapper .main-market .khado-market .market-title {
  background: #2c3e50 !important;
  color: #fff !important;
  text-align: left !important;
  font-size: 12px !important;
  padding: 3px 6px !important;
}

/* Khado row: name left, back right */
.sports-wrapper .main-market .khado-market .table-row {
  display: flex !important;
  align-items: center;
}

.sports-wrapper .main-market .khado-market .table-row .country-name {
  flex: 1 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* ============================================================
   D247 MEASURED PARITY (2026-09-05 live extraction, match 812604921)
   Reference: /tmp/d247-ref/d247-812604921-deep.json + docs/D247-MARKET-TABLE-GAP-REPORT.md
   ============================================================ */

/* --- Market title bar: 39px tall, flex row, Cashout button right --- */
.main-market .market-title.mt-1 {
  min-height: 39px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 4px 8px !important;
  box-sizing: border-box !important;
}
.main-market .market-title.mt-1 > span {
  line-height: 1.2 !important;
}
.main-market .market-title.mt-1 .btn {
  font-size: 12px !important;
  padding: 2px 10px !important;
  line-height: 1.5 !important;
  border-radius: 3px !important;
}

/* --- Desktop grid: name flex-fills, 6 x 60px fixed cells (D247 measured) --- */
@media (min-width: 769px) {
  .main-market .table-header .country-name,
  .main-market .table-row .country-name {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    flex: 1 1 auto !important;
  }

  .main-market .table-header .box-1,
  .main-market .table-header .box-2,
  .main-market .table-header .box-3,
  .main-market .table-header [class*="back"],
  .main-market .table-header [class*="lay"],
  .main-market .table-row .box-1,
  .main-market .table-row [class*="back"],
  .main-market .table-row [class*="lay"] {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px !important;
    box-sizing: border-box !important;
  }

  .main-market .table-header {
    min-height: 28px !important;
  }

  /* Reference markets: rows 34px, cells 60px wide (D247 measured) */
  .reference-market-half-header {
    grid-template-columns: minmax(0, 1fr) 60px 60px 60px !important;
  }

  .reference-market-pane {
    grid-template-columns: minmax(0, 1fr) 60px 60px 60px !important;
    min-height: 34px !important;
    border-left: none !important;
  }

  .reference-market-grid__row {
    min-height: 34px !important;
  }

  .reference-market-quote {
    min-height: 34px !important;
    border-left: none !important;
  }

  .reference-market-grid__header {
    background: #f7f7f7 !important;
  }
}

/* --- Back/Lay ladder alpha gradient (D247 measured: 50% -> 75% -> 100%) --- */
.main-market .table-row .back2 {
  background-color: rgba(114, 187, 239, 0.498) !important;
}
.main-market .table-row .back1 {
  background-color: rgba(114, 187, 239, 0.75) !important;
}
.main-market .table-row .back {
  background-color: #72bbef !important;
}
.main-market .table-row .lay {
  background-color: #faa9ba !important;
}
.main-market .table-row .lay1 {
  background-color: rgba(250, 169, 186, 0.75) !important;
}
.main-market .table-row .lay2 {
  background-color: rgba(250, 169, 186, 0.498) !important;
}

/* --- Cell typography (D247 measured: odd 16px, volume 12px, text #333) --- */
.main-market .table-row .box-1,
.main-market .table-row .box-1 span {
  color: #333 !important;
}
.main-market .table-row .market-volume,
.reference-market-quote .market-volume {
  font-size: 12px !important;
  line-height: 1.2 !important;
  color: #333 !important;
}
.main-market .table-row .odd {
  font-size: 16px !important;
  line-height: 1.2 !important;
}

/* --- Team name: fs12, weight 400 (D247 measured) --- */
.main-market .table-row .country-name .team-name,
.main-market .table-row .country-name .team-name b,
.reference-market-pane__name .team-name,
.reference-market-pane__name .team-name b {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #333 !important;
}

/* --- Header Back/Lay labels: #333 text (D247 measured) --- */
.main-market .table-header .back.box-1 b,
.main-market .table-header .lay.box-1 b,
.reference-market-header-cell {
  color: #333 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

/* --- Reference-market per-pane limits: small, centered (D247 fancy-min-max-box) --- */
.reference-market-pane__limits {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  color: #555 !important;
  padding: 2px 4px !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

/* --- Reference-market odd: fs16 weight400 (D247 measured) --- */
.reference-market-quote .odd {
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
}

/* --- Parity round 2: exact row heights + volume font (fixes specificity) --- */
.reference-market-grid__row {
  min-height: 34px !important;
  height: 34px !important;
}
.reference-market-pane {
  min-height: 34px !important;
  height: 34px !important;
}
.reference-market-pane__name {
  padding: 0 4px !important;
}
.reference-market-quote {
  min-height: 34px !important;
  height: 34px !important;
  padding: 2px 4px !important;
}
.reference-market-quote .odd {
  line-height: 1.05 !important;
}
.main-market .table-row .box-1 .market-volume,
.reference-market-pane .market-volume {
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.1 !important;
}

/* ============================================================
   15. MOBILE PARITY (measured against D247 at 390px):
   - Exchange ladder (MATCH_ODDS/Bookmaker): name 28% + 6 x 12% (D247: 109 + 6 x 47)
   - Fancy markets (Normal/fancy1/meter/oddeven): name 60% + 20% + 20% (D247: 233 + 78 + 78)
   - Back-only (khado): name 80% + back 20%
   ============================================================ */
@media (max-width: 767.98px) {
  /* Exchange ladder rows + header */
  .exchange-market .table-row .country-name,
  .exchange-market .table-header .country-name {
    width: 28% !important;
    min-width: 28% !important;
    max-width: 28% !important;
    flex: 0 0 28% !important;
  }

  .exchange-market .table-row [class*="back"],
  .exchange-market .table-row [class*="lay"],
  .exchange-market .table-header [class*="back"],
  .exchange-market .table-header [class*="lay"],
  .exchange-market .table-header .box-1 {
    width: 12% !important;
    min-width: 12% !important;
    max-width: 12% !important;
    flex: 0 0 12% !important;
  }

  /* Back/Lay label boxes must match the 12% ladder cells (beats older 17.5% rule) */
  .main-market .exchange-market .table-header .back.box-1,
  .main-market .exchange-market .table-header .lay.box-1 {
    width: 12% !important;
    min-width: 12% !important;
    max-width: 12% !important;
    flex: 0 0 12% !important;
  }

  /* Suspended overlay covers only the odds columns */
  .exchange-market .table-row.suspended::after {
    left: 28% !important;
  }

  /* Fancy markets rows + header */
  .fancy-market-type .table-row .country-name,
  .fancy-market-type .table-header .country-name {
    width: 60% !important;
    min-width: 60% !important;
    max-width: 60% !important;
    flex: 0 0 60% !important;
  }

  .fancy-market-type .table-row .back,
  .fancy-market-type .table-row .lay,
  .fancy-market-type .table-header .back,
  .fancy-market-type .table-header .lay {
    width: 20% !important;
    min-width: 20% !important;
    max-width: 20% !important;
    flex: 0 0 20% !important;
  }

  /* Empty ladder cells hidden on fancy rows (D247 mobile shows only 2 cells) */
  .fancy-market-type .table-row .back2,
  .fancy-market-type .table-row .back1,
  .fancy-market-type .table-row .lay1,
  .fancy-market-type .table-row .lay2 {
    display: none !important;
  }

  /* Back-only (khado): name 80% + back 20% */
  .fancy-market-type--back-only .table-row .country-name,
  .fancy-market-type--back-only .table-header .country-name {
    width: 80% !important;
    min-width: 80% !important;
    max-width: 80% !important;
    flex: 0 0 80% !important;
  }

  .fancy-market-type .table-row.suspended::after {
    left: 60% !important;
  }
}

/* ============================================================
   D247 parity round 3 - desktop MATCH_ODDS/Bookmaker header grid
   Problem: header Back/Lay boxes were forced to 10.25% (~76px)
   instead of the 60px ladder cells below them. That widened the
   two label boxes and shrank the name column (347px vs 378px),
   shifting Back/Lay off their columns. Force the labels to the
   same 60px as the ladder cells so the grid columns align.
   ============================================================ */
@media (min-width: 769px) {
  .main-market .table-header .back.box-1,
  .main-market .table-header .lay.box-1 {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    flex: 0 0 60px !important;
  }
}

/* Reference-market No/Yes header cells: full 28px height like D247
   (mobile was collapsing the colored header boxes to 24px) */
.reference-market-header-cell {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
}


/* ============================================================
   19. REFERENCE/EXCHANGE HEADER + SEPARATOR PARITY
   (live-measured against D247, match 812604921)
   Root causes fixed here:
   - D247 fancy-market header labels (No/Yes/Back/Lay) are 16px
     BOLD #333; we rendered them 12px/400 -> labels looked
     small/broken vs the cells below.
   - D247 row names in fancy markets are 14px and NEVER wrap
     (single line + ellipsis); ours were 12px and wrapped.
   - D247 draws each row separator on the OUTER wrapper in
     #c7c8ca so the line visibly crosses the coloured cells;
     ours sat on the pane border-box where the 34px opaque
     quote cells overpainted it -> line vanished inside odds.
   - D247 header rows are 28px on desktop AND mobile; ladder
     header 24px and mobile fancy headers were 24px.
   - D247 rows have no 4px gap; 1px separator instead.
   ============================================================ */

/* ---- Reference market (Normal/fancy1/khado/meter/oddeven) ---- */

/* Row separator: move to the row wrapper, D247 colour, drawn
   BELOW the panes so no cell can cover it (row auto-height). */
.reference-market-grid__row {
  border-bottom: 1px solid #c7c8ca !important;
  height: auto !important;
  min-height: 0 !important;
  margin-bottom: 0 !important;
}
.reference-market-pane {
  border-bottom: none !important;
}
/* line under the header row (D247 .market-header border) */
.reference-market-grid__header {
  border-bottom: 1px solid #c7c8ca !important;
}

/* D247 header labels: 16px bold #333 in 28px cells */
.reference-market-header-cell b {
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #333 !important;
  text-transform: none !important;
}
.reference-market-header-cell {
  font-size: 16px !important;
  font-weight: 700 !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
}
.reference-market-half-header {
  min-height: 28px !important;
}

/* D247 fancy row names: 14px normal, single-line + ellipsis */
.reference-market-pane__name .team-name,
.reference-market-pane__name .team-name b {
  font-size: 14px !important;
  font-weight: 400 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
  max-width: 100% !important;
}

/* D247 fancy odds: 16px bold (No/Yes/Back/Lay values) */
.reference-market-quote .odd {
  font-weight: 700 !important;
}

/* ---- Exchange ladder (MATCH_ODDS / Bookmaker) ---- */

/* Separators: D247 colour on the row, no 4px gap, line visible
   below the 34px cells (row sizes to content). */
.main-market .table-row {
  border-bottom: 1px solid #c7c8ca !important;
  margin-bottom: 0 !important;
  height: auto !important;
}
.main-market .table-header {
  border-bottom: 1px solid #c7c8ca !important;
}

/* ---- Mobile (<=768): D247 measured header 28px, labels stay
   readable, rows uniform 34px, no gap, names single-line ---- */
@media (max-width: 768px) {
  .table-header {
    height: auto !important;
    min-height: 28px !important;
  }
  .table-header .country-name,
  .table-header .back.box-1,
  .table-header .lay.box-1,
  .table-header .back,
  .table-header .lay {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
  .table-header .back b,
  .table-header .lay b {
    font-size: 13px !important;
    font-weight: 700 !important;
  }
  .fancy-market-type .table-row,
  .main-market .table-row {
    margin-bottom: 0 !important;
    border-bottom: 1px solid #c7c8ca !important;
    height: auto !important;
    min-height: 34px !important;
  }
  .fancy-market-type .table-row .country-name,
  .fancy-market-type .table-row .back,
  .fancy-market-type .table-row .back1,
  .fancy-market-type .table-row .back2,
  .fancy-market-type .table-row .lay,
  .fancy-market-type .table-row .lay1,
  .fancy-market-type .table-row .lay2,
  .main-market .table-row .country-name,
  .main-market .table-row .back,
  .main-market .table-row .lay {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
  }
  .fancy-market-type .table-row .country-name .team-name b,
  .main-market .table-row .country-name .team-name b {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
  }
}


/* ---- Desktop exchange ladder header: 28px, 12px bold labels
   (D247 measured: ladder Back/Lay = 12px/700, header 28px) ---- */
@media (min-width: 769px) {
  .main-market .table-header {
    min-height: 28px !important;
    height: auto !important;
  }
  .main-market .table-header .country-name,
  .main-market .table-header .back.box-1,
  .main-market .table-header .lay.box-1 {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
  }
  .main-market .table-header .back.box-1 b,
  .main-market .table-header .lay.box-1 b {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #333 !important;
  }
}


/* ---- Mobile label text parity (D247 measured @390px):
   fancy No/Yes/Back/Lay = 16px/700/#333, ladder = 12px/700 ---- */
@media (max-width: 768px) {
  .table-header .lay b,
  .table-header .back b {
    color: #333 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }
  .main-market .table-header .back.box-1 b,
  .main-market .table-header .lay.box-1 b {
    font-size: 12px !important;
    font-weight: 700 !important;
  }
}


/* ============================================================
   20. HEADER LABEL 1px WHITE INSET FIX
   style.css gives every reference header cell
   border-left: 1px solid #fff -> each No/Yes/Back/Lay label
   painted 59px (not 60) and a white hairline appeared between
   the two label boxes. D247 has no white gap: its header cells
   sit flush (data cells already had the white border removed
   on desktop). Remove it on the header row so labels fill the
   full 60px/78px track exactly like the cells below.
   ============================================================ */
.reference-market-grid__header .reference-market-pane__name,
.reference-market-grid__header .reference-market-header-cell,
.reference-market-grid__header .reference-market-pane__limits {
  border-left: none !important;
}
/* also clear stray white borders on header-only rows of any market */
.reference-market-half-header > div {
  border-left: none !important;
}

/* ============================================================
   21. VIRTUAL CRICKET (E-MATCH) LAYOUT — D247/Tridev parity
   Virtual E-matches render with a dedicated compact layout:
   ball-of-match markets as name+single-back grids (3 pairs/row),
   Match Result / EvenOdd as side-by-side single-Back tables.
   ============================================================ */
.virtual-markets {
  width: 100%;
}

/* Market block */
.virtual-market {
  margin-bottom: 10px;
  border: 1px solid #d9d9d9;
  background: #fff;
}

/* Title bar (dark blue, D247 style) */
.virtual-market__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1c3f94;
  color: #fff;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  min-height: 32px;
}
.virtual-market__title-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.virtual-market__title-max {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  padding-left: 8px;
}
.virtual-market__title-back {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  padding-left: 8px;
}

/* Ball-of-match compact grid: 3 name+back pairs per row */
.virtual-ball-grid__row {
  display: flex;
  width: 100%;
}
.virtual-ball-grid__pair {
  display: flex;
  flex: 1 1 0;
  border-right: 1px solid #d9d9d9;
  border-bottom: 1px solid #d9d9d9;
}
.virtual-ball-grid__pair:last-child {
  border-right: none;
}
.virtual-runner-name {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  background: #f0f2f5;
  min-width: 0;
}
.virtual-runner-name .team-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.virtual-back-cell {
  flex: 0 0 74px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #72bbef;
  color: #fff;
  cursor: pointer;
  padding: 4px 2px;
  min-height: 36px;
  text-align: center;
}
.virtual-back-cell .odd {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
}
.virtual-back-cell .market-volume {
  font-size: 11px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.85);
}
.virtual-back-cell--suspended {
  background: #f0f2f5;
  cursor: default;
}
.virtual-suspended-text {
  color: #e02424;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Yellow flash on odds change (D247 parity) */
.virtual-back-cell--blink {
  animation: virtual-odds-flash 400ms ease-out !important;
}
@keyframes virtual-odds-flash {
  0% { background-color: #ffc01a !important; }
  60% { background-color: #ffc01a !important; }
  100% { background-color: #72bbef !important; }
}

/* Match Result / EvenOdd side-by-side single-column tables */
.virtual-market-pair {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}
.virtual-market-pair__column {
  flex: 1 1 0;
  min-width: 0;
}
.virtual-market-pair__column .virtual-market {
  margin-bottom: 0;
  height: 100%;
}
.virtual-market__limits {
  background: #f0f2f5;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #d9d9d9;
}
.virtual-single-column__row {
  display: flex;
  border-bottom: 1px solid #d9d9d9;
}
.virtual-single-column__row:last-child {
  border-bottom: none;
}
.virtual-single-column__row .virtual-runner-name {
  justify-content: flex-start;
  padding: 6px 10px;
}
.virtual-single-column__row .virtual-back-cell {
  flex: 0 0 90px;
  min-height: 38px;
}

/* Responsive: stack pairs on narrow screens */
@media (max-width: 768px) {
  .virtual-market-pair {
    flex-direction: column;
    gap: 10px;
  }
  .virtual-back-cell {
    flex: 0 0 64px;
  }
  .virtual-single-column__row .virtual-back-cell {
    flex: 0 0 80px;
  }
  .virtual-market__title {
    font-size: 13px;
    padding: 5px 8px;
  }
}

/* ============================================================
   Virtual cricket (E-match) — tridev/d247 style scoreboard strip
   + plain casino-style stream player
   ============================================================ */
.virtual-scoreboard {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 3px;
  margin-bottom: 10px;
  min-height: 84px;
  overflow: hidden;
}
.virtual-scoreboard__col {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.virtual-scoreboard__team.is-active {
  background: rgba(14, 156, 74, 0.06);
}
.virtual-scoreboard__center {
  flex: 1.35 1 0;
  background: #fafbfc;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
}
.virtual-scoreboard__score {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  color: #2b2b2b;
}
.virtual-scoreboard__team.is-active .virtual-scoreboard__score {
  color: #0e9c4a;
}
.virtual-scoreboard__name {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.virtual-scoreboard__status {
  font-size: 14px;
  font-weight: 800;
  color: #f57c00;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.virtual-scoreboard__commentary {
  font-size: 11px;
  color: #666;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.virtual-scoreboard__balls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.virtual-scoreboard__ball {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
/* Plain casino-style player: no card chrome, black stage, directly above markets */
.virtual-stream {
  width: 100%;
  background: #000;
  margin-bottom: 10px;
  line-height: 0;
}
@media (max-width: 768px) {
  .virtual-scoreboard__score {
    font-size: 18px;
  }
  .virtual-scoreboard__col {
    padding: 6px 8px;
  }
  .virtual-scoreboard__status {
    font-size: 12px;
  }
}

/* ===================================================================
   d247 parity — RACING COUPON (/match/10, /match/65)
   -------------------------------------------------------------------
   The racing coupon is a country tab strip plus one row per VENUE with that
   venue's race times as chips, not the two-sided match card. Every number
   below was measured off d247's live DOM (see docs/racing-layout-parity.md §2):

   desktop  row 1312x47 (pad `6px 8px 1px`), venue cell 400px, chip 55x34
            (pad `5px 10px`, bg #cccccc, 16px/24px, radius 4px)
   mobile   row h70 (pad 0), venue strip 100% (bg #f7f7f7, pad 5px,
            margin-bottom 5px), chip 47x28 (12px/18px)
   =================================================================== */

.bet-table.horse-table {
  background-color: #f7f7f7;
}

.horse-table .horse-tabs {
  width: 100%;
  border-bottom: 1px solid #c7c8ca;
}

.horse-table .bet-table-row {
  padding: 6px 8px 1px 8px;
  background-color: #f2f2f2;
}

/* Venue cell: fixed 400px gutter, icon then venue name, left aligned —
   d247 overrides the coupon's 64% / space-between here. */
.horse-table .bet-nation-name {
  width: 400px;
  padding: 0 5px;
  justify-content: flex-start;
  color: #333;
}

.horse-table .bet-nation-name .bet-nation-game-name {
  max-width: 100%;
  color: #333;
}

.horse-table .horse-time-detail {
  width: calc(100% - 400px);
  padding: 0;
}

.bet-table.horse-table .horse-time-detail a {
  display: flex;
  text-decoration: none;
}

.bet-table.horse-table .horse-time-detail span {
  display: inline-block;
  background: #cccccc;
  color: #000;
  padding: 5px 10px;
  margin: 0 5px 5px 0;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  cursor: pointer;
  position: relative;
}

@media (max-width: 768px) {
  .horse-table .bet-table-row {
    padding: 0;
  }

  /* Mobile: the venue takes its own full-width strip above the chips. */
  .horse-table .bet-nation-name {
    width: 100%;
    background: #f7f7f7;
    padding: 5px;
    margin-bottom: 5px;
  }

  .horse-table .horse-time-detail {
    width: 100%;
    padding: 0;
  }

  .bet-table.horse-table .horse-time-detail a {
    display: flex;
  }

  .bet-table.horse-table .horse-time-detail span {
    padding: 5px 10px;
    font-size: 12px;
    line-height: 18px;
  }
}

/* d247 keeps the horse-tab geometry identical on mobile — measured 50x32 with
   pad `8px 16px` and a 16px line-height at 390px, same as desktop. Our theme's
   mobile nav-tabs rule renders 43x45 with 13px padding, so pin the strip. */
.horse-table .horse-tabs .nav-link {
  padding: 8px 16px;
  line-height: 16px;
  font-size: 16px;
}

@media (min-width: 769px) {
  /* d247's coupon row is 24px; only the desktop row inherits it (mobile keeps
     the theme's 18px, which the venue strip and chips set themselves anyway). */
  .horse-table .bet-table-row {
    line-height: 24px;
  }
}

/* The template turns every .nav-tabs strip into a table
   (`style.css:1349  .nav-tabs .nav-item { display: table-cell }`), which
   stretches the horse tabs to 36px tall. d247 renders them as plain bootstrap
   nav-tabs items — 50x32, `display: block` — so scope the strip back to flex. */
.horse-table .horse-tabs {
  display: flex;
  flex-wrap: wrap;
}

.horse-table .horse-tabs .nav-item {
  display: block;
  height: auto;
  margin: 0;
}

.horse-table .horse-tabs .nav-link {
  height: auto;
  min-height: 0;
}

/* Explicit height: with `height: auto` the link resolved to 36px on mobile
   (d247 renders 50x32) even though its padding+line-height sum to 32. The
   content box is exactly 16px here, so a fixed 32px cannot clip. */
.horse-table .horse-tabs .nav-link {
  height: 32px;
}

/* ==========================================================================
   d247 GAME MARKET GRID — sports other than cricket
   --------------------------------------------------------------------------
   d247 hands every market one of its `.market-N` templates and lets a wrapping
   flex container pack the line; the pairing is never decided in JS. That is why
   the same page shows one market per row, three per row, or a single narrow
   market stretched to full width — all from the same rule. Measured against 144
   markets on d247 (football, tennis, table tennis, basketball, volleyball):

     6 quotes (3 back + 3 lay) -> market-4   min-width 100%    38/38 samples
     2 quotes (1 back + 1 lay) -> market-2   min-width 33.33%  92/92 samples
        an 860px row therefore holds two of them at 428px, or three at 284px,
        and one left alone on its line grows to the full 860px
     1 quote per selection, several selections -> market-1: one full-width block
        whose selections tile 3-across (287px items, 38px tall)

   Cell geometry is d247's own model: a fixed 80px odds box with the name column
   taking the remainder (`calc(100% - 160px)` on a 2-quote market, `- 480px` on a
   6-quote one). Percentages cannot express that once a market is only ~287px
   wide, so the grid switches to fixed boxes.

   Scoped to `#root .game-market-grid`, which the React app only puts on the
   markets container for non-cricket sports — cricket, racing and e-games are
   untouched. `#root` is used purely to outrank the legacy `!important` theme.
   ========================================================================== */
#root .game-market-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  align-content: flex-start !important;
}

#root .game-market-grid > div {
  margin-left: 2px;
  margin-right: 2px;
  flex: 1 1 0%;
  min-width: 0;
}

/* Template widths — only the two shapes d247 was measured on. Anything else
   keeps the full-width default, which is what we rendered before. */
#root .game-market-grid > .market-w-full {
  min-width: calc(100% - 4px) !important;
  max-width: calc(100% - 4px) !important;
}

#root .game-market-grid > .market-w-third {
  min-width: calc(33.33% - 4px) !important;
  max-width: calc(100% - 4px) !important;
}

/* d247's `market-11`: the same 2-quote shape as `market-2` but a 50% floor, so
   two share the line instead of three. Used for the tennis game-level markets. */
#root .game-market-grid > .market-w-half {
  min-width: calc(50% - 4px) !important;
  max-width: calc(100% - 4px) !important;
}

/* d247's market-1 is a full-width block whose selections tile 3-across; the
   tile width is a share of that block, so the block itself must stay 100%. */
#root .game-market-grid > .market-w-items {
  min-width: calc(100% - 4px) !important;
  max-width: calc(100% - 4px) !important;
}

#root .game-market-grid .table-header,
#root .game-market-grid .table-row {
  display: flex !important;
  flex-wrap: nowrap !important;
}

/* Name column absorbs whatever the fixed quote boxes leave. */
#root .game-market-grid .table-header .country-name,
#root .game-market-grid .table-row .country-name {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}

#root .game-market-grid .table-row .box-1,
#root .game-market-grid .table-row .box-2,
#root .game-market-grid .table-row .box-3,
#root .game-market-grid .table-row .box-6,
#root .game-market-grid .table-row [class*='back'],
#root .game-market-grid .table-row [class*='lay'],
#root .game-market-grid .table-header .box-1,
#root .game-market-grid .table-header .box-2,
#root .game-market-grid .table-header .box-3,
#root .game-market-grid .table-header .box-6,
#root .game-market-grid .table-header [class*='back'],
#root .game-market-grid .table-header [class*='lay'] {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

/* The suspended band covers the odds area only. That area is now a fixed 80px
   per column — which is exactly how d247 sizes its per-template band
   (`.market-2 .suspended-row::after { width: 160px }`). */
#root .game-market-grid .table-row.suspended::after {
  left: auto !important;
  right: 0 !important;
  width: calc(var(--game-quotes, 6) * 80px) !important;
}

/* d247 market-1: a back-only market with several selections tiles them 3-across
   inside a single row instead of stacking one full-width row per selection.

   NOT scoped to `.game-market-grid`: d247 does not collapse this family on
   mobile — its `@media (max-width: 767px)` block keeps `.market-1` full width but
   drops the tiles to `min-width: 50%`, measured at 390px as tiles [2,2,2] of
   195px with a 51px odds box. So the row exists at every viewport and only the
   basis changes. `.market-items-row` / `.market-1-item` are emitted solely by
   the tiled branch, which is itself gated on `isGameMarketGrid()` (sportId !== 4),
   so this scope can never reach cricket, racing or the virtual games. */
#root .market-items-row.market-items-row {
  display: flex !important;
  flex-wrap: wrap !important;
}

#root .market-items-row.market-items-row .market-1-item {
  position: relative;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  /* Basis is a share of the row, never the name's text width — with a
     content-driven basis long selection names push the tile past a third and
     the row drops to two per line instead of d247's three. */
  flex: 1 1 calc(33.33% - 8px);
  min-width: calc(33.33% - 8px);
  max-width: 50%;
  min-height: 34px;
  padding: 2px 0 2px 8px;
  margin-bottom: 2px;
  overflow: hidden;
}

#root .market-items-row.market-items-row .market-1-item .team-name {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#root .market-items-row.market-items-row .market-1-item .team-name b {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #333 !important;
}

/* A single suspended selection inside a tile row keeps the same dark band, drawn
   over its own tile rather than across the whole row. */
#root .market-1-item.suspended::after {
  content: attr(data-title);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(55, 54, 54, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  pointer-events: none;
  z-index: 2;
}

/* d247 collapses every template to one full-width column below 768px
   (responsive.css:94 — `min-width: 100%` for .market-1 … .market-13). Our
   small-screen layout is already a single column, so keep the grid inert there
   and leave the existing mobile rules in charge of cell geometry. */
@media (max-width: 767px) {
  #root .game-market-grid {
    display: block !important;
  }

  #root .game-market-grid > .market-w-full,
  #root .game-market-grid > .market-w-third,
  #root .game-market-grid > .market-w-half,
  #root .game-market-grid > .market-w-items {
    min-width: 100% !important;
    max-width: 100% !important;
    margin-left: 0;
    margin-right: 0;
  }

  /* The one family d247 does NOT flatten: below 768px it keeps `.market-1` full
     width but sets `.market-1 .market-row .market-1-item { min-width: 50% }`, so
     the selections still tile two per line, and gives the tile's odds box
     `.market-odd-box { width: 30% }` (its 2-quote templates instead use 40% for
     the box pair). Both numbers are read straight off d247's own stylesheet, and
     the 30% overrides the legacy `box-1`/`box-2` percentage classes the tile cell
     still carries from the shared renderer. */
  #root .market-items-row.market-items-row .market-1-item {
    flex: 1 1 calc(50% - 6px);
    min-width: calc(50% - 6px);
    max-width: 50%;
  }

  #root .market-items-row.market-items-row .market-1-item .box-1,
  #root .market-items-row.market-items-row .market-1-item .box-2 {
    width: 30% !important;
    min-width: 30% !important;
    max-width: 30% !important;
  }
}

/* ============================================================================
   Site RULES dialog (the header's `.rules-link`) — geometry of the reference's
   own dialog, measured on tridev 2026-10-27 at 1600x1000:

     .modal-dialog.modal-xl   1140x989, `margin: 10px 230px` (1vh top offset)
     .modal-header            58px, `padding: 10px`, theme blue, white text
     .modal-title.h4          20px / 700
     .rules-langualge         flex-1, right-aligned flag dropdown (English)
     .modal-body              860px tall with `overflow-y: auto` and 2573px of
                              content inside — the dialog is viewport-tall and
                              the body scrolls, so the header stays put

   The width, header and body layout of this dialog were already ported for the
   casino pages (casino-markets-rules-v9.css, `.rules-modal …`); what is added
   here is only the part specific to the SITE dialog: a content box that fills
   the viewport and scrolls internally. Without it the whole overlay scrolled
   and the header left the screen, which the reference never does.
   ============================================================================ */
.site-rules-modal .modal-content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 20px);
  /* style.css sets `margin-top: 5%` on every `.modal-content`; the reference's
     rules dialog has none. */
  margin-top: 0;
}

.site-rules-modal .modal-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

/* Below the sidebar breakpoint the reference stacks the sport rail above the
   pane and lets the body scroll as one column. */
@media only screen and (max-width: 767px) {
  .site-rules-modal .modal-content {
    height: calc(100vh - 10px);
  }

  .site-rules-modal .modal-dialog,
  .site-rules-modal.modal-dialog {
    margin: 5px auto;
  }
}

/* ---- 21. VEIL WIDTH FOLLOWS THE MARKET'S REAL QUOTE COLUMNS ----
   A 1+1 market (Bookmaker 2, Tied Match) has two odds cells, but the veil was
   a flat 60% of the row: it started inside the runner name and covered blank
   row space. Rows now carry --quote-cols (see match-odds.tsx), and the veil is
   exactly the odds area: N x 60px on desktop, N x 12% on phones. Scoped to rows
   that carry the variable, so fancy rows keep their own 60% rule. */
/* Exchange ladders only: a fancy row (Normal, Over By Over) also carries the
   variable, but its two cells are 78px/20% wide, not 60px/12% — its own rules
   below keep handling those rows. */
#root .exchange-market .table-row.suspended::after {
  left: auto !important;
  right: 0 !important;
  width: calc(var(--quote-cols, 6) * 11.67%) !important;
}

@media (min-width: 769px) {
  #root .exchange-market .table-row.suspended::after {
    width: calc(var(--quote-cols, 6) * 60px) !important;
  }
}

@media (max-width: 767.98px) {
  /* Fancy rows on phones: name 60% + No/Yes at 20% each, so the veil is the
     right 40% of the row. The old flat 60% started inside the runner name and
     clipped "BALL RUNNING" at the right edge. */
  #root .main-market .table-row.suspended::after {
    left: auto !important;
    right: 0 !important;
    width: calc(var(--quote-cols, 2) * 20%) !important;
  }

  /* Exchange ladders: 12% per cell. Declared after the fancy rule so it wins
     the specificity tie on ladder rows. */
  #root .exchange-market .table-row.suspended::after {
    width: calc(var(--quote-cols, 6) * 12%) !important;
  }

  /* 1+1 ladders (Bookmaker 2, Tied Match) on phones: two wide cells at 20%
     each, like the fancy rows — a 12% cell left two thirds of the row blank. */
  #root .exchange-market[data-cols="2"] .table-header .country-name,
  #root .exchange-market[data-cols="2"] .table-row .country-name {
    width: 60% !important;
    min-width: 60% !important;
    max-width: 60% !important;
    flex: 0 0 60% !important;
  }

  #root .exchange-market[data-cols="2"] .table-header .back,
  #root .exchange-market[data-cols="2"] .table-header .lay,
  #root .exchange-market[data-cols="2"] .table-row [class*="back"],
  #root .exchange-market[data-cols="2"] .table-row [class*="lay"] {
    width: 20% !important;
    min-width: 20% !important;
    max-width: 20% !important;
    flex: 0 0 20% !important;
  }

  #root .exchange-market[data-cols="2"] .table-row.suspended::after {
    width: 40% !important;
  }
}

/* ---- 22. PROVIDER RUNNER NOTE (`rem`) ----
   D247/tridev print the provider's per-runner note beside the name: a short one
   ("Badla") as a tag on the name line, a sentence ("Lunch Favourite is ** MR W **")
   as a second line under it. Nothing is derived locally — no note, no marker. */
.runner-rem {
  font-size: 9px;
  line-height: 1.1;
  color: #6b6b6b;
  font-weight: 400;
  text-transform: none;
}

.runner-rem--tag {
  float: right;
  margin-left: 6px;
}

/* Tridev's Badla tag: an absolutely positioned gray chip at the bottom-right
   of the runner-name cell. The long provider note is rendered as a separate
   .market-remark row below the quote row, in the same teal as the reference. */
.country-name {
  position: relative;
}

.country-name .badla-icon {
  position: absolute;
  right: 5px;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: #dbdbdb;
  color: #444;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
  pointer-events: none;
}

/* Tridev's back-only suspension: veil and padlock the quote cell only, leaving
   the runner name readable. This is intentionally scoped to the odds rows so
   the same class can keep its casino meaning elsewhere. */
.table-row .suspended-box,
.market-1-item .suspended-box {
  position: relative;
  pointer-events: none;
  cursor: none;
}

.table-row .suspended-box::before,
.market-1-item .suspended-box::before {
  background-image: url('../img/icons/lock.svg');
  background-size: 17px 17px;
  background-repeat: no-repeat;
  background-position: center;
  filter: invert(1);
  -webkit-filter: invert(1);
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.table-row .suspended-box::after,
.market-1-item .suspended-box::after {
  content: '';
  background-color: #373636d6;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: not-allowed;
  pointer-events: none;
}

/* Keep the inline P/L preview inside the runner-name column. The runner name
   was forced to 100% width while the P/L was floated, so a selected stake made
   the green/red numbers run under the adjacent Back/Lay cells. Stack the name
   and preview in the 35% (30% mobile) cell and clip them there. */
.main-market .table-row .country-name {
  flex-wrap: wrap !important;
  align-content: center !important;
}

.main-market .table-row .country-name .team-name {
  flex: 1 1 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.main-market .table-row .country-name p {
  display: flex !important;
  flex: 1 1 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  gap: 4px !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.main-market .table-row .country-name p:empty {
  display: none !important;
}

.main-market .table-row .country-name p .runner-pnl,
.main-market .table-row .country-name p .float-right {
  float: none !important;
  display: inline-block !important;
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

/* The compact cricket boards (Normal/fancy1/khado/meter/oddeven) use the
   reference pane, not the generic runner row. Put the selected runner's P/L on
   its own line inside the name cell so it cannot reach the No/Yes quotes. */
.reference-market-pane__name .team-name {
  display: flex !important;
  flex-wrap: wrap !important;
  align-content: center !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.reference-market-pane__name .team-name > b {
  flex: 1 1 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.reference-market-pane__name .team-name .runner-pnl {
  float: none !important;
  display: block !important;
  flex: 1 1 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
}

/* Session/fancy list: show the selected selection's preview beside its name. */
.fancy-tripple .country-name p .runner-pnl {
  float: none !important;
  display: inline-block !important;
  margin-left: 8px !important;
  font-size: 11px !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

/* ==========================================================================
   Reference template pass: d247 `market-10` (khado) and `market-9` (innings
   line markets). These are template rules, not per-match fixes:
   - market-10 is a full-width, one-runner-per-row back-only ladder
     (name flex + 80px Back + 80px Min/Max).
   - market-9 is a half-width back-only ladder; consecutive line markets share
     an equal row. The generic renderer supplies the row, this supplies the
     template geometry.
   ========================================================================== */
#root .khado-reference-market .market-title {
  min-height: 26px !important;
  height: 26px !important;
  padding: 4px 6px !important;
  background: rgba(4, 112, 165, 0.85) !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 18px !important;
  text-align: left !important;
}

#root .khado-reference-market .reference-market-grid__header {
  grid-template-columns: minmax(0, 1fr) !important;
}

#root .khado-reference-market .reference-market-grid__row {
  grid-template-columns: minmax(0, 1fr) !important;
}

#root .khado-reference-market .reference-market-half-header--back-only,
#root .khado-reference-market .reference-market-pane--back-only {
  grid-template-columns: minmax(0, 1fr) 80px 80px !important;
}

#root .khado-reference-market .reference-market-pane__limits,
#root .khado-reference-market .reference-market-pane__limits--header {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

#root .reference-market-pair--cricket-line {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 4px !important;
}

#root .reference-market-pair--cricket-line .reference-market-pair__column {
  min-width: 0 !important;
  overflow: hidden !important;
}

#root .cricket-line-market .market-title {
  min-height: 26px !important;
  height: 26px !important;
  padding: 4px 6px !important;
  background: rgba(4, 112, 165, 0.85) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 18px !important;
  text-align: left !important;
  text-transform: uppercase !important;
}

#root .cricket-line-market .table-header .country-name,
#root .cricket-line-market .table-row .country-name {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 1 1 auto !important;
}

#root .cricket-line-market .table-header .back,
#root .cricket-line-market .table-row .back,
#root .cricket-line-market .table-row .box-1,
#root .cricket-line-market .table-row .box-2,
#root .cricket-line-market .table-row .box-3 {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

/* d247 `market-2` + Bookmaker 2: the same 70/30 line as Bookmaker + Tied Match.
   Measured at 1600px: 601px (121 name + 6x80) beside 255px (95 name + 2x80).
   The previous 1fr/1fr pair gave both 50%, which was the remaining cricket
   mismatch on every match that carries a second bookmaker. */
#root .reference-market-pair--bookmaker2 {
  grid-template-columns: minmax(0, 70fr) minmax(0, 30fr) !important;
  gap: 4px !important;
}

#root
  .reference-market-pair--bookmaker2
  .reference-market-pair__column--bookmaker
  .country-name {
  width: calc(100% - 480px) !important;
  min-width: calc(100% - 480px) !important;
  max-width: calc(100% - 480px) !important;
  flex: 0 0 calc(100% - 480px) !important;
}

#root .reference-market-pair--bookmaker2 .reference-market-pair__column--bookmaker .box-1 {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

#root
  .reference-market-pair--bookmaker2
  .reference-market-pair__column--bookmaker2
  .country-name {
  width: calc(100% - 160px) !important;
  min-width: calc(100% - 160px) !important;
  max-width: calc(100% - 160px) !important;
  flex: 0 0 calc(100% - 160px) !important;
}

#root .reference-market-pair--bookmaker2 .reference-market-pair__column--bookmaker2 .box-1 {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  flex: 0 0 80px !important;
}

@media (max-width: 768px) {
  #root .reference-market-pair--bookmaker2 {
    grid-template-columns: 1fr !important;
  }
}

/* ---- Compact session ladder (Normal / Over By Over / oddeven …) ----
   Tridev prints one row per quote level, with the runner name and Min/Max on
   the first rung only. Each runner's rungs stay stacked inside its own half
   of the two-column grid, so the No/Yes columns keep lining up. */
.reference-market-pane-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.reference-market-pane-group > .reference-market-pane + .reference-market-pane {
  border-top: 1px solid #c7c8ca !important;
}

