.lottery-shell {
  position: fixed;
  inset: 0;
  z-index: 5000;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8fbff 0%, #edf3ff 100%);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #2b2b34;
}

.lottery-shell *,
.lottery-shell *::before,
.lottery-shell *::after {
  box-sizing: border-box;
}

.lottery-shell.hidden {
  display: none;
}

.lottery-shell.lottery-overlay-only {
  background: transparent;
  overflow: visible;
  pointer-events: none;
}

.lottery-shell.lottery-overlay-only .lottery-modal {
  pointer-events: auto;
}

.lottery-page-loading {
  min-height: 70vh;
  display: grid;
  place-items: center;
  color: #66708f;
  font-size: 15px;
}

.lottery-page,
.lottery-room-page {
  min-height: 100%;
  padding: 16px 12px 24px;
}

.lottery-room-page {
  position: relative;
  min-height: 100vh;
  padding: 0 0 100px;
  background: #eef0f8;
}

.lottery-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lottery-card {
  position: relative;
  min-height: 110px;
  padding: 16px 16px 16px 18px;
  border: 1px solid rgba(205, 220, 255, 0.92);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.96)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.75), rgba(255, 222, 243, 0.24));
  box-shadow: 0 14px 28px rgba(108, 132, 197, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lottery-card::after {
  content: attr(data-mark);
  position: absolute;
  right: 12px;
  top: 0;
  font-size: 46px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(240, 199, 235, 0.34);
}

.lottery-meta {
  position: relative;
  z-index: 1;
  width: 42%;
}

.lottery-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  background: radial-gradient(circle at 35% 30%, #e5bcff, #8d43ff 72%);
  box-shadow: 0 6px 12px rgba(146, 76, 255, 0.35);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.lottery-title {
  font-size: 18px;
  font-weight: 800;
  color: #262c40;
}

.lottery-subtitle {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.8px;
  color: #aa8fc3;
}

.lottery-subtitle::after {
  content: "";
  width: 28px;
  height: 1px;
  background: #d7c8ef;
}

.lottery-enter {
  margin-top: 12px;
  display: inline-grid;
  place-items: center;
  min-width: 70px;
  height: 24px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d8b9ff 0%, #a364ff 100%);
  color: #fff;
  font-size: 11px;
  box-shadow: 0 8px 16px rgba(153, 92, 255, 0.28);
}

.lottery-visual {
  position: relative;
  width: 160px;
  height: 94px;
  flex: 0 0 auto;
}

.lottery-wheel {
  position: absolute;
  right: 10px;
  top: -2px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 3px solid rgba(193, 186, 192, 0.95);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.88), inset 0 0 0 10px rgba(236, 237, 243, 0.55);
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0 55%, rgba(247, 241, 250, 0.9) 56% 100%);
}

.lottery-ball {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 8px rgba(122, 122, 152, 0.22);
}

