/* ============================================
   로또 당첨 시뮬레이터 - 용지 스타일 Grid
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

.predict-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #0a0e1a 0%, #050508 100%);
  color: #fff;
  font-family: 'Pretendard', -apple-system, "Malgun Gothic", sans-serif;
  padding: 5rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-title {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: #ffd700;
}

.page-desc {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 1.5rem;
}

/* ========== 로또 용지 ========== */
.lotto-slip {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, #1a1a1e 0%, #0d0d10 100%);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.slip-header {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(255,255,255,0.9);
}

.slip-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  margin-bottom: 1rem;
}

.slip-num {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.slip-num:hover {
  background: rgba(255,255,255,0.12);
}

.slip-num.marked {
  background: #000;
  border-color: #333;
  color: #fff;
  animation: markPop 0.25s ease-out;
}

@keyframes markPop {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.slip-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-slip {
  flex: 1;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}

.btn-auto {
  background: linear-gradient(135deg, #DC3545 0%, #a71d2a 100%);
  color: #fff;
}

.btn-clear {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
}

/* ========== 시뮬레이션 영역 ========== */
.sim-area {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.btn-start {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
  color: #000;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}

.btn-start:hover:not(:disabled) {
  opacity: 0.95;
}

.btn-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.sim-status {
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 1rem;
  min-height: 80px;
}

.sim-line {
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
  color: rgba(255,255,255,0.9);
}

.sim-line:last-child { margin-bottom: 0; }

/* ========== 대량 구매 로딩 오버레이 ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #0a0e1a 0%, #050508 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.loading-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,215,0,0.03) 2px,
    rgba(255,215,0,0.03) 4px
  );
  pointer-events: none;
}

.loading-inner {
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.loading-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(255,215,0,0.5);
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.loading-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ff6b00);
  border-radius: 4px;
  animation: loadingBarMove 1.8s ease-in-out infinite;
}

@keyframes loadingBarMove {
  0% { width: 0%; margin-left: 0; }
  50% { width: 70%; margin-left: 15%; }
  100% { width: 0%; margin-left: 0; }
}

.loading-msg {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  min-height: 1.5em;
}

.submit-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffd700;
  z-index: 1999;
  text-shadow: 0 0 30px rgba(255,215,0,0.8);
  animation: submitPop 0.6s ease-out;
}

@keyframes submitPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  70% { transform: translate(-50%, -50%) scale(1.05); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========== 결과 팝업 ========== */
.result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.result-card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, #1e1e24 0%, #121218 100%);
  border-radius: 20px;
  padding: 2rem;
  border: 2px solid #ffd700;
  box-shadow: 0 0 40px rgba(255,215,0,0.3);
}

.result-card-pop {
  animation: cardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardPop {
  0% { opacity: 0; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

.result-main {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 1rem;
  text-align: center;
}

.result-header {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #ffd700;
}

.result-body {
  margin-bottom: 1.5rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 0.95rem;
}

.result-item .label {
  color: rgba(255,255,255,0.6);
}

.result-item span:last-child {
  font-weight: 600;
  color: #ffd700;
}

.result-professor {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(255,215,0,0.08);
  border-left: 4px solid #ffd700;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  font-style: italic;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
}

.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-result {
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.btn-share {
  background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
  color: #fff;
}

.btn-save {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}

.btn-other {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.3);
}
