/* LionSports Universe Baccarat — Dream444 visual parity (original CSS).
   No Dream444 proprietary assets or source. */
:root {
  --ub-page: #ededed;
  --ub-text: #212529;
  --ub-top: #000000;
  --ub-lobby: #ffcc2f;
  --ub-player-grad: linear-gradient(-180deg, #1285e2 0%, #0b5795 100%);
  --ub-banker-grad: linear-gradient(-180deg, #af2736 0%, #93212d 100%);
  --ub-tie-grad: linear-gradient(-180deg, #11b24b 0%, #1c6235 100%);
  --ub-lock: rgba(0, 0, 0, 0.6);
  /* Match Dream mobile-footer-menu link height (13.33333vw) + safe area.
     Floor at 74px so narrow viewports never under-reserve. */
  --ub-nav-space: max(74px, calc(13.33333vw + env(safe-area-inset-bottom, 0px)));
  --ub-lock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M17 8h-1V6a4 4 0 0 0-8 0v2H7a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zm-7-2a2 2 0 0 1 4 0v2h-4V6zm7 14H7V10h10v10z'/%3E%3C/svg%3E");
}

#lion-universe-baccarat-root {
  position: fixed;
  inset: 0 0 var(--ub-nav-space) 0;
  /* Below .mobile-footer-menu (z-index: 9999) so bottom nav stays clickable */
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: var(--ub-page);
  color: var(--ub-text);
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

#lion-universe-baccarat-root * {
  box-sizing: border-box;
}

/* —— Top chrome: sports event/fullmarket header look; casino controls kept —— */
.ub-top {
  --ub-header-bg: linear-gradient(-180deg, #323232 0, #0d0d0d 100%);
  --ub-header-text: #fff;
  --ub-header-exp: #ff0000;
  --ub-btn-bg: linear-gradient(-180deg, #323232 0, #0d0d0d 100%);
  --ub-btn-border: #0b1933;
  --ub-btn-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--ub-header-bg);
  color: var(--ub-header-text);
  min-height: 56px;
  height: 56px;
  font-family: Tahoma, Helvetica, sans-serif;
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  position: relative;
  z-index: 5;
}

.ub-top .ub-rules {
  flex: 0 0 auto;
  height: 36px;
  background: var(--ub-btn-bg);
  color: #fff;
  border: 1px solid var(--ub-btn-border);
  border-radius: 6px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 34px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--ub-btn-shadow);
}

.ub-top .ub-lobby {
  flex: 0 0 auto;
  height: 36px;
  background: linear-gradient(180deg, #ffd84d 0%, #ffb400 55%, #f0a000 100%);
  color: #111;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 36px;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.ub-top .ub-lobby:active {
  filter: brightness(0.95);
}

.ub-top .ub-bal-wrap {
  margin-left: auto;
  text-align: left;
  line-height: 1.2;
  min-width: 72px;
  padding-right: 4px;
  position: relative;
}

.ub-top .ub-bal,
.ub-top .ub-exp {
  margin: 0;
  display: block;
  font-family: inherit;
  white-space: nowrap;
}

.ub-top .ub-bal {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.ub-top .ub-bal strong {
  font-weight: 700;
}

.ub-top .ub-exp {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.ub-top .ub-exp #ub-exp-amt,
.ub-top .ub-exp-amt {
  color: var(--ub-header-exp);
}

.ub-top .ub-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-right: -2px;
}

/* Dream sports header loadingBalance — pulsing dots while refresh runs */
.ub-top .ub-loading-balance {
  display: none;
  align-items: center;
  justify-content: flex-start;
  min-height: 36px;
  min-width: 72px;
  margin-left: auto;
  padding-right: 4px;
}

.ub-top.is-refreshing .ub-bal-wrap {
  display: none;
}

.ub-top.is-refreshing .ub-loading-balance {
  display: inline-flex;
}

.ub-top .ub-loading-balance span {
  display: inline-block;
  vertical-align: middle;
  width: 0.2em;
  height: 0.2em;
  margin: 0.19em;
  background: #fff;
  border-radius: 0.6em;
  animation: ub-loading-balance 0.5s infinite alternate;
}

.ub-top .ub-loading-balance span:nth-of-type(2) {
  animation-delay: 0.1s;
}
.ub-top .ub-loading-balance span:nth-of-type(3) {
  animation-delay: 0.2s;
}
.ub-top .ub-loading-balance span:nth-of-type(4) {
  animation-delay: 0.3s;
}
.ub-top .ub-loading-balance span:nth-of-type(5) {
  animation-delay: 0.4s;
}
.ub-top .ub-loading-balance span:nth-of-type(6) {
  animation-delay: 0.5s;
}
.ub-top .ub-loading-balance span:nth-of-type(7) {
  animation-delay: 0.6s;
}

@keyframes ub-loading-balance {
  0% {
    width: 0.2em;
    height: 0.2em;
    opacity: 0;
  }
  50% {
    width: 0.4em;
    height: 0.4em;
    opacity: 0.5;
  }
  to {
    width: 0.6em;
    height: 0.6em;
    opacity: 1;
  }
}

/* Match sports .bet-refresh / .head-refresh button chrome */
.ub-top .ub-iconbtn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--ub-btn-border);
  background: var(--ub-btn-bg);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--ub-btn-shadow);
}

.ub-top .ub-iconbtn:active {
  filter: brightness(1.08);
}

.ub-top .ub-iconbtn.is-refreshing {
  pointer-events: none;
}

.ub-top .ub-iconbtn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.ub-top .ub-iconbtn svg.refresh-ico {
  fill: currentColor;
}

.ub-top .ub-iconbtn svg.openbets-ico {
  fill: currentColor;
  width: 20px;
  height: 20px;
  pointer-events: none;
  display: block;
}

.ub-top .ub-iconbtn.is-refreshing svg.refresh-ico {
  transform-origin: center;
  animation: ub-refresh-spin 0.75s linear infinite;
}

@keyframes ub-refresh-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 400px) {
  .ub-top {
    gap: 4px;
    padding: 4px 6px;
  }
  .ub-top .ub-lobby {
    padding: 0 8px;
    font-size: 11px;
  }
  .ub-top .ub-rules {
    padding: 0 8px;
  }
}