.lottery-ball.red { background: linear-gradient(180deg, #ff8d9c, #f34d63); }
.lottery-ball.blue { background: linear-gradient(180deg, #5ec7ff, #1598ed); }
.lottery-ball.green { background: linear-gradient(180deg, #7fe48d, #25b05a); }
.lottery-ball.orange { background: linear-gradient(180deg, #ffc666, #ff9d24); }
.lottery-ball.purple { background: linear-gradient(180deg, #d19cff, #9856ff); }

.lottery-ball.b1 { top: 14px; left: 72px; }
.lottery-ball.b2 { top: 26px; left: 94px; }
.lottery-ball.b3 { top: 48px; left: 78px; }
.lottery-ball.b4 { top: 22px; left: 122px; }
.lottery-ball.b5 { top: 60px; left: 110px; }
.lottery-ball.b6 { top: 66px; left: 58px; }
.lottery-ball.b7 { top: 37px; left: 56px; }
.lottery-ball.b8 { top: 58px; left: 134px; }

.lottery-platform {
  position: absolute;
  right: 0;
  bottom: 6px;
  width: 128px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f2f6ff, #d9dfef);
  box-shadow: inset 0 2px 5px rgba(255, 255, 255, 0.75);
}

.lottery-extra {
  position: absolute;
  left: 58px;
  bottom: 8px;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.lottery-extra.flag {
  background: #fff;
  color: #ef4758;
  border: 1px solid #f3cfd5;
}

.lottery-extra.coin {
  background: linear-gradient(180deg, #ffdd7f, #f3a02a);
  color: #875812;
}

.lottery-modal {
  position: fixed;
  inset: 0;
  z-index: 5002;
  display: flex;
  align-items: flex-end;
  background: rgba(37, 40, 60, 0.34);
}

.lottery-sheet {
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 48vh;
  overflow-y: auto;
  padding: 12px 0 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 28px rgba(72, 92, 138, 0.18);
}

.lottery-modal .lottery-sheet {
  flex: 0 0 auto;
  padding-top: 0;
  border-radius: 18px 18px 0 0;
  width: calc(100% - 20px);
  margin: 0 10px;
  height: auto !important;
  max-height: 420px !important;
  overflow: hidden;
}

.lottery-modal .lottery-sheet-head {
  display: none;
}

.lottery-modal .lottery-room-row {
  min-height: 48px;
  height: 48px;
  grid-template-columns: 34px minmax(0, 1fr) auto 18px;
  gap: 8px;
  padding: 5px 12px;
  border-top: 1px solid #e6e9f0;
}

.lottery-modal .lottery-room-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(180deg, #d29aff 0%, #914be0 100%);
  font-size: 11px;
}

.lottery-modal .lottery-room-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lottery-modal .lottery-room-hot {
  font-size: 12px;
}

.lottery-modal .lottery-room-arrow {
  font-size: 20px;
  line-height: 1;
}

.lottery-sheet-title {
  flex: 1;
  height: 44px;
  border: 0;
  background: #fff;
  font-size: 15px;
  font-weight: 800;
  color: #21283f;
}

.lottery-sheet-head {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid #e4e7f0;
}

.lottery-sheet-close {
  width: 70px;
  height: 44px;
  border: 0;
  background: #fff;
  color: #77819a;
  font-size: 13px;
}

.lottery-sheet-x {
  width: 40px;
  font-size: 16px;
}

.lottery-room-row {
  width: 100%;
  min-height: 58px;
  margin: 0;
  border: 0;
  border-top: 1px solid #e4e7f0;
  border-radius: 0;
  background: #fff;
  display: grid;
  grid-template-columns: 44px 1fr auto 24px;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
}

.lottery-room-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #d3a2ff 0%, #8a43dc 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.lottery-room-name {
  font-size: 14px;
  font-weight: 700;
  color: #27304a;
  text-align: left;
}

.lottery-room-hot {
  color: #8790a8;
  font-size: 12px;
  white-space: nowrap;
}

.lottery-room-hot b {
  color: #f04d5c;
  font-weight: 700;
}

.lottery-room-arrow {
  color: #a2adc8;
  font-size: 18px;
}

.lottery-room-header {
  height: 52px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 0;
  color: #fff;
  background: linear-gradient(180deg, #16c9ee 0%, #159ee9 100%);
}

.lottery-room-back,
.lottery-room-menu {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 27px;
  line-height: 1;
}

.lottery-room-menu {
  font-size: 20px;
}

.lottery-room-title {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
}

.lottery-room-panel {
  position: relative;
  padding: 14px 10px 0;
  background: #fff;
  border-bottom: 1px solid #e2e6f0;
}

.lottery-room-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.lottery-room-label {
  color: #6e7894;
  font-size: 12px;
}

.lottery-room-label b,
.lottery-room-result b {
  color: #3f82d8;
  font-weight: 500;
}

.lottery-room-timer {
  margin-top: 4px;
  color: #ff6e7f;
  font-size: 24px;
  font-weight: 800;
}

.lottery-room-balance {
  margin-top: 4px;
  font-size: 20px;
  color: #222c44;
}

.lottery-room-result {
  margin: 12px -10px 0;
  padding: 10px;
  color: #67728e;
  font-size: 12px;
  border-top: 1px solid #e2e6f0;
}

.lottery-room-balls {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lottery-room-plus {
  color: #3a75ca;
  font-weight: 700;
}

.lottery-room-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.lottery-room-ball.blue {
  background: linear-gradient(180deg, #55c0ff, #1b8de8);
}

.lottery-room-ball.red {
  background: linear-gradient(180deg, #ff8f9f, #f34d63);
}

.lottery-room-message {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  color: #566078;
  font-size: 13px;
}

.lottery-room-message-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffdb2e, #f44336);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.lottery-bet-panel {
  margin: 12px -10px 0;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid #e2e6f0;
}

.lottery-bet-title {
  width: 100%;
  color: #566078;
  font-size: 13px;
}

.lottery-bet-amount {
  width: 86px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid #dce2ef;
  border-radius: 6px;
  color: #27304a;
}

.lottery-bet-button {
  flex: 1;
  min-width: 52px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: #16bdea;
  color: #fff;
}

.lottery-bet-button.active {
  background: #0a8ed5;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7);
}

.lottery-bet-confirm {
  width: 100%;
  height: 36px;
  border: 0;
  border-radius: 5px;
  background: #18b9e8;
  color: #fff;
  font-size: 13px;
}

.lottery-bet-subtitle {
  margin-top: 8px;
}

.lottery-number-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.lottery-number-button {
  height: 34px;
  border: 1px solid #dce2ef;
  border-radius: 5px;
  background: #fff;
  color: #348ff0;
  font-size: 16px;
}

.lottery-number-button small,
.lottery-odds-button small {
  display: block;
  margin-top: 2px;
  color: #8e98af;
  font-size: 9px;
}

.lottery-bet-section-label {
  width: 100%;
  margin-top: 8px;
  color: #566078;
  font-size: 12px;
}

.lottery-odds-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.lottery-odds-button {
  min-height: 39px;
  border: 1px solid #dce2ef;
  border-radius: 5px;
  background: #fff;
  color: #27304a;
  font-size: 13px;
}

.lottery-number-button.active small,
.lottery-odds-button.active small {
  color: rgba(255, 255, 255, .85);
}

.lottery-number-button.active {
  border-color: #18b9e8;
  background: #18b9e8;
  color: #fff;
}

.lottery-odds-button.active {
  border-color: #18b9e8;
  background: #18b9e8;
  color: #fff;
}

.lottery-chip-title {
  width: 100%;
  margin-top: 10px;
  color: #566078;
  font-size: 12px;
}

.lottery-chip-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
}

.lottery-global-chip-bar {
  width: 100%;
  padding: 7px 0 2px;
  border-top: 1px solid #e2e7f1;
  color: #566078;
  font-size: 12px;
}

.lottery-global-chip-bar .lottery-chip-grid {
  margin-top: 5px;
}

.lottery-chip-button {
  height: 30px;
  border: 1px solid #d6dfef;
  border-radius: 4px;
  background: #fff;
  color: #258be8;
  font-size: 12px;
}

.lottery-chip-button.active {
  border-color: #18b9e8;
  background: #18b9e8;
  color: #fff;
}

.lottery-chip-settings-button {
  height: 30px;
  border: 1px solid #d6dfef;
  border-radius: 4px;
  background: #fff;
  color: #7d89a3;
  font-size: 16px;
}

.lottery-chip-settings {
  min-height: 100vh;
  background: #f3f4fb;
}

.lottery-chip-settings-head {
  height: 52px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #4e8ff0, #4b9fe9);
  color: #fff;
}

.lottery-chip-settings-head button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.lottery-chip-settings-head button:first-child {
  font-size: 24px;
}

.lottery-chip-settings-note,
.lottery-chip-settings-label {
  padding: 12px;
  color: #5f6a84;
  font-size: 12px;
}

.lottery-chip-settings-inputs,
.lottery-chip-presets {
  padding: 0 12px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.lottery-chip-settings-inputs label {
  position: relative;
}

.lottery-chip-settings-inputs input,
.lottery-chip-presets button,
.lottery-chip-presets input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1dced;
  border-radius: 4px;
  background: #fff;
  color: #273653;
  font-size: 14px;
  text-align: center;
}

.lottery-chip-presets input {
  background: #fff;
  color: #2f6fcb;
  outline: none;
}

.lottery-chip-settings-inputs button {
  position: absolute;
  top: -7px;
  right: -4px;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #8c9ab5;
  color: #fff;
  font-size: 11px;
}

.lottery-chip-presets {
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.lottery-chat-quick {
  width: 100%;
  flex-basis: 100%;
  display: flex;
  gap: 5px;
  margin-top: 6px;
  overflow-x: auto;
}

.lottery-chat-quick button {
  flex: 0 0 auto;
  width: auto;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid #b9d9f4;
  border-radius: 14px;
  background: #fff;
  color: #258be8;
  font-size: 12px;
}

.lottery-chip-save {
  width: calc(100% - 24px);
  height: 38px;
  margin: 24px 12px;
  border: 0;
  border-radius: 5px;
  background: #4b9fe9;
  color: #fff;
}

.lottery-bet-summary {
  width: 100%;
  margin: 8px 0;
  color: #65708a;
  font-size: 12px;
}

.lottery-room-page {
  min-height: 100vh;
  padding-bottom: 18px;
  background: #eef0f8;
}

.lottery-room-panel {
  padding: 12px 0 0;
}

.lottery-room-info {
  min-height: 72px;
  padding: 0 22px 10px;
  align-items: flex-end;
}

.lottery-room-info-divider {
  width: 1px;
  height: 42px;
  background: #dfe4ef;
}

.lottery-room-label {
  color: #333b51;
}

.lottery-room-timer {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #59617a;
  color: #fff;
  font-size: 16px;
}

.lottery-room-balance {
  color: #f04444;
  font-size: 14px;
}

/* 首页余额卡片的积分/现金切换，不改变原有充值入口。 */
.lottery-home-balance-toggle {
  margin-left: 6px;
  min-width: 30px;
  padding: 2px 5px;
  border: 1px solid #c5a0ff;
  border-radius: 8px;
  background: #fff;
  color: #8b55d9;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  vertical-align: middle;
}

.lottery-game-id {
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.lottery-home-game-id {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 2px;
  color: #44537a;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.lottery-game-id-eye {
  min-width: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  margin-left: 4px;
  color: #7f8799;
  font-size: 11px;
  line-height: 16px;
  cursor: pointer;
}

.lottery-discover-stage-entry {
  width: calc(100% - 16px);
  min-height: 60px;
  margin: 10px auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  background: #fff;
  color: #26365d;
  box-shadow: 0 4px 12px rgba(80, 101, 155, .08);
  cursor: pointer;
}

.lottery-discover-stage-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #557fd7;
  font-size: 14px;
  margin-left: 12px;
}

.lottery-discover-stage-icon > img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
}

.lottery-discover-stage-icon.lottery-wheel-icon {
  border: 1px solid #a2b7ef;
}

.lottery-discover-stage-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lottery-discover-stage-arrow {
  margin-left: auto;
  margin-right: 14px;
  color: #c2cbe0;
  font-size: 24px;
}

.lottery-stage-page {
  min-height: 100vh;
  background: #f3f4fb;
}

.lottery-stage-header {
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #6678df, #8051b7);
  color: #fff;
}

.lottery-stage-header button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
}

.lottery-stage-empty {
  margin: 16px;
  padding: 48px 20px;
  border-radius: 12px;
  background: #fff;
  color: #8992ad;
  text-align: center;
}

.lottery-current-line {
  min-height: 44px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e0e4ee;
  border-bottom: 1px solid #e0e4ee;
  color: #20283b;
  font-size: 12px;
}

/* Keep the room header compact: the latest draw is represented by one row. */
.lottery-current-line {
  display: none;
}

.lottery-history-compact {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  display: grid;
  grid-template-columns: auto 1fr 18px;
  align-items: center;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid #e5e9f1;
  background: #fff;
  color: #28334c;
  font-size: 11px;
  text-align: left;
}

.lottery-history-compact b {
  color: #378ff0;
  font-weight: 500;
}

.lottery-history-compact small {
  display: none;
  color: #9aa3b8;
  white-space: nowrap;
}

.lottery-history-compact .lottery-history-result {
  justify-content: flex-end;
  min-width: 0;
}

.lottery-history-compact i {
  color: #8c96aa;
  font-style: normal;
  text-align: right;
}

.lottery-history-expanded {
  display: none;
}

.lottery-history.is-expanded .lottery-history-expanded {
  display: block;
}

.lottery-scratch-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 21px;
  line-height: 34px;
}

.lottery-scratch-toggle.active {
  background: rgba(255, 255, 255, .24);
}

.lottery-scratch-card {
  display: none;
  position: relative;
  min-height: 108px;
  margin: 0 -10px 8px;
  padding: 12px 16px;
  border-radius: 0 0 10px 10px;
  background: #fff;
  text-align: center;
}

.lottery-room-page.is-scratch-mode .lottery-scratch-card {
  display: block;
}

.lottery-room-page.is-scratch-mode .lottery-current-line,
.lottery-room-page.is-scratch-mode .lottery-history {
  display: none;
}

/* Scratch mode replaces the normal balance/current-period panel on H5. */
.lottery-room-page.is-scratch-mode .lottery-room-info {
  display: none;
}

.lottery-scratch-card-period {
  color: #27304a;
  font-size: 12px;
}

.lottery-scratch-card-period b {
  color: #378ff0;
  font-weight: 500;
}

.lottery-scratch-result {
  min-height: 54px;
  margin: 8px auto 0;
  padding: 14px 8px;
  border-radius: 5px;
  background: #fff;
}

.lottery-scratch-result .lottery-room-balls {
  margin: 0;
}

.lottery-scratch-cover {
  position: absolute;
  left: 42%;
  right: 4%;
  top: 40px;
  bottom: 10px;
  z-index: 2;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, .8);
  font-size: 11px;
}

.lottery-scratch-cover::after {
  content: '✦  ✦  ✦';
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, .72);
  letter-spacing: 4px;
}

.lottery-scratch-card.is-revealed .lottery-scratch-cover {
  opacity: 0;
  pointer-events: none;
}

/* Scratch layout follows the compact two-column result card used by the reference page. */
.lottery-scratch-card {
  min-height: 112px;
  margin: 0 -10px;
  padding: 10px 12px 8px;
  border-radius: 0 0 9px 9px;
  height: 112px;
  min-height: 0;
  overflow: hidden;
}

.lottery-scratch-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 24px;
  color: #29334a;
  font-size: 11px;
  text-align: center;
}

.lottery-scratch-head b {
  color: #378ff0;
  font-weight: 500;
}

.lottery-scratch-body {
  position: relative;
  height: 74px;
  min-height: 0;
  overflow: hidden;
}

.lottery-scratch-countdown {
  position: absolute;
  left: 18%;
  top: 6px;
  min-width: 56px;
  height: 25px;
  padding: 0 8px;
  border-radius: 4px;
  background: #5c657f;
  color: #fff;
  font-size: 16px;
  line-height: 25px;
  text-align: center;
}

.lottery-scratch-refresh {
  position: absolute;
  left: 18%;
  bottom: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4b9ff0;
  font-size: 11px;
}

.lottery-scratch-result {
  position: absolute;
  left: 38%;
  right: 2%;
  top: 0;
  bottom: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: transparent;
  visibility: visible;
  z-index: 1;
}

.lottery-scratch-result .lottery-room-balls {
  margin: 0;
  justify-content: center;
}

.lottery-scratch-cover {
  position: absolute;
  left: 38%;
  right: 2%;
  top: 0;
  bottom: 0;
  display: block;
  width: auto;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  z-index: 9999 !important;
  opacity: 1;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}

.lottery-scratch-cover::after {
  margin-top: 8px;
}

/* Keep the hidden result completely inside the scratchable area. */
.lottery-scratch-result {
  overflow: visible !important;
  visibility: hidden !important;
}

.lottery-scratch-result .lottery-room-balls {
  display: flex;
  width: 100%;
  min-width: 0;
  max-width: none;
  overflow: visible;
  flex-wrap: nowrap;
  justify-content: center;
  white-space: nowrap;
}

.lottery-scratch-result-canvas {
  position: absolute;
  left: 38%;
  right: 2%;
  top: 0;
  bottom: 0;
  display: block;
  width: auto;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.lottery-room-chat.is-latest-only,
.lottery-room-page .lottery-room-chat {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
}

/* Match the compact reference scratch card on narrow H5 screens. */
.lottery-room-page.is-scratch-mode .lottery-scratch-card {
  display: block;
  width: 100%;
  height: 112px;
  margin: 0;
  padding: 10px 10px 8px;
  border-radius: 0 0 8px 8px;
  box-sizing: border-box;
}

.lottery-room-page.is-scratch-mode .lottery-scratch-head {
  height: 24px;
  min-height: 24px;
}

.lottery-room-page.is-scratch-mode .lottery-scratch-body {
  height: 74px;
}

.lottery-current-line > span:first-child {
  white-space: nowrap;
}

.lottery-current-line b,
.lottery-history-row > span:first-child {
  color: #378ff0;
  font-weight: 500;
}

.lottery-current-line .lottery-room-balls {
  margin: 0;
}

.lottery-room-balls i {
  color: #3c4b69;
  font-style: normal;
}

.lottery-room-balls em {
  color: #3d465d;
  font-style: normal;
  white-space: nowrap;
}

.lottery-history {
  padding: 0 8px;
  background: #fff;
}

.lottery-history-row.is-history-extra {
  display: none;
}

.lottery-history.is-expanded .lottery-history-row.is-history-extra {
  display: grid;
}

.lottery-history-head,
.lottery-history-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.45fr;
  align-items: center;
  min-height: 30px;
  gap: 4px;
  font-size: 11px;
}

.lottery-history-head {
  color: #6e7891;
  background: #f0f2f7;
  text-align: center;
}

.lottery-history-row {
  border-bottom: 1px solid #edf0f5;
  color: #68728b;
  text-align: center;
}

.lottery-history-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.lottery-history-result .lottery-room-ball,
.lottery-current-line .lottery-room-ball {
  width: 19px;
  height: 19px;
  font-size: 10px;
}

.lottery-history-result em {
  font-size: 10px;
}

.lottery-history-more {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #edf0f5;
  padding: 10px;
  color: #378ff0;
  background: #fff;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
}

.lottery-history-more span {
  margin-left: 4px;
  font-size: 13px;
}

.lottery-history-empty {
  padding: 24px 8px;
  color: #9aa3b8;
  text-align: center;
  font-size: 12px;
}

.lottery-bet-panel {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 76px;
  z-index: 20;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  margin: 0;
  padding: 12px 10px;
  background: #fff;
  border: 1px solid #e1e6f0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 24px rgba(71, 91, 137, .18);
  animation: lottery-sheet-rise .22s ease-out both;
}

.lottery-bet-panel.is-collapsed {
  display: none !important;
}

.lottery-room-tools {
  padding: 16px 8px 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 8px;
  background: #fff;
}

.lottery-room-tools button {
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #353b4c;
  font-size: 12px;
}

.lottery-room-tools button span,
.lottery-room-tools button b {
  display: block;
}

.lottery-room-tools button span {
  width: 22px;
  height: 22px;
  margin: 0 auto 3px;
  border-radius: 50%;
  background: #aeb8d0;
  color: #fff;
  line-height: 22px;
  font-size: 14px;
}

.lottery-my-bets-list {
  padding: 8px 12px 20px;
  background: #f4f6fb;
}

.lottery-my-bet-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: #fff;
  color: #263b69;
  font-size: 12px;
}

.lottery-my-bet-row > div:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.lottery-my-bet-row b,
.lottery-my-bet-row span {
  display: block;
}

.lottery-my-bet-row span {
  margin-top: 4px;
  color: #8b96b1;
}

.lottery-my-bet-row em {
  display: block;
  margin-top: 6px;
  color: #667796;
  font-style: normal;
  line-height: 1.55;
  word-break: break-all;
}

.lottery-my-bet-group > div:first-child {
  min-width: 0;
}

.lottery-my-bet-group > div:last-child b {
  color: #1c396e;
}

[data-room-points] + [data-role="refresh-points"] {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6d8edb;
  font-size: 11px;
}

.lottery-more-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  background: rgba(22, 28, 48, .12);
}

.lottery-more-sheet {
  width: 100%;
  padding: 18px 12px 24px;
  background: #fff;
  box-sizing: border-box;
  animation: lottery-sheet-rise .22s ease-out both;
}

@keyframes lottery-sheet-rise {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.lottery-more-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
}

.lottery-more-grid button {
  min-height: 58px;
  border: 0;
  background: transparent;
  color: #27304a;
  font-size: 12px;
}

.lottery-more-grid button span,
.lottery-more-grid button b {
  display: block;
}

.lottery-more-icon {
  width: 30px;
  height: 30px;
  margin: 0 auto 6px;
  border-radius: 8px;
  background: #eef1f8;
  color: #8692ae;
  line-height: 30px;
  font-size: 18px;
  font-weight: 400;
}

.lottery-tool-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  background: rgba(22, 28, 48, .55);
}

.lottery-tool-sheet {
  width: 100%;
  max-height: 76vh;
  overflow: auto;
  border-radius: 14px 14px 0 0;
  animation: lottery-sheet-rise .22s ease-out both;
  background: #fff;
}

.lottery-tool-head {
  height: 44px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7eaf1;
  color: #27304a;
}

.lottery-tool-head button {
  min-width: 54px;
  border: 0;
  background: transparent;
  color: #4aa0f5;
  font-size: 12px;
}

.lottery-tool-list {
  padding: 0 10px 16px;
}

.lottery-tool-list > div {
  min-height: 36px;
  display: grid;
  grid-template-columns: 1fr 1.4fr .6fr;
  align-items: center;
  border-bottom: 1px solid #edf0f5;
  color: #5d6780;
  font-size: 11px;
  text-align: center;
}

.lottery-tool-list b {
  color: #288fe9;
  font-weight: 500;
}

.lottery-tool-list em {
  color: #f05d6b;
  font-style: normal;
}

.lottery-room-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: flex-end;
  background: rgba(22, 28, 48, .48);
}

.lottery-room-settings-sheet {
  width: 100%;
  max-height: 82vh;
  overflow: auto;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -6px 24px rgba(22, 28, 48, .16);
  animation: lottery-sheet-rise .22s ease-out both;
}

.lottery-room-settings-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid #edf0f5;
  color: #27304a;
  text-align: center;
}

.lottery-room-settings-head button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4c5870;
  font-size: 24px;
}

.lottery-room-settings-head b {
  font-size: 16px;
  font-weight: 600;
}

.lottery-room-settings-section {
  padding: 16px;
  border-top: 8px solid #f3f5fa;
}

.lottery-room-settings-section h3 {
  margin: 0 0 14px;
  color: #27304a;
  font-size: 15px;
  font-weight: 600;
}

.lottery-room-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 8px;
}

.lottery-room-settings-grid button {
  min-height: 76px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #27304a;
  font-size: 12px;
}

.lottery-room-settings-grid button b,
.lottery-room-settings-grid button span {
  display: block;
}

.lottery-room-settings-icon {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 7px;
  border-radius: 14px;
  background: #edf7ff;
  color: #3ca9e7;
  font-size: 24px;
}

.lottery-room-settings-grid button b {
  font-weight: 400;
}

.lottery-room-setting-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  cursor: pointer;
}

