/* ===== HEADER ===== */
.header {
    background: var(--glass-bg);
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--glass-border);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3px 0 var(--spacing-lg);
}

@media (max-width: 768px) {
    .header .container {
        padding: 0 3px 0 0;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-icon {
    font-size: 2rem;
    filter: grayscale(0.2);
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-primary);
    letter-spacing: -0.5px;
    text-shadow: var(--neon-text-glow);
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-dark);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo-img {
    height: 64px;
    width: auto;
    max-width: 360px;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.logo:hover .logo-img {
    transform: scale(1.02);
}

.header-right .search-box {
    display: flex;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-glass);
    border: 1px solid var(--glass-border);
}

.header-right .search-box input {
    background: var(--glass-bg-dark);
    border: none;
    border-right: none;
    color: var(--text-light);
    padding: var(--spacing-sm) var(--spacing-md);
    width: 280px;
    font-size: 0.9rem;
}

.header-right .search-box input::placeholder {
    color: var(--text-dark);
}

.header-right .search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.header-right .search-box button {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: #f5f5f5;
    padding: var(--spacing-sm) var(--spacing-lg);
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.header-right .search-box button:hover {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    box-shadow: 0 0 15px rgba(30, 164, 89, 0.4);
}

/* 랜덤 로또 버튼 - 헤더 (데스크탑 전용) */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lotto-header-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
}
.lotto-header-btn:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 8px rgba(168,85,247,0.5));
}
.lotto-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.lotto-header-text {
    font-size: 17px;
    font-weight: 800;
    background: linear-gradient(90deg, #f59e0b, #fcfcfc, #e52955, #fcfcfc, #f59e0b);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: lottoShine 2s linear infinite;
    filter: drop-shadow(0 0 6px rgba(245,158,11,0.5));
    margin-left: 5px;
    letter-spacing: 0.5px;
}
@keyframes lottoShine {
    0% { background-position: 200% center; }
    100% { background-position: -200% center; }
}

/* 랜덤 로또 버튼 - 사이드바 (모바일 전용) */
.lotto-sidebar-btn {
    display: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    margin-left: 6px;
}
.lotto-sidebar-btn:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px rgba(168,85,247,0.5));
}
.lotto-icon-sm {
    width: 44px;
    height: 44px;
    object-fit: contain;
}
.lotto-sidebar-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light, #5a5a5a);
    margin-left: 3px;
}
.mobile-lotto-text {
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(90deg, #f59e0b, #fcfcfc, #e52955, #fcfcfc, #f59e0b);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: lottoShine 2s linear infinite;
    filter: drop-shadow(0 0 4px rgba(245,158,11,0.4));
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* 모바일에서만 사이드바 로또 버튼 표시 */
@media (max-width: 1024px) {
    .lotto-sidebar-btn {
        display: inline-flex;
        align-items: center;
    }
}

/* ===== MAIN NAVIGATION ===== */
.main-nav {
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 1100;
}

.main-nav .container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    border-bottom: 2px solid var(--accent-dark);
    box-shadow: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    flex-wrap: nowrap;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 16px 15px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition-fast);
}
/* 드롭다운 있는 메뉴 — 아래화살표 표시 */
.nav-item.has-dropdown > a::after {
    content: '▾';
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 1px;
}
.nav-item.has-dropdown:hover > a::after { opacity: 1; }

.nav-item > a:hover,
.nav-item > a.active {
    background: transparent;
    color: #ffffff;
    box-shadow: none;
}

/* Dropdown Menu */
.nav-item.has-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--glass-bg-dark);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-gray);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-dark);
    transition: all var(--transition-fast);
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
    padding-left: var(--spacing-lg);
}

/* 드롭다운 메뉴 카테고리 스타일 */
.dropdown-menu-categorized {
    min-width: 180px;
}

.dropdown-category {
    padding: 8px 16px 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-dark);
    margin: 4px 0;
}

.dropdown-highlight {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #e52955 !important;
    font-weight: 600;
}

.dropdown-highlight:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

/* 모바일 HOT 메뉴 스타일 */
.hot-menu {
    color: #e52955 !important;
    font-weight: 600 !important;
}

