﻿:root {
  color-scheme: light;
  --bg: #e7edf1;
  --panel: #ffffff;
  --panel-soft: #f6f8fa;
  --line: #d9e1e7;
  --header: #eeeeee;
  --text: #17212b;
  --muted: #6d7a86;
  --accent: #18a058;
  --accent-dark: #087a3a;
  --blue: #68a7e8;
  --red: #ef3f4f;
  --orange: #ff9500;
  --teal: #009f9d;
  --bubble-other: #ffffff;
  --bubble-me: #d9fdd3;
  --warning: #c27719;
  --lottery-bg: #edf4f7;
  --lottery-soft: #f9fcfd;
  --lottery-text: #17212b;
  --lottery-accent: #1666c5;
  --lottery-warm: #e05a22;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  overflow: hidden;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(231, 237, 241, 0.9)),
    radial-gradient(circle at 14% 9%, rgba(183, 217, 210, 0.9) 0, transparent 32%),
    radial-gradient(circle at 86% 18%, rgba(197, 214, 245, 0.9) 0, transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.phone-shell {
  width: min(100%, 620px);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  margin: 0 auto;
  background: #eef3f6;
  box-shadow: 0 0 42px rgba(23, 33, 43, 0.18);
  display: block;
  position: relative;
  overflow: hidden;
}

.result-panel {
  padding: 0;
  background: var(--lottery-bg);
  border-bottom: 1px solid #cfdae2;
}

.result-panel__head,
.chat-header,
.composer {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.icon-button,
.tool-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text);
  display: inline-grid;
  place-items: center;
  font-size: 24px;
  cursor: pointer;
  flex: 0 0 auto;
}

.result-panel__head .icon-button {
  margin-left: auto;
  color: var(--accent-dark);
}

.source-link {
  display: block;
  width: 100%;
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lottery-card {
  width: 100%;
  color: var(--lottery-text);
  background: var(--lottery-bg);
  border-bottom: 1px solid var(--line);
}

.lottery-next {
  min-height: 65px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: linear-gradient(180deg, #fbfdfe 0%, #eef6f9 100%);
}

.next-left {
  text-align: center;
}

.next-period,
.latest-period,
.balance-label {
  color: var(--lottery-text);
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}

.next-period strong,
.latest-period span {
  color: var(--lottery-accent);
  font-weight: 800;
}

.countdown {
  margin-top: 8px;
  color: #17212b;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 800;
  text-align: center;
}

.divider {
  width: 1px;
  height: 28px;
  background: #c8d5de;
}

.balance {
  text-align: center;
  display: grid;
  justify-items: center;
  align-content: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.balance-label {
  color: var(--muted);
  width: 100%;
  text-align: center;
}

.refresh-dot {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 13px;
}

.balance-value {
  margin-top: 8px;
  color: #e83d52;
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  width: 100%;
  text-align: center;
}

.balance[aria-expanded="true"] .balance-label {
  color: var(--lottery-accent);
}

.lottery-latest {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(122px, 1fr) minmax(150px, 1.2fr) minmax(72px, 1fr);
  align-items: center;
  gap: 4px;
  padding: 9px 8px;
  background: #eaf2f6;
  border-top: 1px solid #d4e0e7;
}

.formula {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  width: 100%;
  justify-self: center;
}

.ball {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, #3bb6e8, #1d7fd0);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.ball--sum {
  background: linear-gradient(180deg, #ff6b43, #e42d3e);
  color: #fff;
}

.operator {
  color: #d34b3f;
  font-size: 12px;
  opacity: 0.9;
}

.result-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  min-width: 58px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.tag {
  color: var(--lottery-warm);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.chevron {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
}

.result-tags[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.history-panel {
  background: #f8fbfc;
  border-top: 1px solid #d4e0e7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(23, 33, 43, 0.28);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.ledger-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  width: 70vw;
  max-width: 430px;
  min-width: 280px;
  background: #f8fbfc;
  border-left: 1px solid #d4e0e7;
  box-shadow: -12px 0 28px rgba(23, 33, 43, 0.18);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.ledger-panel.is-open {
  transform: translateX(0);
}

.ledger-titlebar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 16px;
  background: #ffffff;
  border-bottom: 1px solid #dce6ec;
}

.ledger-titlebar strong {
  color: #17212b;
  font-size: 17px;
}

.ledger-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f6f8fa;
  color: #51606d;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.ledger-head {
  height: 32px;
  display: grid;
  grid-template-columns: 1fr 90px;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid #dce6ec;
}

.ledger-list {
  overflow-y: auto;
}

.ledger-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid #e1e9ee;
  color: #26323d;
}

.ledger-row:nth-child(even) {
  background: rgba(235, 243, 247, 0.7);
}

.ledger-title {
  font-size: 13px;
  font-weight: 800;
}

.ledger-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ledger-amount {
  justify-self: end;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.ledger-amount.is-in {
  color: #e83d52;
}

.ledger-amount.is-out {
  color: #16845f;
}

.ledger-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.recharge-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(23, 33, 43, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.recharge-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.recharge-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 810;
  width: min(100%, 620px);
  height: 80vh;
  height: 80dvh;
  max-height: 80vh;
  max-height: 80dvh;
  transform: translate(-50%, 102%);
  transition: transform 0.28s ease;
  background: #fff;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 42px rgba(23, 33, 43, 0.2);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.recharge-panel.is-open {
  transform: translate(-50%, 0);
}

.recharge-head {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.recharge-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f3f6f8;
  color: var(--muted);
  font-size: 24px;
}

.recharge-body {
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.recharge-label {
  margin: 8px 0;
  color: #26323d;
  font-size: 13px;
  font-weight: 800;
}

.recharge-methods,
.recharge-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.recharge-method,
.recharge-quick button,
.recharge-secondary,
.recharge-primary {
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f7fafc;
  color: #26323d;
  font-weight: 800;
}

.recharge-method.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: rgba(24, 160, 88, 0.1);
}

.recharge-input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
}

.recharge-primary {
  width: 100%;
  margin-top: 14px;
  border: 0;
  background: var(--accent);
  color: #fff;
}

.recharge-primary:disabled {
  background: #aab6bf;
}

.recharge-secondary {
  width: 100%;
  margin-top: 8px;
}

.recharge-order-meta {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f8fb;
  color: #26323d;
  font-size: 13px;
}

.recharge-money {
  color: #e83d52;
  font-size: 18px;
}

.recharge-paybox {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed #b8c8d3;
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
  background: #fbfdfe;
}

.recharge-paybox img,
.recharge-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: contain;
}

.recharge-link {
  display: block;
  padding: 10px;
  border-radius: 8px;
  background: #edf7f1;
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
  word-break: break-all;
}

.usdt-pay-amount {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #7c3f00;
}

.usdt-pay-amount span {
  font-size: 13px;
  font-weight: 800;
}

.usdt-pay-amount strong {
  color: #e83d52;
  font-size: 24px;
  line-height: 1.1;
}

.usdt-pay-amount small {
  color: #8b6b4b;
  font-size: 12px;
}

.usdt-address {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #f3f8fb;
  color: #26323d;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-all;
}

.usdt-copy-btn {
  width: 100%;
  height: 42px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: #18a058;
  color: #fff;
  font-weight: 900;
}

.usdt-copy-btn.is-copied {
  background: #0f8a4a;
}

.recharge-copy-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 900;
  transform: translate(-50%, -50%) scale(0.92);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(23, 33, 43, 0.86);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.recharge-copy-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.recharge-countdown {
  margin: 10px 0;
  color: #e83d52;
  font-weight: 900;
  text-align: center;
}

.recharge-upload {
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  color: #26323d;
  font-weight: 800;
}

.recharge-upload input {
  display: none;
}

.recharge-preview {
  margin-top: 10px;
  text-align: center;
}

.recharge-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--accent-dark);
  font-size: 13px;
  text-align: center;
}

.recharge-status.is-error {
  color: #e83d52;
}

.history-head {
  height: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid #dce6ec;
}

.history-list {
  max-height: 260px;
  overflow-y: auto;
}

.history-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) minmax(118px, 1.2fr) minmax(46px, 0.55fr);
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #e1e9ee;
  color: #26323d;
  font-size: 13px;
}

