:root {
  --tb-blue: #0054a8;
  --tb-blue-dark: #00468f;
  --tb-green: #86c832;
  --tb-green-dark: #72b326;
  --tb-white: #ffffff;
  --tb-page: #f2f2f2;
  --tb-border: #c8d6e6;
  --tb-text: #003f8f;
  --tb-muted: #6f7f90;
  --tb-shadow: 0 14px 40px rgba(0, 45, 95, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--tb-page);
  color: var(--tb-text);
}

.tb-page-shell {
  min-height: 100vh;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(0, 84, 168, 0.06), transparent 34%),
    var(--tb-page);
}

.tb-demo-button {
  border: 1px solid var(--tb-border);
  background: var(--tb-white);
  color: var(--tb-blue);
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 45, 95, 0.08);
}

.tb-age-cover {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 37, 77, 0.68);
  backdrop-filter: blur(4px);
}

.tb-age-cover.is-visible {
  display: flex;
}

.tb-age-card {
  width: min(440px, 100%);
  background: var(--tb-white);
  border-radius: 10px;
  border: 1px solid var(--tb-border);
  box-shadow: var(--tb-shadow);
  overflow: hidden;
  text-align: center;
}

.tb-age-card::before {
  content: "";
  display: block;
  height: 58px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 45%),
    var(--tb-blue);
  border-left: 8px solid var(--tb-green);
}

.tb-age-mark {
  width: 82px;
  height: 82px;
  margin: -41px auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tb-green);
  color: var(--tb-blue);
  border: 6px solid var(--tb-white);
  font-size: 28px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(0, 45, 95, 0.22);
}

.tb-age-title {
  margin: 0 26px 10px;
  font-size: 25px;
  line-height: 1.15;
  color: var(--tb-blue);
}

.tb-age-text {
  margin: 0 30px 24px;
  color: #315b8a;
  font-size: 15px;
  line-height: 1.55;
}

.tb-age-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 26px 18px;
}

.tb-age-note {
  margin: 0;
  padding: 14px 28px 18px;
  background: #f7f9fc;
  border-top: 1px solid var(--tb-border);
  color: var(--tb-muted);
  font-size: 12px;
  line-height: 1.45;
}

.tb-cookie-panel {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 900;
  width: min(1020px, calc(100% - 32px));
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  background: var(--tb-white);
  border: 1px solid var(--tb-border);
  border-left: 8px solid var(--tb-green);
  border-radius: 9px;
  box-shadow: var(--tb-shadow);
  transform: translateX(-50%);
}

.tb-cookie-panel.is-visible {
  display: flex;
}

.tb-cookie-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tb-cookie-icon {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tb-blue);
  color: var(--tb-green);
  font-size: 19px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -1px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}

.tb-cookie-content {
  max-width: 560px;
}

.tb-cookie-title {
  margin: 0;
  color: var(--tb-blue);
  font-size: 22px;
  line-height: 1.2;
}

.tb-cookie-text {
  margin: 6px 0 0;
  color: #315b8a;
  font-size: 14px;
  line-height: 1.45;
}

.tb-cookie-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.tb-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.tb-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 45, 95, 0.16);
}

.tb-button-primary {
  background: var(--tb-green);
  color: var(--tb-blue);
}

.tb-button-primary:hover {
  background: var(--tb-green-dark);
}

.tb-button-secondary {
  background: var(--tb-blue);
  color: var(--tb-white);
}

.tb-button-secondary:hover {
  background: var(--tb-blue-dark);
}

.tb-button-outline {
  background: var(--tb-white);
  color: var(--tb-blue);
  border: 1px solid var(--tb-border);
}

.tb-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 37, 77, 0.55);
  backdrop-filter: blur(3px);
}

.tb-cookie-modal.is-visible {
  display: flex;
}

.tb-cookie-window {
  width: min(560px, 100%);
  background: var(--tb-white);
  border-radius: 10px;
  border: 1px solid var(--tb-border);
  box-shadow: var(--tb-shadow);
  overflow: hidden;
}

.tb-cookie-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: var(--tb-blue);
  border-left: 8px solid var(--tb-green);
}

.tb-cookie-head .tb-cookie-title {
  color: var(--tb-white);
}

.tb-cookie-subtitle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.4;
}

.tb-close-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--tb-white);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.tb-cookie-list {
  padding: 12px;
}

.tb-cookie-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--tb-border);
  cursor: pointer;
}

.tb-cookie-option:last-child {
  border-bottom: 0;
}

.tb-cookie-option strong {
  display: block;
  color: var(--tb-blue);
  font-size: 15px;
  margin-bottom: 5px;
}

.tb-cookie-option small {
  display: block;
  color: var(--tb-muted);
  font-size: 13px;
  line-height: 1.4;
}

.tb-cookie-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tb-cookie-option i {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: #dce4ee;
  transition: background 0.18s ease;
}

.tb-cookie-option i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--tb-white);
  box-shadow: 0 2px 6px rgba(0, 45, 95, 0.24);
  transition: transform 0.18s ease;
}

.tb-cookie-option input:checked + i {
  background: var(--tb-green);
}