/* 모바일 서브메뉴 스타일 */
.sub-menu-header {
    padding: 8px 24px 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sub-menu-divider {
    height: 1px;
    background: var(--border-dark);
    margin: 4px 16px;
}

/* NEW 배지 */
.new-badge {
    display: inline-block;
    padding: 2px 6px;
    background: linear-gradient(135deg, #f59e0b, #e52955);
    color: #fcfcfc;
    font-size: 9px;
    font-weight: 700;
    border-radius: 3px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: new-badge-pulse 2s infinite;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

/* 드롭다운 메뉴 내 NEW 배지 */
.dropdown-menu .new-badge,
.sub-menu .new-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1;
    white-space: nowrap;
}

@keyframes new-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
}

/* 모바일 햄버거 메뉴 버튼 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1003;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-light);
    transition: all 0.3s ease;
}

/* 햄버거 버튼은 열렸을 때 숨김 (내부 닫기 버튼 사용) */
.mobile-menu-btn.open {
    opacity: 0;
    pointer-events: none;
}

/* 모바일 네비게이션 오버레이 */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.open {
    display: block;
    opacity: 1;
}

/* 모바일 사이드 네비게이션 */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    height: 100dvh;
    background: var(--glass-bg-dark);
    border-left: 1px solid var(--glass-border);
    z-index: 1200;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    transition: right 0.3s ease;
}

.mobile-nav.open {
    right: 0;
    display: block;
}

.mobile-nav-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-dark);
}

.mobile-nav-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 28px;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
}

.mobile-nav-user {
    display: flex;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(30, 164, 89, 0.14), rgba(30, 164, 89, 0.06));
    border-bottom: 1px solid rgba(30, 164, 89, 0.28);
    backdrop-filter: blur(8px);
}

/* 모바일 사이드 메뉴 내 배너 — edge-to-edge, 가로 꽉 차게 */
.mobile-nav-banner {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    line-height: 0;
}
.mobile-nav-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.mobile-login-btn, .mobile-register-btn {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.mobile-login-btn {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.mobile-register-btn {
    background: var(--bg-tertiary);
    color: var(--text-light);
    border: 1px solid var(--border-light);
}

.mobile-user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* 모바일 프로필 영역 */
.mobile-user-profile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.mobile-user-avatar {
    flex-shrink: 0;
}

.mobile-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
}

.mobile-avatar-default {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.mobile-profile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 1;
}

.mobile-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent-primary);
}

.mobile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobile-avatar-text {
    font-size: 20px;
    font-weight: 700;
    color: #000;
}

.mobile-user-details {
    flex: 1;
    min-width: 0;
}

.mobile-user-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-rank-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.mobile-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.mobile-admin-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--accent-primary);
    color: #000;
    border-radius: 4px;
    font-weight: 600;
}

.mobile-user-rank {
    font-size: 12px;
    color: var(--accent-primary);
    margin-top: 2px;
}

.mobile-user-points {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.mobile-user-stats {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.mobile-stat-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
}

.mobile-stat-item:hover {
    background: var(--bg-hover);
    transform: scale(1.02);
}

.mobile-stat-item .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.mobile-stat-item .stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-primary);
    text-shadow: 0 0 6px rgba(30, 164, 89, 0.55);
    display: flex;
    align-items: baseline;
}

.mobile-stat-item .stat-unit {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-left: 1px;
}

.mobile-user-quick-links .mobile-logout-btn {
    background: var(--danger-color, #dc3545) !important;
    color: #fcfcfc !important;
    font-weight: 600;
    border-radius: var(--radius-md);
}

.mobile-user-quick-links {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(30, 164, 89, 0.18);
}

.mobile-user-quick-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    text-align: center;
}

.mobile-user-quick-links a:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.mobile-user-quick-links .quick-icon {
    font-size: 14px;
}

.mobile-nav-search {
    display: flex;
    padding: 12px 20px;
    gap: 8px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-dark);
}

.mobile-nav-search input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 14px;
}

.mobile-nav-search button {
    padding: 10px 16px;
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-bottom: 80px;
    /* 자체 스크롤 제거 — 부모 .mobile-nav 에서 통합 스크롤되어
       #mobile-nav-user 와 ul 메뉴가 같이 위아래로 밀리도록 함 */
}

.mobile-nav-menu > li {
    border-bottom: 1px solid rgba(30, 164, 89, 0.12);
}

.mobile-nav-menu > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(30, 164, 89, 0.08), rgba(30, 164, 89, 0.03));
    transition: background 0.2s;
}

.mobile-nav-menu > li > a:hover {
    background: linear-gradient(135deg, rgba(30, 164, 89, 0.18), rgba(30, 164, 89, 0.08));
}

.mobile-nav-menu .arrow {
    color: var(--text-gray);
    transition: transform 0.3s;
}

.mobile-nav-menu .sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--bg-primary);
}

.mobile-nav-menu .sub-menu li a {
    display: block;
    padding: 12px 20px 12px 36px;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 14px;
    border-top: 1px solid var(--border-dark);
}

.mobile-nav-menu .sub-menu li a:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

