/*
 * 파일명: style.css
 * 위치: /css/style.css
 * 기능: 로또 번호 생성기 리팩토링된 스타일시트 (미니볼 표준화)
 * 작성일: 2025-05-24
 * 수정일: 2025-06-09
 */

/* ===================================
 * CSS 변수 및 전역 스타일
 * =================================== */

/* CSS 변수 정의 */
:root {
    /* 기본 색상 */
    --primary-color: #10a37f;
    --primary-color-light: #1ad1a4;
    --primary-color-dark: #0b755c;
    --secondary-color: #343541;
    --light-bg: #f8f9fa;
    --card-shadow: 0 2px 15px rgba(0,0,0,0.05);
    --transition-speed: 0.3s;
    --gradient-start: #10a37f;
    --gradient-end: #5664d2;
    
    /* 로또볼 색상 */
    --lotto-gold: #fbc400;
    --lotto-blue: #69c8f2;
    --lotto-red: #ff7272;
    --lotto-gray: #aaa;
    --lotto-green: #b0d840;
    
    /* 볼 사이즈 변수 */
    --main-ball-size: 60px;
    --main-ball-font: 24px;
    --medium-ball-size: 48px;
    --medium-ball-font: 20px;
    --small-ball-size: 36px;
    --small-ball-font: 16px;
    --mini-ball-size: 32px;
    --mini-ball-font: 14px;
    --micro-ball-size: 28px;
    --micro-ball-font: 13px;
    --tiny-ball-size: 24px;
    --tiny-ball-font: 12px;
}

/* 기본 스타일 */
body {
    font-family: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--secondary-color);
    line-height: 1.6;
}

main {
    flex: 1;
}


/* ===================================
 * 로또볼 사이즈별 클래스
 * =================================== */

/* 메인 볼 (60px) - 번호 생성 결과용 */
.lotto-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 2px;
    width: var(--main-ball-size);
    height: var(--main-ball-size);
    font-size: var(--main-ball-font);
    margin: 0 8px;
}

/* 미디움 볼 (48px) - 히스토리용 */
.lotto-medium-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 2px;
    width: var(--medium-ball-size);
    height: var(--medium-ball-size);
    min-width: var(--medium-ball-size);
    min-height: var(--medium-ball-size);
    font-size: var(--medium-ball-font);
}

/* 스몰 볼 (36px) - 검색 결과용 */
.lotto-small-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 2px;
    width: var(--small-ball-size);
    height: var(--small-ball-size);
    min-width: var(--small-ball-size);
    min-height: var(--small-ball-size);
    font-size: var(--small-ball-font);
}

/* 미니 볼 (32px) - 공개 로그용 */
.lotto-mini-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 2px;
    width: var(--mini-ball-size);
    height: var(--mini-ball-size);
    min-width: var(--mini-ball-size);
    min-height: var(--mini-ball-size);
    font-size: var(--mini-ball-font);
}

/* 마이크로 볼 (28px) - 추첨 통계용 */
.lotto-micro-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 1px;
    width: var(--micro-ball-size);
    height: var(--micro-ball-size);
    min-width: var(--micro-ball-size);
    min-height: var(--micro-ball-size);
    font-size: var(--micro-ball-font);
}

/* 타이니 볼 (24px) - 최소 사이즈 */
.lotto-tiny-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 1px;
    width: var(--tiny-ball-size);
    height: var(--tiny-ball-size);
    min-width: var(--tiny-ball-size);
    min-height: var(--tiny-ball-size);
    font-size: var(--tiny-ball-font);
}

/* 공통 하이라이트 효과 */
.lotto-ball::before,
.lotto-medium-ball::before,
.lotto-small-ball::before,
.lotto-mini-ball::before,
.lotto-micro-ball::before,
.lotto-tiny-ball::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
}

/* 공통 호버 효과 */
.lotto-ball:hover,
.lotto-medium-ball:hover,
.lotto-small-ball:hover,
.lotto-mini-ball:hover,
.lotto-micro-ball:hover,
.lotto-tiny-ball:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ===================================
 * 로또볼 색상 시스템
 * =================================== */

/* 번호별 색상 (모든 볼 사이즈에 적용) */
.number-1-10 { 
    background: linear-gradient(135deg, var(--lotto-gold) 0%, #ffcd3c 100%); 
}

.number-11-20 { 
    background: linear-gradient(135deg, var(--lotto-blue) 0%, #4fa8d8 100%); 
}

.number-21-30 { 
    background: linear-gradient(135deg, var(--lotto-red) 0%, #ff5252 100%); 
}

.number-31-40 { 
    background: linear-gradient(135deg, var(--lotto-gray) 0%, #9e9e9e 100%); 
}

.number-41-45 { 
    background: linear-gradient(135deg, var(--lotto-green) 0%, #8bc34a 100%); 
}

/* 보너스 볼 스타일 */
.bonus {
    border: 3px solid #ffd700 !important;
    box-shadow: 0 3px 8px rgba(255,215,0,0.4) !important;
}

/* ===================================
 * 특수 효과 및 상태
 * =================================== */

/* 당첨 번호 하이라이트 */
.winning-number {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%) !important;
    border: 2px solid #ff6b6b !important;
    animation: winningPulse 1.5s ease-in-out infinite;
    position: relative;
}

.winning-number::after {
    content: '✨';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 10px;
    animation: sparkle 1s ease-in-out infinite;
}

@keyframes winningPulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
    }
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: rotate(0deg); }
    50% { opacity: 1; transform: rotate(180deg); }
}

/* 매칭 하이라이트 */
.matching-highlight {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.6) !important;
    animation: matchPulse 1.5s ease-in-out infinite;
}

