:root {
  --bg: #0a1218;
  --panel: #121212;
  --card: #edf0f3;
  --card-soft: #f8fcff;
  --text: #01043a;
  --muted: #424b6b;
  --orange: #ff5b14;
  --orange-2: #ff8139;
  --green: #27ec8d;
  --cyan: #29f2ba;
  --danger: #ea442e;
  --win: #00c166;
  --header: #050505;
  --slip-bg: #f2f5fb;
  --accent-line: #edba40;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg) url("/casino/basketball/modules/FSEL/bin_prod/data/images/preload/backgrounds/main-bg.webp") center/cover fixed;
  font-family: "Roboto", "Segoe UI", sans-serif;
  color: #fff;
  overflow: hidden;
  user-select: none;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
}

.topbar {
  height: 64px;
  background: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand img.logo { height: 40px; }
.brand .sub {
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  text-transform: uppercase;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  position: relative;
  z-index: 110;
  overflow: visible;
}

.clock { font-size: 12px; opacity: .9; }
.balance {
  font-size: 14px;
  letter-spacing: .2px;
}

.exit-btn {
  border: 0;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 8px 14px;
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
}
.exit-btn:hover {
  background: var(--orange-2);
}

.help-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
}
.help-btn img {
  width: 26px;
  height: 26px;
  display: block;
  filter: brightness(0) saturate(100%) invert(72%) sepia(72%) saturate(1200%) hue-rotate(146deg) brightness(104%) contrast(101%);
}
.help-btn:hover { opacity: .85; }

.lang-switch { position: relative; z-index: 120; }
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 0;
  border-radius: 6px;
  background: #18222e;
  color: #fff;
  cursor: pointer;
}
.lang-btn img { width: 22px; height: 16px; object-fit: cover; border-radius: 2px; }
.lang-btn #lang-code { font-size: 12px; font-weight: 700; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  max-height: 280px;
  overflow: auto;
  min-width: 180px;
  background: #1a222c;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  z-index: 130;
}
.lang-menu.hide { display: none; }
.lang-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
}
.lang-item:hover, .lang-item.on { background: #243040; }
.lang-item img { width: 22px; height: 16px; object-fit: cover; }

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.7);
  padding: 16px;
}
.help-modal.hide { display: none; }
.help-modal-card {
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: #2f343b;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  overflow: hidden;
  color: #fff;
}
.help-modal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 14px;
  border-bottom: 1px solid #444;
}
.help-modal-head h2 { margin: 0; font-size: 16px; }
.help-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.help-modal-body {
  padding: 14px 16px;
  overflow: auto;
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
  color: #e8eef5;
}
.help-modal-body p { margin: 0 0 12px; }
.stats-footer { padding: 10px 16px; border-top: 1px solid #444; }
.stats-clear {
  background: #243545;
  border: 0;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}
.stats-row {
  padding: 8px 0;
  border-bottom: 1px solid #3a4048;
  font-size: 13px;
}
.stats-row .sub { opacity: .75; font-size: 12px; margin-top: 2px; }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  grid-template-areas: "main slip";
  gap: 10px;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

.main-col {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: rgba(0,0,0,.25);
  border-radius: 4px;
  overflow: hidden;
}

.day-bar {
  height: 50px;
  background: #edf0f3;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 18px;
  font-weight: 500;
  flex-shrink: 0;
}

.day-bar button {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  width: 40px;
  height: 40px;
}
.day-bar .prev { left: 8px; }
.day-bar .next { right: 8px; }

.match-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: rgba(10,18,24,.55);
  flex-shrink: 0;
}
.match-tabs-wrap .tab-nav {
  flex: 0 0 40px;
  height: 44px;
  border: 0;
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(31,41,90,.1);
}
.match-tabs-wrap .tab-nav:disabled {
  opacity: .35;
  cursor: default;
}
.match-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
}

.match-tab {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-family: "Roboto Condensed", sans-serif;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 5px rgba(31,41,90,.1);
}

.match-tab img { height: 26px; width: 26px; object-fit: contain; }
.match-tab .vs { font-size: 12px; opacity: .7; }
.match-tab.active {
  background: linear-gradient(90deg, #29f2ba, #27ec8d);
  color: #012018;
}
.match-tab .badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffc700;
  color: #111;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 800;
}

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 420px;
  height: 48vh;
  background: #0b1014 url("/casino/basketball/modules/FSEL/bin_prod/data/images/preload/backgrounds/content-bg.webp") center/cover;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: none;
}
.stage.playing video { display: block; }

.mute-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.45);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.preview-board {
  position: relative;
  z-index: 2;
  width: min(640px, 94%);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  text-align: center;
}