.lottery-room-setting-switch > span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lottery-room-setting-switch > span b {
  color: #27304a;
  font-size: 14px;
}

.lottery-room-setting-switch small {
  color: #8994aa;
  font-size: 12px;
}

.lottery-room-setting-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lottery-room-setting-switch i {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 20px;
  background: #d4dbe8;
  transition: background .2s ease;
}

.lottery-room-setting-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(22, 28, 48, .18);
  transition: transform .2s ease;
}

.lottery-room-setting-switch input:checked + i {
  background: #56b8ed;
}

.lottery-room-setting-switch input:checked + i::after {
  transform: translateX(20px);
}

.lottery-room-rules-body {
  padding: 20px;
  color: #536078;
  font-size: 14px;
  line-height: 1.8;
}

@media (min-width: 768px) {
  .lottery-room-settings-sheet {
    width: min(520px, 100%);
    margin: 0 auto;
  }
}

.lottery-road-grid {
  min-height: 116px;
  margin: 14px 10px 8px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  border: 1px solid #d9e0ef;
  background: repeating-linear-gradient(0deg, transparent 0 22px, #e8edf7 23px), repeating-linear-gradient(90deg, transparent 0 34px, #e8edf7 35px);
}

.lottery-road-dot {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
}

.lottery-road-dot.is-big { background: #ef6675; }
.lottery-road-dot.is-small { background: #4b9eee; }

.lottery-tool-note {
  padding: 0 14px 18px;
  color: #9aa3b8;
  font-size: 11px;
  text-align: center;
}

.lottery-hot-grid {
  padding: 12px 10px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.lottery-hot-grid div {
  padding: 8px 2px;
  border: 1px solid #e3e8f2;
  border-radius: 6px;
  text-align: center;
}

.lottery-hot-grid b,
.lottery-hot-grid span {
  display: block;
}

.lottery-hot-grid b { color: #338fe9; }
.lottery-hot-grid span { margin-top: 3px; color: #8993aa; font-size: 10px; }

.lottery-room-compose {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 48px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.lottery-room-input {
  flex: 1;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #fff;
  color: #aeb5c8;
  font-size: 13px;
}

.lottery-room-compose > button {
  width: 54px;
  height: 36px;
  border: 0;
  border-radius: 20px;
  background: #8be9fa;
  color: #fff;
}

.lottery-room-chat {
  max-height: 360px;
  min-height: 180px;
  padding: 12px 10px 58px;
  overflow-y: auto;
  background: #eef0f8;
}

.lottery-chat-message {
  margin: 0 0 12px;
}

.lottery-chat-name {
  margin: 0 8px 4px;
  color: #8992a8;
  font-size: 12px;
}

.lottery-chat-name small {
  margin-left: 6px;
  color: #b1b7c6;
  font-size: 12px;
}

.lottery-chat-bubble {
  display: inline-block;
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 4px 14px 14px 14px;
  background: #fff;
  color: #3c465c;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}

.lottery-chat-message.is-robot .lottery-chat-bubble {
  background: #fff;
  color: #3c465c;
}

.lottery-chat-message.is-system {
  margin: 10px 0;
  text-align: center;
}

.lottery-chat-message.is-system .lottery-chat-name {
  display: none;
}

.lottery-chat-message.is-system .lottery-chat-bubble {
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 12px;
  background: transparent;
  color: #9aa3b8;
  font-size: 12px;
}

.lottery-chat-empty {
  padding: 48px 10px;
  color: #a8afc0;
  font-size: 12px;
  text-align: center;
}

/* Room chat: keep the message hierarchy used by the reference layout. */
.lottery-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lottery-chat-message.is-system {
  display: block;
}

.lottery-chat-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  border-radius: 50%;
  background: #d9deeb;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.lottery-chat-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.lottery-chat-avatar.robot {
  background: #55349c;
}

.lottery-chat-content {
  min-width: 0;
  flex: 1;
}

.lottery-chat-name {
  margin-left: 0;
}

.lottery-chat-bubble {
  max-width: 92%;
  border-radius: 4px 14px 14px 14px;
}

.lottery-chat-message.is-bet .lottery-chat-bubble {
  min-height: 34px;
  color: #3c465c;
}

.lottery-bill-title {
  margin: 0 0 4px;
  color: #8992a8;
  font-size: 10px;
}

.lottery-bill-card {
  width: min(92%, 272px);
  overflow: hidden;
  border-radius: 4px 14px 14px 14px;
  background: #fff;
}

.lottery-bill-period {
  padding: 10px 12px 7px;
  color: #3c465c;
  font-size: 14px;
  line-height: 1.3;
}

.lottery-bill-list {
  margin: 0 10px 9px;
  padding: 2px 8px;
  border-radius: 5px;
  background: #f0f1f6;
}

.lottery-bill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 34px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid #e2e4ec;
  outline: 0;
  background: transparent;
  color: #454d61;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}

.lottery-bill-row:last-child {
  border-bottom: 0;
}

.lottery-bill-row b {
  color: #8d96b0;
  font-size: 20px;
  font-weight: 400;
}

.lottery-bill-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .56);
}

.lottery-bill-detail-sheet {
  width: min(86vw, 320px);
  min-height: 250px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(0, 0, 0, .18);
}

.lottery-bill-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 8px;
  color: #20263a;
  font-size: 14px;
}

.lottery-bill-detail-head span {
  color: #f15b52;
  white-space: nowrap;
}

.lottery-bill-detail-list {
  margin: 0 10px;
  padding: 5px 10px;
  border-radius: 6px;
  background: #eef0f8;
}

.lottery-bill-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  border-bottom: 1px solid #e0e3ef;
  color: #3c465c;
  font-size: 13px;
}

.lottery-bill-detail-row:last-child {
  border-bottom: 0;
}

.lottery-bill-detail-row b {
  padding: 2px 7px;
  border-radius: 4px;
  background: #19b9ed;
  color: #fff;
  font-size: 12px;
}

.lottery-bill-detail-row strong {
  color: #f15b52;
  font-size: 13px;
}

.lottery-bill-detail-close {
  width: 100%;
  margin-top: 118px;
  padding: 13px 10px;
  border: 0;
  border-top: 1px solid #e8e8ee;
  background: #fff;
  color: #222;
  font-size: 16px;
}

.lottery-room-page.is-betting-closed [data-role="select-bet"],
.lottery-room-page.is-betting-closed [data-role="confirm-bet"],
.lottery-room-page.is-betting-closed [data-role="chat-quick"] {
  opacity: .45;
  cursor: not-allowed;
}

.lottery-chat-message.is-result .lottery-chat-avatar {
  margin-top: 20px;
}

.lottery-result-card {
  width: min(92%, 290px);
  overflow: hidden;
  border-radius: 5px 14px 14px 14px;
  background: #fff;
  color: #3c465c;
}

.lottery-result-card > strong {
  display: block;
  padding: 10px 12px;
  background: #61b5ed;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}

.lottery-result-balls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 58px;
  padding: 8px;
  white-space: nowrap;
}

.lottery-result-balls b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #24a9e5;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.lottery-result-balls b.is-red {
  background: #f5667d;
}

.lottery-result-balls i {
  color: #59637b;
  font-style: normal;
}

.lottery-result-balls em {
  margin-left: 2px;
  color: #3d465d;
  font-size: 13px;
  font-style: normal;
}

.lottery-result-hidden,
.lottery-result-text {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px 12px;
  color: #62a9e5;
  font-size: 13px;
  text-align: center;
}

.lottery-room-compose {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 2;
  padding: 10px;
  flex-wrap: wrap;
  background: #eef0f8;
}

.lottery-room-input {
  min-width: 0;
  padding: 0 14px;
  border: 0;
  outline: 0;
  box-sizing: border-box;
  text-align: left;
}

.lottery-room-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: #fff;
  color: #8b94ac;
  font-size: 11px;
}

/* Compact quick-bet controls modeled after the reference room layout. */
.lottery-quick-command {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 18px;
  background: #f5f6fb;
  box-sizing: border-box;
}

.lottery-quick-command input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #536078;
  font-size: 13px;
}

