* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #dbeafe;
}

html {
  background: #e8f4fc;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background: #e8f4fc;
  color: #111827;
}

/* Global scrollbar theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #dbeafe;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #94a3b8, #64748b);
}

::-webkit-scrollbar-corner {
  background: #e8f4fc;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

h1, h2, p {
  margin: 0;
  color: #111827;
}

h1 {
  font-size: 22px;
}

.sub {
  margin-top: 6px;
  color: #6b7280;
  font-size: 13px;
}

.current-wrap {
  display: grid;
  gap: 8px;
}

.compact-draw {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: nowrap;
  width: 100%;
}

.compact-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

/* 开奖球与右侧形态紧挨，整体再与期号留间距 */
.compact-balls-tags {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}

/* 形态标签 +「历史」：与开奖球同一行时整体靠右 */
.compact-draw-right {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.compact-draw-right .history-toggle-btn {
  margin-left: 0;
}

.compact-balls {
  padding: 0;
  gap: 6px;
}

.compact-balls .ball {
  width: 34px;
  height: 34px;
}

.compact-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* 手机：期号在开奖号码上方；形态 +「历史」在号码右侧一列 */
@media (max-width: 560px) {
  .compact-left {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .compact-left > #currentPeriod {
    width: 100%;
    font-size: clamp(13px, 3.6vw, 16px);
    line-height: 1.35;
    word-break: break-all;
  }

  .compact-balls-tags {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    flex-wrap: nowrap;
  }

  .compact-balls {
    flex-shrink: 0;
    flex-wrap: nowrap;
  }

  .compact-draw-right {
    flex: 1 1 auto;
    margin-left: 0;
    flex-direction: column;
    align-items: flex-end;
    align-self: stretch;
    gap: 8px;
    min-width: 0;
  }

  .compact-tags {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 4px 6px;
    width: 100%;
    max-width: 100%;
  }

  .compact-draw-right .history-toggle-btn {
    align-self: flex-end;
  }
}

/* 开奖形态：与「历史」按钮同色系（浅蓝天蓝边） */
.draw-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  min-height: 18px;
  line-height: 1.15;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border-radius: 6px;
  border: 1px solid #7dd3fc;
  background: #e0f2fe;
  color: #0369a1;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.draw-tag--sum {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  letter-spacing: 0.02em;
  min-width: 1.6em;
}

/* [hidden] 会被 .draw-tag 的 display 盖住，无「和」时仍会占位成空框 */
.draw-tag[hidden],
.draw-tag.hidden {
  display: none !important;
}

.history-toggle-btn {
  flex-shrink: 0;
  margin-left: auto;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.history-toggle-btn.expanded {
  background: #bae6fd;
  border-color: #38bdf8;
  color: #0c4a6e;
}

/* 顶栏内多个「历史」式按钮并排，不使用 margin-left:auto */
.auth-actions .history-toggle-btn {
  margin-left: 0;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.compact-row {
  justify-content: flex-start;
  gap: 10px;
}

/* 下期期号、倒计时：深黑字（仅 current-wrap 内两行） */
.current-wrap .row.compact-row:not(.countdown-row) > span {
  color: #0a0a0a;
}

.compact-row strong {
  color: #0a0a0a;
}

.countdown-row {
  flex-wrap: wrap;
  align-items: center;
}

/* 下期期号 + 倒计时：与后台开奖条同款醒目提醒 */
.countdown-strip {
  margin-top: 2px;
  padding: 8px 10px 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  color: #1e3a8a;
  display: grid;
  gap: 6px;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.countdown-strip .compact-row {
  margin: 0;
}

.countdown-strip--warn {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #92400e;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25);
}

.countdown-strip--seal {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
  animation: countdown-strip-seal-pulse 1.25s ease-in-out infinite;
}

.countdown-row__label {
  font-size: 15px;
  font-weight: 600;
  color: #0a0a0a;
  white-space: nowrap;
}

.countdown-strip--warn .countdown-row__label,
.countdown-strip--warn .compact-row strong {
  color: #92400e;
}

.countdown-strip--seal .countdown-row__label,
.countdown-strip--seal .compact-row strong {
  color: #991b1b;
}

#countdown.countdown-display {
  flex: 0 1 auto;
  text-align: left;
  font-size: clamp(1.05rem, 2.8vw, 1.28rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: #0a0a0a;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fafafa;
  border: 2px solid #262626;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-shadow: none;
}

.countdown-strip--warn #countdown.countdown-display.countdown-display--warn {
  color: #c2410c;
  border-color: #ea580c;
  background: #fff7ed;
  font-size: clamp(1.12rem, 3.2vw, 1.35rem);
  animation: countdown-pulse-warn 1.1s ease-in-out infinite;
}

.countdown-strip--seal #countdown.countdown-display.countdown-display--critical {
  color: #b91c1c;
  border-color: #b91c1c;
  background: #fef2f2;
  font-size: clamp(1.2rem, 3.6vw, 1.5rem);
  letter-spacing: 0.06em;
  animation: countdown-pulse-critical 0.9s ease-in-out infinite;
}

@keyframes countdown-pulse-warn {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.16), 0 1px 6px rgba(0, 0, 0, 0.08);
  }
}