@keyframes matchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 번호 변경 애니메이션 */
.number-changing {
    animation: numberFlip 0.6s ease-in-out;
}

@keyframes numberFlip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

/* ===================================
 * 모바일 반응형 로또볼
 * =================================== */

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
    :root {
        --main-ball-size: 50px;
        --main-ball-font: 20px;
        --medium-ball-size: 40px;
        --medium-ball-font: 18px;
        --small-ball-size: 32px;
        --small-ball-font: 14px;
        --mini-ball-size: 28px;
        --mini-ball-font: 13px;
        --micro-ball-size: 26px;
        --micro-ball-font: 12px;
        --tiny-ball-size: 22px;
        --tiny-ball-font: 11px;
    }
    
    .lotto-ball {
        margin: 0 4px;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    :root {
        --main-ball-size: 45px;
        --main-ball-font: 18px;
        --medium-ball-size: 36px;
        --medium-ball-font: 16px;
        --small-ball-size: 30px;
        --small-ball-font: 13px;
        --mini-ball-size: 26px;
        --mini-ball-font: 12px;
        --micro-ball-size: 24px;
        --micro-ball-font: 11px;
        --tiny-ball-size: 20px;
        --tiny-ball-font: 10px;
    }
    
    .lotto-ball {
        margin: 0 2px;
    }
}

/* 초소형 모바일 (360px 이하) */
@media (max-width: 360px) {
    :root {
        --main-ball-size: 40px;
        --main-ball-font: 16px;
        --medium-ball-size: 32px;
        --medium-ball-font: 14px;
        --small-ball-size: 28px;
        --small-ball-font: 12px;
        --mini-ball-size: 24px;
        --mini-ball-font: 11px;
        --micro-ball-size: 22px;
        --micro-ball-font: 10px;
        --tiny-ball-size: 18px;
        --tiny-ball-font: 9px;
    }
}

/* ===================================
 * 히스토리 전용 스타일
 * =================================== */

/* 히스토리 로또볼 (미디움 사이즈 사용) */
.history-lotto-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 2px;
    width: var(--medium-ball-size);
    height: var(--medium-ball-size);
    min-width: var(--medium-ball-size);
    min-height: var(--medium-ball-size);
    font-size: var(--medium-ball-font);
}

.history-lotto-ball::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
}

.history-lotto-ball:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.history-lotto-ball.matching {
    border: 2px solid #28a745;
    box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
}

/* ===================================
 * 당첨 상세 모달 전용 스타일
 * =================================== */

/* 당첨자 상세 모달의 번호 배지 */
.number-badge {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 2px;
    width: var(--small-ball-size);
    height: var(--small-ball-size);
    min-width: var(--small-ball-size);
    min-height: var(--small-ball-size);
    font-size: var(--small-ball-font);
    background-color: #6c757d;
}

.number-badge::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
}

.number-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.number-badge.matched {
    background-color: #28a745 !important;
    border: 2px solid #20c997;
}

.number-badge.bonus-matched {
    background-color: #fd7e14 !important;
    border: 2px solid #ffc107;
}

/* ===================================
 * 이번 주 추첨 통계 전용 스타일
 * =================================== */

/* 추첨 통계 미니 볼 (마이크로 사이즈 사용) */
.upcoming-mini-ball {
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    transition: all 0.2s ease-in-out;
    position: relative;
    flex-shrink: 0;
    flex-grow: 0;
    margin: 1px;
    width: var(--micro-ball-size);
    height: var(--micro-ball-size);
    min-width: var(--micro-ball-size);
    min-height: var(--micro-ball-size);
    font-size: var(--micro-ball-font);
}

.upcoming-mini-ball::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 25%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
}

.upcoming-mini-ball:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* 추첨 통계 번호별 색상 (기존과 동일하되 클래스명 변경) */
.upcoming-mini-ball.upcoming-1-10 {
    background: linear-gradient(135deg, #fbc400 0%, #ffcd3c 100%);
}

.upcoming-mini-ball.upcoming-11-20 {
    background: linear-gradient(135deg, #69c8f2 0%, #4fa8d8 100%);
}

.upcoming-mini-ball.upcoming-21-30 {
    background: linear-gradient(135deg, #ff7272 0%, #ff5252 100%);
}

.upcoming-mini-ball.upcoming-31-40 {
    background: linear-gradient(135deg, #aaa 0%, #9e9e9e 100%);
}

.upcoming-mini-ball.upcoming-41-45 {
    background: linear-gradient(135deg, #b0d840 0%, #8bc34a 100%);
}

/* 미선택 번호 투명도 */
.upcoming-mini-ball.upcoming-unselected {
    opacity: 0.4;
    filter: grayscale(50%);
}

/* 빈도수 표시 배지 */
.frequency-badge {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
    margin-top: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.frequency-badge.popular {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    animation: popularBadgePulse 2s ease-in-out infinite;
}

.frequency-badge.unpopular {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
}

@keyframes popularBadgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.95); }
}

/* ===================================
 * 헤더 스타일
 * =================================== */

/* 히어로 헤더 */
.hero-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 60vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-20px) translateY(-10px); }
    50% { transform: translateX(20px) translateY(10px); }
    75% { transform: translateX(-10px) translateY(20px); }
}

/* 히어로 컨텐츠 */
.hero-content {
    color: white;
    z-index: 2;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
    max-width: 500px;
}