.tb-cookie-option input:checked + i::after {
  transform: translateX(24px);
}

.tb-cookie-option input:disabled + i {
  background: var(--tb-blue);
}

.tb-cookie-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 20px;
  background: #f7f9fc;
  border-top: 1px solid var(--tb-border);
}

@media (max-width: 820px) {
  .tb-cookie-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .tb-cookie-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .tb-cookie-main {
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .tb-cookie-footer {
    flex-direction: column;
  }

  .tb-button {
    width: 100%;
  }

  .tb-age-title {
    font-size: 22px;
  }
}
/* Functional betting and account UI. Brand colours match the existing Topbet layout. */
.tb-functional-betslip {
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 12px;
  background: #ffffff;
}

.tb-slip-empty {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 12px;
}

.tb-slip-empty-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--tb-green);
  color: var(--tb-blue);
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
  margin-bottom: 14px;
}

.tb-slip-empty-title {
  color: var(--tb-blue);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tb-slip-empty-text {
  color: #315b8a;
  font-size: 13px;
  line-height: 1.45;
  max-width: 260px;
}

.tb-slip-list {
  display: grid;
  gap: 10px;
}

.tb-slip-card,
.tb-slip-summary {
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 45, 95, 0.08);
}

.tb-slip-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.tb-slip-event {
  color: #315b8a;
  font-size: 12px;
  line-height: 1.35;
}

.tb-slip-selection {
  color: var(--tb-blue);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 4px;
}

.tb-slip-remove {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--tb-border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--tb-blue);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.tb-slip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #315b8a;
  font-size: 13px;
  margin: 8px 0;
}

.tb-slip-row strong {
  color: var(--tb-blue);
  font-size: 14px;
}

.tb-slip-return-row {
  padding-top: 2px;
}

.tb-slip-stake-label {
  display: block;
  color: var(--tb-blue);
  font-size: 12px;
  font-weight: 700;
  margin-top: 10px;
  margin-bottom: 6px;
}

.tb-slip-stake,
.tb-auth-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--tb-blue);
  font: inherit;
  outline: none;
  background: #ffffff;
}

.tb-slip-stake:focus,
.tb-auth-input:focus {
  border-color: var(--tb-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 168, 0.12);
}

.tb-slip-summary {
  margin-top: 12px;
  background: #f7f9fc;
}

.tb-slip-place {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--tb-green);
  color: var(--tb-blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}

.tb-slip-place:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tb-slip-message,
.tb-auth-message {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(134, 200, 50, 0.55);
  border-radius: 8px;
  background: rgba(134, 200, 50, 0.12);
  color: var(--tb-blue);
  font-size: 13px;
  line-height: 1.45;
}

.tb-event-active,
.tb-odd-active {
  box-shadow: inset 0 0 0 2px var(--tb-green) !important;
  border-radius: 8px;
}

.tb-site-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1300;
  max-width: min(380px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 6px solid var(--tb-green);
  background: #ffffff;
  color: var(--tb-blue);
  box-shadow: var(--tb-shadow);
  font-size: 14px;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.tb-site-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.tb-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 37, 77, 0.55);
  backdrop-filter: blur(3px);
}

.tb-auth-modal.is-visible {
  display: flex;
}

.tb-auth-window {
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid var(--tb-border);
  border-radius: 10px;
  box-shadow: var(--tb-shadow);
  overflow: hidden;
}

.tb-auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  background: var(--tb-blue);
  border-left: 8px solid var(--tb-green);
}

.tb-auth-title {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.2;
}

.tb-auth-subtitle {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.4;
}

.tb-auth-form {
  display: grid;
  gap: 12px;
  padding: 18px 20px 20px;
}

.tb-auth-label {
  display: grid;
  gap: 6px;
  color: var(--tb-blue);
  font-size: 13px;
  font-weight: 700;
}

.tb-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #315b8a;
  font-size: 13px;
  line-height: 1.4;
}

.tb-auth-submit {
  width: 100%;
  margin-top: 4px;
}

.tb-auth-switch {
  border: 0;
  background: transparent;
  color: var(--tb-blue);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px;
}

@media (max-width: 520px) {
  .tb-site-toast {
    left: 18px;
    right: 18px;
    max-width: none;
  }
}

.tb-local-market-panel {
  margin: 10px 4px 12px;
  border: 1px solid var(--tb-border);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 45, 95, 0.08);
}

.tb-market-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--tb-blue);
  border-left: 6px solid var(--tb-green);
}

.tb-market-kicker {
  margin-bottom: 4px;
  color: var(--tb-green);
  font-size: 13px;
  font-weight: 700;
}

.tb-market-head h3 {
  margin: 0;
  color: #ffffff;
  font-size: 22px;
  line-height: 1.2;
}

.tb-market-head p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.4;
}

.tb-market-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tb-market-card {
  margin: 10px;
  border: 1px solid var(--tb-border);
  border-radius: 9px;
  background: #f7f9fc;
  overflow: hidden;
}

.tb-market-event-list {
  display: grid;
  gap: 0;
  padding: 0 0 4px;
}

