/* ============================================
   최신 UI 트렌드 기반 디자인 시스템
   - Glassmorphism 효과
   - 부드러운 애니메이션
   - 현대적인 색상 팔레트
   ============================================ */

/* ========== CSS 변수 ========== */
:root {
    /* 메인 색상 */
    --main-color: #BE1111;
    --main-color-dark: #8B0D0D;
    --main-color-light: #E63946;
    --main-color-hover: #D32F2F;
    --gradient-start: #BE1111;
    --gradient-end: #8B0D0D;
    
    /* 배경 색상 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f1f3f5;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    
    /* 텍스트 색상 */
    --text-primary: #1a1a1a;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --text-inverse: #ffffff;
    
    /* 테두리 색상 */
    --border-color: #e9ecef;
    --border-color-light: #f1f3f5;
    --border-color-dark: #dee2e6;
    
    /* 그림자 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.15);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    /* 블러 효과 */
    --blur-sm: blur(8px);
    --blur-md: blur(12px);
    --blur-lg: blur(16px);
    
    /* 전환 효과 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 둥근 모서리 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ========== 기본 스타일 ========== */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========== 로또 번호 스타일 (Glassmorphism) ========== */
.lotto-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5em;
    min-height: 2.5em;
    width: 2.5em;
    height: 2.5em;
    aspect-ratio: 1 / 1;
    text-align: center;
    border-radius: var(--radius-full);
    color: white;
    font-weight: 700;
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    margin: 2px;
    transition: all var(--transition-base);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--blur-sm);
}

.lotto-number::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    pointer-events: none;
}

.lotto-number:hover {
    transform: scale(1.15) translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.lotto-number.bonus {
    background: linear-gradient(135deg, #AAAAAA 0%, #888888 100%);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .lotto-number {
        min-width: 50px;
        min-height: 50px;
        width: 50px;
        height: 50px;
        font-size: clamp(1rem, 2vw, 1.1rem);
    }
}

@media (max-width: 576px) {
    .lotto-number {
        min-width: 2em;
        min-height: 2em;
        width: 2em;
        height: 2em;
        font-size: clamp(1rem, 2vw, 1.1rem);
        margin: 1px;
    }
}

/* ========== 카드 스타일 (Glassmorphism) ========== */
.card {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-glass);
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-header {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    font-weight: 600;
    padding: 1.25rem 1.75rem;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%) !important;
}

.card-body {
    padding: 1.75rem;
    background: transparent;
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 20px;
        border-radius: var(--radius-md);
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
    }
}

/* ========== 네비게이션 스타일 ========== */
.navbar {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%) !important;
    box-shadow: var(--shadow-lg);
    padding: 0.875rem 0;
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white !important;
    transition: all var(--transition-base);
    letter-spacing: -0.02em;
}

.navbar-brand:hover {
    opacity: 0.9;
    transform: translateX(2px);
}

.navbar-brand img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: transform var(--transition-base);
}

.navbar-brand:hover img {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    padding: 0.625rem 1.125rem !important;
    border-radius: var(--radius-sm);
    margin: 0 3px;
    transition: all var(--transition-base);
    position: relative;
}

.navbar-nav .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    transition: transform var(--transition-base);
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white !important;
}

.navbar-nav .nav-link.active::before {
    transform: translateX(-50%) scaleX(1);
}

.dropdown-menu {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-md);
    margin-top: 8px;
    padding: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    transition: all var(--transition-fast);
    border-radius: var(--radius-sm);
    margin: 2px 0;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-brand img {
        height: 36px;
    }
    
    /* 모바일 메뉴 스크롤 설정 */
    .navbar-collapse {
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .navbar-collapse.show {
        max-height: calc(100vh - 56px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .navbar-nav .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0.5rem;
        background-color: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        max-height: none;
    }
    
    .navbar-nav .dropdown.show .dropdown-menu {
        display: block !important;
    }
    
    .navbar-nav .dropdown-item, .navbar-nav .dropdown-header {
        color: rgba(255, 255, 255, 0.95) !important;
        padding: 0.875rem 1.5rem;
    }
    
    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.2);
        color: white !important;
    }
}

/* ========== 버튼 스타일 ========== */
.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    padding: 0.625rem 1.5rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--main-color-hover) 0%, var(--main-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--main-color);
    color: var(--main-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--main-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== 폼 요소 스타일 ========== */
.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all var(--transition-base);
    background: var(--bg-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 0.2rem rgba(190, 17, 17, 0.15);
    outline: none;
    background: var(--bg-primary);
}

.form-check-input:checked {
    background-color: var(--main-color);
    border-color: var(--main-color);
}

.form-check-input:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 0.25rem rgba(190, 17, 17, 0.15);
}

