
/* Import Font */


/* [수정 1] 파일 맨 윗줄에 폰트 불러오기 추가 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap'); /* 이건 원래 있던 거 */

/* ------------------- */
/* -- Design System -- */
/* ------------------- */
:root {
  /* ... 색상 변수들은 그대로 두고 ... */

  /* [수정 2] 폰트 변수를 프리텐다드로 변경 */
  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, 'Noto Sans KR', sans-serif;

  /* ... 나머지 아래 내용 그대로 ... */
}




/* ------------------- */
/* -- Design System -- */
/* ------------------- */
:root {
  /* Color Palette: Energetic & Trustworthy */
  --bg-main: #f4f7f9;
  --bg-card: #ffffff;
  --text-primary: #1a202c;
  --text-secondary: #718096;
  --accent-primary: #2C5282; /* Deep Blue */
  --accent-secondary: #50E3C2;
  --accent-hover: #2A4365; /* Darker Blue */
  --border-color: #e2e8f0;

  /* Shadows */
  --shadow-soft: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lifted: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,0.06);

  /* Typography */
  --font-main: 'Noto Sans KR', sans-serif;

  /* Lotto Ball Gradients */
  --ball-1: radial-gradient(circle at 65% 15%, white, #FFD700 80%);
  --ball-2: radial-gradient(circle at 65% 15%, white, #4A90E2 80%);
  --ball-3: radial-gradient(circle at 65% 15%, white, #FF6B6B 80%);
  --ball-4: radial-gradient(circle at 65% 15%, white, #ADB5BD 80%);
  --ball-5: radial-gradient(circle at 65% 15%, white, #50E3C2 80%);
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden; /* 전체 페이지 가로 스크롤 방지 */
}

/* Main App Container */
.mobile-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background-color: var(--bg-main);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-shadow: var(--shadow-lifted);
}

/* ------------------- */
/* -- Header & Menu -- */
/* ------------------- */
.app-header {
  display: flex; justify-content: center; align-items: center;
  padding: 12px 20px; background: var(--bg-card);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

.logo-image { height: 78px; width: auto; max-width: 100%; }

.menu-button {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 10px;
  color: var(--text-secondary); transition: color 0.2s;
  font-size: 1.4rem;
}
.menu-button:hover { color: var(--accent-primary); }

/* Menu Styles */
.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s linear;
    z-index: 1000;
}
.menu-overlay.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }

.main-menu {
    position: fixed; right: -100%; top: 0; width: 80%; max-width: 320px; height: 100%;
    background: rgba(26, 32, 44, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex; flex-direction: column; padding: 24px;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: var(--shadow-lifted);
}
.menu-overlay.is-active .main-menu { right: 0; }

.menu-header { display: flex; justify-content: flex-end; margin-bottom: 24px; }
.close-menu-button { background: none; border: none; color: #A0AEC0; font-size: 28px; cursor: pointer; }

.main-menu a {
    color: #E2E8F0;
    text-decoration: none; font-size: 1.1rem; font-weight: 600;
    padding: 16px 10px; border-radius: 8px;
    transition: color 0.2s, background-color 0.2s;
}
.main-menu a:hover { color: #ffffff; background-color: rgba(74, 144, 226, 0.1); }

/* ----------------------- */
/* -- Content & Cards -- */
/* ----------------------- */
.main-content {
  flex-grow: 1; padding: 20px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 20px;
}

.info-card, .results-container, .money_container, .card-style {
  background: var(--bg-card);
  border-radius: 24px; padding: 24px;
  box-shadow: var(--shadow-lifted); border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%; /* 카드 너비 강제 */
  overflow-wrap: break-word; /* 텍스트 넘침 방지 */
  word-break: break-word;    /* 안전장치 추가 */
}

.info-card:hover { transform: translateY(-5px); box-shadow: 0 15px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1); }
.info-card h2 { font-size: 1.4rem; font-weight: 900; margin-bottom: 8px; color: var(--text-primary); }
.small-text { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 24px; }

/* Results Section */
.results-container {
    display: flex; flex-direction: column; gap: 16px; padding: 16px;
}

/* [핵심 수정] 로또 공들이 화면을 뚫지 않고 줄바꿈 되도록 수정 */
.lotto-card {
    display: flex;
    justify-content: space-between; /* 공들을 가운데로 */
    align-items: center;
    padding: 16px; /* 패딩을 조금 더 줌 */
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    flex-wrap: nowrap; /* 화면 좁으면 줄바꿈 허용 */
    gap: 4px; /* 공 사이 간격 */
}

.number-ball {
    width: 38px; height: 38px; /* 공 크기 살짝 줄임 (모바일 최적화) */
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-primary); font-size: 0.9rem; font-weight: 700;
    box-shadow: var(--shadow-inner), var(--shadow-soft);
    border: 2px solid rgba(255,255,255,0.8);
    flex-shrink: 0;
}

/* Apply Ball Colors */
.number-ball[data-color='1'] { background: var(--ball-1); }
.number-ball[data-color='2'] { background: var(--ball-2); }
.number-ball[data-color='3'] { background: var(--ball-3); }
.number-ball[data-color='4'] { background: var(--ball-4); }
.number-ball[data-color='5'] { background: var(--ball-5); }


.money_container {
    width: 100%; max-width: 300px; 
    margin: 20px auto;
}


/* ------------------- */
/* -- Interactive -- */
/* ------------------- */
.generate-button {
  width: 100%; padding: 16px; font-size: 1.1rem; font-weight: 700;
  background: var(--accent-primary); color: #fff;
  border: none; border-radius: 16px; cursor: pointer;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  box-shadow: 0 4px 14px 0 rgba(44, 82, 130, 0.35);
  transition: all 0.25s ease;
}
.generate-button:hover:not(:disabled) {
  background: var(--accent-hover); transform: translateY(-3px);
  box-shadow: 0 6px 20px 0 rgba(42, 67, 101, 0.45);
}
.generate-button:disabled { background: #bdc3c7; cursor: not-allowed; box-shadow: none; transform: none; }

.share-button {
    width: 100%; padding: 14px; font-size: 1rem; font-weight: 600;
    color: var(--accent-primary); background: transparent;
    border: 2px solid var(--accent-primary); border-radius: 16px;
    cursor: pointer; transition: all 0.2s ease;
}
.share-button:hover { background: rgba(44, 82, 130, 0.1); }

/* Bars */
.probability-comparison-box .bar-item { margin-bottom: 16px; }
.bar-label { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.bar-wrapper { width: 100%; height: 10px; background: #e2e8f0; border-radius: 5px; overflow: hidden; }
.bar { height: 100%; border-radius: 5px; animation: bar-fill 1.2s ease-out forwards; }
.bar.random { background: #cbd5e1; }
.bar.algo { background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary)); }
@keyframes bar-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.app-footer, .footer {
  padding: 24px 20px; text-align: center; font-size: 0.75rem;
  color: var(--text-secondary); flex-shrink: 0;
}
.message {
    padding: 12px; margin-bottom: 15px; border-radius: 10px; font-size: 14px;
    background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
    text-align: center; display: none;
    cursor: pointer;
}

/* ----------------------- */
/* -- Loading Overlay -- */
/* ----------------------- */
.matrix-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* 반투명 배경 유지 */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    flex-direction: column;
    padding: 20px;
}

.boot-sequence-container {
    width: 100%;
    height: auto; /* 높이를 자동으로 조절 */
    font-family: 'monospace'; /* 컴퓨터 폰트 스타일 */
    color: #0F0; /* 녹색 텍스트 */
    font-size: 14px;
    line-height: 1.7;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 세로 중앙 정렬 */
    overflow: hidden;
    min-height: 150px; /* 최소 높이 지정 */
}

.boot-sequence-container > div {
    white-space: nowrap;
    overflow: hidden;
    animation: typing 0.1s steps(60, end);
    opacity: 0;
    animation-fill-mode: forwards;
}

.matrix-message {
    display: none; /* Initially hidden */
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    line-height: 1.8;
    padding: 20px;
    background: transparent;
    border-radius: 10px;
    z-index: 2001;
    animation: fadeIn 0.5s ease-in-out;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes typing {
    from { width: 0; opacity: 1; }
    to { width: 100%; opacity: 1; }
}
