/* 숫자 야구 — 60초 클리어 모드 */

.board-wrap {
  position: relative;
  width: min(92vw, 480px);
  margin: 0 auto;
}

.bb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 22px;
  background: linear-gradient(135deg, #5b8def, #3461c1);
  border-radius: 24px;
  color: #fff;
  user-select: none;
  text-align: center;
  transition: transform 0.1s;
  box-shadow: 0 10px 30px rgba(91, 141, 239, 0.25);
  min-height: 460px;
}

.bb-card.correct { animation: pop 0.32s ease; }
.bb-card.wrong   { animation: shake 0.32s ease; }
.bb-card.next    { animation: fadeIn 0.32s ease; }

@keyframes pop {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

.bb-prompt {
  font-size: 0.92rem;
  font-weight: 600;
  opacity: 0.9;
}

/* 현재 입력 칸 */
.bb-input-slots {
  display: flex;
  gap: 10px;
  margin: 2px 0 6px;
}
.bb-input-cell {
  width: 44px;
  height: 56px;
  border-radius: 12px;
  background: rgba(255,255,255,0.16);
  border: 2px solid rgba(255,255,255,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,0.4);
  transition: all 0.12s;
}
.bb-input-cell.filled {
  background: rgba(255,255,255,0.95);
  color: #1a3163;
  border-color: rgba(255,255,255,0.95);
}

/* 시도 기록 */
.bb-history {
  width: 100%;
  max-width: 320px;
  height: 138px;
  overflow-y: auto;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}
.bb-history::-webkit-scrollbar { width: 4px; }
.bb-history::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 2px; }

.bb-history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  padding: 4px 6px;
}

.bb-history-guess {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

.bb-history-result {
  display: inline-flex;
  gap: 6px;
  font-style: normal;
  font-weight: 700;
}
.bb-history-result em { font-style: normal; padding: 2px 7px; border-radius: 999px; font-size: 0.82rem; }
.bb-s   { background: #2ed573; color: #0e3a1f; }
.bb-b   { background: #ffd93d; color: #4a3700; }
.bb-out { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.8); }

/* 키패드 */
.bb-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 280px;
}

.bb-key {
  padding: 12px 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.92);
  color: #1a3163;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.bb-key:active { transform: scale(0.95); }
.bb-key:disabled { opacity: 0.5; cursor: not-allowed; }
.bb-key.bb-key-action {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.bb-key.bb-confirm {
  background: #2ed573;
  color: #0e3a1f;
}
.bb-key.bb-confirm:disabled { background: rgba(46,213,115,0.35); color: rgba(14,58,31,0.5); }

.bb-reveal {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,23,41,0.9);
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  animation: fadeIn 0.2s ease;
  white-space: nowrap;
}

/* ===== 시작 오버레이 ===== */

.bb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 41, 0.78);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  z-index: 5;
  transition: opacity 0.2s;
}
.bb-overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-content { text-align: center; padding: 24px; }
.overlay-icon { font-size: 3.5rem; margin-bottom: 12px; }
.overlay-content h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; color: var(--text); }
.overlay-content p { color: var(--text-dim); margin-bottom: 18px; line-height: 1.5; }

.hint {
  text-align: center;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 0 16px;
}

/* ===== 결과 모달 ===== */

.result-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 41, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  animation: fadeIn 0.25s ease;
}
.result-modal.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.result-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-emoji { font-size: 4rem; margin-bottom: 8px; }
.result-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.result-msg { color: var(--text-dim); margin-bottom: 24px; }

.result-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.result-stats > div {
  background: rgba(255,255,255,0.05);
  padding: 14px;
  border-radius: 12px;
}
.result-stats span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}
.result-stats strong {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.result-rank {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 8px 0 4px;
  color: var(--accent);
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.result-actions .btn {
  padding: 12px 16px;
  text-align: center;
  font-size: 0.95rem;
}