/* ========== 알림 스타일 ========== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.25rem;
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: #c53030;
    border-left: 4px solid #c53030;
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
    color: #22543d;
    border-left: 4px solid #38a169;
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    color: #2c5282;
    border-left: 4px solid #3182ce;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* ========== 배지 스타일 ========== */
.badge {
    padding: 0.4em 0.85em;
    font-weight: 600;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-sm);
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%) !important;
}

/* ========== 테이블 스타일 ========== */
.table {
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 1.25rem;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* 게시판 목록 데스크톱 테이블 thead border-radius 제거 */
.board-list-desktop .table thead th:first-child {
    border-top-left-radius: 0;
}

.board-list-desktop .table thead th:last-child {
    border-top-right-radius: 0;
}

.table tbody tr {
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-color-light);
}

.table tbody tr:hover {
    background-color: rgba(190, 17, 17, 0.03);
    transform: scale(1.01);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(190, 17, 17, 0.02);
}

/* ========== 리스트 그룹 스타일 ========== */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color-light);
    transition: all var(--transition-base);
    padding: 1rem 1.5rem;
    background: transparent;
}

.list-group-item:hover {
    background: linear-gradient(90deg, rgba(190, 17, 17, 0.05) 0%, transparent 100%);
    padding-left: 1.75rem;
    border-left: 3px solid var(--main-color);
    transform: translateX(4px);
}

.list-group-item-action:hover {
    background: linear-gradient(90deg, rgba(190, 17, 17, 0.08) 0%, transparent 100%);
    color: var(--main-color);
}

/* ========== 페이지네이션 스타일 ========== */
.pagination {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination .page-link {
    color: var(--main-color);
    border-color: var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    transition: all var(--transition-base);
    background: var(--bg-primary);
}

.pagination .page-link:hover {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    border-color: var(--main-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border-color: var(--main-color);
    box-shadow: var(--shadow-md);
    color: white;
}

/* ========== 푸터 스타일 ========== */
footer {
    margin-top: auto;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 3rem 0 2rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: white;
    transition: width var(--transition-base);
}

footer a:hover {
    color: white;
}

footer a:hover::after {
    width: 100%;
}

/* ========== 애니메이션 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* ========== 스크롤바 스타일 ========== */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--main-color-hover) 0%, var(--main-color) 100%);
}

/* ========== 탭 스타일 ========== */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    transition: all var(--transition-base);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--main-color);
    color: var(--main-color);
    background: rgba(190, 17, 17, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--main-color);
    border-bottom-color: var(--main-color);
    background: transparent;
    font-weight: 600;
}

/* ========== 모달 스타일 ========== */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-xl);
    background: var(--bg-glass);
    backdrop-filter: var(--blur-md);
    -webkit-backdrop-filter: var(--blur-md);
}

.modal-header {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    border-bottom: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-footer {
    border-top: 1px solid var(--border-color-light);
    padding: 1.25rem 1.5rem;
}

/* ========== 프로그레스 바 ========== */
.progress {
    height: 10px;
    border-radius: var(--radius-full);
    background-color: var(--bg-tertiary);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ========== 아코디언 스타일 ========== */
.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, rgba(190, 17, 17, 0.1) 0%, rgba(190, 17, 17, 0.05) 100%);
    color: var(--main-color);
    box-shadow: none;
}

.accordion-button:focus {
    border-color: var(--main-color);
    box-shadow: 0 0 0 0.25rem rgba(190, 17, 17, 0.15);
}

/* ========== 로딩 스피너 ========== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--main-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

.spinner-border {
    color: var(--main-color);
}

/* ========== 조합 번호 표시 스타일 ========== */
.combination-numbers {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 0;
    overflow: hidden;
}

.combination-numbers .combo-number {
    flex: 1;
    max-width: calc(16.66% - 4px);
    min-width: 45px;
    min-height: 45px;
    width: 45px;
    height: 45px;
    line-height: 45px;
    font-size: 16px;
    font-weight: 700;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 !important;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-full);
    text-align: center;
    transition: all var(--transition-base);
}

.combination-numbers .combo-number:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ========== 조합 통계 스타일 ========== */
.combination-stats {
    font-size: 0.9rem;
    line-height: 1.8;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color-light);
    margin-top: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.375rem 0;
    word-break: keep-all;
}

