* { box-sizing: border-box; }
:root { 
  color-scheme: light dark;
  --primary: #6366f1;
  --secondary: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
}
body { 
  margin: 0; 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans KR', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  min-height: 100vh;
  color: #1f2937;
}
.wrap { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 40px 24px;
}
h1 { 
  font-size: 44px;
  font-weight: 800;
  margin: 0 0 12px;
  color: #ffffff;
  letter-spacing: 0.2px;
  line-height: 1.05;
  text-shadow: 0 8px 30px rgba(2,6,23,0.45);
}

@media (max-width: 520px) {
  h1 { font-size: 28px; line-height: 1.1; }
}

/* 간단한 이유(한줄) 스타일: 눈에 잘 띄도록 색상과 여백 조정 */
.reasonShort {
  color: #0b1220;
  background: rgba(255,255,255,0.9);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-style: italic;
  margin-top: 6px;
}
p { 
  line-height: 1.6;
  margin: 0 0 20px;
}
.grid { 
  display: grid; 
  gap: 24px; 
  grid-template-columns: 1fr; 
}
@media (min-width: 1000px) { 
  .grid { 
    grid-template-columns: 420px 1fr; 
  } 
}
.card {
  border: none;
  border-radius: 20px;
  padding: 28px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}
label { 
  display: block; 
  font-size: 13px; 
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px; 
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  font-size: 15px;
  transition: all 0.2s ease;
  color: #1f2937;
}
input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.row { 
  display: grid; 
  grid-template-columns: 1fr; 
  gap: 14px; 
}
@media (min-width: 520px) { 
  .row { 
    grid-template-columns: 1fr 1fr; 
  } 
}
button {
  width: 100%;
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
  letter-spacing: 0.5px;
}
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}
button:active { 
  transform: translateY(0px);
}
.muted { 
  font-size: 13px;
  color: #4b5563;
}

/* Intro / lead 스타일: 가독성 향상용 박스형 문단 */
.lead {
  font-size: 16px;
  line-height: 1.8;
  color: #0f172a;
  background: rgba(255,255,255,0.90);
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 980px;
  box-shadow: 0 8px 20px rgba(2,6,23,0.06);
  margin-bottom: 18px;
}
.err { 
  color: #dc2626; 
  font-size: 13px; 
  margin-top: 10px;
  font-weight: 500;
}
.ok { 
  font-size: 13px; 
  margin-top: 10px;
  color: #059669;
  font-weight: 500;
}
.pill {
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
  padding: 10px 14px; 
  border-radius: 20px;
  border: none;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  font-size: 12px;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 8px;
}
.nums { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 14px; 
  margin: 14px 0 12px;
  min-height: 60px;
}
.ball {
  width: 56px; 
  height: 56px; 
  border-radius: 50%;
  display: flex; 
  align-items: center; 
  justify-content: center;
  border: none;
  font-weight: 800;
  font-size: 18px;
  color: white;
  user-select: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.ball.small { 
  width: 44px; 
  height: 44px;
  font-size: 15px;
}
/* 로또 공 색상 */
.ball[data-range="1"] { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.ball[data-range="2"] { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.ball[data-range="3"] { background: linear-gradient(135deg, #f87171, #ef4444); }
.ball[data-range="4"] { background: linear-gradient(135deg, #9ca3af, #6b7280); }
.ball[data-range="5"] { background: linear-gradient(135deg, #4ade80, #22c55e); }
.sectionTitle { 
  margin: 0 0 12px; 
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}
.hr { 
  height: 1px; 
  background: linear-gradient(90deg, rgba(0,0,0,0.05), rgba(0,0,0,0.1), rgba(0,0,0,0.05));
  margin: 20px 0; 
}
.hexWrap { 
  display: grid; 
  gap: 16px; 
  grid-template-columns: 1fr; 
}
@media (min-width: 560px) { 
  .hexWrap { 
    grid-template-columns: 1fr 1fr; 
  } 
}

/* Hexagram lines */
.hex { 
  padding: 16px; 
  border-radius: 16px; 
  border: 1px solid rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
}
.lineRow { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 12px; 
  margin: 8px 0; 
  padding: 6px 0;
}
.lineLabel { 
  font-size: 12px; 
  font-weight: 600;
  color: #374151;
  white-space: nowrap; 
}
.lineBar { 
  flex: 1; 
  display: flex; 
  gap: 8px; 
  justify-content: flex-end; 
}
.seg { 
  height: 12px; 
  border-radius: 999px; 
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.yang .seg { 
  width: 100%; 
}
.yin .seg { 
  width: calc(50% - 4px); 
}
.yin .seg:last-child { 
  margin-left: 8px; 
}
.movingTag {
  font-size: 11px; 
  padding: 4px 10px; 
  border-radius: 999px;
  border: 1px solid #ec4899;
  color: #ec4899;
  opacity: 0.9;
  font-weight: 600;
  background: rgba(236, 72, 153, 0.05);
}
ul { 
  margin: 12px 0 0 0;
  padding: 0;
  list-style: none;
}
ul li {
  margin-bottom: 20px;
  line-height: 1.8;
  color: #1f2937;
  padding: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(139, 92, 246, 0.05));
  border-left: 4px solid #6366f1;
  border-radius: 8px;
}
code.inline { 
  font-family: 'Courier New', monospace; 
  font-size: 12px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  color: #6366f1;
}
select {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #374151;
}
select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
option {
  color: #1f2937;
  background: white;
  padding: 8px 12px;
}
option:hover {
  background: linear-gradient(#6366f1, #6366f1);
  background-color: #6366f1 !important;
  color: white;
}
.date-input-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.date-input-group select {
  margin: 0;
}
.date-input-group small {
  font-size: 11px;
  color: #6b7280;
  text-align: center;
  margin-top: 4px;
}
.quick-input {
  margin-top: 12px;
}
.quick-input input {
  margin-bottom: 6px;
}
#resultEmpty, #result {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