@keyframes countdown-pulse-critical {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14), 0 1px 5px rgba(0, 0, 0, 0.07);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

@keyframes countdown-strip-seal-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.35);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.12);
  }
}

.countdown-warn-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.06em;
  background: #f59e0b;
  color: #431407;
  border: 1px solid #d97706;
  vertical-align: middle;
}

.countdown-seal-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: #dc2626;
  color: #fff;
  border: 1px solid #991b1b;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(185, 28, 28, 0.45);
  animation: countdown-seal-chip-pulse 1s ease-in-out infinite;
}

.countdown-warn-chip.hidden,
.countdown-seal-chip.hidden {
  display: none !important;
}

@keyframes countdown-seal-chip-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .countdown-strip--seal {
    animation: none;
  }

  .countdown-seal-chip {
    animation: none;
  }

  #countdown.countdown-display.countdown-display--warn,
  #countdown.countdown-display.countdown-display--critical {
    animation: none;
  }

  .countdown-strip--warn #countdown.countdown-display.countdown-display--warn,
  .countdown-strip--seal #countdown.countdown-display.countdown-display--critical {
    animation: none;
  }
}

.bet-wrap--sealed .play-category {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.92;
}

/* 封盘：下注区主体遮罩 + 超大「已封盘」 */
.bet-seal-scope {
  position: relative;
}

.bet-seal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(5px) saturate(1.05);
  -webkit-backdrop-filter: blur(5px) saturate(1.05);
  border-radius: 10px;
  pointer-events: none;
}

.bet-wrap--sealed .bet-seal-overlay {
  display: flex;
}

.bet-seal-overlay__text {
  display: inline-block;
  margin: 0;
  padding: 0.12em 0.28em 0.16em;
  font-size: clamp(3rem, 17vw, 6rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: #450a0a;
  background: linear-gradient(165deg, #fffbeb 0%, #fef3c7 38%, #fde68a 100%);
  border: 4px solid #b91c1c;
  border-radius: clamp(12px, 3vw, 20px);
  box-shadow:
    0 0 0 3px #ffffff,
    0 0 0 5px rgba(185, 28, 28, 0.45),
    0 12px 40px rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.75);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 0 rgba(254, 202, 202, 0.9),
    0 4px 12px rgba(127, 29, 29, 0.35);
  -webkit-text-stroke: 0.5px rgba(255, 250, 240, 0.9);
  user-select: none;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.balls {
  display: flex;
  gap: 10px;
  padding: 8px 0;
}

.ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd34f, #ff9e3d);
  color: #2c1800;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

button {
  border: 1px solid #93c5fd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #1e3a8a;
  background: #dbeafe;
}

button:active {
  transform: scale(0.98);
}

button.danger {
  color: #991b1b;
  background: #fecaca;
  border-color: #f87171;
}

.bet-wrap {
  display: grid;
  gap: 10px;
}

.play-category {
  display: grid;
  gap: 0;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.play-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 10px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.play-tabs::-webkit-scrollbar {
  display: none;
}

.play-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.play-tab:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.play-tab--active {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
  box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.9), 0 1px 3px rgba(14, 165, 233, 0.12);
}

.play-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.play-tab:not(:disabled):active {
  transform: scale(0.98);
}

/* 手机：玩法 Tab 第一排 4 个，第二排「连码」「前中后」各占半宽，避免横滑被裁切 */
@media (max-width: 640px) {
  .play-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
    padding: 8px 8px 8px;
    overflow-x: visible;
    -webkit-overflow-scrolling: auto;
  }

  .play-tab {
    flex: unset;
    min-width: 0;
    width: 100%;
    max-width: none;
    justify-self: stretch;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    word-break: break-word;
    padding: 8px 4px;
    font-size: 11px;
    min-height: auto;
  }

  .play-tab[data-tab="lianma"] {
    grid-column: 1 / span 2;
  }

  .play-tab[data-tab="three-pos"] {
    grid-column: 3 / span 2;
  }
}

.play-tab-panel {
  display: block;
  padding: 10px 10px 14px;
  background: #fafbfc;
}

.two-side-subhead {
  margin: 0;
  padding: 10px 4px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #e2e8f0;
}

.two-side-subhead--spaced {
  margin-top: 12px;
}

.two-side-bet-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 2px 6px;
  width: 100%;
}