/* 히어로 통계 */
.hero-stats {
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* 히어로 비주얼 */
.hero-visual {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-icon {
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    z-index: 1;
}

/* 플로팅 볼 애니메이션 */
.floating-numbers {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-ball {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    animation: float 6s ease-in-out infinite;
}

.ball-1 { 
    background: linear-gradient(135deg, #fbc400 0%, #ffcd3c 100%);
    top: 10%; left: 20%;
    animation-delay: 0s;
}

.ball-2 { 
    background: linear-gradient(135deg, #69c8f2 0%, #4fa8d8 100%);
    top: 25%; right: 15%;
    animation-delay: 1s;
}

.ball-3 { 
    background: linear-gradient(135deg, #ff7272 0%, #ff5252 100%);
    top: 50%; left: 10%;
    animation-delay: 2s;
}

.ball-4 { 
    background: linear-gradient(135deg, #aaa 0%, #9e9e9e 100%);
    top: 70%; right: 25%;
    animation-delay: 3s;
}

.ball-5 { 
    background: linear-gradient(135deg, #b0d840 0%, #8bc34a 100%);
    bottom: 20%; left: 30%;
    animation-delay: 4s;
}

.ball-6 { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    bottom: 10%; right: 10%;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-20px) rotate(90deg); }
    50% { transform: translateY(-10px) rotate(180deg); }
    75% { transform: translateY(-15px) rotate(270deg); }
}

/* 반응형 헤더 */
@media (max-width: 991.98px) {
    .hero-header {
        min-height: 70vh;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-visual {
        height: 300px;
        margin-top: 2rem;
    }
    
    .hero-icon {
        font-size: 6rem;
    }
    
    .floating-ball {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .stat-item {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
}

/* ===================================
 * 카드 스타일
 * =================================== */

/* 카드 컨테이너 */
.card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* 카드 바디 */
.card-body {
    padding: 2rem;
}

/* ===================================
 * 동적 번호 애니메이션
 * =================================== */

/* 초기 로딩 애니메이션 */
.lotto-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 1rem 0;
    min-height: 80px;
}

.lotto-preview .lotto-ball {
    animation: floatNumbers 2s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.1s);
}

@keyframes floatNumbers {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 번호 생성 애니메이션 */
.lotto-current .lotto-ball {
    opacity: 0;
    transform: scale(0);
    animation: ballPop 0.6s ease forwards;
}

@keyframes ballPop {
    0% { opacity: 0; transform: scale(0) rotate(180deg); }
    60% { transform: scale(1.2) rotate(360deg); }
    100% { opacity: 1; transform: scale(1) rotate(360deg); }
}

/* 각 볼의 애니메이션 딜레이 */
.lotto-current .lotto-ball:nth-child(1) { animation-delay: 0.1s; }
.lotto-current .lotto-ball:nth-child(2) { animation-delay: 0.2s; }
.lotto-current .lotto-ball:nth-child(3) { animation-delay: 0.3s; }
.lotto-current .lotto-ball:nth-child(4) { animation-delay: 0.4s; }
.lotto-current .lotto-ball:nth-child(5) { animation-delay: 0.5s; }
.lotto-current .lotto-ball:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
 * 버튼 스타일
 * =================================== */

/* 기본 버튼 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    border: none;
    color: white;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(16, 163, 127, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-color-light) 0%, var(--primary-color) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 163, 127, 0.4);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* 보조 버튼 */
.btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: transparent;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* ===================================
 * 매칭 섹션 스타일
 * =================================== */

/* 번호 매칭 섹션 */
.number-match-section {
    display: flex;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 163, 127, 0.05) 0%, rgba(86, 100, 210, 0.05) 100%);
    border-radius: 16px;
    border: 1px solid rgba(16, 163, 127, 0.1);
}

/* 매칭된 번호 강조 */
.matching-numbers {
    display: flex;
    align-items: center;
    padding: 15px;
    background: rgba(16, 163, 127, 0.1);
    border-radius: 12px;
    margin: 0 15px;
    border: 2px solid var(--primary-color);
}

/* 매칭 정보 */
.match-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    text-align: center;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-info:hover {
    background: rgba(16, 163, 127, 0.1);
    transform: translateY(-3px);
}

/* ===================================
 * 히스토리 섹션 스타일
 * =================================== */

/* 히스토리 아이템 */
.number-history-item {
    padding: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    animation: slideIn 0.5s ease forwards;
    background: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.number-history-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 히스토리 헤더 */
.history-header {
    margin-bottom: 12px;
}

.history-first-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.history-separator {
    color: #6c757d;
    font-weight: normal;
    font-size: 0.9rem;
}

.history-second-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-second-line .btn-link {
    font-size: 0.85rem;
    text-decoration: none;
    padding: 0;
}

.history-second-line .btn-link:hover {
    text-decoration: underline;
}

/* 히스토리 번호 컨테이너 */
.history-numbers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

/* ===================================
 * 통계 섹션 스타일
 * =================================== */

/* 통계 배지 */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    margin: 0.25rem;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%) !important;
}

/* ===================================
 * FAQ 섹션 스타일
 * =================================== */

/* FAQ 아코디언 */
.accordion-button {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 12px !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-dark) 100%);
    color: white;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(16, 163, 127, 0.25);
}

/* ===================================
 * 관련 자료 섹션 스타일
 * =================================== */

/* 관련 자료 컨테이너 */
.related-content-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.related-content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Cpath d='M20 20c0-11.046-8.954-20-20-20v40c11.046 0 20-8.954 20-20z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
}

/* 관련 자료 카드 */
.insight-card {
    background: rgba(255, 255, 255, 0.95);
    color: var(--secondary-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.insight-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* ===================================
 * 플로팅 버튼 스타일
 * =================================== */

/* 플로팅 버튼 컨테이너 */
.floating-buttons {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

/* 플로팅 버튼 */
.floating-button {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #495057 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.floating-button:hover {
    transform: translateX(-8px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.scroll-top-button {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

.share-button {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

/* ===================================
 * 푸터 스타일
 * =================================== */

/* 푸터 컨테이너 */
footer {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #212529 100%);
    color: white;
    padding: 3rem 0 1rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--gradient-end) 100%);
}

/* ===================================
 * 공개 로그 스타일
 * =================================== */

/* 공개 로그 컨테이너 */
.public-log {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
}

/* 로그 아이템 기본 스타일 */
.log-item {
    background: white;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    animation: slideInLog 0.5s ease forwards;
}

.log-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}


/* 첫 번째 줄: 사용자명, 시간, 당첨 정보 */
.log-first-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

/* 당첨 배지 */
.log-first-line .badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 4px;
}

/* 두 번째 줄: 번호들 */
.log-second-line {
    display: flex;
    justify-content: center;
}


@keyframes winningGlow {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
    }
    50% { 
        box-shadow: 0 0 12px rgba(255, 193, 7, 0.7);
    }
}


@keyframes slideInLog {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 로그 헤더 */
.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

/* 사용자 이니셜 */
.user-initial {
    font-weight: bold;
    color: var(--primary-color);
    background: rgba(16, 163, 127, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.8rem;
}

/* 시간 표시 */
.log-time {
    color: #6c757d;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* 로그 번호 표시 */
.log-numbers {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
}

/* 당첨 아이템 스타일 */
.log-item.winning-item {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border-left-color: #ffc107;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.2);
}

.log-item.winning-item:hover {
    transform: translateX(5px) scale(1.01);
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

/* 당첨 번호 하이라이트 */
.log-numbers .winning-number {
    border: 2px solid #ffc107;
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.4);
    animation: winningGlow 1.5s ease-in-out infinite;
}

/* 당첨 정보 섹션 */
.winning-info {
    background: rgba(255, 193, 7, 0.1);
    border-radius: 8px;
    padding: 8px;
    border: 1px solid rgba(255, 193, 7, 0.2);
}


/* 태블릿 반응형 (768px 이하) */
@media (max-width: 768px) {
    .log-item {
        padding: 8px 10px;
        margin-bottom: 6px;
    }
    
    .log-first-line {
        margin-bottom: 5px;
        font-size: 0.8rem;
    }
    
    .user-initial {
        font-size: 0.75rem;
        padding: 1px 5px;
    }
    
    .log-time {
        font-size: 0.7rem;
    }
    
    .log-first-line .badge {
        font-size: 0.65rem;
        padding: 1px 4px;
    }
    
    .log-numbers {
        gap: 2px;
    }
}

/* 모바일 반응형 (480px 이하) */
@media (max-width: 480px) {
    .log-item {
        padding: 6px 8px;
        margin-bottom: 5px;
    }
    
    .log-first-line {
        margin-bottom: 4px;
        font-size: 0.75rem;
    }
    
    .user-initial {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
    
    .log-time {
        font-size: 0.65rem;
    }
    
    .log-first-line .badge {
        font-size: 0.6rem;
        padding: 1px 3px;
        margin-left: 2px;
    }
    
    .log-numbers {
        gap: 1px;
    }
    
    /* 작은 화면에서 시간과 당첨 정보가 길 경우 줄바꿈 */
    .log-first-line {
        flex-wrap: wrap;
        gap: 4px;
    }
}

/* 초소형 모바일 (360px 이하) */
@media (max-width: 360px) {
    .log-first-line {
        font-size: 0.7rem;
    }
    
    .user-initial {
        font-size: 0.65rem;
    }
    
    .log-time {
        font-size: 0.6rem;
    }
    
    .log-first-line .badge {
        font-size: 0.55rem;
    }
}




/* ===================================
 * 당첨번호 섹션 스타일
 * =================================== */

/* 당첨결과 섹션 스타일 */
.winning-results-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid #dee2e6;
}

.round-title h4 {
    color: #dc3545 !important;
    font-size: 1.5rem;
}

/* 당첨번호 표시 스타일 */
.winning-numbers-display .numbers-container {
    align-items: flex-start;
}

.winning-group,
.bonus-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.winning-group .numbers-row,
.bonus-group .numbers-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.label-row {
    text-align: center;
}

.label-row small {
    font-size: 0.85rem;
    color: #6c757d;
}

.plus-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 15px;
}

.plus-symbol {
    color: #6c757d;
    font-weight: bold;
    font-size: 1.5rem;
}

/* ===========================
 * 1등 당첨 정보 모바일 반응형 스타일
 * =========================== */
/* 당첨번호 표시 기본 스타일 */
.winning-numbers-display .lotto-ball {
    width: var(--main-ball-size);
    height: var(--main-ball-size);
    font-size: var(--main-ball-font);
    margin: 0 4px;
}


.first-prize-header h6 {
    color: #f39c12 !important;
    font-size: 1.1rem;
}

.first-prize-card {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border: 2px solid #ffc107;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.prize-left, .prize-right {
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
}

.prize-left {
    border-right: 1px solid #ffc107;
}

.prize-value {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    word-break: keep-all;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    font-variant-numeric: tabular-nums;
    display: block;
    text-align: center;
}

.prize-label {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 호버 효과 */
.first-prize-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.3);
    transition: all 0.3s ease;
}

/* 태블릿 반응형 (768px 이하) */
@media (max-width: 768px) {
    .first-prize-header h6 {
        font-size: 1rem;
    }
    
    .first-prize-card {
        border-radius: 12px;
        border-width: 1px;
    }
    
    .winning-numbers-display .lotto-ball {
        width: var(--medium-ball-size);
        height: var(--medium-ball-size);
        min-width: var(--medium-ball-size);
        min-height: var(--medium-ball-size);
        font-size: var(--medium-ball-font);
        margin: 0 3px;
    }
    
    .winning-numbers-display .numbers-row {
        gap: 4px !important;
    }
    
    .plus-symbol {
        font-size: 1.2rem !important;
    }
	
	.prize-left, .prize-right {
        padding: 1.5rem 1rem;
    }
    
    .prize-left {
        border-right: none;
        border-bottom: 1px solid #ffc107;
    }
    
    .prize-value {
        font-size: 1.8rem;
        margin-bottom: 0.3rem;
        line-height: 1.1;
    }
    
    .prize-label {
        font-size: 0.85rem;
        letter-spacing: 0.3px;
    }
}

/* 모바일 반응형 (480px 이하) */
@media (max-width: 480px) {
    .prize-info-section {
        margin-top: 1.5rem !important;
    }
    
    .winning-numbers-display .lotto-ball {
        width: var(--small-ball-size);
        height: var(--small-ball-size);
        min-width: var(--small-ball-size);
        min-height: var(--small-ball-size);
        font-size: var(--small-ball-font);
        margin: 0 2px;
    }
    
    .winning-numbers-display .numbers-row {
        gap: 2px !important;
        margin-bottom: 6px !important;
    }
    
    .plus-container {
        margin: 0 8px !important;
    }
    
    .plus-symbol {
        font-size: 1rem !important;
    }
    
    .label-row small {
        font-size: 0.75rem !important;
    }
	
	.first-prize-header {
        margin-bottom: 1rem !important;
    }
    
    .first-prize-header h6 {
        font-size: 0.95rem;
    }
    
    .first-prize-card {
        border-radius: 10px;
        box-shadow: 0 2px 10px rgba(255, 193, 7, 0.15);
    }
    
    .prize-left, .prize-right {
        padding: 1.2rem 0.8rem;
    }
    
    .prize-value {
        font-size: 1.4rem;
        font-weight: 700;
        margin-bottom: 0.25rem;
        line-height: 1.1;
        /* 긴 텍스트 감지 및 크기 조정 */
        container-type: inline-size;
    }
    
    /* 컨테이너 쿼리로 텍스트 길이에 따른 크기 조정 */
    @container (max-width: 200px) {
        .prize-value {
            font-size: 1.2rem;
        }
    }
    
    @container (max-width: 150px) {
        .prize-value {
            font-size: 1.1rem;
        }
    }
    
    .prize-label {
        font-size: 0.8rem;
        letter-spacing: 0.2px;
        color: #495057;
    }

    
    /* 컬럼을 세로로 배치 */
    .first-prize-card .row.g-0 {
        flex-direction: column;
    }
    
    .first-prize-card .col-6 {
        flex: none;
        width: 100%;
    }
    
    .prize-left {
        border-right: none;
        border-bottom: 1px solid #ffc107;
    }
    
    .prize-right {
        border-bottom: none;
    }
}

/* 초소형 모바일 (360px 이하) */
@media (max-width: 360px) {
    .first-prize-header h6 {
        font-size: 0.9rem;
    }
    
    .winning-numbers-display .lotto-ball {
        width: var(--mini-ball-size);
        height: var(--mini-ball-size);
        min-width: var(--mini-ball-size);
        min-height: var(--mini-ball-size);
        font-size: var(--mini-ball-font);
        margin: 0 1px;
    }
    
    .winning-numbers-display .numbers-row {
        gap: 1px !important;
    }
    
    .plus-container {
        margin: 0 6px !important;
    }
    
    .plus-symbol {
        font-size: 0.9rem !important;
    }
    
    .label-row small {
        font-size: 0.7rem !important;
    }
	
	.prize-left, .prize-right {
        padding: 1rem 0.6rem;
    }
    
    .prize-value {
        font-size: 1.2rem;
        font-weight: 600;
        line-height: 1.05;
    }
    
    .prize-label {
        font-size: 0.75rem;
    }
    
    /* 아이콘 크기 조정 */
    .first-prize-header .bi-trophy-fill {
        font-size: 0.9rem;
    }
}

/* 세로 배치 시 애니메이션 효과 */
@media (max-width: 480px) {
    .first-prize-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
    }
}

/* 텍스트 길이가 긴 경우 대응 */
.prize-value {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

/* 한국어 숫자 표시 최적화 */
.prize-value {
    font-variant-numeric: tabular-nums;
}


/* JavaScript 없이 텍스트 길이 감지 대안 방법 */
.prize-value[data-length="long"] {
    font-size: 1.2rem !important;
}

.prize-value[data-length="very-long"] {
    font-size: 1.1rem !important;
}

/* 특정 길이의 텍스트에 대한 스타일 */
@media (max-width: 480px) {
    /* 10자 이상의 텍스트 */
    .prize-value:where([title*="억"], [title*="조"]) {
        font-size: 1.2rem;
    }
    
    /* 매우 긴 당첨금액 (15자 이상) */
    .prize-value:where([title*="1,000"], [title*="10,000"]) {
        font-size: 1.1rem;
    }
}

/* 반응형 폰트 크기 유틸리티 클래스 */
.prize-value-responsive {
    font-size: clamp(1.1rem, 4vw, 2.2rem);
}

@media (max-width: 480px) {
    .prize-value-responsive {
        font-size: clamp(1rem, 3.5vw, 1.4rem);
    }
}

@media (max-width: 360px) {
    .prize-value-responsive {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
}



/* 당첨금액이 길 경우 폰트 크기 자동 조정 */
@media (max-width: 480px) {
    .prize-value:has-text(길이가 긴 텍스트) {
        font-size: 1.2rem;
    }
}

/* 접근성 개선 */
.first-prize-card:focus-within {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* ===================================
 * 당첨 통계 카드
 * =================================== */

/* 당첨 통계 카드 */
.winning-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.winning-stats-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
}

.winning-stats-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ===================================
 * 당첨자 상세 보기 스타일
 * =================================== */

/* 당첨자 상세 보기 스타일 */
.winner-item {
    transition: background-color 0.2s;
}

.winner-item:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin: -10px;
}

.winner-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* 당첨 하이라이트 */
.winning-highlight {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
    transform: scale(1.05);
}

/* 보너스번호 하이라이트 */
.bonus-highlight {
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5);
    transform: scale(1.05);
}

/* 보너스볼 스타일 */
.bonus-ball {
    border: 2px solid #ffc107;
    font-weight: bold;
}

/* 일치 정보 스타일 */
.matching-info {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

/* 명예의 전당 스타일 */
.winner-hall .winner-item {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.winner-hall .winner-item:hover {
    background-color: #e3f2fd !important;
    border-color: #2196f3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.winner-hall .winner-item:hover .text-primary {
    color: #1976d2 !important;
}

/* 당첨자 상세 팝업 스타일 */
.winner-profile {
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    margin-bottom: 1rem;
}

.winning-details {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.congratulations {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffeaa7;
}

/* 당첨번호 섹션 스타일 */
.winning-numbers-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

/* ===================================
 * 이번 주 추첨 통계 특수 스타일
 * =================================== */

/* 추첨 통계 카드 그리드 */
.upcoming-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 추첨 통계 카드 */
.upcoming-stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    backdrop-filter: blur(10px);
}

.upcoming-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.upcoming-stat-card h3 {
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.upcoming-stat-card p {
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.upcoming-stat-card small {
    color: #6c757d;
    font-size: 0.85rem;
}

/* D-day 배지 특별 스타일 */
.d-day-badge {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    animation: dDayPulse 2s ease-in-out infinite;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

@keyframes dDayPulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4);
    }
    50% { 
        opacity: 0.9; 
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(0, 123, 255, 0);
    }
}

/* 추첨 완료 배지 */
.draw-complete-badge {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
    animation: drawCompletePulse 3s ease-in-out infinite;
}

@keyframes drawCompletePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* 번호 분석 섹션 */
.number-analysis-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.number-analysis-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 번호 그룹 컨테이너 */
.number-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.number-group-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 4px;
}

/* 미선택 번호 섹션 */
.unselected-section {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1) 0%, rgba(173, 181, 189, 0.1) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 2px dashed #dee2e6;
}

.unselected-section h6 {
    color: #6c757d;
    font-weight: 600;
}

/* ===================================
 * 광고 영역 스타일
 * =================================== */

/* 광고 컨테이너 */
.ad-container {
    margin: 2rem 0;
    text-align: center;
    min-height: 250px;
    width: 100%;
    max-width: 728px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* ===================================
 * 모바일 전용 반응형 스타일
 * =================================== */

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1.5rem;
    }

    .number-match-section {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .floating-buttons {
        right: 15px;
    }

    .floating-button {
        width: 45px;
        height: 45px;
    }
    
    .upcoming-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .upcoming-stat-card {
        padding: 1rem;
    }
    
    .upcoming-stat-card h3 {
        font-size: 1.5rem;
    }
    
    .number-group {
        justify-content: center;
    }
    
    .d-day-badge {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .log-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .log-numbers {
        justify-content: center;
    }
    
    .prize-left {
        border-right: none;
        border-bottom: 1px solid #ffc107;
    }
    
    .prize-left, .prize-right {
        padding: 1.5rem 1rem;
    }
    
    .prize-value {
        font-size: 1.8rem;
    }

    .number-history-item {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .history-first-line {
        gap: 6px;
    }
    
    .history-second-line {
        gap: 8px;
    }
    
    .history-second-line .btn-link {
        font-size: 0.8rem;
        margin-top: 2px;
    }
    
    .history-numbers-container {
        gap: 4px;
        justify-content: center;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    .card {
        margin-bottom: 15px;
    }

    .upcoming-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .number-analysis-section {
        padding: 1rem;
    }
    
    .unselected-section {
        padding: 1rem;
    }

    .number-history-item {
        padding: 10px;
    }
    
    .history-first-line {
        gap: 4px;
    }
    
    .history-first-line small {
        font-size: 0.8rem;
    }
    
    .history-second-line {
        gap: 6px;
    }
    
    .history-second-line small {
        font-size: 0.75rem;
    }
    
    .history-numbers-container {
        gap: 3px;
    }
}

/* ===================================
 * 로딩 및 에러 상태
 * =================================== */

/* 로딩 상태 스타일 */
.upcoming-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.upcoming-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 에러 상태 스타일 */
.upcoming-error {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(248, 249, 250, 1) 100%);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.upcoming-error .btn-link {
    color: #dc3545;
    font-weight: 500;
}

.upcoming-error .btn-link:hover {
    color: #c82333;
    text-decoration: underline;
}

/* ===================================
 * 아이폰 노치 대응
 * =================================== */

@supports (padding-top: env(safe-area-inset-top)) {
    .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}



/* =========================
 * 회차 정보 모달 전용 스타일 
 * ========================= */

/* 모달 내 당첨번호 기본 스타일 */
#roundInfoModal .lotto-ball {
    width: var(--medium-ball-size);
    height: var(--medium-ball-size);
    min-width: var(--medium-ball-size);
    min-height: var(--medium-ball-size);
    font-size: var(--medium-ball-font);
    margin: 0 6px;
}

#roundInfoModal .winner-numbers {
    margin-bottom: 2rem;
}

#roundInfoModal .winner-numbers .d-flex {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

#roundInfoModal .mx-2 {
    margin: 0 8px !important;
}

#roundInfoModal .bi-plus-circle-fill {
    font-size: 1.2rem;
}

/* 태블릿 (768px 이하) */
@media (max-width: 768px) {
    #roundInfoModal .lotto-ball {
        width: var(--small-ball-size);
        height: var(--small-ball-size);
        min-width: var(--small-ball-size);
        min-height: var(--small-ball-size);
        font-size: var(--small-ball-font);
        margin: 0 4px;
    }
    
    #roundInfoModal .mx-2 {
        margin: 0 6px !important;
    }
    
    #roundInfoModal .bi-plus-circle-fill {
        font-size: 1rem;
    }
    
    #roundInfoModal .winner-numbers .d-flex {
        gap: 2px;
    }
}