.team-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.team-block img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.45));
}
.team-block .name {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}
.team-block .pos {
  font-size: 12px;
  opacity: .85;
}
.team-block .pct {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(0,0,0,.35);
}
.form {
  display: flex;
  gap: 4px;
}
.form span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.form .W { background: var(--win); }
.form .L { background: var(--danger); }

.center-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.countdown {
  background: #fff;
  color: var(--text);
  border-radius: 20px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.countdown.urgent {
  background: var(--danger);
  color: #fff;
  animation: flicker 1s steps(1) infinite;
}
@keyframes flicker {
  50% { background: #fff; color: var(--danger); }
}
.h2h {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #dfe0e1;
}
.h2h div.win-left span:first-child,
.h2h div.win-right span:last-child { color: var(--green); }

.scoreboard {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 6;
  display: none;
  align-items: center;
  gap: 10px;
  background: #18191b;
  padding: 8px 14px;
  border-radius: 2px;
  min-width: 320px;
  justify-content: center;
}
.stage.playing .scoreboard { display: flex; }
.scoreboard img { height: 28px; width: 28px; object-fit: contain; }
.scoreboard .score {
  font-size: 22px;
  font-weight: 800;
  font-family: "Roboto Condensed", sans-serif;
  letter-spacing: 2px;
}
.scoreboard .meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 48px;
  font-size: 12px;
  line-height: 1.15;
  color: #1a0a00;
  background: linear-gradient(180deg, #ff5b14, #ff8139);
  padding: 5px 10px;
  border-radius: 2px;
  font-weight: 800;
}
.scoreboard .meta span:first-child {
  font-size: 14px;
}
.scoreboard .meta span:last-child {
  font-size: 10px;
}

.fulltime {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5,5,5,.55);
  backdrop-filter: blur(4px);
  gap: 18px;
}
.fulltime.show { display: flex; }
.fulltime h2 {
  color: var(--orange);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 #d32803, 0 6px 10px rgba(211,40,3,.4);
}
.fulltime .row {
  display: flex;
  align-items: center;
  gap: 40px;
}
.fulltime .team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.fulltime .team img { width: 120px; height: 120px; object-fit: contain; }
.fulltime .winner-tag {
  background: linear-gradient(90deg, #29f2ba, #27ec8d);
  color: #012018;
  font-weight: 800;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 2px;
}
.fulltime .final-score {
  font-size: 48px;
  font-weight: 900;
  background: #26282b;
  padding: 8px 28px;
  border-bottom: 4px solid var(--orange);
}

.markets {
  background: #cbd5e6;
  padding: 6px 8px 16px;
  flex: 1 1 auto;
  position: relative;
  z-index: 3;
  min-height: 220px;
  max-height: none;
  overflow-y: auto;
  padding-bottom: 20px;
}
.markets-head {
  display: flex;
  color: #fff;
  background: #1a2430;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px 6px 178px;
  gap: 8px;
}
.markets-head span { flex: 1; text-align: center; }

.market-row {
  display: grid;
  grid-template-columns: 168px 1fr 1fr;
  gap: 6px;
  align-items: center;
  background: #fff;
  margin-top: 4px;
  padding: 8px 8px 8px 10px;
  border-radius: 2px;
}
.market-row.active-match {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}
.pair {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  min-width: 0;
  padding-left: 2px;
  overflow: hidden;
}
.pair img { height: 22px; width: 22px; object-fit: contain; flex-shrink: 0; }
.pair span { flex-shrink: 0; }

.odds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.odd-btn {
  border: 1px solid #d4d8df;
  background: #f8faff;
  height: 36px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.odd-btn:hover:not(:disabled) {
  border-color: var(--orange);
  background: #fff4ec;
}
.odd-btn b { color: var(--text); font-size: 14px; }
.odd-btn.selected {
  background: #ff5b14 !important;
  color: #1a2430 !important;
  border-color: #e04e0f !important;
}
.odd-btn.selected b {
  color: #111827 !important;
  font-weight: 900;
}
.odd-btn:disabled { opacity: .45; cursor: default; }

.ticket {
  grid-area: slip;
  background: #121212;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-height: 0;
  align-self: start;
  overflow: hidden;
  color: #fff;
  transition: box-shadow .35s ease, border-color .35s ease;
}
.ticket.has-bets {
  border-color: rgba(21,216,23,.35);
  box-shadow: 0 0 0 1px rgba(21,216,23,.12);
}
.ticket-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: inherit;
}
.ticket-toggle:hover { background: rgba(255,255,255,.03); }
.ticket-toggle h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: .04em;
  flex: 1;
  font-weight: 700;
  color: #fff;
}
.ticket-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--orange);
  color: #111;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ticket-count.hide { display: none; }