.two-side-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.two-side-bet-btn {
  width: 100%;
  min-height: 42px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.two-side-odds {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.2;
  text-align: center;
}

.play-tab-panel.hidden {
  display: none;
}

/* 与定位胆/连码/前中后一致的顶部分区线（两面盘为默认首屏，不设顶线） */
#singleCodeTabPanel.play-tab-panel:not(.hidden),
#ballBetTabPanel.play-tab-panel:not(.hidden) {
  border-top: 2px solid #bae6fd;
}

/* 必须压过后续各 tab 的 display:grid，否则带 .hidden 的连码/前中后面板仍会显示 */
.play-category > .play-tab-panel.hidden {
  display: none !important;
}

.fix-pos-tab-panel.play-tab-panel:not(.hidden) {
  display: grid;
  gap: 16px;
  padding: 12px 12px 20px;
  border-top: 2px solid #bae6fd;
}

.fix-pos-tab-panel .two-side-subhead {
  padding-top: 10px;
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.fix-pos-tab-panel #fixPosGrid.fix-pos-grid {
  gap: 12px 10px;
  padding: 8px 4px 6px;
}

.fix-pos-tab-panel #fixPosGrid .fix-pos-btn {
  border-radius: 10px;
  padding: 12px 10px;
  min-height: 50px;
  font-size: 13px;
}

.fix-pos-tab-panel #fixDigitGrid.single-code-grid {
  gap: 14px 12px;
  padding: 10px 4px 10px;
  justify-items: center;
}