.lottery-quick-command button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #9ca5b8;
  color: #fff;
  font-size: 18px;
  line-height: 24px;
}

.lottery-quick-numbers {
  width: 100%;
  display: grid;
  grid-template-columns: 24px repeat(7, minmax(0, 1fr)) 24px;
  gap: 4px;
  margin: 6px 0 4px;
  padding: 3px 0;
  background: #dfe2eb;
}

.lottery-quick-numbers.is-wide-page {
  grid-template-columns: 24px repeat(8, minmax(0, 1fr)) 24px;
}

.lottery-quick-numbers button,
.lottery-quick-actions button {
  min-height: 32px;
  padding: 2px 4px;
  border: 1px solid #d5dbea;
  border-radius: 5px;
  background: #fff;
  color: #394861;
  font-size: 12px;
}

.lottery-quick-numbers button small {
  display: block;
  color: #8f99ae;
  font-size: 9px;
}

.lottery-quick-numbers .lottery-quick-arrow {
  padding: 0;
  border: 0;
  background: transparent;
  color: #8d96aa;
  font-size: 26px;
  line-height: 30px;
}

.lottery-quick-number {
  min-width: 0;
  min-height: 38px !important;
  padding: 1px 2px !important;
  background: #fff !important;
  text-align: center;
}

