/* TV entry points: keep the two player actions easy to distinguish and reach. */
.tv-account-actions[hidden], .tv-account-actions > [hidden] { display: none !important; }
.tv-account-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 6px; }
body.tv-broadcast-body .tv-account-actions > :is(a, button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid #58738f;
  border-radius: 9px;
  background: #132c49;
  color: #edf5ff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
body.tv-broadcast-body .tv-account-actions > a {
  color: #fff1bb;
  background: #273048;
  border-color: #a7894e;
}
body.tv-broadcast-body .tv-account-actions > #tv-deposit {
  color: #172238;
  background: #ffda74;
  border-color: #ffe6a0;
}
body.tv-broadcast-body .tv-account-actions > #tv-signout { color: #d3e3f5; }
body.tv-broadcast-body .tv-account-actions > :is(a, button):focus-visible {
  outline: 2px solid #b5e2ff;
  outline-offset: 2px;
}
.tv-account-actions svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tv-wallet-balances[hidden] { display: none !important; }
.tv-wallet-balances {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding: 6px 8px;
  color: #d8eaff;
  font-size: 11px;
}
.tv-wallet-balances > div { display: grid; gap: 2px; }
.tv-wallet-balances strong { color: #ffe18a; font-size: 14px; font-variant-numeric: tabular-nums; }
#tv-purchase-overlay .tv-wallet-balances {
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid #31587e;
  background: #102744;
}
@media (max-width: 699px) {
  body.tv-broadcast-body > .topbar:has(> .tv-wallet-balances:not([hidden])) {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }
  body.tv-broadcast-body > .topbar:has(> .tv-wallet-balances:not([hidden])) > .brand {
    flex: 1 1 165px;
    width: auto !important;
    min-width: 0 !important;
  }
  body.tv-broadcast-body > .topbar > .tv-wallet-balances {
    order: 1;
    flex: 0 0 auto;
    padding: 0;
    flex-direction: column;
    gap: 4px;
  }
  body.tv-broadcast-body > .topbar > .tv-wallet-balances > div {
    grid-template-columns: auto auto;
    justify-content: space-between;
    align-items: baseline;
    gap: 5px;
  }
  body.tv-broadcast-body > .topbar > .tv-wallet-balances strong { font-size: 12px; }
}
body.tv-broadcast-body > .topbar > nav #buy-tickets,
body.tv-broadcast-body > .topbar > nav #tv-draws-open {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  min-width: 0 !important;
  min-height: 40px !important;
  box-sizing: border-box !important;
  padding: 8px 13px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  line-height: 1.05 !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  overflow: visible !important;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease !important;
}

body.tv-broadcast-body > .topbar > nav #buy-tickets {
  z-index: 1;
  border: 1px solid #ffe49a !important;
  background: linear-gradient(180deg, #ffe18a, #d4a532) !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .34), inset 0 1px 1px rgba(255, 255, 255, .68) !important;
  color: #172238 !important;
  text-shadow: none !important;
}

body.tv-broadcast-body > .topbar > nav #buy-tickets::after {
  position: absolute;
  z-index: -1;
  inset: -5px;
  border: 1px solid rgba(255, 224, 130, .72);
  border-radius: 15px;
  content: "";
  pointer-events: none;
  animation: tv-buy-callout 1.6s ease-out 1 both;
}

body.tv-broadcast-body > .topbar > nav #buy-tickets .btn-icon { font-size: 15px !important; }
body.tv-broadcast-body > .topbar > nav .buy-ticket-mobile-label { display: none !important; }

body.tv-broadcast-body > .topbar > nav #tv-draws-open {
  border: 1px solid #4c80b2 !important;
  background: linear-gradient(180deg, #18385c, #102744) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .08) !important;
  color: #d9ebff !important;
}

body.tv-broadcast-body > .topbar > nav #tv-draws-open i { color: #8bc9ff; }
body.tv-broadcast-body > .topbar > nav #buy-tickets:hover,
body.tv-broadcast-body > .topbar > nav #buy-tickets:focus-visible,
body.tv-broadcast-body > .topbar > nav #tv-draws-open:hover,
body.tv-broadcast-body > .topbar > nav #tv-draws-open:focus-visible {
  transform: translateY(-1px) !important;
  outline: 2px solid #fff1b4 !important;
  outline-offset: 2px !important;
}

@keyframes tv-buy-callout {
  0% { opacity: .72; transform: scale(.96); }
  100% { opacity: 0; transform: scale(1.08); }
}

#tv-draws-overlay[inert] { pointer-events: none; }

#tv-purchase-overlay,
#tv-auth-overlay { z-index: 1701; }

#tv-draws-overlay[inert] ~ #tv-auth-overlay,
body:has(#tv-draws-overlay[inert]) #tv-purchase-overlay {
  background: rgba(3, 11, 25, .68);
}

.tv-draws-dialog {
  width: min(760px, 100%);
  height: min(820px, calc(100vh - 32px));
  grid-template-rows: auto minmax(0, 1fr);
}

.tv-draws-list {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  scrollbar-color: #4a78a7 #091a32;
}

.tv-upcoming-list { display: grid; gap: 10px; }