/* 定位胆数字：球形；压过 .bet-wrap button.play-btn 白底 */
.fix-pos-tab-panel #fixDigitGrid .single-code-btn.play-btn {
  width: min(100%, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  color: #111827;
  border: 2px solid #93c5fd;
  background: radial-gradient(circle at 32% 22%, #ffffff 0%, #dbeafe 42%, #bfdbfe 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.fix-pos-tab-panel #fixDigitGrid .single-code-btn.play-btn.play-selected {
  color: #111827;
  border-color: #d97706;
  background: radial-gradient(circle at 32% 22%, #fffbeb 0%, #fde68a 45%, #fcd34d 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    0 0 0 2px rgba(245, 158, 11, 0.45),
    0 2px 10px rgba(0, 0, 0, 0.1);
}

.single-code-tab-panel #singleCodeGrid.single-code-grid {
  gap: 14px 12px;
  padding: 10px 4px 10px;
  justify-items: center;
}

/* 单码数字：球形；压过 .bet-wrap button.play-btn */
.single-code-tab-panel #singleCodeGrid .single-code-btn.play-btn {
  width: min(100%, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  color: #111827;
  border: 2px solid #93c5fd;
  background: radial-gradient(circle at 32% 22%, #ffffff 0%, #dbeafe 42%, #bfdbfe 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.single-code-tab-panel #singleCodeGrid .single-code-btn.play-btn.play-selected {
  color: #111827;
  border-color: #d97706;
  background: radial-gradient(circle at 32% 22%, #fffbeb 0%, #fde68a 45%, #fcd34d 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    0 0 0 2px rgba(245, 158, 11, 0.45),
    0 2px 10px rgba(0, 0, 0, 0.1);
}

.combo-tab-panel.play-tab-panel:not(.hidden) {
  display: grid;
  gap: 16px;
  padding: 12px 12px 20px;
  border-top: 2px solid #bae6fd;
}

.combo-tab-panel .two-side-subhead {
  padding-top: 10px;
  padding-bottom: 10px;
  margin-bottom: 2px;
}

.combo-tab-panel .play-block--combo-only {
  padding: 12px 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.combo-tab-panel .play-block-label--combo {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
}

.combo-tab-panel .combo-only-area.fix-pos-grid {
  gap: 12px 10px;
  padding: 8px 4px 6px;
}

.combo-tab-panel .combo-only-area .fix-pos-btn {
  border-radius: 10px;
  padding: 12px 10px;
  min-height: 50px;
  font-size: 13px;
}

.combo-tab-panel #comboDigitGrid.single-code-grid {
  gap: 14px 12px;
  padding: 10px 4px 10px;
  justify-items: center;
}

/* 连码选号：球形数字 */
.combo-tab-panel #comboDigitGrid .single-code-btn {
  width: min(100%, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
  color: #111827;
  border: 2px solid #93c5fd;
  background: radial-gradient(circle at 32% 22%, #ffffff 0%, #dbeafe 42%, #bfdbfe 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.08);
}

.combo-tab-panel #comboDigitGrid .single-code-btn.active {
  color: #111827;
  border-color: #16a34a;
  background: radial-gradient(circle at 32% 22%, #f0fdf4 0%, #bbf7d0 45%, #86efac 100%);
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.9),
    0 0 0 2px rgba(34, 197, 94, 0.35),
    0 2px 10px rgba(0, 0, 0, 0.1);
}

.combo-tab-panel .combo-only-actions.bet-actions {
  margin-top: 2px;
  gap: 12px;
  flex-wrap: wrap;
}

.combo-tab-panel .combo-only-actions button {
  flex: 1 1 calc(50% - 6px);
  min-width: 120px;
  padding: 12px 14px;
}

.combo-tab-panel #comboPreviewTip {
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.three-pos-tab-panel.play-tab-panel:not(.hidden) {
  display: grid;
  gap: 16px;
  padding: 12px 12px 20px;
  border-top: 2px solid #bae6fd;
}

.three-pos-tab-panel .two-side-subhead {
  padding-top: 10px;
  padding-bottom: 10px;
}

.three-pos-tab-panel .play-block--threepos-only {
  padding: 12px 12px 14px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.three-pos-tab-panel .play-block-label--threepos {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  letter-spacing: 0.02em;
}

.three-pos-tab-panel .threepos-only-area.fix-pos-grid {
  gap: 10px;
  padding: 4px 0 2px;
}

.three-pos-tab-panel .threepos-only-area .fix-pos-btn {
  padding: 11px 6px;
  min-height: 46px;
  font-size: 13px;
}

.three-pos-tab-panel .threepos-only-area.composite-play-grid {
  gap: 10px;
  padding: 6px 0 4px;
}

.three-pos-tab-panel .threepos-only-area .composite-btn {
  padding: 11px 6px;
  min-height: 46px;
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

label {
  color: #374151;
  font-size: 13px;
}

input,
select {
  width: 100%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bet-actions {
  margin-top: 0;
}

.single-code-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.single-code-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bet-wrap .single-code-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.fix-pos-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.fix-pos-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fix-pos-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.fix-pos-btn.active {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(191, 219, 254, 0.8);
}

.single-code-btn.active {
  background: #dcfce7;
  color: #166534;
  border-color: #22c55e;
  box-shadow: inset 0 0 0 1px rgba(187, 247, 208, 0.9);
}

.quick-amount-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.quick-amount-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.quick-amount-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.quick-amount-btn.active {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #2563eb;
}

.quick-amount-edit-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.quick-amount-edit-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.quick-amount-edit-btn:active {
  transform: scale(0.98);
}

.bet-entry-bottom {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid #e5e7eb;
}

.bet-entry-amount-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.bet-entry-amount-field {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.bet-entry-clear {
  flex-shrink: 0;
  padding: 10px 12px;
  align-self: flex-end;
}

.bet-entry-actions {
  margin-top: 0;
}

.composite-play-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.composite-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 6px;
  min-height: 40px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.composite-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.ball-bet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ball-bet-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 10px 12px;
  display: grid;
  gap: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ball-bet-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.03em;
}

.ball-bet-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.mini-action-btn {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 0;
  min-height: 36px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mini-action-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.bet-wrap button.play-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.bet-wrap button.play-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.bet-wrap button.play-btn.play-selected {
  background: #dbeafe;
  color: #1e3a8a;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(191, 219, 254, 0.9), 0 1px 3px rgba(37, 99, 235, 0.12);
}

.tip {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
}

/* 页面底部：玩法总览 */
.play-overview-card {
  display: grid;
  gap: 6px;
}

.play-overview-head {
  display: flex;
  align-items: center;
}

.play-overview-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: 999px;
  padding: 5px 12px;
  letter-spacing: 0.02em;
}

.play-overview-subtitle {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.play-overview-detail {
  margin: 0;
  white-space: pre-line;
  line-height: 1.55;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  padding-right: 2px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bet-filter-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 8px;
  flex-wrap: wrap;
}

.bet-today-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  font-size: 12px;
}

.bet-filter-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bet-filter-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.bet-filter-btn--active {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.history-list--in-modal {
  max-height: min(42vh, 320px);
  min-height: 120px;
}

.history-trend-panel.hidden {
  display: none;
}

.history-trend-panel {
  margin-top: 4px;
  display: grid;
  gap: 10px;
}

.trend-wrap {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.trend-head,
.trend-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.trend-head {
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.trend-head span,
.trend-row span {
  padding: 8px 6px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
  color: #111827;
}

.trend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.trend-row {
  font-size: 12px;
  background: #ffffff;
}

.history-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: #ffffff;
}

.history-item--merged {
  gap: 8px;
  border-color: #dbeafe;
  background: #f8fbff;
}

.history-merged-head {
  padding-bottom: 6px;
  border-bottom: 1px dashed #bfdbfe;
}

.history-merged-summary {
  font-weight: 600;
  color: #334155;
}

.bet-merged-list {
  display: grid;
  gap: 8px;
}

.bet-merged-item {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.history-top {
  display: flex;
  justify-content: space-between;
  color: #374151;
  font-size: 13px;
}

.mini-balls {
  display: flex;
  gap: 6px;
}

.mini-ball {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  color: #78350f;
  border: 1px solid #f59e0b;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.empty {
  color: #6b7280;
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

.result-pending,
.result-won,
.result-lost,
.result-cancelled {
  font-size: 13px;
}

.result-pending {
  color: #ffcc66;
}

.result-won {
  color: #3ad07f;
}

.result-lost {
  color: #ff7f7f;
}

.result-cancelled {
  color: #94a3b8;
}

.hidden {
  display: none !important;
}

.modal.hidden {
  display: none;
}

.bet-entry-sheet.hidden {
  display: none;
}

/* 内嵌在下注区玩法下方，不盖在玩法上 */
.bet-entry-sheet {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 8px 0 0;
}

.bet-entry-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  max-height: min(60vh, 420px);
  overflow: auto;
  padding: 14px 14px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: grid;
  gap: 12px;
}

.bet-entry-card h3 {
  margin: 0;
  font-size: 16px;
  color: #111827;
}

.bet-entry-balance {
  margin: -6px 0 2px;
  font-size: 13px;
  color: #1e3a8a;
  font-weight: 600;
}

.bet-entry-stack {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.bet-entry-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 200px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.bet-entry-lines--hidden {
  display: none;
}

.bet-entry-line {
  padding: 8px 10px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-size: 13px;
  color: #111827;
  line-height: 1.35;
}

.bet-entry-summary {
  margin: 0;
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
}

.bet-entry-total {
  font-weight: 700;
  color: #1e40af;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 10000;
  padding: 16px;
}

.modal-card {
  width: min(520px, 100%);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  display: grid;
  gap: 10px;
  color: #111827;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.modal-card h3 {
  margin: 0;
  font-size: 16px;
  color: #111827;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.modal-grid-presets {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-grid label {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.app-header-row h1 {
  margin-bottom: 4px;
}

.notice-bar {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #fde68a;
  background: linear-gradient(90deg, #fffbeb 0%, #fef3c7 100%);
}

.notice-bar--urgent {
  border-color: #dc2626;
  background: linear-gradient(90deg, #fff1f2 0%, #fee2e2 100%);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.24);
  animation: notice-urgent-pulse 1.15s ease-in-out infinite;
}

.notice-bar.hidden {
  display: none !important;
}

.notice-bar-static {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.notice-bar-static.hidden {
  display: none !important;
}

.notice-label {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #f59e0b;
  background: #fef3c7;
}

.notice-bar--urgent .notice-label {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.notice-track-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  min-height: 20px;
  display: block;
}

.notice-track {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  white-space: nowrap;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
  will-change: transform;
  animation: notice-marquee 18s linear infinite;
  pointer-events: none;
}

.notice-bar--urgent .notice-track {
  color: #991b1b;
}

@keyframes notice-marquee {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

@keyframes notice-urgent-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.24);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14);
  }
}

.auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.auth-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #ca8a04;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 28%),
    linear-gradient(135deg, #fef9c3 0%, #fde68a 33%, #f59e0b 70%, #d97706 100%);
  color: #713f12;
  font-size: 13px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -2px 0 rgba(120, 53, 15, 0.18),
    0 2px 10px rgba(146, 64, 14, 0.28);
  position: relative;
  overflow: hidden;
}

.auth-balance strong {
  color: #7c2d12;
  font-size: 19px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.auth-balance strong.balance-hit-jitter {
  animation: balance-hit-jitter 0.46s steps(2, end) 2;
}

.auth-balance::before {
  content: "🪙";
  font-size: 16px;
  line-height: 1;
}

.auth-balance::after {
  content: "";
  position: absolute;
  top: -140%;
  left: -18%;
  width: 36%;
  height: 320%;
  transform: rotate(24deg);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  animation: auth-balance-shine 2.35s linear infinite;
}

.auth-balance.auth-balance--pop {
  animation: auth-balance-pop 0.95s cubic-bezier(0.2, 0.82, 0.22, 1);
}

.auth-balance.auth-balance--pop::after {
  animation-duration: 0.75s;
}

.auth-balance.auth-balance--jackpot {
  animation:
    auth-balance-pop 0.95s cubic-bezier(0.2, 0.82, 0.22, 1),
    auth-balance-jackpot-shake 0.45s linear 2;
  border-color: #facc15;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -2px 0 rgba(120, 53, 15, 0.2),
    0 0 0 2px rgba(250, 204, 21, 0.38),
    0 0 26px rgba(250, 204, 21, 0.45);
}

@keyframes auth-balance-pop {
  0% {
    transform: scale(1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 2px 8px rgba(37, 99, 235, 0.16);
  }
  28% {
    transform: scale(1.13);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 6px 24px rgba(245, 158, 11, 0.46);
  }
  56% {
    transform: scale(0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 4px 16px rgba(37, 99, 235, 0.24);
  }
  100% {
    transform: scale(1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 2px 8px rgba(37, 99, 235, 0.16);
  }
}

@keyframes auth-balance-shine {
  0% {
    left: -38%;
    opacity: 0;
  }
  16% {
    opacity: 0.92;
  }
  44% {
    opacity: 0;
  }
  100% {
    left: 122%;
    opacity: 0;
  }
}

@keyframes auth-balance-jackpot-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-2px);
  }
  40% {
    transform: translateX(2px);
  }
  60% {
    transform: translateX(-1px);
  }
  80% {
    transform: translateX(1px);
  }
}

@keyframes balance-hit-jitter {
  0% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(-1.2px, 0.5px) scale(1.07);
  }
  50% {
    transform: translate(1.2px, -0.8px) scale(1.05);
  }
  75% {
    transform: translate(-0.8px, 0.8px) scale(1.04);
  }
  100% {
    transform: translate(0, 0) scale(1);
  }
}

.coin-burst-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1600;
}

.coin-flash-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(254, 240, 138, 0.45) 0%, rgba(254, 240, 138, 0) 55%),
    linear-gradient(180deg, rgba(250, 204, 21, 0.22), rgba(245, 158, 11, 0.08));
  mix-blend-mode: screen;
  animation: coin-flash-frame-fade 0.34s ease-out 1;
}

.coin-flash-frame--jackpot {
  animation-duration: 0.5s;
  background:
    radial-gradient(circle at 50% 42%, rgba(254, 240, 138, 0.6) 0%, rgba(254, 240, 138, 0) 58%),
    linear-gradient(180deg, rgba(250, 204, 21, 0.32), rgba(245, 158, 11, 0.12));
}

.coin-token {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7cc 0%, #fde68a 30%, #f59e0b 85%, #d97706 100%);
  border: 1px solid rgba(146, 64, 14, 0.38);
  box-shadow: 0 2px 5px rgba(146, 64, 14, 0.35);
  opacity: 0;
  transform: translate(0, 0) scale(0.65) rotate(0deg);
  animation: coin-fly-in-balance 0.88s cubic-bezier(0.22, 0.88, 0.2, 1) forwards;
}

.coin-token::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 6px;
  width: 14px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0), rgba(245, 158, 11, 0.48));
}

.coin-token--big {
  width: 20px;
  height: 20px;
  box-shadow: 0 3px 8px rgba(146, 64, 14, 0.42);
}

.coin-impact {
  position: fixed;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 999px;
  pointer-events: none;
  background: rgba(250, 204, 21, 0.9);
  box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.65);
  animation: coin-impact-ring 0.72s ease-out forwards;
}

.coin-gain-float {
  position: fixed;
  transform: translate(-50%, 0);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #fef08a;
  text-shadow:
    0 1px 0 rgba(120, 53, 15, 0.9),
    0 0 12px rgba(250, 204, 21, 0.8),
    0 0 18px rgba(245, 158, 11, 0.65);
  white-space: nowrap;
  animation: coin-gain-pop 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.coin-gain-float--jackpot {
  color: #fff7b3;
  text-shadow:
    0 1px 0 rgba(120, 53, 15, 0.95),
    0 0 16px rgba(254, 240, 138, 0.95),
    0 0 28px rgba(245, 158, 11, 0.85);
  animation-duration: 1.25s;
}

.coin-combo-float {
  position: fixed;
  transform: translate(-50%, 0);
  white-space: nowrap;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  border: 1px solid rgba(124, 45, 18, 0.8);
  background: linear-gradient(135deg, #f97316 0%, #dc2626 70%);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.38);
  animation: coin-combo-pop 0.95s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes coin-fly-in-balance {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.65) rotate(0deg);
  }
  8% {
    opacity: 1;
  }
  74% {
    opacity: 1;
    transform: translate(var(--coin-tx), calc(var(--coin-ty) - 22px)) scale(1.08) rotate(var(--coin-rot, 340deg));
  }
  100% {
    opacity: 0;
    transform: translate(var(--coin-tx), var(--coin-ty)) scale(0.28) rotate(calc(var(--coin-rot, 340deg) + 120deg));
  }
}

@keyframes coin-impact-ring {
  0% {
    opacity: 0.95;
    box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.65);
    transform: scale(0.6);
  }
  100% {
    opacity: 0;
    box-shadow: 0 0 0 28px rgba(250, 204, 21, 0);
    transform: scale(1.35);
  }
}

@keyframes coin-gain-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 6px) scale(0.72);
  }
  18% {
    opacity: 1;
  }
  56% {
    opacity: 1;
    transform: translate(-50%, -28px) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58px) scale(0.9);
  }
}

