/* 闖關、每日、排行榜、徽章等新畫面的樣式（沿用 base.css 的配色） */

.xp-bar {
  position: relative;
  height: 14px;
  background: #0a0d16;
  border-bottom: 1px solid var(--card-border);
}
.xp-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0088cc, #00d26a);
  transition: width 0.4s;
}
.xp-text {
  position: absolute;
  inset: 0;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  color: #cfd6ea;
  letter-spacing: 0.5px;
}
.ticket-pill { cursor: pointer; margin-right: 6px; }
.top-right-tools { flex-wrap: nowrap; }

.quick-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 4px;
}
.quick-btn {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  border-radius: 14px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.quick-icon { font-size: 20px; }
.dot {
  display: none;
  position: absolute;
  top: 8px;
  right: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

.panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
}
.hint-line {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  margin: 8px 2px;
  text-align: center;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.btn-wide {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 14px;
  background: var(--gold-gradient);
  color: #000;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  margin-top: 12px;
}
.btn-wide:disabled { background: #222941; color: var(--text-sub); cursor: default; }
.btn-wide.ghost {
  background: #1c2238;
  color: #fff;
  border: 1px solid #353f65;
  margin-bottom: 4px;
}
.btn-small {
  background: var(--gold-gradient);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.btn-small:disabled { background: #222941; color: var(--text-sub); cursor: default; }
.btn-link {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}

/* 闖關 */
.stage-intro { text-align: center; }
.stage-big { font-size: 30px; font-weight: 900; color: #ffc837; margin: 6px 0 10px; }
.stage-sub { font-size: 14px; color: var(--text-main); margin-bottom: 8px; }
.boss-tag {
  display: inline-block;
  background: rgba(248, 49, 47, 0.15);
  border: 1px solid rgba(248, 49, 47, 0.5);
  color: #ff8d8b;
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  margin: 6px 0 10px;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px;
  font-size: 13px;
  color: var(--text-sub);
  border-bottom: 1px dashed var(--card-border);
}
.info-row b { color: var(--text-main); }

.stage-status { padding: 12px 14px; }
.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}
.hands-left { color: #ffc837; font-size: 12px; }
.progress {
  height: 10px;
  background: #0a0d16;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}
.progress-fill {
  height: 100%;
  background: var(--gold-gradient);
  transition: width 0.4s;
}
.panel.task .progress { margin-bottom: 10px; }

.game-area {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.hand-banner {
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--text-sub);
}
.hand-banner.show { opacity: 1; }
.hand-banner.win { color: var(--accent-green); }
.hand-banner.lose { color: var(--accent-red); }
.bet-selector { flex-wrap: wrap; }
.bet-label { font-size: 12px; color: #7b9e8a; }
.btn-action small { font-size: 12px; opacity: 0.9; }
.btn-action-tie { background: linear-gradient(135deg, #f5a623, #c97c00); color: #000; }
.btn-action.wide { grid-column: span 2; font-size: 18px; padding: 16px; }
.table-actions:has(.btn-action-tie) { grid-template-columns: 1fr 0.8fr 1fr; }

.mini-card {
  width: 46px;
  height: 64px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
  animation: popIn 0.2s ease-out;
}
.mini-card.red { color: #d92b2b; }
.mini-card.back {
  background: linear-gradient(145deg, #7c3aed, #3b82f6);
  color: rgba(255, 255, 255, 0.85);
  font-size: 22px;
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.mini-rank { font-size: 19px; line-height: 1; }
.mini-suit { font-size: 17px; line-height: 1.1; }
.mini-row { display: flex; gap: 5px; justify-content: center; min-height: 64px; }
.bac-side {
  flex: 1;
  min-width: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 12px;
  border: 1px solid transparent;
}
.bac-side.win { border-color: #ffc837; background: rgba(245, 166, 35, 0.1); }
.bac-title { font-size: 12px; font-weight: 800; color: #9fc3ad; }
.bac-points { font-size: 20px; font-weight: 900; color: #ffc837; }
.versus-badge.small { width: 30px; height: 30px; font-size: 12px; flex: none; }

.slot-reels { display: flex; gap: 10px; justify-content: center; width: 100%; }
.slot-reel {
  width: 76px;
  height: 86px;
  background: #0a0f0c;
  border: 2px solid #2d4f3b;
  border-radius: 12px;
  font-size: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-reel.idle { opacity: 0.45; }
.slot-pay { width: 100%; text-align: center; font-size: 13px; font-weight: 700; color: #9fc3ad; margin-top: 8px; }

.match-board {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.match-team {
  padding: 16px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
}
.match-team.win { border-color: #ffc837; color: #ffc837; background: rgba(245, 166, 35, 0.1); }
.match-score { font-size: 26px; font-weight: 900; color: #fff; min-width: 76px; text-align: center; }

/* 清單 */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 6px;
  font-size: 13px;
  border-bottom: 1px dashed var(--card-border);
}
.list-row:last-child { border-bottom: none; }
.list-row.me { background: rgba(245, 166, 35, 0.1); border-radius: 10px; }
.list-row b { color: #ffc837; white-space: nowrap; }
.rank-no { width: 30px; text-align: center; font-weight: 800; color: var(--text-sub); }
.rank-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 每日簽到 */
.signin-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.signin-box {
  background: #111422;
  border: 1px solid #23283e;
  border-radius: 10px;
  padding: 8px 2px;
  text-align: center;
}
.signin-box.done { background: rgba(0, 210, 106, 0.12); border-color: rgba(0, 210, 106, 0.5); }
.signin-box.today { border-color: #ffc837; box-shadow: 0 0 8px rgba(245, 166, 35, 0.4); }
.signin-day { font-size: 9px; color: var(--text-sub); }
.signin-coins { font-size: 10px; font-weight: 800; margin-top: 4px; color: var(--text-main); }

/* 徽章 */
.badge-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.badge {
  background: #111422;
  border: 1px solid #23283e;
  border-radius: 12px;
  padding: 8px 2px;
  text-align: center;
  opacity: 0.55;
}
.badge.got { opacity: 1; border-color: #ffc837; background: rgba(245, 166, 35, 0.12); }
.badge-icon { font-size: 20px; }
.badge-level { font-size: 11px; font-weight: 800; color: var(--text-main); margin-top: 2px; }

/* 集卡 */
.reveal-title { font-size: 13px; color: #ffc837; font-weight: 700; margin-bottom: 8px; }
.card-emoji { font-size: 24px; }
.card-name { font-weight: 800; margin-top: 4px; }
.card-meta { font-size: 10px; margin-top: 2px; }
.vault-rate.full { background: rgba(248, 49, 47, 0.2); color: #ff8d8b; }

/* 彈窗、提示 */
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.modal-btn.secondary { background: #20263b; color: #fff; }
.toast {
  display: none;
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 90%;
  background: rgba(20, 24, 45, 0.96);
  color: #ffc837;
  border: 1px solid #ffc837;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}
.loading-cover {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(10, 12, 28, 0.9);
  color: #ffc837;
  font-size: 14px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
}

.user-info .username {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 前層偽裝版三款 */
.btn-action-blue { background: linear-gradient(135deg, #2f80ed, #1b4fa8); color: #fff; }
.btn-link.peek { margin: 4px auto 0; width: 100%; color: #9fc3ad; }

.rb-orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5b6688, #232a44);
  color: rgba(255, 255, 255, 0.8);
  font-size: 40px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), inset 0 -8px 16px rgba(0, 0, 0, 0.35);
}
.rb-orb.red { background: radial-gradient(circle at 35% 30%, #ff8a88, #c11512); }
.rb-orb.blue { background: radial-gradient(circle at 35% 30%, #86bcff, #1b4fa8); }
.rb-orb.gold { background: radial-gradient(circle at 35% 30%, #ffe9a3, #e08a00); }
.rb-orb.spin { animation: orbSpin 0.55s ease-in-out; }
@keyframes orbSpin {
  0% { transform: scale(1) rotate(0); }
  50% { transform: scale(0.8) rotate(180deg); }
  100% { transform: scale(1) rotate(360deg); }
}
.road {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
}
.road-dot { aspect-ratio: 1; border-radius: 50%; }
.road-dot.red { background: #f8312f; }
.road-dot.blue { background: #2f80ed; }
.road-dot.gold { background: #ffc837; }
.road-empty { grid-column: 1 / -1; font-size: 12px; color: var(--text-sub); text-align: center; }

.race-track { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.race-lane {
  position: relative;
  height: 46px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}
.race-lane.win { border-color: #ffc837; background: rgba(245, 166, 35, 0.1); }
.race-runner {
  position: absolute;
  left: 8px;
  top: 6px;
  font-size: 26px;
  transform: scaleX(-1);
  transition: left 1.05s cubic-bezier(0.3, 0.1, 0.4, 1);
}
.race-lane.run-win .race-runner, .race-lane.done.win .race-runner { left: calc(100% - 74px); }
.race-lane.run-lose .race-runner, .race-lane.done:not(.win) .race-runner { left: calc(72% - 74px); }
.race-name { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--text-sub); }
.race-flag { position: absolute; right: 8px; top: 9px; font-size: 20px; }
.form-panel { width: 100%; background: rgba(0, 0, 0, 0.35); border-radius: 10px; padding: 8px 10px; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; padding: 4px 0; }
.form-label { color: var(--text-sub); margin-left: auto; }

/* 第二、三批：吹氣球、暗牌唬人、新手禮、每日幸運號、手速擂台 */
.btn-action:disabled { opacity: 0.35; cursor: default; }
.btn-action-gold { background: linear-gradient(135deg, #f5a623, #c97c00); color: #000; }
.btn-action-ghost { background: #1c2238; color: #fff; border: 1px solid #353f65; }
.balloon { width: 100%; text-align: center; line-height: 1.15; min-height: 150px; display: flex; align-items: center; justify-content: center; transition: font-size 0.18s ease-out; }
.balloon.popped { animation: popIn 0.2s ease-out; }
.gift-panel { text-align: center; }
.gift-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(59, 130, 246, 0.35));
  border: 1px solid #5b6bd6;
  border-radius: 14px;
  padding: 10px 14px;
  margin: 12px 0 4px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lotto-panel { text-align: center; }
.lotto-wheels { display: flex; justify-content: center; gap: 12px; margin: 8px 0; }
.lotto-wheel { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lotto-digit {
  width: 62px;
  height: 72px;
  border-radius: 12px;
  background: #0a0d16;
  border: 2px solid #ffc837;
  color: #ffc837;
  font-size: 40px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lotto-step {
  width: 62px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #353f65;
  background: #1c2238;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.badge-row.four { grid-template-columns: repeat(4, 1fr); }
.reflex-bar {
  position: relative;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(90deg, #3a1414, #6b5a12 35%, #0f5c33 50%, #6b5a12 65%, #3a1414);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin: 10px 8px 14px;
}
.reflex-zone { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; opacity: 0.7; }
.reflex-marker {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 6px;
  margin-left: -3px;
  border-radius: 3px;
  background: #ffc837;
  box-shadow: 0 0 10px #ffc837;
}
.reflex-scores { justify-content: center; min-height: 30px; margin-bottom: 12px; }
.reflex-tap { width: 100%; }
.btn-wide.ghost.on { border-color: #ffc837; color: #ffc837; }

/* 頂部列：名字長、金幣位數多的時候，縮的是名字，不讓整列超出畫面 */
.top-bar { gap: 8px; }
.user-profile { flex: 1 1 auto; min-width: 0; }
.user-profile .avatar { flex: none; }
.user-info { min-width: 0; }
.user-info .username { max-width: 100%; }
.top-right-tools { flex: none; }
.ticket-pill { margin-right: 0; }
.wallet-pill { padding: 6px 10px; gap: 4px; font-size: 14px; white-space: nowrap; }

.hint-line.strong { color: #ffc837; font-weight: 700; }
