/* lotto 공통 스타일. Bootstrap 5 위에 최소한만 얹는다. */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR",
        "Malgun Gothic", sans-serif;
}

/* 모바일 하단 탭바가 콘텐츠를 가리지 않도록 여백 확보 */
@media (max-width: 991.98px) {
    body:not(.standalone-page) .app-content {
        padding-bottom: 5rem;
    }
}

.bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-around;
    padding: 0.35rem 0 calc(0.35rem + env(safe-area-inset-bottom));
}

.bottom-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.25rem 0;
    font-size: 0.7rem;
    text-decoration: none;
    color: var(--bs-secondary-color);
}

.bottom-tab i {
    font-size: 1.15rem;
}

.bottom-tab.active {
    color: var(--bs-primary);
}

/* 로그인·회원가입처럼 nav 없이 가운데 정렬되는 화면 */
.standalone-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.standalone-page .app-content {
    width: 100%;
    max-width: 26rem;
}

/* 로또 번호 공 */
.lotto-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    font-weight: 600;
    color: #fff;
    background: var(--bs-secondary);
}

.lotto-ball--sm {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.8rem;
}

/* 동행복권 색 규약: 1-10 노랑, 11-20 파랑, 21-30 빨강, 31-40 회색, 41-45 초록 */
.lotto-ball[data-range="1"]  { background: #fbc400; color: #4a3800; }
.lotto-ball[data-range="2"]  { background: #69c8f2; color: #06364a; }
.lotto-ball[data-range="3"]  { background: #ff7272; }
.lotto-ball[data-range="4"]  { background: #aaa; }
.lotto-ball[data-range="5"]  { background: #b0d840; color: #2c3a06; }

.stat-card {
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    background: var(--bs-body-bg);
}

/* 차트 컨테이너.
   Chart.js 는 responsive:true 일 때 canvas 의 height 속성을 무시하고 부모
   크기를 따른다. 부모에 높이가 없으면 캔버스가 0 높이로 접히므로 여기서
   명시한다. maintainAspectRatio:false 와 짝을 이룬다. */
.chart-box {
    position: relative;
    height: 320px;
}

.chart-box--sm {
    height: 240px;
}

@media (max-width: 576px) {
    .chart-box { height: 240px; }
    .chart-box--sm { height: 200px; }
}

/* 연도 × 번호 히트맵.
   Chart.js 에 히트맵 타입이 없어 표로 그린다. 라이브러리를 하나 더 붙일
   만큼의 기능이 아니다. 셀 색은 그 해 기대치 대비 비율로 정한다. */
.heatmap {
    border-collapse: collapse;
    font-size: .68rem;
    white-space: nowrap;
}

.heatmap th,
.heatmap td {
    padding: 2px 4px;
    text-align: center;
    font-weight: 400;
}

.heatmap__year {
    position: sticky;
    left: 0;
    background: var(--bs-body-bg);
    text-align: right !important;
    padding-right: 8px !important;
    font-weight: 600 !important;
}

.heatmap__year span { font-weight: 400; margin-left: 2px; }

.heatmap__num { color: var(--bs-secondary-color); }

.heatmap__cell { color: transparent; }
.heatmap__cell[data-level="0"] { background: rgba(13, 110, 253, .04); }
.heatmap__cell[data-level="1"] { background: rgba(13, 110, 253, .18); }
.heatmap__cell[data-level="2"] { background: rgba(13, 110, 253, .36); }
.heatmap__cell[data-level="3"] { background: rgba(13, 110, 253, .58); }
.heatmap__cell[data-level="4"] { background: rgba(13, 110, 253, .82); }