.ticket-chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid #9aa;
  border-bottom: 2px solid #9aa;
  transform: rotate(45deg);
  transition: transform .35s ease;
  margin-top: -4px;
  flex-shrink: 0;
}
.ticket:not(.is-collapsed) .ticket-chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}
.ticket-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .45s cubic-bezier(.22,.61,.36,1);
}
.ticket:not(.is-collapsed) .ticket-panel {
  grid-template-rows: 1fr;
}
.ticket-panel-inner {
  overflow: hidden;
  min-height: 0;
  padding: 0 10px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s ease, transform .35s ease, padding .35s ease;
}
.ticket:not(.is-collapsed) .ticket-panel-inner {
  padding: 0 10px 10px;
  opacity: 1;
  transform: translateY(0);
}
.ticket-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}
.linkish {
  background: none;
  border: 0;
  color: var(--cyan);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.stake-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #9aa3b5;
}
.stake-row input {
  width: 72px;
  text-align: center;
  background: #0a1018;
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  border-radius: 4px;
  padding: 6px;
}
.stake-row button {
  width: 28px;
  height: 28px;
  background: #243545;
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.chips button {
  min-width: 48px;
  height: 32px;
  padding: 0 8px;
  background: #1a2836;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.chips button.active {
  background: #163018;
  border-color: var(--orange);
  color: #fff;
}
.slip-body {
  overflow: auto;
  min-height: 0;
  max-height: 0;
  transition: max-height .35s ease;
  background: transparent;
  position: relative;
}
.ticket:not(.is-collapsed) .slip-body {
  max-height: 160px;
  min-height: 48px;
}
.ticket.ticket--grow:not(.is-collapsed) .slip-body { max-height: 240px; }
.ticket.ticket--grow2:not(.is-collapsed) .slip-body { max-height: 320px; }
.slip-empty {
  color: var(--cyan);
  font-size: 13px;
  padding: 12px 4px;
  position: static;
  display: block;
}
.slip-item {
  background: #1a222c;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #fff;
  position: relative;
  animation: slipIn .28s ease;
}
@keyframes slipIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.slip-item .meta {
  font-size: 11px;
  color: #9aa3b5;
  margin-bottom: 4px;
}
.slip-item .sel {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.slip-item .est {
  color: var(--orange);
  font-size: 11px;
  text-align: right;
  margin-top: 4px;
}
.slip-item input {
  width: 78px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 2px;
  text-align: right;
  padding: 0 6px;
  font-weight: 700;
  margin-top: 6px;
  background: #0a1018;
  color: #fff;
}
.slip-item .remove {
  float: right;
  border: 0;
  background: transparent;
  color: #9aa3b5;
  cursor: pointer;
  font-size: 16px;
}
.ticket-totals {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 8px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.ticket-totals strong {
  float: right;
  color: var(--orange);
  font-size: 15px;
  font-weight: 800;
}
.submit-btn {
  width: 100%;
  margin-top: 10px;
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff5b14, #ff8139);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
}
.submit-btn:disabled,
.submit-btn.is-disabled {
  opacity: .5;
  cursor: default;
}
.submit-btn .sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  font-family: "Roboto Condensed", sans-serif;
  text-transform: none;
  opacity: .95;
}
.panel-head {
  min-height: 50px;
  background: #121212 url("/casino/basketball/modules/FSEL/bin_prod/data/images/preload/backgrounds/module-bg.webp") center/cover;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  font-size: 18px;
  font-weight: 500;
}
.panel-head .count {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--orange);
  color: #111;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matchday-bets {
  margin-top: 4px;
  background: #fff;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  max-height: 56px;
}
.md-list { max-height: 48px; overflow: auto; color: var(--text); }
.md-item {
  padding: 10px 12px;
  border-top: 1px solid #dfe0e1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.md-item .right { text-align: right; color: var(--orange); font-weight: 700; }
.md-item.won .right { color: var(--win); }
.md-item.lost .right { color: var(--danger); }

.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: rgba(255,255,255,.95);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  z-index: 50;
  display: none;
  font-weight: 600;
}
.toast.show { display: block; animation: slideIn .35s ease; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  body { overflow: auto; }
  #app { overflow: auto; height: auto; min-height: 100%; }
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "slip";
  }
  .ticket { width: 100%; }
  .stage { min-height: 420px; height: 50vh; }
  .team-block img { width: 80px; height: 80px; }
  .fulltime h2 { font-size: 28px; }
}