.ub-mark {
  position: absolute;
  bottom: 6px;
  right: 8px;
  z-index: 6;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  white-space: nowrap;
}

.ub-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ub-page);
}

/* —— Video —— */
.ub-video {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.ub-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ub-overlay {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  width: auto;
  max-width: 42%;
  min-width: 108px;
}

.ub-round {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  margin-bottom: 2px;
}

.ub-hands {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ub-hand h3 {
  margin: 0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.ub-cards {
  display: flex;
  gap: 2px;
}

.ub-cards img {
  width: 36px;
  height: auto;
  display: block;
  border-radius: 2px;
  background: #fff;
}

.ub-timer-wrap {
  /* Dream casino: top-right of video */
  position: absolute;
  top: 6px;
  right: 6px;
  left: auto;
  bottom: auto;
  transform: none;
  width: 42px;
  height: 42px;
  z-index: 3;
  pointer-events: none;
}

#ub-timer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

#ub-result-banner {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  place-items: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.35);
}

#ub-result-banner.show {
  display: grid;
}

.ub-result-card {
  min-width: 160px;
  padding: 14px 22px;
  border-radius: 8px;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  animation: ub-result-pop 0.35s ease-out;
}

.ub-result-card.P {
  background: linear-gradient(-180deg, #1285e2 0%, #0b5795 100%);
}
.ub-result-card.B {
  background: linear-gradient(-180deg, #af2736 0%, #93212d 100%);
}
.ub-result-card.T {
  background: linear-gradient(-180deg, #11b24b 0%, #1c6235 100%);
}

@keyframes ub-result-pop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.ub-toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--ub-nav-space) + 12px);
  transform: translateX(-50%);
  z-index: 20;
  display: none;
  max-width: 90%;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.ub-toast.show {
  display: block;
}

.ub-mkt .ub-pl,
.ub-pair .ub-pl {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.ub-pl.plus-book {
  color: #7CFF7C;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.ub-pl.minus-book {
  color: #ff2d2d;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

/* Dream pairs: white liability on dark tiles (override base minus-book) */
.ub-pair .ub-pl.minus-book {
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.ub-mkt .ub-mkt-inner,
.ub-pair .ub-mkt-inner {
  position: relative;
}

.ub-timer-wrap svg {
  width: 42px;
  height: 42px;
  display: block;
}

.ub-timer-wrap .ub-tnum {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  font-family: Tahoma, Helvetica, sans-serif;
}

.ub-timer-wrap.warn .ub-tnum {
  color: #e6a700;
}

.ub-timer-wrap.danger .ub-tnum {
  color: #ff6b6b;
}

.ub-overlay-msg {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 4;
  text-align: center;
  padding: 16px;
  pointer-events: auto;
  color: #fff;
}

.ub-overlay-msg.show {
  display: grid;
}

.ub-overlay-msg button {
  margin-top: 10px;
  padding: 8px 14px;
  border: 0;
  border-radius: 4px;
  background: var(--ub-lobby);
  color: #111;
  font-weight: 700;
  cursor: pointer;
}

/* —— Main bets —— */
.ub-markets {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  margin: 5px 0 0;
  padding: 0 5px;
  height: 110px;
  align-items: flex-start;
}

.ub-mkt {
  position: relative;
  flex: 1 1 50%;
  height: 90px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.ub-mkt .ub-mkt-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.ub-mkt .name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.ub-mkt .price {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.ub-mkt.player .ub-mkt-inner {
  align-items: flex-start;
  padding: 0 0 0 20px;
  background: var(--ub-player-grad);
  border-radius: 16px 0 0 16px;
}

.ub-mkt.banker .ub-mkt-inner {
  align-items: flex-end;
  padding: 0 20px 0 0;
  background: var(--ub-banker-grad);
  border-radius: 0 16px 16px 0;
}

.ub-mkt.tie {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  flex: none;
  width: 90px;
  height: 90px;
  z-index: 15;
  border-radius: 50%;
}

.ub-mkt.tie .ub-mkt-inner {
  align-items: center;
  background: var(--ub-tie-grad);
  border-radius: 50%;
}

.ub-mkt.selected {
  outline: 2px solid var(--ub-lobby);
  outline-offset: -2px;
}

.ub-mkt.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--ub-lock);
  background-image: var(--ub-lock-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
  z-index: 2;
  pointer-events: none;
}

.ub-mkt.player.locked::after {
  border-radius: 16px 0 0 16px;
}

.ub-mkt.banker.locked::after {
  border-radius: 0 16px 16px 0;
}

.ub-mkt.tie.locked::after {
  border-radius: 50%;
  background-size: 26px 26px;
}

/* —— Pairs —— */
.ub-pairs {
  display: flex;
  flex: 0 0 auto;
  margin: 12px 0 0;
  padding: 0 5px;
  gap: 10px;
  height: 70px;
}

.ub-pair {
  position: relative;
  flex: 1 1 50%;
  height: 70px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.ub-pair .ub-mkt-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  color: #fff;
  font-size: 10px;
  text-align: center;
}

.ub-pair .name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.ub-pair .price {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
}

.ub-pair.player-pair .ub-mkt-inner {
  background: var(--ub-banker-grad);
  border-radius: 4px 0 0 4px;
}

.ub-pair.banker-pair .ub-mkt-inner {
  background: var(--ub-player-grad);
  border-radius: 0 4px 4px 0;
}

.ub-pair.selected {
  outline: 2px solid var(--ub-lobby);
  outline-offset: -2px;
}

.ub-pair.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--ub-lock);
  background-image: var(--ub-lock-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px 26px;
  z-index: 2;
  pointer-events: none;
}

.ub-pair.player-pair.locked::after {
  border-radius: 4px 0 0 4px;
}

.ub-pair.banker-pair.locked::after {
  border-radius: 0 4px 4px 0;
}

/* —— Chip tray (Dream444 /assets/chips/*.svg) —— */
.ub-chips {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 10px 14px;
  background: var(--ub-page);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  align-items: flex-end;
  min-height: 72px;
}

.ub-chips::-webkit-scrollbar {
  display: none;
}

.ub-chip {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  top: 0;
  font-family: Tahoma, "Helvetica Neue", Arial, sans-serif;
  transition: top 0.15s linear;
}

.ub-chip img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 0.25rem #fd8f3b);
}

.ub-chip > span {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #272727;
  pointer-events: none;
  padding-bottom: 2px;
}

.ub-chip-ring {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 48px;
  height: 40px;
  margin-left: -24px;
  border: 0 solid #fd8f3b;
  border-radius: 100px / 76px;
  z-index: 0;
  pointer-events: none;
  font-size: 0;
}

.ub-chip:hover {
  top: -5px;
}

.ub-chip:active {
  top: -2px;
}

.ub-chip.selected {
  top: -8px;
}

.ub-chip.selected .ub-chip-ring {
  border-width: 4px;
  top: auto;
  bottom: -2px;
}

/* —— Recent Result (Dream .recent-res parity) —— */
.ub-recent {
  flex: 0 0 auto;
  display: block;
  width: 100%;
  background: #000;
  color: #fff;
  padding: 5px 8px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ub-recent::-webkit-scrollbar {
  display: none;
}

.ub-recent h5 {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-size: 1.07375rem;
  font-weight: 700;
  line-height: 32px;
  vertical-align: middle;
  white-space: nowrap;
  color: #fff;
}

.ub-recent ul {
  display: inline-block;
  list-style: none;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

.ub-recent li {
  display: inline-block;
  width: 28px;
  height: 28px;
  margin-left: 10px;
  padding: 0;
  border-radius: 50%;
  list-style: none;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 28px;
  color: #fff;
  vertical-align: middle;
  cursor: default;
}

.ub-recent li.P {
  background: #1285e2;
}

.ub-recent li.B {
  background: #c62828;
}

.ub-recent li.T {
  background: #11b24b;
}

.ub-modal {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: none;
  place-items: center;
  z-index: 20;
  padding: 16px;
}

.ub-modal.open {
  display: grid;
}

.ub-modal .box {
  width: min(420px, 100%);
  max-height: 80%;
  overflow: auto;
  background: #fff;
  color: #243a48;
  border-radius: 8px;
  padding: 12px;
}

.ub-modal .box h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.ub-modal .box .close {
  float: right;
  border: 0;
  background: #111;
  color: #fff;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

@media (min-width: 801px) {
  #lion-universe-baccarat-root {
    inset: 56px 0 0 0;
    --ub-nav-space: 0px;
  }

  .ub-main {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  }

  .ub-top {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
  }

  .ub-cards img {
    width: 40px;
  }
}

@media (max-width: 400px) {
  .ub-cards img {
    width: 30px;
  }

  .ub-mkt.tie {
    width: 78px;
    height: 78px;
  }

  .ub-markets {
    height: 100px;
  }

  .ub-mkt {
    height: 78px;
  }

  .ub-chip {
    width: 46px;
    height: 46px;
  }

  .ub-chip > span {
    font-size: 10px;
  }

  .ub-chip-ring {
    width: 42px;
    height: 34px;
    margin-left: -21px;
  }

  .ub-recent h5 {
    font-size: 15px;
    line-height: 28px;
  }

  .ub-recent li {
    width: 26px;
    height: 26px;
    line-height: 26px;
    margin-left: 8px;
  }

  .ub-top .ub-lobby {
    padding: 5px 8px;
    font-size: 11px;
  }
}

#lion-universe-baccarat-tile {
  cursor: pointer;
  border: 1px solid #7e97a7;
  background: linear-gradient(180deg, #222, #111);
  color: #fff;
  padding: 8px;
  margin: 6px;
  min-width: 140px;
  text-align: center;
  position: relative;
}

#lion-universe-baccarat-tile .ub-t-title {
  font-weight: 700;
  font-size: 13px;
}

#lion-universe-baccarat-tile .ub-t-meta {
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.9;
}

#lion-universe-baccarat-tile .ub-t-badge {
  display: inline-block;
  margin: 2px;
  padding: 1px 5px;
  background: #ffcc2f;
  color: #111;
  font-size: 9px;
  font-weight: 700;
}
