/* keno — 基諾 */

.app {
  max-width: 640px;
  padding-bottom: 32px;
}

/* ── HUD ───────────────────────────────────────────────── */
.hud {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 12px 0;
}
.hud-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.hud-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.5px; }
.hud-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-value.win  { color: #2e9e4a; }
.hud-value.lose { color: #e53935; }
.hud-value.small { font-size: 14px; line-height: 26px; }
.hud-value.hud-pulse { animation: hud-pulse 0.5s ease; }
@keyframes hud-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ── Bet bar ───────────────────────────────────────────── */
.bet-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 4px 0 10px;
  color: var(--text-strong);
}
.bar-label { font-weight: 700; font-size: 14px; }
.bet-row { display: flex; gap: 6px; }
.bet-btn {
  min-width: 50px;
  height: 36px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text-strong);
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.bet-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #7b1fa2, #4a148c);
  border-color: #ce93d8;
  color: #fff;
}
.bet-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.bet-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.spot-count { font-size: 14px; font-variant-numeric: tabular-nums; }
.spot-count b { font-size: 18px; }

/* ── Board ─────────────────────────────────────────────── */
.board-wrap {
  background: linear-gradient(180deg, #23124a, #140a2e);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.4), var(--shadow-sm);
}
.keno-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.num {
  aspect-ratio: 1 / 1;
  min-width: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: #2e1d5c;
  color: #ece6ff;
  font-weight: 800;
  font-size: 14px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s ease, transform 0.12s ease;
}
.num:hover:not(:disabled) { background: #3d2878; }
.num:disabled { cursor: default; }
.num:focus-visible { outline: 3px solid #ffd54f; outline-offset: 1px; }
.num.picked {
  background: radial-gradient(circle at 35% 30%, #ffe082, #f9a825);
  color: #3a2500;
  border-color: #fff3c4;
}
.num.drawn {
  background: #5e5480;
  color: #fff;
  box-shadow: inset 0 0 0 2px #b39ddb;
}
.num.hit {
  background: radial-gradient(circle at 35% 30%, #a5ffb9, #1fae55);
  color: #05300f;
  border-color: #e8ffe9;
  box-shadow: 0 0 10px rgba(80, 255, 140, 0.8);
}
.num.pop { animation: num-pop 0.35s ease; }
@keyframes num-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.draw-strip {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,0.25);
}
.ball {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.ball.empty { border: 1px dashed rgba(255,255,255,0.25); }
.ball.miss { background: radial-gradient(circle at 35% 30%, #fff, #c9c3dd); color: #2a1f45; }
.ball.hit  { background: radial-gradient(circle at 35% 30%, #c8ffd4, #1fae55); color: #05300f; }
.ball.new  { animation: ball-in 0.3s cubic-bezier(.2,1.4,.5,1); }
@keyframes ball-in {
  from { transform: translateY(-14px) scale(0.4); }
  to   { transform: translateY(0) scale(1); }
}

/* ── Result banner ─────────────────────────────────────── */
.result-banner {
  text-align: center;
  margin: 10px auto 0;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.4);
  color: #fff;
  animation: banner-pop 0.35s cubic-bezier(.2,1.4,.5,1);
}
.result-banner[hidden] { display: none; }
.banner-head { font-size: 22px; font-weight: 900; }
.banner-sub  { font-size: 13px; margin-top: 2px; color: #e6e0f5; }
.result-banner.win  .banner-head { color: #ffd54f; }
.result-banner.lose .banner-head { color: #ffab9f; }
.result-banner.big { box-shadow: 0 0 18px rgba(255,215,0,0.6); }
.result-banner .tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #ffd54f;
  color: #3a2500;
  font-size: 13px;
  vertical-align: middle;
}
@keyframes banner-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Actions ───────────────────────────────────────────── */
.action-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.action-row.small { margin-top: 8px; }
.action-row .btn { min-width: 96px; }
.action-row .btn.primary {
  background: linear-gradient(180deg, #8e24aa, #5e1580);
  color: #fff;
  font-weight: 800;
}
.action-row .btn.primary:disabled { background: var(--btn-disabled); color: rgba(255,255,255,0.7); }
.btn-opt[aria-pressed="true"] { background: #2e7d32; }
.btn[hidden] { display: none; }
.msg {
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #e53935;
  margin-top: 6px;
}

/* ── Paytable ──────────────────────────────────────────── */
.paytable {
  margin-top: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  color: var(--text-strong);
}
.pt-title { font-size: 15px; margin: 0 0 8px; text-align: center; }
.pt-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pt-hint { font-size: 13px; }
.pt-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 62px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.pt-cell.now { background: #1fae55; color: #fff; border-color: #1fae55; }
.pt-h { font-size: 12px; }
.pt-m { font-size: 16px; font-weight: 900; }
.pt-p { font-size: 12px; }
.pt-all { margin-top: 8px; font-size: 13px; }
.pt-all summary { cursor: pointer; font-weight: 700; text-align: center; }
.pt-scroll { overflow-x: auto; margin-top: 6px; }
.pt-all table { border-collapse: collapse; width: 100%; font-size: 11px; font-variant-numeric: tabular-nums; }
.pt-all th, .pt-all td { border: 1px solid var(--border); padding: 3px 2px; text-align: center; white-space: nowrap; }
.pt-all tr.cur { background: rgba(142, 36, 170, 0.15); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 520px) {
  .board-wrap { padding: 6px; }
  .keno-board, .draw-strip { gap: 3px; }
  .num { font-size: 12px; }
  .ball { font-size: 11px; }
  .hud-value { font-size: 18px; }
  .bet-btn { min-width: 44px; }
  .action-row .btn { min-width: 80px; }
}

:where(body:not(.dark)) .hud-value { color: color-mix(in srgb, var(--accent) 55%, #000); }
