* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(150deg, #0a0a1a 0%, #111a2e 40%, #0f2847 70%, #0a1628 100%);
  background-attachment: fixed;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #fff;
  padding: 0 16px 40px;
}

/* 히어로 헤더 */
.hero {
  text-align: center;
  padding: 56px 24px 40px;
  max-width: 640px;
  width: 100%;
}

.hero-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 20px rgba(226, 183, 20, 0.3));
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f7d358, #e2b714, #f0c040);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.hero-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(226, 183, 20, 0.12);
  border: 1px solid rgba(226, 183, 20, 0.25);
  color: #f7d358;
  letter-spacing: 0.3px;
}

/* 섹션 공통 */
.section {
  max-width: 640px;
  width: 100%;
  margin-bottom: 48px;
}

.section-title {
  text-align: center;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #e2b714, #f7d358);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.recommend-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px 22px;
  backdrop-filter: blur(8px);
}

.set-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.set-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  min-width: 40px;
}

.set-balls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.data-error {
  max-width: 640px;
  width: 100%;
  margin: 10px 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.82rem;
  text-align: center;
}

/* 모델 설정 */
.model-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
}

.model-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.model-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.model-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
}

.model-field input {
  width: 76px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  padding: 4px 6px;
  text-align: center;
}

.model-hint {
  margin-top: 10px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
}

.rolling-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 12px 0 6px;
}

.rolling-summary {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.5);
}

.chart-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 16px 18px;
  margin: 12px 0 18px;
  backdrop-filter: blur(8px);
}

.chart-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
}

.chart-area {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}

.chart-bar {
  flex: 1;
  min-width: 18px;
  background: linear-gradient(180deg, rgba(247, 211, 88, 0.85), rgba(226, 183, 20, 0.6));
  border-radius: 8px 8px 4px 4px;
  position: relative;
  transition: height 0.3s ease;
}

.chart-bar span {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7);
}

.chart-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 560px) {
  .model-grid {
    grid-template-columns: 1fr;
  }
  .rolling-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 각 회차 카드 */
.prediction-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 12px;
  backdrop-filter: blur(8px);
  animation: fadeSlideIn 0.4s ease both;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prediction-card:hover {
  border-color: rgba(226, 183, 20, 0.25);
  box-shadow: 0 4px 24px rgba(226, 183, 20, 0.08);
}

.prediction-card:last-child {
  margin-bottom: 0;
}

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

/* 카드 헤더 */
.prediction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.round-badge {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.round-badge span {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  margin-left: 2px;
}

.prediction-range {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 8px;
}

/* 번호 공 */
.prediction-balls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 14px;
}

.ball {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.35);
  position: relative;
}

.ball::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  height: 30%;
  background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent);
  border-radius: 50%;
  pointer-events: none;
}

.ball.ball-sm {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
  font-weight: 800;
  transition: transform 0.15s;
}

.ball.ball-sm:hover {
  transform: scale(1.15);
}

.ball.range-1  { background: linear-gradient(145deg, #fdd835, #e1b12c); }
.ball.range-10 { background: linear-gradient(145deg, #42a5f5, #1e88e5); }
.ball.range-20 { background: linear-gradient(145deg, #ef5350, #c62828); }
.ball.range-30 { background: linear-gradient(145deg, #66bb6a, #2e7d32); }
.ball.range-40 { background: linear-gradient(145deg, #ab47bc, #7b1fa2); }

/* 접이식 사유 */
.prediction-details {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.details-toggle {
  display: block;
  padding: 10px 0 4px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  text-align: center;
  list-style: none;
  transition: color 0.2s;
  user-select: none;
}

.details-toggle::-webkit-details-marker {
  display: none;
}

.details-toggle::before {
  content: '▸ ';
}

.prediction-details[open] .details-toggle::before {
  content: '▾ ';
}

.details-toggle:hover {
  color: rgba(255, 255, 255, 0.6);
}

.prediction-reasons {
  padding: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reason-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.55;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.reason-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.reason-num {
  font-weight: 800;
  color: #f7d358;
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

.reason-text {
  flex: 1;
}

/* 동반/연번 사유 하이라이트 */
.reason-pair {
  background: rgba(66, 165, 245, 0.06);
  border-left: 2px solid rgba(66, 165, 245, 0.4);
  padding-left: 10px;
}

/* 예측 통계 태그 */
.prediction-stats {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 8px;
}

.hit-count {
  margin-left: 8px;
  font-size: 0.68rem;
  color: rgba(46, 204, 113, 0.9);
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  padding: 3px 8px;
  border-radius: 999px;
}

/* 패턴 분석 카드 */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.pattern-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}

.pattern-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f7d358;
  margin-bottom: 4px;
}

.pattern-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

.pattern-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 10px;
}

.pattern-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 12px;
}

/* 구간 분포 바 */
.range-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.range-bar-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  min-width: 42px;
  text-align: right;
  flex-shrink: 0;
}

.range-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.range-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e2b714, #f7d358);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.range-pct {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.4);
  min-width: 36px;
}

/* 동반출현 쌍 */
.pair-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pair-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(66, 165, 245, 0.1);
  border: 1px solid rgba(66, 165, 245, 0.2);
  color: #42a5f5;
}

/* 비교 카드 */
.comparison-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px 22px;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.hit-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}

.hit-badge.hit-zero {
  background: rgba(231, 76, 60, 0.12);
  border-color: rgba(231, 76, 60, 0.25);
  color: #e74c3c;
}

.comparison-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.comparison-row:last-child {
  margin-bottom: 0;
}

.row-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  min-width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.comparison-balls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ball.ball-hit {
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.25),
    inset 0 -3px 6px rgba(0, 0, 0, 0.3),
    0 0 0 2px #2ecc71,
    0 0 12px rgba(46, 204, 113, 0.4);
}

.ball.ball-miss {
  opacity: 0.35;
}

/* 분석 박스 */
.analysis-box {
  background: rgba(231, 76, 60, 0.06);
  border: 1px solid rgba(231, 76, 60, 0.15);
  border-radius: 18px;
  padding: 22px 24px;
  margin-top: 16px;
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.analysis-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ef5350;
}

.analysis-rate {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
}

.analysis-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.analysis-list li {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.analysis-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #ef5350;
  font-weight: 700;
}

/* 푸터 */
.footer {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
}

.footer p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
}