.history-row:nth-child(even) {
  background: rgba(235, 243, 247, 0.7);
}

.history-period {
  color: var(--lottery-accent);
  font-weight: 800;
}

.history-formula {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
}

.history-ball {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(180deg, #3bb6e8, #1d7fd0);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.history-ball--sum {
  background: linear-gradient(180deg, #ff6b43, #e42d3e);
}

.history-tags {
  justify-self: end;
  color: var(--lottery-warm);
  font-weight: 900;
  white-space: nowrap;
}

.history-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.mark--small,
.mark--big,
.mark--even,
.mark--odd {
  color: var(--lottery-warm) !important;
}

.data-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.data-note.is-warning {
  color: var(--warning);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat {
  height: 100vh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.chat-header {
  height: 53px;
  padding: 0 12px;
  background: rgba(248, 250, 252, 0.94);
  border-bottom: 1px solid var(--line);
}

.header-user {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.header-user-avatar {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.header-user-name {
  display: none;
}

.chat-title {
  min-width: 0;
  flex: 1;
  text-align: center;
}

.chat-title strong,
.chat-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-title strong {
  font-size: 17px;
  line-height: 1;
}

.chat-title span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.messages {
  min-height: 0;
  padding: 14px 14px 18px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(242, 247, 249, 0.94), rgba(235, 243, 247, 0.96)),
    repeating-linear-gradient(135deg, rgba(24, 160, 88, 0.06) 0 1px, transparent 1px 18px);
}

.message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  max-width: 86%;
}

.message.is-me {
  grid-template-columns: minmax(0, 1fr) 36px;
  margin-left: auto;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}

.bubble-wrap {
  min-width: 0;
}

.name {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 4px;
}

.message.is-me .name {
  text-align: right;
}

.bubble {
  display: inline-block;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bubble-other);
  box-shadow: 0 1px 2px rgba(23, 33, 43, 0.08);
  line-height: 1.45;
  word-break: break-word;
}

.message.is-me .bubble {
  float: right;
  background: var(--bubble-me);
}

.time-divider {
  width: fit-content;
  margin: 4px auto 14px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(109, 122, 134, 0.18);
  color: var(--muted);
  font-size: 12px;
}

.composer {
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.composer input {
  min-width: 0;
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-soft);
  padding: 0 14px;
  outline: none;
}

.composer input:focus {
  border-color: var(--accent);
  background: #fff;
}

.send-button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 420px) {
  .phone-shell {
    width: 100%;
  }

  body {
    overflow-x: hidden;
  }

  .lottery-next {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 8px 6px;
  }

  .next-period,
  .latest-period,
  .balance-label {
    font-size: 14px;
  }

  .countdown,
  .balance-value {
    font-size: 22px;
  }

  .lottery-latest {
    grid-template-columns: minmax(104px, 1fr) minmax(132px, 1.25fr) minmax(54px, 1fr);
    gap: 5px;
    padding: 8px 6px;
  }

  .tag {
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .lottery-next {
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  }

  .next-period,
  .latest-period,
  .balance-label {
    font-size: 12px;
  }

  .countdown,
  .balance-value {
    font-size: 20px;
  }

  .lottery-latest {
    grid-template-columns: minmax(88px, 1fr) minmax(118px, 1.25fr) minmax(42px, 1fr);
  }

  .ball {
    width: 21px;
    height: 21px;
    font-size: 12px;
  }

  .operator {
    font-size: 10px;
  }
}

/* ===== BET CARD STYLES ===== */
.bc-card {
 width: 100%; max-width: 100%;
 background: #fff;
 box-shadow: 0 2px 12px rgba(0,0,0,.08);
 border-radius: 14px;
 overflow: visible;
 font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.bc-success-top {
 text-align: center;
 padding: 6px 12px 0px;
 background: none;
}
.bc-check-circle {
 width: 48px; height: 48px; margin: 0 auto 2px;
 border-radius: 50%;
 background: linear-gradient(135deg, #34e880 0%, #0ef05a 50%, #05c44e 100%);
 display: flex; align-items: center; justify-content: center;
 box-shadow: 0 6px 20px rgba(22,216,93,.35), 0 0 40px rgba(22,216,93,.15);
 position: relative;
}
.bc-check-circle::after {
 content: ""; position: absolute; inset: -2px;
 border-radius: 50%;
 border: 1.5px solid rgba(22,216,93,.2);
 animation: check-ring-pulse 2s ease-out infinite;
}
@keyframes check-ring-pulse {
 0% { transform: scale(1); opacity: .6; }
 100% { transform: scale(1.3); opacity: 0; }
}
.bc-check-circle svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.bc-check-circle svg path {
 stroke-dasharray: 24;
 stroke-dashoffset: 24;
 animation: check-draw .5s .2s ease forwards;
}
@keyframes check-draw { to { stroke-dashoffset: 0; } }
.bc-title-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 2px; }
.bc-decor { width: 30px; height: 11px; position: relative; flex-shrink: 0; }
.bc-decor i { position: absolute; right: 0; display: block; height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(19,205,90,.18), #18d35f); }
.bc-decor i:nth-child(1) { width: 30px; top: 2px; }
.bc-decor i:nth-child(2) { width: 14px; top: 9px; right: 5px; }
.bc-decor.right { transform: scaleX(-1); }
.bc-success-title { font-size: 15px; font-weight: 700; color: #1e2a3b; letter-spacing: 1px; }
.bc-content { position: relative; padding: 2px 12px 2px 8px; }
.bc-timeline { display: none; }
.bc-info-row {
 display: flex; align-items: center; justify-content: space-between;
 padding: 5px 12px 5px 15px;
 border-bottom: 1px solid rgba(200,220,210,.35);
}
.bc-info-row:last-of-type { border-bottom: none; }
.bc-left { display: flex; align-items: center; gap: 10px; }
.bc-icon-circle {
 width: 17px; height: 17px; border-radius: 50%;
 border: 1.5px solid #18cb58; display: flex; align-items: center; justify-content: center;
 background: rgba(24,203,88,.06); flex-shrink: 0;
}
.bc-icon-circle svg { width: 9px; height: 9px; fill: #16c954; }
.bc-label { font-size: 12px; color: #666f7e; font-weight: 500; }
.bc-value { font-size: 14px; color: #1f2a3b; font-weight: 600; }
.bc-value.green { color: #15c954; font-size: 17px; font-weight: 700; }
.bc-time-box {
 margin: 0px 8px 4px; background: #eef7ee; border-radius: 9px;
 padding: 4px 10px;
}
.bc-time-left { display: flex; align-items: center; gap: 12px; }
.bc-clock-wrap { width: 28px; height: 28px; border-radius: 50%; background: rgba(24,203,88,.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bc-clock-circle { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(180deg, #16d85d, #05c44e); display: flex; align-items: center; justify-content: center; }
.bc-clock-circle svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
.bc-clock-circle circle { stroke: #18a058; stroke-width: 1.5; fill: none; }
.bc-time-text { flex: 1; border-left: 1.5px dashed #d0e0d5; padding-left: 10px; }
.bc-time-label { font-size: 10px; color: #8a96a3; margin-bottom: 2px; }
.bc-time-value { font-size: 12px; color: #1f2a3b; font-weight: 600; }

/* 中奖状态行 */
.bc-status-box {
 display: flex; align-items: center; justify-content: space-between;
 padding: 8px 12px 8px 15px;
}
.bc-status-left { display: flex; align-items: center; gap: 10px; }
.bc-status-icon-wrap { width: 28px; height: 28px; border-radius: 50%; background: rgba(24,203,88,.1); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bc-status-icon { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(180deg, #16d85d, #05c44e); display: flex; align-items: center; justify-content: center; }
.bc-status-icon svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bc-status-left span:last-child { font-size: 12px; color: #666f7e; font-weight: 500; }
.bc-status-val { font-size: 14px; font-weight: 600; }
.bc-status-val.pending { color: #f59e0b; }
.bc-status-val.won { color: #15c954; font-size: 16px; font-weight: 700; }
.bc-status-val.lost { color: #9ca3af; }

.bc-bubble { padding: 4px !important; overflow: visible !important; }

.top-fixed {
  position: fixed;
  top: 0;
  left: 50%;
  right: auto;
  width: min(100%, 620px);
  transform: translateX(-50%);
  z-index: 500;
  background: #eef3f6;
  box-shadow: 0 1px 0 rgba(207, 218, 226, 0.95);
}

.messages-scroll {
  position: absolute;
  left: 0;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.bet-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s ease;
}
.bet-panel.show {
  transform: translateY(0);
}
.bet-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bet-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.bet-panel-footer {
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

/* ===== BET BAR ===== */
.bet-bar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 620px);
  z-index: 500;
  background: linear-gradient(135deg, #1a8d50 0%, #12b04a 50%, #0e9e42 100%);
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 -2px 12px rgba(0,0,0,.15);
}
.bet-bar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
}
.bet-bar-text {
  color: #fff;
}

/* ===== BET TOAST ===== */
.bet-toast {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translateX(-50%) translateY(-50%) scale(0.8);
  background: rgba(0,0,0,.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 900;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.bet-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-50%) scale(1);
}

/* ===== BET OPTIONS ===== */
.bet-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.bet-option {
  padding: 10px 4px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  transition: all .2s;
}
.bet-option.selected {
  border-color: #18cb58;
  background: #e8f9ee;
  color: #18cb58;
}
.bet-option:hover {
  border-color: #18cb58;
}

/* ===== BET QUICK AMOUNTS ===== */
.bet-quick-amounts {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bet-quick-btn {
  padding: 6px 14px;
  border: 1px solid #d0d0d0;
  border-radius: 20px;
  background: #f5f5f5;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.bet-quick-btn:hover {
  background: #e8f9ee;
  border-color: #18cb58;
}

/* ===== BET AMOUNT INPUT ===== */
.bet-amount-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.bet-amount-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color .2s;
}
.bet-amount-input:focus {
  border-color: #18cb58;
}

/* ===== BET ADD BUTTON ===== */
.bet-add-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #18cb58, #12b04a);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: transform .15s;
}
.bet-add-btn:active {
  transform: scale(0.97);
}

/* ===== BET BASKET ===== */
.bet-basket {
  margin-top: 12px;
}
.bet-basket-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}
.bet-basket-list {
  max-height: 180px;
  overflow-y: auto;
}
.bet-basket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f8f8f8;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.bet-basket-remove {
  color: #e74c3c;
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
}

/* ===== BET CONFIRM DIALOG ===== */
.bet-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.bet-confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.bet-confirm-box {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: min(90%, 360px);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.bet-confirm-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}
.bet-confirm-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.bet-confirm-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.bet-confirm-total {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #e74c3c;
  margin-bottom: 10px;
}
.bet-confirm-actions {
  display: flex;
  gap: 10px;
}
.bet-confirm-cancel {
  flex: 1;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.bet-confirm-submit {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #18cb58, #12b04a);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}


/* ===== Betting panel polish 2026-06-12 ===== */
.bet-overlay {
  position: fixed;
  inset: 0;
  z-index: 590;
  background: rgba(16, 30, 42, 0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.bet-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.bet-panel {
  left: 50%;
  right: auto;
  width: min(100%, 620px);
  height: 70dvh;
  max-height: 70dvh;
  transform: translateX(-50%) translateY(105%);
  transition: transform 0.58s cubic-bezier(.22, .8, .24, 1);
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.bet-panel.active,
.bet-panel.show {
  transform: translateX(-50%) translateY(0);
}
.bet-panel-handle {
  height: 18px;
  display: grid;
  place-items: center;
  background: #fff;
}
.bet-panel-handle span {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #d5dde4;
}
.bet-panel-title {
  font-size: 17px;
  font-weight: 800;
}
.bet-panel-close,
.bet-basket-clear,
.bet-basket-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.bet-section {
  margin-bottom: 14px;
}
.bet-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #26323d;
  font-size: 14px;
  font-weight: 800;
}
.bet-options {
  gap: 10px;
}
.bet-option {
  min-height: 68px;
  display: grid;
  gap: 4px;
  border: 1px solid #dce6ec;
  border-radius: 12px;
  background: #f8fbfc;
}
.bet-option-label {
  color: #17212b;
  font-size: 20px;
  font-weight: 900;
}
.bet-option-odds {
  color: #e83d52;
  font-size: 12px;
  font-weight: 800;
}
.bet-option.selected {
  border-color: #18a058;
  background: #e9f8ef;
  box-shadow: 0 0 0 2px rgba(24, 160, 88, 0.12);
}
.bet-amount-row {
  display: grid;
  gap: 10px;
}
.bet-quick-amounts {
  margin-bottom: 0;
}
.bet-add-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.bet-basket-count {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #18a058;
  color: #fff;
  font-size: 12px;
}
.bet-basket-clear {
  margin-left: auto;
  color: #e83d52;
  font-size: 12px;
}
.bet-basket-item em {
  color: #6d7a86;
  font-style: normal;
  font-size: 12px;
}
.bet-basket-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 12px;
  font-weight: 800;
}
.bet-basket-total-amount,
.bet-confirm-total-amount {
  color: #e83d52;
}
.bet-checkout-btn,
.bet-confirm-pay {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #18cb58, #0f9c43);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.bet-checkout-btn {
  width: 100%;
  padding: 13px;
}
.bet-confirm-overlay.active,
.bet-confirm-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.bet-confirm-modal,
.bet-confirm-box {
  width: min(90%, 360px);
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(23, 33, 43, 0.24);
}
.bet-confirm-item small {
  margin-left: 6px;
  color: #6d7a86;
}
.bet-confirm-pay,
.bet-confirm-cancel {
  flex: 1;
  padding: 12px;
}
.bc-card {
  width: 188px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f5fbf7 100%);
  border: 1px solid #e2ece8;
  box-shadow: 0 4px 16px rgba(21, 148, 82, 0.14);
  overflow: hidden;
}
.bc-success-top {
  padding: 8px 8px 2px;
}
.bc-check-circle {
  width: 54px;
  height: 54px;
  margin-bottom: 4px;
}
.bc-check-circle svg path {
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.bc-title-row {
  margin-bottom: 4px;
}
.bc-content {
  padding: 0 10px 8px;
}
.bc-info-row,
.bc-time-box,
.bc-status-box {
  min-height: 30px;
  padding: 5px 2px;
  border-bottom: 1px solid #dfeee6;
}
.bc-time-box,
.bc-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  background: transparent;
  border-radius: 0;
}
.bc-info-row:last-child,
.bc-status-box {
  border-bottom: 0;
}
.bc-left,
.bc-status-left {
  gap: 7px;
}
.bc-icon-circle,
.bc-status-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 2px solid #16c954;
  color: #16c954;
  background: #eefaf3;
  font-size: 10px;
  line-height: 1;
}
.bc-solid,
.bc-status-icon {
  background: #13c95a;
  color: #fff;
  border-color: #13c95a;
}
.bc-label {
  color: #677281;
  font-size: 12px;
}
.bc-value {
  color: #26323d;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}
.bc-value.green {
  color: #17c95a;
  font-size: 15px;
}
.bc-time-value {
  color: #26323d;
  font-size: 13px;
  font-weight: 700;
}
.bc-status-val.pending {
  color: #f39c12;
  font-size: 13px;
  font-weight: 900;
}
.bc-status-val.won {
  color: #13a654;
}
.bc-status-val.lost {
  color: #9ca3af;
}
.bc-bubble {
  background: transparent !important;
  box-shadow: none !important;
}


/* ===== Ledger drawer 2026-06-12 ===== */
.drawer-backdrop {
  z-index: 640;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.drawer-backdrop.is-open {
  pointer-events: auto;
}
.ledger-panel {
  z-index: 650;
  width: min(70vw, 434px);
  max-width: 70vw;
  transform: translateX(105%);
  transition: transform 0.55s cubic-bezier(.22, .8, .24, 1);
}
.ledger-panel.is-open {
  transform: translateX(0);
}
.ledger-row {
  grid-template-columns: minmax(0, 1fr) 86px;
}
.ledger-title {
  color: #17212b;
}
.ledger-meta {
  white-space: normal;
  line-height: 1.35;
}
.ledger-amount.is-in {
  color: #e83d52;
}
.ledger-amount.is-out {
  color: #16845f;
}
@media (max-width: 420px) {
  .ledger-panel {
    width: 70vw;
    min-width: 0;
  }
  .ledger-titlebar {
    height: 48px;
    padding-left: 12px;
  }
  .ledger-head,
  .ledger-row {
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* ===== Mobile message bottom clearance 2026-06-13 ===== */
.messages-scroll {
  overscroll-behavior-y: contain;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
.messages {
  overflow: visible;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.message,
.bubble-wrap,
.bubble {
  overflow: visible;
}
.message.is-me {
  max-width: min(92%, 360px);
}
.bc-card {
  margin-bottom: 10px;
}
@media (max-width: 420px) {
  .messages {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .message {
    max-width: 94%;
  }
  .message.is-me {
    max-width: 94%;
  }
  .bc-card {
    margin-bottom: 12px;
  }
}

/* Touch phone bottom clearance: avoids mobile browser bottom bars without affecting desktop narrow windows. */
@media (hover: none) and (pointer: coarse) and (max-width: 600px) {
  .messages {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .bc-card {
    margin-bottom: 10px;
  }
}

@supports (-webkit-touch-callout: none) {
  @media (max-width: 600px) {
    .messages {
      padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }
    .bc-card {
      margin-bottom: 10px;
    }
  }
}