@keyframes coin-combo-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 5px) scale(0.78);
  }
  20% {
    opacity: 1;
  }
  55% {
    opacity: 1;
    transform: translate(-50%, -16px) scale(1.06);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -34px) scale(0.92);
  }
}

@keyframes coin-flash-frame-fade {
  0% {
    opacity: 0;
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-balance.auth-balance--pop {
    animation: none;
  }
  .auth-balance.auth-balance--jackpot {
    animation: none;
  }
  .auth-balance strong.balance-hit-jitter {
    animation: none;
  }
  .auth-balance::after {
    animation: none;
    opacity: 0;
  }
  .coin-flash-frame {
    animation: none;
    opacity: 0;
  }
  .coin-token {
    animation: none;
    opacity: 0;
  }
  .coin-impact {
    animation: none;
    opacity: 0;
  }
  .coin-gain-float {
    animation: none;
    opacity: 0;
  }
  .coin-combo-float {
    animation: none;
    opacity: 0;
  }
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.auth-actions--user {
  margin-left: auto;
}

/* 登录后：头像 + 下拉菜单 */
.user-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.user-avatar-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #93c5fd;
  background: linear-gradient(145deg, #dbeafe 0%, #bfdbfe 45%, #60a5fa 100%);
  color: #1e3a8a;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.22);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  position: relative;
  overflow: hidden;
}

.user-avatar-btn:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.user-avatar-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 3px;
}

.user-avatar-btn:active {
  transform: scale(0.96);
}

.user-avatar-initial {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

.user-avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-avatar-img.hidden {
  display: none !important;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 8000;
  min-width: min(260px, calc(100vw - 32px));
  padding: 0;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.user-menu-dropdown.hidden {
  display: none !important;
}

.user-menu-header {
  padding: 12px 14px 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid #e2e8f0;
}

.user-menu-name {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-all;
}

.user-menu-balance-line {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.user-menu-balance-line strong {
  font-size: 16px;
  font-weight: 800;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}

.user-menu-list {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #1e293b;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
  box-shadow: none;
}

.user-menu-item:hover {
  background: #f1f5f9;
}

.user-menu-item:focus-visible {
  outline: none;
  background: #e0f2fe;
}

.user-menu-item--link {
  text-decoration: none;
  color: #1d4ed8;
}

.user-menu-item--link:hover {
  text-decoration: none;
  background: #eff6ff;
}

.user-menu-item--danger {
  color: #b91c1c;
  border-top: 1px solid #f1f5f9;
  margin-top: 2px;
}

.user-menu-item--danger:hover {
  background: #fef2f2;
}

.user-menu-item--active {
  background: #e0f2fe !important;
  color: #0369a1;
}

.avatar-picker-panel {
  margin: 4px 12px 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.avatar-picker-panel.hidden {
  display: none !important;
}

.avatar-picker-title {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
}

.avatar-preset-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.avatar-preset-btn {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 2px;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.avatar-preset-btn img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-preset-btn:hover {
  border-color: #38bdf8;
  background: #e0f2fe;
}

.admin-link {
  font-size: 13px;
  color: #1d4ed8;
  text-decoration: none;
}

.admin-link:hover {
  text-decoration: underline;
}

.mini-btn {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
  color: #111827;
}

.mini-btn.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.mini-btn.primary,
button.primary {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.modal-card--wide {
  width: min(400px, 100%);
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab--active {
  color: #1d4ed8;
  font-weight: 600;
  border-bottom-color: #1d4ed8;
}

.auth-pane label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  margin-bottom: 8px;
}

.auth-pane input {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}

.auth-error {
  color: #b91c1c;
  font-size: 13px;
  margin: 0;
}

.finance-modal-title {
  margin: 0 0 4px;
}

.finance-status {
  font-weight: 700;
}

.finance-status--pending {
  color: #b45309;
}

.finance-status--approved {
  color: #15803d;
}

.finance-status--rejected {
  color: #b91c1c;
}

.finance-records-card {
  width: min(720px, 100%);
  max-height: 80vh;
  overflow: auto;
}

.finance-summary {
  display: grid;
  gap: 6px;
  margin: 10px 0 8px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.finance-summary.hidden {
  display: none;
}

.finance-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bet-filter-modal-card {
  width: min(420px, 100%);
}