.lottery-quick-number small {
  font-size: 9px !important;
}

.lottery-quick-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 0 3px 4px;
  background: #dfe2eb;
}

.lottery-quick-grid button {
  min-height: 38px;
  padding: 2px 1px;
  border: 1px solid #d3d8e3;
  border-radius: 5px;
  background: #f8f9fc;
  color: #303b50;
  font-size: 13px;
  line-height: 16px;
}

.lottery-quick-grid button small {
  display: block;
  color: #768198;
  font-size: 9px;
  line-height: 11px;
}

.lottery-quick-grid button[data-role="clear-bets"],
.lottery-quick-grid button[data-role="quick-backspace"] {
  background: #aeb6c5;
  color: #fff;
}

.lottery-quick-grid button[data-role="quick-digit"] {
  background: #fff;
  color: #5a94f0;
  font-size: 22px;
}

.lottery-quick-grid .lottery-bet-confirm {
  border-color: #56b8ee;
  background: #56b8ee;
  color: #fff;
}

.lottery-bet-panel .lottery-bet-summary {
  width: 100%;
  padding: 6px 10px;
  background: #eef0f8;
  color: #65718a;
  font-size: 11px;
}

.lottery-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
}

.lottery-quick-actions button:first-child {
  background: #aeb6c5;
  color: #fff;
}