.stat-prize {
    margin-bottom: 0.5rem;
}

.stat-info {
    margin-top: 0.25rem;
}

.stat-item i {
    font-size: 1.1rem;
    margin-right: 0.375rem;
}

.stat-item strong {
    color: var(--main-color);
    margin-right: 0.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.stat-item .badge {
    font-size: 0.8rem;
    padding: 0.4em 0.7em;
    font-weight: 500;
    white-space: nowrap;
}

/* ========== 로또 시트 버튼 스타일 ========== */
.lotto-sheet {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.lotto-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
}

.lotto-sheet-btn,
.lotto-number-btn {
    border-radius: var(--radius-sm) !important;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    flex: 1;
    box-shadow: var(--shadow-sm);
}

.lotto-sheet-btn:hover:not(:disabled),
.lotto-number-btn:hover:not(:disabled) {
    border-color: var(--main-color);
    background: rgba(190, 17, 17, 0.1);
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-md);
}

.lotto-sheet-btn.selected,
.lotto-number-btn.selected {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    border-color: var(--main-color);
    box-shadow: var(--shadow-md);
}

.lotto-number-btn.fixed {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-color: #dc3545;
}

.lotto-number-btn.excluded {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border-color: #6c757d;
    opacity: 0.7;
}

.lotto-number-btn.variable {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-color: #0d6efd;
}