/* 모바일 (480px 이하) */
@media (max-width: 480px) {
    #roundInfoModal .lotto-ball {
        width: var(--mini-ball-size);
        height: var(--mini-ball-size);
        min-width: var(--mini-ball-size);
        min-height: var(--mini-ball-size);
        font-size: var(--mini-ball-font);
        margin: 0 2px;
    }
    
    #roundInfoModal .mx-2 {
        margin: 0 4px !important;
    }
    
    #roundInfoModal .bi-plus-circle-fill {
        font-size: 0.9rem;
    }
    
    #roundInfoModal .winner-numbers {
        margin-bottom: 1.5rem;
    }
    
    #roundInfoModal .winner-numbers .d-flex {
        gap: 1px;
        padding: 0 10px;
    }
    
    /* 모달 제목 크기 조정 */
    #roundInfoModal .modal-title {
        font-size: 1.1rem;
    }
    
    /* 모달 패딩 조정 */
    #roundInfoModal .modal-body {
        padding: 1rem;
    }
    
    /* 당첨 정보 섹션 조정 */
    #roundInfoModal .winner-info {
        padding: 1rem;
        margin-top: 1rem;
    }
    
    #roundInfoModal .winner-info h6 {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }
    
    #roundInfoModal .winner-info p {
        margin-bottom: 0.5rem;
    }
    
    #roundInfoModal .winner-info small {
        font-size: 0.8rem;
    }
}

