/* Type A: 과정 중심형 전용 스타일 */
/* 2026-02-11 생성 */
/* 2026-02-11 수정: "뽑기 더미 → 공개 → 묶음 배치" 비주얼 흐름으로 재설계 */

/* ========== 컨트롤 바 ========== */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.speed-group { display: flex; gap: 4px; }

.speed-btn {
  padding: 4px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.speed-btn.active {
  background: var(--accent-gold);
  color: #1a1a2e;
  border-color: var(--accent-gold);
  font-weight: 600;
}

.speed-btn:hover:not(.active) {
  border-color: rgba(255,255,255,0.3);
  color: var(--text-primary);
}

.status-text {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 600;
  min-width: 140px;
  text-align: center;
}

/* ========== 4열 카드 기둥 ========== */
.bundles-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.bundle-slot {
  background: var(--bg-secondary);
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  text-align: center;
  transition: all 0.3s ease;
}

.bundle-slot.active {
  border-color: rgba(212, 165, 32, 0.5);
  box-shadow: 0 0 16px rgba(212, 165, 32, 0.2);
}

.bundle-slot.match-glow {
  border-color: rgba(46, 204, 113, 0.5);
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.2);
}

.bundle-slot .slot-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 700;
}

.bundle-slot .slot-count {
  font-size: 0.65rem;
  color: var(--accent-gold);
  margin-top: 4px;
  font-weight: 700;
}

/* 슬롯 내부 카드 — 세로 겹침 기둥 */
.slot-cards {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 90px;
}

.slot-cards .card-wrapper {
  width: 60px;
  height: 90px;
  margin-bottom: -64px;
}

.slot-cards .card-wrapper:last-child {
  margin-bottom: 0;
}

/* 새 카드 도착 애니메이션 */
.slot-cards .card-wrapper.slot-card-enter {
  animation: slotCardEnter 0.25s ease forwards;
}

@keyframes slotCardEnter {
  from { opacity: 0; transform: scale(0.5) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 카드 도착 펄스 */
.bundle-slot.pulse {
  animation: slotPulse 0.3s ease;
}

@keyframes slotPulse {
  0% { border-color: rgba(212, 165, 32, 0.6); }
  100% { border-color: rgba(255, 255, 255, 0.06); }
}

/* ========== 뽑기 영역 ========== */
.draw-section {
  margin: 20px 0;
}

.draw-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  min-height: 140px;
}

/* 뽑기 더미 */
.draw-pile {
  text-align: center;
  flex-shrink: 0;
}

.pile-cards {
  position: relative;
  width: 60px;
  height: 90px;
  margin: 0 auto 6px;
}

.pile-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,255,255,0.03) 4px, rgba(255,255,255,0.03) 5px),
    linear-gradient(135deg, #1a0a0a 0%, #2d1515 50%, #1a0a0a 100%);
  border: 2px solid #8b2020;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.pile-card:nth-child(1) { top: 0; left: 0; }
.pile-card:nth-child(2) { top: 2px; left: 2px; }
.pile-card:nth-child(3) { top: 4px; left: 4px; }

.draw-pile.drawing .pile-card:last-child {
  animation: pileDrawPop 0.3s ease;
}

@keyframes pileDrawPop {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px) rotate(5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

.pile-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* 화살표 */
.draw-area::before {
  content: '';
}

/* 공개 카드 자리 */
.reveal-spot {
  width: 70px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
}

.reveal-spot .card-wrapper {
  width: 66px;
  height: 96px;
}

.reveal-spot .card-wrapper .card-emoji {
  font-size: 1.6rem;
}

.reveal-spot .card-wrapper .card-month {
  font-size: 0.65rem;
}

.reveal-spot .card-wrapper .card-type-label {
  font-size: 0.5rem;
}

.reveal-placeholder {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.15);
  text-align: center;
  line-height: 1.4;
}

/* 배치 정보 */
.place-info {
  min-width: 100px;
  text-align: center;
}

.place-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.place-text .target-bundle {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-top: 4px;
}

.place-text .match-reason {
  display: block;
  font-size: 0.72rem;
  color: #2ecc71;
  margin-top: 2px;
}

.place-text .rr-reason {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ========== 플라잉 카드 ========== */
.flying-card {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
}

.flying-card .card-wrapper {
  width: 60px;
  height: 90px;
}

.flying-card .card-emoji { font-size: 1.4rem; }
.flying-card .card-month { font-size: 0.6rem; }
.flying-card .card-type-label { font-size: 0.45rem; }

/* ========== 진행 바 ========== */
.progress-section {
  margin: 12px 0;
  text-align: center;
}

.progress-bar-wrap {
  background: var(--bg-secondary);
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #e6a817);
  border-radius: 6px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text { font-size: 0.75rem; color: var(--text-secondary); }

/* ========== 시작 오버레이 ========== */
.start-overlay { text-align: center; padding: 40px 0; }

.start-overlay .desc {
  color: var(--text-secondary);
  margin: 12px 0 24px;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========== 결과 영역 ========== */
.result-section { margin-top: 24px; }

.result-bundles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 500px;
  margin: 16px auto;
}

.result-bundle {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.result-bundle .rb-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
}

.result-bundle .rb-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
}

.result-bundle .rb-cards .card-wrapper { width: 42px; height: 63px; }
.result-bundle .rb-cards .card-emoji { font-size: 0.9rem; }
.result-bundle .rb-cards .card-month { font-size: 0.5rem; }
.result-bundle .rb-cards .card-type-label { font-size: 0.38rem; }

.result-bundle .rb-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--accent-gold), #b8860b);
  color: #1a1a2e;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 8px;
}

/* 점괘 결과 */
.fortune-panel-a { margin-top: 20px; animation: slideUp 0.6s ease; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.fortune-panel-a .fortune-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border: 1px solid rgba(212, 165, 32, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 12px;
}

.fortune-panel-a .fortune-emoji { font-size: 2rem; text-align: center; margin-bottom: 8px; }
.fortune-panel-a .fortune-month { text-align: center; font-size: 1rem; font-weight: 700; color: var(--accent-gold); margin-bottom: 3px; }
.fortune-panel-a .fortune-keyword { text-align: center; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 12px; }
.fortune-panel-a .fortune-detail { font-size: 0.95rem; line-height: 1.8; color: var(--text-primary); text-align: center; }

.fortune-panel-a .fortune-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px 16px;
  font-size: 0.95rem;
  line-height: 1.8;
}

.fortune-panel-a .fortune-empty .empty-icon { font-size: 2rem; margin-bottom: 10px; }

.bottom-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 0 40px;
}

/* ========== 반응형 ========== */
@media (max-width: 480px) {
  .bundles-row { gap: 4px; }
  .bundle-slot { padding: 6px 3px; }
  .slot-cards .card-wrapper { width: 48px; height: 72px; margin-bottom: -52px; }
  .slot-cards .card-wrapper:last-child { margin-bottom: 0; }
  .slot-cards .card-emoji { font-size: 1.2rem; }
  .slot-cards .card-month { font-size: 0.55rem; }

  .draw-area { gap: 14px; padding: 16px 10px; }
  .pile-cards { width: 50px; height: 75px; }
  .reveal-spot { width: 58px; height: 84px; }
  .reveal-spot .card-wrapper { width: 54px; height: 80px; }
  .reveal-spot .card-wrapper .card-emoji { font-size: 1.3rem; }
  .place-info { min-width: 80px; }

  .result-bundle .rb-cards .card-wrapper { width: 36px; height: 54px; }
  .control-bar { gap: 8px; padding: 8px 10px; }
}