/* ========== 광고 영역 스타일 ========== */
.ad-container {
    margin: 24px 0;
    text-align: center;
    min-height: 100px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ad-container.horizontal {
    width: 100%;
    min-height: 90px;
}

.ad-container.vertical {
    width: 100%;
    min-height: 250px;
}

.ad-container.square {
    width: 100%;
    min-height: 250px;
}

@media (min-width: 992px) {
    .ad-sidebar {
        position: sticky;
        top: 24px;
        height: fit-content;
    }
    
    .ad-container.vertical {
        min-height: 600px;
    }
}

@media (max-width: 768px) {
    .ad-container {
        margin: 16px 0;
        min-height: 50px;
        border-radius: var(--radius-sm);
    }
    
    .ad-container.horizontal {
        min-height: 50px;
    }
    
    .ad-container.vertical {
        min-height: 100px;
    }
}

/* ========== 반응형 개선 ========== */
@media (max-width: 576px) {
    .card-header h4,
    .card-header h5 {
        font-size: 1.1rem;
    }
    
    .combination-numbers .combo-number {
        min-width: 35px;
        min-height: 35px;
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 14px;
        max-width: calc(16.66% - 2px);
    }
    
    .lotto-sheet-btn,
    .lotto-number-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
        max-width: 40px;
        min-width: 40px;
    }
    
    .stat-item {
        flex-wrap: wrap;
        font-size: 0.85rem;
    }
    
    .stat-item .badge {
        font-size: 0.7rem;
        padding: 0.3em 0.5em;
    }
    
    .combination-stats {
        font-size: 0.85rem;
    }
    
    .card-body {
        padding: 1rem 0.875rem !important;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-sm {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    .combination-numbers {
        gap: 3px;
        padding: 4px 0;
    }
    
    .combination-numbers .combo-number {
        min-width: 35px;
        min-height: 35px;
        width: 35px;
        height: 35px;
        line-height: 35px;
        font-size: 14px;
        max-width: calc(16.66% - 2px);
    }
    
    .lotto-sheet {
        padding: 12px;
    }
    
    .lotto-row {
        margin-bottom: 4px;
        gap: 4px;
    }
    
    .lotto-sheet-btn,
    .lotto-number-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
        max-width: 40px;
        min-width: 0px;
    }
    
    .stat-item {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========== 메인 컨텐츠 영역 ========== */
main {
    flex: 1;
    padding-bottom: 2rem;
}

@media (max-width: 768px) {
    main {
        padding-bottom: 120px;
    }
}

.container,
.container-fluid {
    position: relative;
    padding-left: 15px;
    padding-right: 15px;
}

@media (max-width: 576px) {
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ========== 모바일 하단 고정 광고 ========== */
@media (max-width: 768px) {
    body {
        padding-bottom: 100px;
    }
    
    .fixed-bottom {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        max-height: 100px;
        overflow: hidden;
        background: var(--bg-glass);
        backdrop-filter: var(--blur-md);
        -webkit-backdrop-filter: var(--blur-md);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }
}

/* ========== 게시글 내용 스타일 ========== */
.post-content {
    line-height: 1.8;
    word-wrap: break-word;
}

.post-content .combination-display {
    margin: 20px 0;
    padding: 20px;
    background: var(--bg-glass);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.post-content .combination-display strong {
    color: var(--main-color);
    font-size: 1rem;
    margin-bottom: 12px;
    display: block;
}

.post-content .combination-display .lotto-number {
    min-width: 2.25em;
    min-height: 2.25em;
    width: 2.25em;
    height: 2.25em;
    font-size: clamp(0.875rem, 2vw, 1rem);
}

@media (max-width: 768px) {
    .post-content .combination-display .lotto-number {
        min-width: 2em;
        min-height: 2em;
        width: 2em;
        height: 2em;
        font-size: clamp(0.75rem, 2vw, 0.875rem);
    }
}

/* ========== 댓글 스타일 ========== */
.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color-light);
}

.comment-item:last-child {
    border-bottom: none;
}

/* ========== 유틸리티 클래스 ========== */
.text-gradient {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.text-main {
    color: var(--main-color) !important;
}

.bg-main {
    background-color: var(--main-color) !important;
}

.shadow-main {
    box-shadow: var(--shadow-lg) !important;
}

.section-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--main-color), transparent);
    margin: 2.5rem 0;
    border-radius: var(--radius-full);
}

/* ========== 성능 최적화 ========== */
a, button, .btn, .card, .lotto-number, .lotto-sheet-btn, .lotto-number-btn, 
.nav-link, .dropdown-item, .list-group-item {
    transition: background-color var(--transition-fast), 
                color var(--transition-fast), 
                border-color var(--transition-fast), 
                transform var(--transition-base), 
                box-shadow var(--transition-base);
    will-change: transform;
}

/* ========== 접근성 개선 ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== 인쇄 스타일 ========== */
@media print {
    .navbar,
    .ad-container,
    footer,
    .fixed-bottom {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        background: white;
    }
}

/* ========== 당첨인증 롤링 배너 ========== */
.verification-banner-pc {
    position: relative;
    left: 0;
    right: 0;
    z-index: 1030;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
    padding-top: 0;
}

.verification-banner-mobile {
    position: fixed;
    top: 56px; /* 네비게이션 높이 */
    left: 0;
    right: 0;
    z-index: 1;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.verification-rolling-container {
    overflow: hidden;
    height: 40px;
    position: relative;
}

.verification-rolling-wrapper {
    display: flex;
    flex-direction: column;
    animation: rollDown 30s linear infinite;
    white-space: nowrap;
}

.verification-item {
    flex-shrink: 0;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.verification-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    width: 100%;
    transition: background-color var(--transition-fast);
    padding: 8px 15px;
    border-radius: 4px;
}

.verification-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.verification-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verification-author {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-left: auto;
    padding-left: 10px;
}

.verification-link i {
    font-size: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes rollDown {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

/* PC에서 상단 배너가 있을 때 메인 콘텐츠 여백 조정 (JavaScript로 동적 조정) */

/* 모바일에서 배너가 있을 때 메인 콘텐츠 여백 조정 */
body:has(.verification-banner-mobile) main {
    margin-top: 96px; /* 네비게이션(56px) + 배너(40px) */
}

/* 호버 시 애니메이션 일시정지 */
.verification-rolling-container:hover .verification-rolling-wrapper {
    animation-play-state: paused;
}

/* ========== 플로팅 빠른 메뉴 스타일 ========== */
.floating-quick-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.floating-menu-button {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border: none;
    color: white;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.floating-menu-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(190, 17, 17, 0.5);
}

.floating-menu-button:active {
    transform: scale(0.95);
}

.floating-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1049;
}

.floating-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.floating-menu-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 280px;
    max-height: 70vh;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1050;
    overflow: hidden;
}

.floating-menu-container.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.floating-menu-header {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floating-menu-header h6 {
    margin: 0;
    font-weight: 600;
}

.floating-menu-header .btn-close {
    opacity: 0.8;
    filter: brightness(0) invert(1);
}

.floating-menu-header .btn-close:hover {
    opacity: 1;
}

.floating-menu-items {
    max-height: calc(70vh - 60px);
    overflow-y: auto;
}

.floating-menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color-light);
    transition: all var(--transition-base);
}

.floating-menu-item:last-child {
    border-bottom: none;
}

.floating-menu-item:hover {
    background-color: var(--bg-secondary);
    color: var(--main-color);
}

.floating-menu-item i {
    font-size: 20px;
    width: 30px;
    margin-right: 12px;
    color: var(--main-color);
}

.floating-menu-item span {
    font-size: 15px;
    font-weight: 500;
}

/* 플로팅 메뉴 스크롤바 스타일 */
.floating-menu-items::-webkit-scrollbar {
    width: 6px;
}

.floating-menu-items::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.floating-menu-items::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    border-radius: 3px;
}