/* 초소형 모바일 (360px 이하) */
@media (max-width: 360px) {
    #roundInfoModal .lotto-ball {
        width: var(--micro-ball-size);
        height: var(--micro-ball-size);
        min-width: var(--micro-ball-size);
        min-height: var(--micro-ball-size);
        font-size: var(--micro-ball-font);
        margin: 0 1px;
    }
    
    #roundInfoModal .mx-2 {
        margin: 0 3px !important;
    }
    
    #roundInfoModal .bi-plus-circle-fill {
        font-size: 0.8rem;
    }
    
    #roundInfoModal .winner-numbers .d-flex {
        gap: 0px;
        padding: 0 5px;
    }
    
    #roundInfoModal .modal-title {
        font-size: 1rem;
    }
    
    #roundInfoModal .winner-info {
        padding: 0.75rem;
    }
    
    #roundInfoModal .winner-info h6 {
        font-size: 0.9rem;
    }
    
    #roundInfoModal .winner-info small {
        font-size: 0.75rem;
    }
}

/* 모달 다이얼로그 크기 조정 */
@media (max-width: 576px) {
    #roundInfoModal .modal-dialog {
        margin: 1rem 0.5rem;
        max-width: none;
        width: auto;
    }
}

/* 모달 내용이 잘리지 않도록 조정 */
#roundInfoModal .modal-content {
    overflow: hidden;
}