.tb-market-event-button {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--tb-border);
  background: #ffffff;
  color: var(--tb-blue);
  cursor: pointer;
  text-align: left;
  padding: 10px 14px;
  font: inherit;
}

.tb-market-event-button strong {
  display: block;
  color: var(--tb-blue);
  font-size: 15px;
  line-height: 1.25;
}

.tb-market-event-button small {
  display: block;
  margin-top: 3px;
  color: var(--tb-green);
  font-size: 13px;
  font-weight: 700;
}

.tb-market-event-button > span:last-child {
  color: var(--tb-blue);
  font-size: 24px;
}

.tb-market-title {
  padding: 10px 14px;
  color: var(--tb-blue);
  font-size: 14px;
  font-weight: 700;
  background: #f2f2f2;
  border-bottom: 1px solid var(--tb-border);
}

.tb-market-selections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 8px;
  padding: 10px;
  background: #ffffff;
}

.tb-market-price {
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border: 2px solid var(--tb-border);
  border-radius: 9px;
  background: #ffffff;
  color: var(--tb-blue);
  cursor: pointer;
  padding: 8px;
  font: inherit;
  text-align: center;
}

.tb-market-price span {
  color: var(--tb-blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.tb-market-price strong {
  color: var(--tb-green);
  font-size: 18px;
  line-height: 1;
}

.tb-market-price:hover,
.tb-market-event-button:hover {
  box-shadow: inset 0 0 0 2px rgba(134, 200, 50, 0.55);
}

.tb-market-search-label {
  display: grid;
  gap: 7px;
  padding: 12px;
  color: var(--tb-blue);
  font-size: 13px;
  font-weight: 700;
  background: #ffffff;
}

.tb-market-search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--tb-blue);
  font: inherit;
  outline: none;
}

.tb-market-search-input:focus {
  border-color: var(--tb-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 168, 0.12);
}

.tb-market-empty {
  padding: 18px;
  color: #315b8a;
  font-size: 14px;
  background: #ffffff;
}

@media (max-width: 640px) {
  .tb-local-market-panel {
    margin-left: 0;
    margin-right: 0;
  }

  .tb-market-head {
    padding: 14px;
  }

  .tb-market-head h3 {
    font-size: 19px;
  }

  .tb-market-selections {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile Bet Slip drawer. Hidden on desktop so the original layout stays unchanged. */
.tb-mobile-betslip-toggle,
.tb-mobile-betslip-backdrop,
.tb-mobile-betslip-close {
  display: none;
}

@media (max-width: 900px) {
  body.tb-betslip-open {
    overflow: hidden;
  }

  .tb-mobile-betslip-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1490;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 999px;
    padding: 0 16px;
    background: var(--tb-green);
    color: var(--tb-blue);
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 45, 95, 0.28);
  }

  .tb-mobile-betslip-toggle span {
    min-width: 24px;
    min-height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: var(--tb-blue);
    color: #ffffff;
    font-size: 12px;
    line-height: 1;
    padding: 0 6px;
  }

  .tb-mobile-betslip-backdrop.is-visible {
    position: fixed;
    inset: 0;
    z-index: 1450;
    display: block;
    background: rgba(0, 37, 77, 0.52);
    backdrop-filter: blur(2px);
  }

  .tb-right-betslip[data-mobile-betslip] {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: min(390px, 92vw) !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 1500 !important;
    flex: 0 0 auto !important;
    transform: translateX(105%);
    transition: transform 0.22s ease;
    will-change: transform;
  }

  .tb-right-betslip[data-mobile-betslip].is-mobile-open {
    transform: translateX(0);
  }

  .tb-right-betslip[data-mobile-betslip] > .css-g5y9jx {
    height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-left-width: 1px !important;
    box-shadow: -12px 0 32px rgba(0, 45, 95, 0.24);
  }

  .tb-mobile-betslip-close {
    width: 34px;
    height: 34px;
    margin-left: auto;
    margin-right: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .tb-functional-betslip {
    max-height: calc(100vh - 64px);
  }
}

@media (max-width: 420px) {
  .tb-right-betslip[data-mobile-betslip] {
    width: 100vw !important;
  }
}

/* Mobile Bet Slip visibility patch: the exported mobile layout hides the desktop
   right column with display:none!important, so the drawer must explicitly undo it. */
@media (max-width: 900px) {
  .tb-right-betslip[data-mobile-betslip] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    min-width: 0 !important;
    max-width: min(390px, 92vw) !important;
    width: min(390px, 92vw) !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    pointer-events: auto !important;
    background: transparent !important;
  }

  .tb-right-betslip[data-mobile-betslip]:not(.is-mobile-open) {
    pointer-events: none !important;
  }

  .tb-right-betslip[data-mobile-betslip].is-mobile-open {
    display: flex !important;
    visibility: visible !important;
    transform: translateX(0) !important;
  }

  .tb-right-betslip[data-mobile-betslip] > .css-g5y9jx {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    visibility: visible !important;
  }
}

@media (max-width: 420px) {
  .tb-right-betslip[data-mobile-betslip] {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