/* Room footer: hide the shortcut command row and quick-score row. */
.lottery-room-page .lottery-chat-quick,
.lottery-room-page .lottery-global-chip-bar {
  display: none !important;
}

/* H5 room layout: keep the chat viewport and bottom navigation inside the phone screen. */
@media (max-width: 600px) {
  .lottery-modal .lottery-sheet {
    width: calc(100% - 20px);
    margin: 0 10px;
    height: auto !important;
    max-height: 360px !important;
  }

  .lottery-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .lottery-room-page {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding: 0 0 60px;
    overflow: hidden;
  }

  .lottery-room-panel {
    height: calc(100dvh - 52px);
    min-height: 0;
    padding: 0;
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .lottery-room-chat {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding-bottom: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lottery-room-compose {
    flex: 0 0 auto;
    padding: 8px 10px;
  }

  /* The existing four-button bar is .lottery-room-tools; keep it visible. */
  .lottery-room-tools {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: 0 !important;
    z-index: 200 !important;
    height: calc(60px + env(safe-area-inset-bottom)) !important;
    min-height: 60px !important;
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 6px 8px env(safe-area-inset-bottom) !important;
    background: #fff !important;
    box-shadow: 0 -2px 10px rgba(80, 96, 135, .12) !important;
  }

  .lottery-room-tools button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 42px !important;
  }

  .lottery-room-page {
    padding-bottom: calc(78px + env(safe-area-inset-bottom)) !important;
  }

  .lottery-room-chat {
    padding-bottom: 10px !important;
  }

  .lottery-bet-panel {
    display: none;
  }

  .lottery-bet-panel:not(.is-collapsed) {
    display: flex;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 60px;
    z-index: 30;
    max-height: 68dvh;
    overflow-y: auto;
  }

  .lottery-room-page.is-scratch-mode .lottery-scratch-card {
    flex: 0 0 112px;
  }
}

/* 首页右上角下载入口：使用“我的”页面同款紫色下载按钮 */
.hallPage .download-link:not(.codex-hall-header-action) {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 2.2rem !important;
  height: .72rem !important;
  margin: .22rem .28rem 0 0 !important;
  padding: .04rem .08rem !important;
  overflow: hidden !important;
  border: .02667rem solid #b66cf2 !important;
  border-radius: .36rem !important;
  background: #fff !important;
  box-shadow: 0 .04rem .12rem rgba(161, 52, 241, .16) !important;
  line-height: 1 !important;
}

.hallPage .download-link:not(.codex-hall-header-action) img {
  display: none !important;
}

.hallPage .download-link:not(.codex-hall-header-action)::before {
  content: "⇩" !important;
  display: inline-block !important;
  margin-right: .06rem !important;
  color: #9b4de8 !important;
  font-size: .42rem !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.hallPage .download-link:not(.codex-hall-header-action)::after {
  content: "下载" !important;
  display: inline-block !important;
  color: #7d3fce !important;
  font-size: .3rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}

/* 大舞台使用主站标题栏承载独立社区，内容区由 iframe 铺满。 */
.lottery-stage-page.lottery-stage-embedded{display:flex;flex-direction:column;width:100%;height:100vh;min-height:100vh;overflow:hidden;background:#f4f6fd}.lottery-stage-embedded .lottery-stage-header{flex:0 0 1.08rem;height:1.08rem;display:grid;grid-template-columns:.9rem 1fr .9rem;align-items:center;text-align:center;background:#fff;border-bottom:1px solid #edf0f7;box-sizing:border-box;z-index:2}.lottery-stage-embedded .lottery-stage-header button{border:0;background:transparent;color:#62708f;font-size:.48rem}.lottery-stage-embedded .lottery-stage-header b{color:#182541;font-size:.36rem}.lottery-stage-frame-wrap{position:relative;flex:1 1 auto;min-height:0;overflow:hidden}.lottery-stage-frame,.lottery-stage-frame-loading{position:absolute;inset:0;width:100%;height:100%}.lottery-stage-frame{display:block;border:0;background:#fff;opacity:0;transition:opacity .18s ease}.lottery-stage-frame-loading{display:grid;place-items:center;color:#98a1b7;font-size:.28rem;background:#f4f6fd}.lottery-stage-frame-wrap.is-loaded .lottery-stage-frame{opacity:1}.lottery-stage-frame-wrap.is-loaded .lottery-stage-frame-loading{display:none}

.cash-wheel-page{min-height:100vh;background:linear-gradient(#fff9f0,#f8f2ff);color:#4d465a;overflow:auto;padding-bottom:.5rem}.cash-wheel-header{height:1.1rem;background:#fff;display:grid;grid-template-columns:.8rem 1fr .8rem;align-items:center;text-align:center;font-size:.38rem;position:sticky;top:0;z-index:5}.cash-wheel-header button{border:0;background:transparent;font-size:.48rem;color:#667085}.cash-wheel-loading{text-align:center;padding:2rem 0}.cash-wheel-hero{padding:.45rem .2rem;text-align:center}.cash-wheel-disc{position:relative;width:6.6rem;height:6.6rem;margin:.2rem auto .55rem;border:.18rem solid #f5d49d;border-radius:50%;box-shadow:0 0 0 .08rem #fff,0 .15rem .4rem rgba(78,54,104,.22);background:repeating-conic-gradient(#303746 0deg 45deg,#444b59 45deg 90deg);transition:transform 3s cubic-bezier(.12,.7,.18,1);transform:rotate(0deg)}.cash-wheel-disc:before{content:"";position:absolute;left:50%;top:-.32rem;transform:translateX(-50%);border-left:.22rem solid transparent;border-right:.22rem solid transparent;border-top:.55rem solid #fff;z-index:3}.cash-wheel-disc span{position:absolute;left:calc(50% - .65rem);top:calc(50% - .2rem);width:1.3rem;color:#ffe4b3;font-size:.25rem;text-align:center;transform-origin:.65rem .2rem;white-space:nowrap}.cash-wheel-disc button{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:1.65rem;height:1.65rem;border-radius:50%;border:.12rem solid #fff3dc;background:linear-gradient(#efbd7c,#c8833d);box-shadow:0 .06rem .2rem rgba(0,0,0,.35);color:#fff;font-size:.34rem;font-weight:700;z-index:4}.cash-wheel-disc button:disabled{opacity:.75}.cash-wheel-times{display:inline-block;padding:.18rem .65rem;border:1px solid #e8bd7f;border-radius:.6rem;background:#fff0d5;color:#9b7048;font-size:.32rem}.cash-wheel-times b,.cash-wheel-progress b,.cash-wheel-rules b{color:#ef655b}.cash-wheel-progress{margin-top:.28rem;font-size:.27rem;color:#8b8298}.cash-wheel-rules{margin:.25rem;border-radius:.18rem;background:#fff;padding:.35rem .3rem;box-shadow:0 .05rem .2rem rgba(80,60,110,.06)}.cash-wheel-rules h3{text-align:center;font-size:.34rem;font-weight:500}.cash-wheel-rules p{text-align:center;color:#887f91;font-size:.26rem}.cash-wheel-rules ul{list-style:none;padding:0;margin:0}.cash-wheel-rules li{display:flex;justify-content:space-between;padding:.22rem .18rem;margin:.08rem 0;border-radius:.1rem;background:#faf7ff;font-size:.27rem}