#roundInfoModal .modal-body {
    overflow-x: auto;
    overflow-y: visible;
}

/* 번호가 한 줄에 안 들어갈 경우 줄바꿈 */
@media (max-width: 320px) {
    #roundInfoModal .winner-numbers .d-flex {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
        row-gap: 4px;
    }
    
    #roundInfoModal .mx-2 {
        width: 100%;
        text-align: center;
        margin: 2px 0 !important;
        order: 10;
    }
}



/* ===================================
 * 당첨금액 (녹색) 모바일 폰트 크기 조정 (추가)
 * =================================== */

/* 당첨금액 (text-success) 기본 스타일 */
.prize-value.text-success {
    font-size: 2.2rem !important;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    word-break: keep-all;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    font-variant-numeric: tabular-nums;
}

/* 태블릿 (768px 이하) - 당첨금액 크기 조정 */
@media (max-width: 768px) {
    .prize-value.text-success {
        font-size: 1.6rem !important;
        line-height: 1.1;
    }
}

/* 모바일 (480px 이하) - 당첨금액 더 작게 */
@media (max-width: 480px) {
    .prize-value.text-success {
        font-size: 1.2rem !important;
        font-weight: 700;
        line-height: 1.05;
        margin-bottom: 0.3rem;
    }
    
    /* 매우 긴 당첨금액의 경우 더 작게 */
    .prize-value.text-success[title*="억"] {
        font-size: 1.1rem !important;
    }
    
    .prize-value.text-success[title*="조"] {
        font-size: 1rem !important;
    }
}