.floating-menu-items::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--main-color-hover) 0%, var(--main-color) 100%);
}

/* ========== 푸터 스타일 개선 ========== */
footer .footer-logo {
    height: 30px;
}

footer .footer-text-secondary {
    opacity: 0.8;
}

footer .footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-base);
}

footer .footer-link:hover {
    color: white;
}

footer .footer-border-top {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

footer .footer-info-text {
    opacity: 0.7;
    font-size: 0.85rem;
}

/* 모바일 최적화 */
@media (max-width: 576px) {
    .floating-quick-menu {
        bottom: 15px;
        right: 15px;
    }

    .floating-menu-button {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .floating-menu-container {
        bottom: 80px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: 320px;
        margin: 0 auto;
    }
}

/* ========== QR 스캐너 스타일 ========== */
.qr-scanner-container {
    position: relative;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    min-height: 300px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}

.qr-scanner-container:active {
    opacity: 0.8;
}

#qr-reader {
    width: 100%;
    min-height: 300px;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.qr-scan-line {
    position: absolute;
    top: 50%;
    left: 15%;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff00, transparent);
    animation: scanLine 2s linear infinite;
    box-shadow: 0 0 10px #00ff00;
}

@keyframes scanLine {
    0% {
        top: 15%;
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        top: 85%;
        opacity: 0.3;
    }
}

.qr-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid #00ff00;
    box-shadow: 0 0 10px #00ff00;
}

.qr-corner-tl {
    top: 15%;
    left: 15%;
    border-right: none;
    border-bottom: none;
}

.qr-corner-tr {
    top: 15%;
    right: 15%;
    border-left: none;
    border-bottom: none;
}

.qr-corner-bl {
    bottom: 15%;
    left: 15%;
    border-right: none;
    border-top: none;
}

.qr-corner-br {
    bottom: 15%;
    right: 15%;
    border-left: none;
    border-top: none;
}

.qr-status {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 20;
    pointer-events: none;
}

.qr-status i {
    margin-right: 5px;
}

@keyframes highlight {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(190, 17, 17, 0.2);
    }
}

/* ========== 동행복권 모달 스타일 ========== */
.dhlottery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.dhlottery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.dhlottery-modal-content {
    position: relative;
    background-color: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-width: 95%;
    max-height: 98vh;
    width: 600px;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

.dhlottery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--main-color) 0%, var(--main-color-dark) 100%);
    color: white;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.dhlottery-modal-header h5 {
    margin: 0;
    color: white;
    font-size: 1rem;
}

.dhlottery-modal-header .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dhlottery-modal-header .btn-close:hover {
    opacity: 1;
}

.dhlottery-modal-body {
    padding: 0.75rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.dhlottery-modal-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.dhlottery-modal-body table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.dhlottery-modal-body table td:last-child {
    white-space: nowrap;
    overflow: hidden;
}

.dhlottery-modal-body .lotto-number {
    white-space: nowrap;
}

/* ========== 번호 입력 필드 스타일 ========== */
.lotto-number-input {
    width: 70px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .qr-scanner-container {
        min-height: 250px;
    }
    
    #qr-reader {
        min-height: 250px;
    }
    
    .qr-corner {
        width: 25px;
        height: 25px;
    }
    
    .qr-scan-line {
        left: 10%;
        width: 80%;
    }
    
    .qr-corner-tl,
    .qr-corner-tr {
        top: 10%;
    }
    
    .qr-corner-bl,
    .qr-corner-br {
        bottom: 10%;
    }
    
    .qr-corner-tl,
    .qr-corner-bl {
        left: 10%;
    }
    
    .qr-corner-tr,
    .qr-corner-br {
        right: 10%;
    }
    
    .dhlottery-modal-content {
        max-width: 98%;
        width: 98%;
        max-height: 98vh;
    }
    
    .dhlottery-modal-header {
        padding: 0.5rem 0.75rem;
    }
    
    .dhlottery-modal-body {
        padding: 0.5rem;
    }
    
    .dhlottery-modal-footer {
        padding: 0.5rem 0.75rem;
    }
    
    .dhlottery-modal-footer .btn {
        padding: 0.25rem 0.75rem;
        font-size: 0.875rem;
    }
}