.tv-upcoming-draw {
  min-width: 0;
  padding: 13px;
  border: 1px solid #294e73;
  border-radius: 14px;
  background: linear-gradient(145deg, #102a49, #0b1d35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.tv-upcoming-draw > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.tv-upcoming-date {
  display: grid;
  min-width: 76px;
  gap: 2px;
  justify-items: center;
  padding: 8px;
  border: 1px solid #3d6a97;
  border-radius: 11px;
  background: #122f51;
  color: #c7dcf5;
  text-transform: capitalize;
}

.tv-upcoming-date span { font-size: 11px; font-weight: 800; }
.tv-upcoming-date strong { color: #ffe18a; font-size: 20px; line-height: 1; }

.tv-upcoming-match { display: grid; min-width: 0; gap: 3px; }
.tv-upcoming-match strong { color: #f5f8ff; font-size: 19px; line-height: 1.1; overflow-wrap: anywhere; }
.tv-upcoming-match small { color: #b5cce5; font-size: 12px; }

.tv-upcoming-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 11px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(10, 26, 47, .76);
  color: #b9cee5;
  font-size: 12px;
}

.tv-upcoming-meta strong { color: #ffe18a; font-size: 15px; }

.tv-upcoming-prizes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.tv-upcoming-prize {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 8px 5px;
  border: 1px solid #29496b;
  border-radius: 9px;
  background: #102642;
  text-align: center;
}

.tv-upcoming-prize span { color: #aec7e2; font-size: 10px; font-weight: 800; }
.tv-upcoming-prize strong { color: #edf5ff; font-size: clamp(11px, 1.7vw, 14px); line-height: 1.1; overflow-wrap: anywhere; }

#tv-draws-list .tv-upcoming-buy {
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #ffe377;
  border-radius: 10px;
  background: #ffcf38;
  color: #172238;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .28);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

#tv-draws-list .tv-upcoming-buy:hover { background: #ffe16a; }
#tv-draws-list .tv-upcoming-buy:active { background: #f4b91f; }
#tv-draws-list .tv-upcoming-buy:focus-visible { outline: 2px solid #b5e2ff; outline-offset: 2px; }

.tv-draws-empty {
  margin: 0;
  padding: 22px 16px;
  border: 1px dashed #365a80;
  border-radius: 12px;
  color: #c3d7ee;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

html.tv-purchase-open,
html.tv-purchase-open > body.tv-broadcast-body,
html.tv-purchase-open > body.tv-broadcast-body > main {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

#close-tv-draws,
#close-tv-purchase {
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
}

#close-tv-draws svg,
#close-tv-purchase svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.5;
}

#close-tv-purchase {
  flex-basis: 44px;
  width: 44px;
  height: 44px;
}

#close-tv-purchase:hover { outline: none; }
#close-tv-purchase:focus-visible { outline: 2px solid #b5e2ff; outline-offset: 2px; }

@media (max-width: 699px) {
  body.tv-broadcast-body > .topbar > nav {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    gap: 5px !important;
  }

  body.tv-broadcast-body > .topbar > nav:has(#tv-auth-open:not([hidden])) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.tv-broadcast-body > .topbar > nav #buy-tickets,
  body.tv-broadcast-body > .topbar > nav #tv-draws-open,
  body.tv-broadcast-body > .topbar > nav button {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    padding: 6px 3px !important;
    font-size: clamp(9px, 2.55vw, 11px) !important;
    letter-spacing: -.02em !important;
    line-height: 1.05 !important;
    overflow: visible !important;
    text-overflow: ellipsis !important;
  }

  body.tv-broadcast-body > .topbar > nav #buy-tickets {
    border-radius: 12px !important;
    box-shadow: 0 4px 11px rgba(0, 0, 0, .36), inset 0 1px 1px rgba(255, 255, 255, .65) !important;
  }

  body.tv-broadcast-body > .topbar > nav #buy-tickets .btn-icon { display: none !important; }
  body.tv-broadcast-body > .topbar > nav .buy-ticket-desktop-label { display: none !important; }
  body.tv-broadcast-body > .topbar > nav .buy-ticket-mobile-label { display: inline !important; }
  body.tv-broadcast-body > .topbar > nav #tv-draws-open { gap: 4px !important; }
  body.tv-broadcast-body > .topbar > nav #tv-draws-open i { font-size: 12px !important; }
  .tv-draws-overlay { padding: 8px; }
  .tv-draws-dialog {
    width: 100%;
    height: min(900px, calc(100vh - 16px));
    height: min(900px, calc(100dvh - 16px));
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
  }
  .tv-draws-dialog .tv-purchase-heading { padding: 12px; }
  .tv-draws-dialog .tv-purchase-heading h2 { font-size: 19px; }
  .tv-draws-list { padding: 10px; }
  .tv-upcoming-list { gap: 8px; }
  .tv-upcoming-draw { padding: 10px; }
  .tv-upcoming-draw > header { gap: 9px; }
  .tv-upcoming-date { min-width: 67px; padding: 7px 5px; }
  .tv-upcoming-date strong { font-size: 18px; }
  .tv-upcoming-match strong { font-size: 17px; }
  .tv-upcoming-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  body.tv-broadcast-body > .topbar > nav { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
  body.tv-broadcast-body > .topbar > nav:has(#tv-auth-open:not([hidden])) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  body.tv-broadcast-body > .topbar > nav #buy-tickets,
  body.tv-broadcast-body > .topbar > nav #tv-draws-open,
  body.tv-broadcast-body > .topbar > nav button { min-height: 38px !important; padding-inline: 2px !important; font-size: 9px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.tv-broadcast-body > .topbar > nav #buy-tickets::after { animation: none; }
  body.tv-broadcast-body > .topbar > nav #buy-tickets,
  body.tv-broadcast-body > .topbar > nav #tv-draws-open { transition: none !important; }
}