/* 초소형 모바일 (360px 이하) - 당첨금액 최소 크기 */
@media (max-width: 360px) {
    .prize-value.text-success {
        font-size: 1.1rem !important;
        font-weight: 600;
        line-height: 1;
    }
    
    .prize-value.text-success[title*="억"] {
        font-size: 1rem !important;
    }
    
    .prize-value.text-success[title*="조"] {
        font-size: 0.95rem !important;
    }
}

/* 매우 작은 화면 (320px 이하) */
@media (max-width: 320px) {
    .prize-value.text-success {
        font-size: 1rem !important;
        font-weight: 600;
    }
    
    .prize-value.text-success[title*="억"],
    .prize-value.text-success[title*="조"] {
        font-size: 0.9rem !important;
    }
}


/* ===================================
 * 명예의 전당 모바일 반응형 스타일 (추가)
 * =================================== */

/* 등급별 당첨 현황 기본 스타일 */
.rank-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 1rem;
}

.rank-stat-card {
    background: #D1E7DD;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.rank-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rank-stat-card .rank-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.rank-stat-card .rank-count {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 2px;
    color: #333;
}

.rank-stat-card .rank-percentage {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.rank-stat-card .rank-action {
    margin-top: 4px;
	font-size: 0.9rem;
}

.rank-stat-card .btn-link {
    font-size: 0.9rem;
    padding: 0;
    text-decoration: none;
}

.rank-stat-card .small {
    font-size: 0.65rem;
    color: #6c757d;
    display: block;
    margin-top: 2px;
}

/* 전체 통계 요약 스타일 */
.total-stats-summary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 10px;
    padding: 1rem;
    color: white;
    margin-top: 1rem;
}

.total-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    text-align: center;
}

.total-stat-item .stat-number {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.total-stat-item .stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
}

/* 태블릿 반응형 (768px 이하) */
@media (max-width: 768px) {
    .rank-stats-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .rank-stat-card {
        padding: 10px 6px;
    }
    
    .rank-stat-card .rank-title {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .rank-stat-card .rank-count {
        font-size: 1.1rem;
    }
    
    .rank-stat-card .rank-percentage {
        font-size: 0.7rem;
    }
    
    .rank-stat-card .btn-link {
        font-size: 0.65rem;
    }
    
    .rank-stat-card .small {
        font-size: 0.6rem;
    }
    
    .total-stats-grid {
        gap: 0.75rem;
    }
    
    .total-stat-item .stat-number {
        font-size: 1.2rem;
    }
    
    .total-stat-item .stat-label {
        font-size: 0.75rem;
    }
}

/* 모바일 반응형 (480px 이하) */
@media (max-width: 480px) {
    .rank-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 1rem;
    }
    
    .rank-stat-card {
        padding: 12px 8px;
        border-radius: 10px;
    }
    
    .rank-stat-card .rank-title {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .rank-stat-card .rank-count {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }
    
    .rank-stat-card .rank-percentage {
        font-size: 0.75rem;
        margin-bottom: 6px;
    }
    
    .rank-stat-card .btn-link {
        font-size: 0.9rem;
    }
    
    .rank-stat-card .small {
        font-size: 0.65rem;
        margin-top: 4px;
    }
    
    /* 4,5등을 두 번째 줄에 배치 */
    .rank-stats-grid .rank-stat-card:nth-child(4),
    .rank-stats-grid .rank-stat-card:nth-child(5) {
        grid-column: span 1;
    }
    
    /* 4,5등 카드를 중앙 정렬 */
    .rank-stats-second-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        justify-content: center;
        margin-top: 8px;
    }
    
    .total-stats-summary {
        padding: 0.75rem;
    }
    
    .total-stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }
    
    .total-stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.25rem 0;
    }
    
    .total-stat-item .stat-number {
        font-size: 1.1rem;
    }
    
    .total-stat-item .stat-label {
        font-size: 0.8rem;
    }
}

/* 초소형 모바일 (360px 이하) */
@media (max-width: 360px) {
    .rank-stats-grid {
        gap: 6px;
    }
    
    .rank-stat-card {
        padding: 10px 6px;
    }
    
    .rank-stat-card .rank-title {
        font-size: 0.8rem;
    }
    
    .rank-stat-card .rank-count {
        font-size: 1.2rem;
    }
    
    .rank-stat-card .rank-percentage {
        font-size: 0.7rem;
    }
    
    .rank-stat-card .btn-link {
        font-size: 0.65rem;
    }
    
    .rank-stat-card .small {
        font-size: 0.6rem;
    }
    
    .total-stat-item .stat-number {
        font-size: 1rem;
    }
    
    .total-stat-item .stat-label {
        font-size: 0.75rem;
    }
}

/* 이모지 크기 조정 */
@media (max-width: 480px) {
    .rank-stat-card .rank-title {
        line-height: 1.2;
    }
    
    /* 이모지가 있는 경우 폰트 크기 조정 */
    .rank-stat-card .rank-title:contains("🥇"),
    .rank-stat-card .rank-title:contains("🥈"),
    .rank-stat-card .rank-title:contains("🥉"),
    .rank-stat-card .rank-title:contains("🏅"),
    .rank-stat-card .rank-title:contains("🎖️") {
        font-size: 0.8rem;
    }
}

/* 당첨자 없음 표시 스타일 개선 */
.rank-stat-card .no-winner {
    color: #6c757d;
    font-style: italic;
}

.rank-stat-card.no-winner-card {
    opacity: 0.7;
    background: #f8f9fa;
}

.rank-stat-card.no-winner-card:hover {
    transform: none;
    box-shadow: none;
}