/* ============================================
   LOTTO 6/45 - Modern UI Redesign
   ============================================ */

:root {
    /* Colors - Premium Gold Scale */
    --primary: #FFD700;
    --primary-dark: #C5A000;
    --primary-light: #FFEB33;
    --accent: #FF5252;
    --success: #00E676;
    --info: #00B0FF;
    --danger: #FF1744;
    --danger-rgb: 255, 23, 68;

    /* Backgrounds - Ultra Dark Premium Theme */
    --bg-dark: #05050A;
    --bg-surface: rgba(15, 15, 26, 0.85);
    --bg-card: rgba(25, 25, 45, 0.6);
    --bg-hover: rgba(45, 45, 75, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Text - Enhanced Legibility */
    --text-primary: #FFFFFF;
    --text-secondary: #BDBDBD;
    --text-muted: #757575;

    /* Layout */
    --header-height: 64px;
    --nav-height: 64px;
    --sidebar-width: 300px;
    --border-radius: 20px;
    --border-radius-sm: 12px;

    /* Shadows - Deep & Subtle */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(255, 215, 0, 0.2);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* ============================================
       확장 컬러 팔레트 (Phase 3-2)
       ============================================ */
    /* Primary - Gold Scale */
    --primary-50: #fffbeb;
    --primary-100: #fef3c7;
    --primary-200: #fde68a;
    --primary-300: #fcd34d;
    --primary-400: #fbbf24;
    --primary-500: #ffd700;
    --primary-600: #e5b800;
    --primary-700: #ca9b00;
    --primary-800: #a17d00;
    --primary-900: #7a5f00;

    /* Semantic Colors */
    --success-light: #86efac;
    --success-dark: #22c55e;
    --warning-light: #fcd34d;
    --warning-dark: #d97706;
    --error-light: #fca5a5;
    --error-dark: #dc2626;
    --info-light: #7dd3fc;
    --info-dark: #0284c7;

    /* ============================================
       타이포그래피 스케일 (Phase 3-2)
       ============================================ */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* ============================================
       간격 시스템 (Phase 3-2)
       ============================================ */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
}

/* ============================================
   Light Theme
   ============================================ */
[data-theme="light"] {
    /* Backgrounds - Pristine Light Theme */
    --bg-dark: #F8F9FA;
    --bg-surface: rgba(255, 255, 255, 0.9);
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-hover: rgba(0, 0, 0, 0.03);
    --glass-border: rgba(0, 0, 0, 0.05);

    /* Text - Soft Contrast */
    --text-primary: #121212;
    --text-secondary: #4A4A4A;
    --text-muted: #8E8E93;

    /* Shadows - Soft & Clean */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.15);

    /* Primary adjustments for light */
    --primary: #D4AF37;
    /* More refined gold for light mode */
    --primary-dark: #B8860B;
}

/* Light Theme specific overrides */
[data-theme="light"] .app-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .side-menu {
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .mobile-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .card {
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .menu-item:hover,
[data-theme="light"] .menu-item.active {
    background: #f0f0f5;
}

[data-theme="light"] .btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    background: #f5f5f7;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .toast {
    background: #1a1a2e;
    color: #ffffff;
}

[data-theme="light"] #loading-screen {
    background: linear-gradient(135deg, #f5f5f7 0%, #ffffff 50%, #f5f5f7 100%);
}

[data-theme="light"] .loading-ball {
    color: var(--text-primary);
}

/* Theme toggle button styles */
.theme-toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
}

.theme-toggle-item .menu-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--bg-hover);
    border-radius: 13px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transition: var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-toggle.active {
    background: var(--primary);
}

.theme-toggle.active::before {
    transform: translateX(24px);
    background: #ffffff;
}

.theme-toggle-icons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    height: 100%;
    position: relative;
    z-index: 1;
}

.theme-toggle-icons i {
    font-size: 12px;
    color: var(--text-muted);
    transition: var(--transition-normal);
}

.theme-toggle.active .fa-sun {
    color: var(--text-primary);
}

.theme-toggle:not(.active) .fa-moon {
    color: var(--primary);
}

/* ============================================
   Reset & Base
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   접근성: 포커스 표시 강화 (WCAG 2.1)
   ============================================ */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn:focus-visible,
.select-input:focus-visible,
.input-field:focus-visible,
button:focus-visible {
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.25);
}

/* 스킵 네비게이션 (스크린 리더용) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--bg-dark);
    padding: 8px 16px;
    z-index: 10000;
    font-weight: 600;
    border-radius: 0 0 8px 0;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

html {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + 16px);
    overflow-x: hidden;
}

/* ============================================
   Loading Screen
   ============================================ */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #0f0f1a 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
}

.loading-balls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.loading-ball {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    animation: ballBounce 1s ease-in-out infinite;
}

.loading-ball.ball-1 {
    background: linear-gradient(145deg, #ffd700 0%, #ff9500 100%);
    color: #1a1a2e;
    animation-delay: 0s;
}

.loading-ball.ball-2 {
    background: linear-gradient(145deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    animation-delay: 0.15s;
}

@keyframes ballBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.loading-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, #ff9500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.loading-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.loading-spinner {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.2s ease-in-out infinite;
}

.spinner-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.spinner-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dotPulse {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   App Header
   ============================================ */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-btn {
    width: 44px;
    /* 터치 타겟 확대: WCAG 권장 44px */
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.25rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: var(--bg-hover);
}

.header-btn:active {
    transform: scale(0.95);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #ff9500 100%);
    color: #1a1a2e;
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.header-tools {
    display: flex;
    gap: 4px;
}

/* ============================================
   Side Menu
   ============================================ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: 200;
}

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

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-surface);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    border-right: 1px solid var(--glass-border);
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

.logo-badge {
    background: linear-gradient(135deg, var(--primary) 0%, #ff9500 100%);
    color: #1a1a2e;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
}

.menu-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.2rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

.menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.side-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.menu-section {
    margin-bottom: 20px;
}

.menu-section-title {
    padding: 8px 24px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.side-menu-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.side-menu-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Mobile Navigation
   ============================================ */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 18px;
    /* 터치 영역 확대 */
    min-height: 56px;
    /* 최소 높이 보장 */
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    /* 가독성 향상 */
    transition: var(--transition-fast);
    border-radius: var(--border-radius-sm);
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item:active {
    transform: scale(0.95);
}

/* ============================================
   Main Container
   ============================================ */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ============================================
   Tab Content
   ============================================ */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-highlight {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 215, 0, 0.08) 100%);
    border: 1px solid rgba(255, 215, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    /* 마진 확대: 16px → 20px */
}

.card-title {
    font-size: 1.1rem;
    /* 폰트 크기 증가: 1rem → 1.1rem */
    font-weight: 600;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.card-title i {
    color: var(--primary);
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    /* 마진 확대: 20px → 24px */
    line-height: 1.6;
    /* 라인 높이 증가: 1.5 → 1.6 */
}

/* ============================================
   Latest Draw (Home)
   ============================================ */
.latest-draw {
    text-align: center;
}

.latest-draw-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.draw-round {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.draw-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.latest-draw-numbers {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.latest-draw-prize {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prize-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.prize-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================
   Stats Row (Home)
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Lotto Balls
   ============================================ */
.ball-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    box-shadow:
        inset -4px -4px 8px rgba(0, 0, 0, 0.4),
        inset 4px 4px 8px rgba(255, 255, 255, 0.3),
        0 4px 10px rgba(0, 0, 0, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.ball::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    filter: blur(2px);
}

.ball.small {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
}

.ball.range-1 {
    background: radial-gradient(circle at 30% 30%, #FFD700, #F0C000);
    color: #000;
}

.ball.range-2 {
    background: radial-gradient(circle at 30% 30%, #5BC0EB, #2581A8);
}

.ball.range-3 {
    background: radial-gradient(circle at 30% 30%, #FF6B6B, #EE5A5A);
}

.ball.range-4 {
    background: radial-gradient(circle at 30% 30%, #868E96, #495057);
}

.ball.range-5 {
    background: radial-gradient(circle at 30% 30%, #95D45A, #7BC043);
    color: #000;
}

.ball.bonus {
    box-shadow: 0 0 0 3px var(--primary), 0 0 15px rgba(255, 215, 0, 0.4);
}

.ball.matched {
    box-shadow: 0 0 0 3px var(--success), 0 0 20px rgba(0, 230, 118, 0.5);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff9500 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1rem;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* ============================================
   Form Controls
   ============================================ */
.generator-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.select-input,
.input-field {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.select-input:focus,
.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

/* ============================================
   Generated Numbers List
   ============================================ */
.generated-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-row {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.game-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.game-index {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.game-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* ============================================
   Filter Status
   ============================================ */
.filter-status {
    margin-bottom: 16px;
}

.filter-status:empty {
    display: none;
}

/* ============================================
   Hot & Cold Grid
   ============================================ */
.hot-cold-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.section-title.hot {
    color: var(--accent);
}

.section-title.cold {
    color: var(--info);
}

/* ============================================
   Frequency Chart
   ============================================ */
.frequency-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   Simulation Stats
   ============================================ */
.sim-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.sim-stat-box {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 10px;
    border-radius: var(--border-radius-sm);
    text-align: center;
}

.sim-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.sim-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sim-stat-value.profit {
    color: var(--success);
}

.sim-stat-value.loss {
    color: var(--accent);
}

.sim-log {
    max-height: 280px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    font-size: 0.85rem;
}

.sim-log-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.sim-log-item.win {
    color: var(--primary);
}

/* ============================================
   History List
   ============================================ */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-sm);
}

.history-round {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   Modals
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 300;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Legal Modal (이용약관/개인정보처리방침) */
.legal-modal {
    max-width: 600px;
    max-height: 80vh;
}

.legal-modal .modal-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.legal-modal .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
}

.legal-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
    line-height: 1.7;
}

.legal-content h4 {
    color: var(--primary);
    font-size: 1rem;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.legal-content h4:first-child {
    margin-top: 0;
}

.legal-content p {
    margin: 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.legal-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.legal-content li {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 4px 0;
}

.legal-date {
    margin-top: 30px !important;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
}

/* ============================================
   Withdraw Modal (회원 탈퇴)
   ============================================ */
.withdraw-modal {
    max-width: 400px;
}

.withdraw-modal .modal-header h3 i {
    color: #e74c3c;
}

.withdraw-warning {
    text-align: center;
    padding: 20px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.withdraw-warning i {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 10px;
}

.withdraw-warning h4 {
    color: #e74c3c;
    font-size: 1.1rem;
    margin: 0;
}

.withdraw-info {
    margin-bottom: 20px;
}

.withdraw-info p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.withdraw-info ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.withdraw-info li {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.withdraw-info li i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.withdraw-info .warning-text {
    color: #e74c3c;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 회원탈퇴 체크리스트 */
.withdraw-checklist {
    margin-bottom: 20px;
}

.withdraw-check-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.withdraw-check-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.withdraw-check-item:has(input:checked) {
    background: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.3);
}

.withdraw-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #e74c3c;
    cursor: pointer;
    flex-shrink: 0;
}

.withdraw-check-item span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.withdraw-check-item span i {
    color: #e74c3c;
    width: 18px;
    text-align: center;
}

.withdraw-confirm {
    margin-bottom: 20px;
}

.withdraw-confirm label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.withdraw-confirm input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1rem;
}

.withdraw-confirm input:focus {
    outline: none;
    border-color: #e74c3c;
}

.withdraw-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 메뉴 구분선 */
.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 8px 20px;
}

/* Legal Menu Group (사이드 메뉴 하단) */
.legal-menu-group {
    padding-top: 4px;
}

/* 작은 메뉴 아이템 (법적 고지용) */
.menu-item.menu-item-small {
    padding: 8px 24px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    gap: 12px;
}

.menu-item.menu-item-small i {
    width: 16px;
    font-size: 0.75rem;
}

.menu-item.menu-item-small:hover {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.03);
}

/* 공지사항 배지 */
.notice-badge {
    background: #e74c3c;
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 8px;
    margin-left: auto;
    font-weight: 600;
}

/* 공지사항 모달 */
.notices-modal .modal-content {
    max-width: 500px;
    max-height: 80vh;
}

.notices-list {
    max-height: 60vh;
    overflow-y: auto;
}

.notice-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
}

.notice-item.notice-warning {
    border-left-color: #f39c12;
}

.notice-item.notice-maintenance {
    border-left-color: #e74c3c;
}

.notice-item.pinned {
    background: rgba(255, 215, 0, 0.1);
}

.notice-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.notice-title {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
}

.notice-type-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.notice-type-badge.maintenance {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.notice-type-badge.warning {
    background: rgba(243, 156, 18, 0.2);
    color: #f39c12;
}

.notice-content {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    white-space: pre-wrap;
}

.notice-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 8px;
}

.notice-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.notice-empty i {
    font-size: 2rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 관리자 공지 작성 폼 */
.notice-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notice-form input,
.notice-form textarea,
.notice-form select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 0.9rem;
}

.notice-form textarea {
    min-height: 120px;
    resize: vertical;
}

.notice-form-row {
    display: flex;
    gap: 12px;
}

.notice-form-row>* {
    flex: 1;
}

/* ============================================
   Number Grid (Filter)
   ============================================ */
.filter-section {
    margin-bottom: 20px;
}

.filter-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.filter-title.exclude {
    color: var(--accent);
}

.filter-title.include {
    color: var(--success);
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.grid-ball {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.grid-ball:hover {
    background: var(--bg-hover);
}

.grid-ball.selected-exclude {
    background: var(--accent);
    color: white;
}

.grid-ball.selected-include {
    background: var(--success);
    color: white;
}

.grid-ball.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ============================================
   Tax Calculator
   ============================================ */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.quick-amounts {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tax-result {
    margin-top: 20px;
}

.tax-result:empty {
    display: none;
}

.tax-result-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
    padding: 16px;
}

.tax-result .result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tax-result .result-row:last-child {
    border-bottom: none;
}

.tax-result .result-row .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.tax-result .result-row .value {
    font-weight: 600;
    font-size: 0.95rem;
}

.tax-result .result-row .value.minus {
    color: var(--accent);
}

.tax-result .result-row.prize {
    padding-bottom: 14px;
    margin-bottom: 4px;
}

.tax-result .result-row.prize .label {
    color: var(--text-primary);
    font-weight: 600;
}

.tax-result .result-row.prize .value {
    color: var(--primary);
    font-size: 1.1rem;
}

.tax-result .result-row.tax-free {
    justify-content: flex-start;
    gap: 12px;
}

.tax-result .result-row.tax-free .badge {
    background: var(--success);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tax-result .result-row.tax-free .note {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tax-result .result-row.total-tax {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 14px;
}

.tax-result .result-row.total-tax .label {
    color: var(--text-primary);
}

.tax-result .result-row.net {
    background: rgba(255, 215, 0, 0.1);
    margin: 12px -16px -16px -16px;
    padding: 16px;
    border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
    border-bottom: none;
}

.tax-result .result-row.net .label {
    color: var(--primary);
    font-weight: 700;
    font-size: 1rem;
}

.tax-result .result-row.net .value {
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.tax-result .error {
    color: var(--accent);
    text-align: center;
    padding: 20px;
}

/* ============================================
   QR Scanner
   ============================================ */
#qr-reader {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

#qr-reader video {
    border-radius: var(--border-radius-sm);
}

.scan-error,
.scan-success {
    padding: 16px;
    text-align: center;
}

.scan-error p,
.scan-success p {
    margin-bottom: 8px;
}

.scan-error .small {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.scan-info-msg {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.debug-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    bottom: calc(var(--nav-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    /* 모달(10000)보다 높게 */
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.fade-out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Toast 타입별 스타일 */
.toast {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast i {
    font-size: 1.1rem;
}

.toast-success,
.toast.success {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.9), rgba(0, 191, 165, 0.9));
    color: white;
    border-left: 4px solid var(--success);
}

.toast-error,
.toast.error {
    background: linear-gradient(135deg, rgba(255, 23, 68, 0.9), rgba(213, 0, 0, 0.9));
    color: white;
    border-left: 4px solid var(--danger);
}

.toast-warning,
.toast.warning {
    background: linear-gradient(135deg, rgba(255, 171, 0, 0.9), rgba(255, 145, 0, 0.9));
    color: #000;
    border-left: 4px solid #FFAB00;
}

.toast-info,
.toast.info {
    background: linear-gradient(135deg, rgba(0, 176, 255, 0.9), rgba(0, 145, 234, 0.9));
    color: white;
    border-left: 4px solid var(--info);
}

/* 토스트 액션 버튼 */
.toast-action {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-action button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.toast-action button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 라이트 모드에서도 동일 */
[data-theme="light"] .toast-success,
[data-theme="light"] .toast-error,
[data-theme="light"] .toast-warning,
[data-theme="light"] .toast-info {
    color: white;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

/* ============================================
   Responsive - Larger Screens
   ============================================ */
@media (min-width: 768px) {
    .container {
        max-width: 640px;
    }

    .ball {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

@media (min-width: 1024px) {
    body {
        padding-bottom: 20px;
    }

    .mobile-nav {
        display: none;
    }

    .container {
        max-width: 720px;
    }
}

/* ============================================
   Small Screens
   ============================================ */
@media (max-width: 380px) {
    .ball {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .ball.small {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .sim-stats-grid {
        grid-template-columns: 1fr;
    }

    .generator-controls {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Safe Area (iOS)
   ============================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom));
    }

    .mobile-nav {
        height: calc(var(--nav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   AI Features Styles
   ============================================ */

/* Menu Badge */
.menu-badge {
    background: linear-gradient(135deg, var(--accent), #ff8888);
    color: #fff;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: auto;
    font-weight: 600;
}

/* AI Card */
.card-ai {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(75, 0, 130, 0.2));
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.ai-badge-pro {
    background: linear-gradient(135deg, #8a2be2, #4b0082);
    color: #fff;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
}

/* AI Method Selector */
.ai-method-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.ai-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ai-method-btn i {
    font-size: 1.5rem;
}

.ai-method-btn span {
    font-size: 0.8rem;
}

.ai-method-btn:hover,
.ai-method-btn.active {
    background: rgba(138, 43, 226, 0.2);
    border-color: #8a2be2;
    color: var(--text-primary);
}

.ai-method-btn.active i {
    color: #8a2be2;
}

/* Method Hint */
.method-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 8px;
}

/* Method Tag */
.method-tag {
    font-size: 0.65rem;
    padding: 2px 8px;
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border-radius: 10px;
    margin-left: auto;
    margin-right: 8px;
}

/* AI Button */
.btn-ai {
    background: linear-gradient(135deg, #8a2be2, #4b0082);
    border: none;
    color: #fff;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #9b3df3, #5c0093);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 43, 226, 0.4);
}

/* AI Results Container */
.ai-results-container {
    margin-top: 16px;
}

.ai-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.ai-placeholder i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* AI Trend Summary */
.ai-trend-summary {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.ai-trend-summary h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.trend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.trend-item {
    padding: 12px;
    border-radius: var(--border-radius-sm);
}

.trend-item.hot {
    background: rgba(255, 107, 107, 0.1);
}

.trend-item.cold {
    background: rgba(56, 189, 248, 0.1);
}

.trend-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.trend-item.hot .trend-label {
    color: var(--accent);
}

.trend-item.cold .trend-label {
    color: var(--info);
}

.trend-numbers {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.trend-numbers .ball {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

/* AI Result Card */
.ai-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-results-list h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.ai-result-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-index {
    font-weight: 600;
    color: var(--text-secondary);
}

.ai-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.ai-badge.grade-s {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}

.ai-badge.grade-a {
    background: linear-gradient(135deg, #8a2be2, #6a1bb2);
    color: #fff;
}

.ai-badge.grade-b {
    background: rgba(56, 189, 248, 0.3);
    color: var(--info);
}

.ai-badge.grade-c {
    background: rgba(160, 160, 184, 0.3);
    color: var(--text-secondary);
}

.ai-badge.grade-d {
    background: rgba(107, 107, 128, 0.3);
    color: var(--text-muted);
}

.result-numbers {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.result-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.confidence-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #4b0082);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.confidence-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 8px 14px;
    font-size: 0.75rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-analyze {
    background: rgba(138, 43, 226, 0.2);
    color: #a855f7;
}

.btn-analyze:hover {
    background: rgba(138, 43, 226, 0.4);
}

.btn-save {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.btn-save:hover {
    background: rgba(74, 222, 128, 0.4);
}

/* AI 결과 선택 기능 */
.ai-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-results-header h4 {
    margin: 0;
}

.ai-action-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-result-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-result-card:hover {
    border-color: rgba(138, 43, 226, 0.4);
}

.ai-result-card.selected {
    background: rgba(138, 43, 226, 0.15);
    border-color: rgba(138, 43, 226, 0.5);
}

.result-checkbox {
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.result-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.result-content {
    flex: 1;
    min-width: 0;
}

/* Number Input Grid (Backtest) */
.number-input-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.number-input-grid input {
    width: 100%;
    padding: 12px 8px;
    border: 2px solid var(--bg-hover);
    border-radius: var(--border-radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 1rem;
    text-align: center;
    transition: var(--transition-fast);
}

.number-input-grid input:focus {
    outline: none;
    border-color: var(--primary);
}

.number-input-grid input::placeholder {
    color: var(--text-muted);
}

/* Backtest Results */
.backtest-result-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-top: 16px;
}

.backtest-result-card h4 {
    margin-bottom: 8px;
}

.total-rounds {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.wins-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.win-item {
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.05);
}

.win-item .rank {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.win-item .count {
    font-weight: 700;
    font-size: 1rem;
}

.win-item.first {
    background: rgba(255, 215, 0, 0.2);
    color: var(--primary);
}

.win-item.second {
    background: rgba(192, 192, 192, 0.2);
    color: #c0c0c0;
}

.win-item.third {
    background: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stats-summary .stat {
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-sm);
}

.stats-summary .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stats-summary .value {
    font-weight: 600;
    font-size: 1rem;
}

.stats-summary .value.positive {
    color: var(--success);
}

.stats-summary .value.negative {
    color: var(--accent);
}

.best-result {
    padding: 12px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
}

.best-result h5 {
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.match-distribution h5 {
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.distribution-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dist-bar {
    display: grid;
    grid-template-columns: 40px 1fr 50px;
    align-items: center;
    gap: 10px;
}

.match-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.occurrence {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
}

/* Cluster Container */
.cluster-container {
    margin-top: 16px;
}

.cluster-prediction {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.2), rgba(75, 0, 130, 0.2));
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
}

.cluster-prediction h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.prediction-result {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.predicted-type {
    font-size: 1.2rem;
    font-weight: 700;
    color: #a855f7;
}

.probability {
    background: rgba(168, 85, 247, 0.3);
    color: #a855f7;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.cluster-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cluster-list h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.cluster-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
}

.cluster-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cluster-name {
    font-weight: 600;
    color: var(--text-primary);
}

.cluster-percentage {
    background: rgba(255, 215, 0, 0.2);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.cluster-stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cluster-representative {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.cluster-representative .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.cluster-representative .numbers {
    display: flex;
    gap: 4px;
}

.ball-sm {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
}

.ball-lg {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

/* 당첨 번호 매칭 상태 */
.ball.matched {
    /* 일치 - 강조 효과 */
    box-shadow: 0 0 0 2px #fff, 0 0 8px rgba(255, 215, 0, 0.8);
    transform: scale(1.1);
    z-index: 1;
}

.ball.bonus-matched {
    /* 보너스 번호 일치 - 보라색 테두리 */
    box-shadow: 0 0 0 2px #a855f7, 0 0 8px rgba(168, 85, 247, 0.6);
    transform: scale(1.1);
    z-index: 1;
}

.ball.unmatched {
    /* 불일치 - 흐리게 */
    opacity: 0.35;
    filter: grayscale(70%);
}

.cluster-description {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Analysis Modal */
.analysis-modal {
    max-width: 500px;
}

.analysis-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-sm);
}

.score-section {
    margin-bottom: 20px;
}

.total-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.score-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
}

.score-grade {
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.score-grade.grade-s {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}

.score-grade.grade-a {
    background: linear-gradient(135deg, #8a2be2, #6a1bb2);
    color: #fff;
}

.score-grade.grade-b {
    background: rgba(56, 189, 248, 0.3);
    color: var(--info);
}

.score-grade.grade-c {
    background: rgba(160, 160, 184, 0.3);
    color: var(--text-secondary);
}

.score-grade.grade-d {
    background: rgba(107, 107, 128, 0.3);
    color: var(--text-muted);
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 60px 1fr 40px;
    align-items: center;
    gap: 12px;
}

.breakdown-item .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.breakdown-item .bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.breakdown-item .fill {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, var(--primary));
    border-radius: 4px;
}

.breakdown-item .value {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: right;
}

.cluster-section,
.backtest-section,
.analysis-comments {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cluster-section h4,
.backtest-section h4,
.analysis-comments h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.cluster-section .cluster-name {
    font-size: 1.1rem;
    color: #a855f7;
}

.cluster-section .cluster-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.backtest-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.backtest-item {
    text-align: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
}

.backtest-item .rank {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.backtest-item .count {
    font-weight: 600;
}

.win-rate {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

.analysis-comments p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

/* Generated Numbers Modal */
.generated-row {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
}

.generated-row .index {
    font-weight: 600;
    color: var(--text-muted);
}

.generated-row .numbers {
    display: flex;
    gap: 6px;
}

/* Loading Spinner for AI */
.loading-spinner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
}

.loading-spinner .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(138, 43, 226, 0.2);
    border-top-color: #8a2be2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-message {
    color: var(--accent);
    text-align: center;
    padding: 20px;
}

/* AI Score Indicator in Generate Tab */
.ai-score-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 8px;
}

.ai-grade {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

.ai-grade.grade-s {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}

.ai-grade.grade-a {
    background: linear-gradient(135deg, #8a2be2, #6a1bb2);
    color: #fff;
}

.ai-grade.grade-b {
    background: rgba(56, 189, 248, 0.3);
    color: var(--info);
}

.ai-grade.grade-c {
    background: rgba(160, 160, 184, 0.3);
    color: var(--text-secondary);
}

.ai-grade.grade-d {
    background: rgba(107, 107, 128, 0.3);
    color: var(--text-muted);
}

.ai-confidence {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.game-row.ai-generated {
    border-left: 3px solid #8a2be2;
}

.game-row.ai-generated .game-index {
    color: #a855f7;
}

/* Responsive AI Styles */
@media (max-width: 480px) {
    .ai-method-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .number-input-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .wins-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .wins-grid .win-item:nth-child(4),
    .wins-grid .win-item:nth-child(5) {
        grid-column: span 1;
    }

    .stats-summary {
        grid-template-columns: 1fr;
    }

    .backtest-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Storage Category Tabs
   ============================================ */
.storage-category-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.storage-category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-tab i {
    font-size: 0.9rem;
}

.category-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.category-tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #000;
    border-color: var(--primary);
}

.category-tab.active i {
    color: #000;
}

.category-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-tab.active .category-count {
    background: rgba(0, 0, 0, 0.3);
}

/* Category-specific method tags */
.method-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 8px;
}

.method-badge.ai {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
    color: #a855f7;
}

.method-badge.generator {
    background: rgba(56, 189, 248, 0.2);
    color: var(--info);
}

.method-badge.manual {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

/* Saved number item with category */
.saved-number-item {
    position: relative;
}

.saved-number-item .method-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.saved-number-item .method-info i {
    font-size: 0.7rem;
}

/* Empty state for categories */
.category-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.category-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.category-empty p {
    margin-bottom: 8px;
}

.category-empty .hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 480px) {
    .storage-category-tabs {
        gap: 6px;
        padding: 8px 0;
    }

    .category-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .category-tab span:not(.category-count) {
        display: none;
    }

    .category-tab i {
        margin-right: 0;
    }
}

/* ============================================
   AI Item in Storage
   ============================================ */
.saved-number-item.ai-item {
    border-left: 3px solid #a855f7;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.05) 0%, transparent 100%);
}

.ai-grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.ai-grade-badge.grade-s {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 193, 7, 0.3) 100%);
    color: #ffd700;
}

.ai-grade-badge.grade-a {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.ai-grade-badge.grade-b {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.ai-grade-badge.grade-c {
    background: rgba(160, 160, 184, 0.2);
    color: #a0a0b8;
}

.ai-grade-badge.grade-d {
    background: rgba(107, 107, 128, 0.2);
    color: #6b6b80;
}

.ai-score-bar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ai-score-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ai-score-info .ai-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-score-info .ai-grade.grade-s {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, rgba(255, 193, 7, 0.3) 100%);
    color: #ffd700;
}

.ai-score-info .ai-grade.grade-a {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.ai-score-info .ai-grade.grade-b {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
}

.ai-score-info .ai-grade.grade-c {
    background: rgba(160, 160, 184, 0.2);
    color: #a0a0b8;
}

.ai-score-info .ai-grade.grade-d {
    background: rgba(107, 107, 128, 0.2);
    color: #6b6b80;
}

.ai-confidence-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.ai-confidence-bar-mini {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.ai-confidence-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.confidence-mini {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-right: 8px;
}

/* ============================================
   Share Modal
   ============================================ */
.share-modal-content {
    text-align: center;
}

.share-numbers-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-hover);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.share-numbers-display .ball {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.share-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-normal);
    color: var(--text-primary);
}

.share-option-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.share-option-btn i {
    font-size: 1.5rem;
    color: var(--primary);
}

.share-option-btn span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.share-option-btn.share-native {
    grid-column: span 3;
    flex-direction: row;
    justify-content: center;
    background: var(--primary);
    border-color: var(--primary);
}

.share-option-btn.share-native i,
.share-option-btn.share-native span {
    color: #1a1a2e;
}

.share-option-btn.share-native span {
    font-weight: 600;
}

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border-radius: var(--border-radius);
    margin-top: 16px;
}

.qr-container canvas {
    border-radius: 8px;
}

.qr-label {
    margin-top: 12px;
    font-size: 0.85rem;
    color: #1a1a2e;
    font-weight: 500;
}

.share-text-preview {
    background: var(--bg-hover);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Light theme share modal */
[data-theme="light"] .share-option-btn {
    background: #f5f5f7;
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .share-option-btn:hover {
    background: #e8e8ec;
}

[data-theme="light"] .share-numbers-display {
    background: #f0f0f5;
}

/* Share button in number items */
.btn-share {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-share:hover {
    background: var(--primary);
    color: #1a1a2e;
}

/* ============================================
   Purchase Set Styles
   ============================================ */

/* Sets View */
.sets-view {
    margin-top: 16px;
}

.sets-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Set Card */
.set-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.set-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.set-card-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.set-round {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.set-name {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.set-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.set-status.pending {
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.set-status.checked {
    background: rgba(0, 209, 178, 0.15);
    color: var(--primary);
}

/* Set Games */
.set-games {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.set-game-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 8px;
}

.set-game-index {
    font-weight: 600;
    color: var(--primary);
    min-width: 20px;
}

.set-game-numbers {
    display: flex;
    gap: 4px;
    flex: 1;
}

.set-game-numbers .ball {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.set-game-result {
    font-size: 0.8rem;
    font-weight: 600;
}

.set-game-result.win {
    color: var(--primary);
}

.set-game-result.lose {
    color: var(--text-muted);
}

/* Set Win Summary */
.set-win-summary {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 209, 178, 0.1);
    border-radius: 8px;
    margin-bottom: 12px;
}

.set-win-item {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

/* Set Actions */
.set-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.set-card-actions .btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* Set Modal */
.set-modal-content {
    max-width: 500px;
}

.set-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-input {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.set-numbers-section {
    margin-bottom: 20px;
}

.set-numbers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.set-numbers-header span {
    font-weight: 500;
    color: var(--text-secondary);
}

.set-add-buttons {
    display: flex;
    gap: 8px;
}

.set-round-input {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
}

.set-round-input label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.set-round-input input {
    width: 100px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.set-round-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.set-round-input .round-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.set-add-buttons-full {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.set-add-buttons-full .btn {
    width: 100%;
    justify-content: center;
}

.set-numbers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 150px;
    max-height: 250px;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg-surface);
    border-radius: 8px;
}

.set-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--text-muted);
}

.set-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.5;
}

.set-number-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 8px;
}

.set-number-item .game-label {
    font-weight: 600;
    color: var(--primary);
    min-width: 24px;
}

.set-number-item .balls {
    display: flex;
    gap: 4px;
    flex: 1;
}

.set-number-item .balls .ball {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.set-number-item .remove-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.set-number-item .remove-btn:hover {
    opacity: 1;
}

.set-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Sets empty state */
.sets-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.sets-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.sets-empty p {
    margin-bottom: 8px;
}

.sets-empty .hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Light theme adjustments */
[data-theme="light"] .set-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .set-game-row {
    background: #f5f5f7;
}

[data-theme="light"] .form-input {
    background: #f5f5f7;
}

[data-theme="light"] .set-numbers-list {
    background: #f5f5f7;
}

[data-theme="light"] .set-number-item {
    background: #ffffff;
}

/* ============================================
   Storage Selector Modal
   ============================================ */
.storage-selector-content {
    max-width: 500px;
}

.selector-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    text-align: center;
}

.storage-selector-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 350px;
    overflow-y: auto;
    padding: 4px;
    margin-bottom: 16px;
}

.selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.selector-item:hover {
    background: var(--bg-hover);
}

.selector-item.selected {
    border-color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
}

.selector-item .checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.selector-item.selected .checkbox {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.selector-item .balls {
    display: flex;
    gap: 4px;
    flex: 1;
}

.selector-item .balls .ball {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
}

.selector-item .method-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.selector-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.selector-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.5;
}

[data-theme="light"] .selector-item {
    background: #f5f5f7;
}

[data-theme="light"] .selector-item:hover {
    background: #ebebed;
}

[data-theme="light"] .selector-item.selected {
    background: rgba(255, 215, 0, 0.15);
}

/* ============================================
   New Round Notification Popup
   ============================================ */
.new-round-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 400;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.new-round-popup.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.new-round-content {
    background: linear-gradient(145deg, var(--bg-card), var(--bg-surface));
    border-radius: 24px;
    width: 100%;
    max-width: 380px;
    border: 2px solid var(--primary);
    box-shadow:
        0 0 40px rgba(255, 215, 0, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

.new-round-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(90deg, var(--primary), #ff9500);
}

.new-round-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a2e;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.new-round-badge i {
    animation: pulse 1.5s ease infinite;
}

.new-round-close {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: #1a1a2e;
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.new-round-close:hover {
    background: rgba(0, 0, 0, 0.3);
}

.new-round-body {
    padding: 24px 20px;
    text-align: center;
}

.new-round-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.new-round-title span {
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.new-round-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.new-round-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
}

.new-round-numbers .ball {
    font-size: 1rem;
    width: 38px;
    height: 38px;
    animation: slideUp 0.5s ease backwards;
}

.new-round-numbers .ball:nth-child(1) {
    animation-delay: 0.1s;
}

.new-round-numbers .ball:nth-child(2) {
    animation-delay: 0.15s;
}

.new-round-numbers .ball:nth-child(3) {
    animation-delay: 0.2s;
}

.new-round-numbers .ball:nth-child(4) {
    animation-delay: 0.25s;
}

.new-round-numbers .ball:nth-child(5) {
    animation-delay: 0.3s;
}

.new-round-numbers .ball:nth-child(6) {
    animation-delay: 0.35s;
}

.new-round-numbers .ball:nth-child(7) {
    animation-delay: 0.45s;
}

.new-round-numbers .ball:nth-child(8) {
    animation-delay: 0.5s;
}

.new-round-prize {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.new-round-prize .prize-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.new-round-prize .prize-amount {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}

.new-round-footer {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
}

.new-round-footer .btn {
    flex: 1;
}

.new-round-footer .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Light theme adjustments */
[data-theme="light"] .new-round-content {
    background: linear-gradient(145deg, #ffffff, #f5f5f7);
    border-color: var(--primary-dark);
}

[data-theme="light"] .new-round-numbers {
    background: rgba(0, 0, 0, 0.05);
}

/* ============================================
   Store Finder Styles
   ============================================ */

/* Store Finder Container */
.store-finder-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 12px;
}

/* Search Bar */
.store-search-bar {
    display: flex;
    gap: 10px;
    padding: 0 4px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper i.fa-search {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 14px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.search-input-wrapper .clear-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
}

/* Filter Tabs */
.store-filter-tabs {
    display: flex;
    gap: 8px;
    padding: 0 4px;
}

.filter-tab {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.filter-tab:hover {
    background: var(--bg-hover);
}

.filter-tab.active {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.filter-tab i {
    font-size: 12px;
}

/* Map Container */
.store-map {
    height: 280px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.map-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    color: var(--primary);
    opacity: 0.5;
}

.map-placeholder .map-hint {
    font-size: 12px;
    margin-top: 8px;
    opacity: 0.7;
}

/* Store Markers */
.store-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.store-marker:hover {
    transform: scale(1.2);
}

/* 일반 판매점 - 회색 */
.store-marker.normal {
    background: #6b7280;
    color: white;
}

/* 카카오 검색 결과 - 파란색 */
.store-marker.kakao {
    background: #3b82f6;
    color: white;
}

/* 명당 - 금색 */
.store-marker.winner {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.5);
}

/* Current Location Marker */
.current-location-marker {
    position: relative;
    width: 20px;
    height: 20px;
}

.current-location-marker .pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-out infinite;
}

.current-location-marker .dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border: 3px solid white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Store Info Window */
.store-info-window {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    max-width: 280px;
}

.store-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.store-info-header .store-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.store-info-header .win-badge {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #000;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.store-info-window .store-address {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.store-info-window .store-distance {
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

.store-info-window .store-phone {
    color: var(--info);
    font-size: 12px;
    margin-top: 4px;
}

.store-info-window .store-phone a {
    color: inherit;
    text-decoration: none;
}

/* Store List */
.store-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.store-list-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.store-list-items {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
}

/* Store List Item */
.store-list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.store-list-item:hover {
    background: var(--bg-hover);
}

.store-list-item.winner {
    background: rgba(251, 191, 36, 0.08);
}

.store-list-item.winner:hover {
    background: rgba(251, 191, 36, 0.15);
}

.store-list-item.kakao {
    background: rgba(59, 130, 246, 0.05);
}

.store-list-item.kakao:hover {
    background: rgba(59, 130, 246, 0.1);
}

.store-rank {
    width: 28px;
    height: 28px;
    background: var(--bg-surface);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}

.store-rank.winner {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #000;
}

.store-rank.kakao {
    background: #3b82f6;
    color: white;
}

.store-item-content {
    flex: 1;
    min-width: 0;
}

.store-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.store-item-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.winner-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.winner-badge.legendary {
    background: linear-gradient(145deg, #a855f7, #7c3aed);
    color: white;
}

.winner-badge.gold {
    background: linear-gradient(145deg, #fbbf24, #f59e0b);
    color: #000;
}

.winner-badge.silver {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary);
}

/* 카카오 검색 결과 배지 */
.kakao-badge {
    background: #3b82f6;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

.store-item-address {
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
}

.store-item-address i {
    margin-top: 2px;
    flex-shrink: 0;
}

.store-item-meta {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-item-meta .store-phone {
    font-size: 11px;
    color: var(--info);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.store-item-meta .store-phone i {
    font-size: 10px;
}

.recent-win {
    font-size: 11px;
    color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
}

.store-item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.store-item-distance {
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.store-arrow {
    color: var(--text-muted);
    font-size: 12px;
}

/* Empty State */
.store-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.store-empty i {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.store-empty p {
    margin: 4px 0;
}

.store-empty-hint {
    font-size: 12px;
    opacity: 0.7;
}

/* API Key Warning */
.api-key-warning {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.api-key-warning i {
    font-size: 40px;
    color: #f59e0b;
    margin-bottom: 12px;
}

.api-key-warning h4 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

.api-key-warning code {
    background: var(--bg-surface);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary);
}

/* Light Theme Store Finder */
[data-theme="light"] .store-marker.normal {
    background: #9ca3af;
}

[data-theme="light"] .store-info-window {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .store-list-item {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .store-rank {
    background: #f3f4f6;
}

/* ============================================
   인증 UI 스타일
   ============================================ */

/* 헤더 사용자 정보 */
.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

/* 사이드메뉴 사용자 */
.side-menu-user {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    margin: 8px 12px;
    background: var(--bg-surface);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-primary);
    font-size: 14px;
}

.side-menu-user:hover {
    background: var(--bg-hover);
}

.side-menu-user .logout-btn-sm {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.side-menu-user .logout-btn-sm:hover {
    color: var(--accent);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   전체 화면 로그인 페이지
   ============================================ */
.auth-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-page.active {
    opacity: 1;
    visibility: visible;
}

/* 배경 애니메이션 원들 */
.auth-page-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: floatCircle 20s infinite ease-in-out;
}

.auth-bg-circle-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.auth-bg-circle-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.auth-bg-circle-3 {
    width: 200px;
    height: 200px;
    background: #fbbf24;
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes floatCircle {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    75% {
        transform: translate(20px, 10px) scale(1.05);
    }
}

/* 콘텐츠 컨테이너 */
.auth-page-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 닫기 버튼 */
.auth-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
}

/* 로고 영역 */
.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-balls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.auth-ball {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.auth-ball.ball-1 {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.auth-ball.ball-2 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.auth-logo-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: 4px;
}

.auth-logo-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 4px 0 0 0;
}

/* 카드 */
.auth-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.auth-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 8px 0;
    text-align: center;
}

.auth-card-subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0 0 24px 0;
    text-align: center;
}

/* 버튼들 */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: #fff;
    color: #333;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google i {
    font-size: 1.2rem;
    color: #4285f4;
}

.btn-apple {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 24px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apple:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-apple i {
    font-size: 1.3rem;
}

/* 구분선 */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    padding: 0 16px;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* 게스트 버튼 */
.btn-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: transparent;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-guest:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #9ca3af;
}

.btn-guest i {
    font-size: 1rem;
}

/* 기능 안내 */
.auth-features {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.auth-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
}

.auth-feature i {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
}

.auth-feature span {
    font-size: 0.75rem;
}

/* 푸터 */
.auth-footer {
    margin-top: 24px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.auth-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
}

.auth-footer a:hover {
    color: #fff;
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .auth-page-content {
        padding: 16px;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .auth-logo-text {
        font-size: 2rem;
    }

    .auth-ball {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .auth-features {
        gap: 16px;
    }
}

/* 라이트 테마일 때 */
[data-theme="light"] .auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 라이트모드 */
[data-theme="light"] .side-menu-user {
    background: #f3f4f6;
}

[data-theme="light"] .side-menu-user:hover {
    background: #e5e7eb;
}

/* ============================================
   Admin Panel Styles
   ============================================ */

/* 관리자 메뉴 섹션 */
.admin-menu-section {
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    margin-top: 8px;
    padding-top: 8px;
}

.admin-menu-section .menu-section-title {
    color: #ffd700;
}

/* 관리자 패널 모달 */
.admin-panel-content {
    max-width: 480px;
    max-height: 85vh;
    overflow: hidden;
}

.admin-panel-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
}

.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-muted);
    gap: 8px;
}

.admin-section {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.admin-section:last-child {
    border-bottom: none;
}

.admin-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-section-title i {
    font-size: 0.9rem;
}

/* 통계 그리드 */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.admin-stat-card {
    background: var(--bg-hover);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
}

.admin-stat-card.highlight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.admin-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.admin-stat-card.highlight .admin-stat-value {
    color: #ffd700;
}

.admin-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 방법별 통계 */
.admin-method-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-method-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
}

.admin-method-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.admin-method-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

/* 정보 목록 */
.admin-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.admin-info-row:last-child {
    border-bottom: none;
}

.admin-info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* 빠른 작업 버튼 */
.admin-action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.admin-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-action-btn i {
    font-size: 1.1rem;
    color: var(--primary);
}

.admin-action-btn:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.admin-action-btn.warning {
    border-color: rgba(255, 193, 7, 0.5);
}

.admin-action-btn.warning i {
    color: #ffc107;
}

.admin-action-btn.warning:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: #ffc107;
}

/* 사용자 관리 모달 */
.admin-users-content {
    max-width: 520px;
    max-height: 80vh;
}

.admin-users-summary {
    padding: 12px 16px;
    background: var(--bg-hover);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.admin-users-table-wrap {
    max-height: 50vh;
    overflow-y: auto;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-users-table th,
.admin-users-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-users-table th {
    background: var(--bg-hover);
    font-weight: 600;
    color: var(--text-muted);
    position: sticky;
    top: 0;
}

.admin-users-table td {
    color: var(--text-primary);
}

.admin-users-table tr:hover td {
    background: var(--bg-hover);
}

/* 반응형 */
@media (max-width: 480px) {
    .admin-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-action-grid {
        grid-template-columns: 1fr 1fr;
    }

    .admin-panel-content,
    .admin-users-content {
        max-width: 100%;
        margin: 0 10px;
    }
}

/* ============================================
   내 구매 내역 스타일
   ============================================ */

/* 등록 버튼 */
.purchase-register-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.purchase-register-buttons .register-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: var(--bg-hover);
    border: 2px dashed var(--primary);
    border-radius: var(--border-radius);
    color: var(--primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.purchase-register-buttons .register-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-style: solid;
}

.purchase-register-buttons .register-btn i {
    font-size: 1.5rem;
}

/* 필터 탭 */
.purchase-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.purchase-filter-tab {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.purchase-filter-tab.active,
.purchase-filter-tab:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

/* 구매 목록 */
.purchases-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.purchases-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.purchases-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.purchases-empty .hint {
    font-size: 0.85rem;
    margin-top: 8px;
}

/* 구매 카드 */
.purchase-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 16px;
    border-left: 4px solid var(--primary);
    transition: var(--transition-fast);
}

.purchase-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.purchase-card.checked {
    border-left-color: var(--success);
}

.purchase-card.pending {
    border-left-color: var(--info);
}

.purchase-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.purchase-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.purchase-round {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.purchase-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.purchase-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.checked {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.status-badge.pending {
    background: rgba(56, 189, 248, 0.2);
    color: var(--info);
}

.win-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #ff6b6b);
    color: var(--bg-dark);
}

/* 구매 게임 목록 */
.purchase-games {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.purchase-game-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
}

.purchase-game-row.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 107, 107, 0.2));
}

.purchase-game-row.rank-2 {
    background: rgba(192, 192, 192, 0.2);
}

.purchase-game-row.rank-3 {
    background: rgba(205, 127, 50, 0.2);
}

.purchase-card .game-index {
    font-weight: 700;
    color: var(--primary);
    min-width: 20px;
}

.purchase-card .game-numbers {
    display: flex;
    gap: 4px;
    flex: 1;
}

.purchase-card .game-numbers .ball {
    font-size: 0.75rem;
}

.game-rank {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.game-rank.rank-0 {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.game-rank.rank-1 {
    background: var(--primary);
    color: var(--bg-dark);
}

.game-rank.rank-2 {
    background: #c0c0c0;
    color: var(--bg-dark);
}

.game-rank.rank-3 {
    background: #cd7f32;
    color: var(--bg-dark);
}

.game-rank.rank-4,
.game-rank.rank-5 {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.purchase-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--bg-hover);
}

/* 구매 삭제 모드 */
.purchase-card.delete-mode {
    cursor: pointer;
    position: relative;
    padding-left: 48px;
}

.purchase-card.delete-mode:hover {
    background: var(--bg-card);
}

.purchase-card.delete-mode.selected {
    background: rgba(var(--danger-rgb), 0.1);
    border-color: var(--danger);
}

.purchase-delete-checkbox {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    transition: all 0.15s ease;
}

.purchase-delete-checkbox i {
    opacity: 0;
    color: white;
    font-size: 0.75rem;
    transition: opacity 0.15s ease;
}

.purchase-delete-checkbox.checked {
    background: var(--danger);
    border-color: var(--danger);
}

.purchase-delete-checkbox.checked i {
    opacity: 1;
}

#purchaseDeleteBtn.active {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* 헤더 액션 버튼 그룹 */
.card-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 구매 모달 */
.purchase-modal-content {
    max-width: 500px;
}

.purchase-round-section {
    margin-bottom: 20px;
}

.purchase-round-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.purchase-round-input {
    display: flex;
    gap: 8px;
}

.purchase-round-input input {
    flex: 1;
    padding: 12px;
    background: var(--bg-hover);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
}

.purchase-round-input input:focus {
    border-color: var(--primary);
    outline: none;
}

.purchase-games-section {
    margin-bottom: 20px;
}

.purchase-games-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.purchase-games-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.purchase-game-input {
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    padding: 12px;
}

.game-input-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.purchase-game-input .game-label {
    font-weight: 700;
    color: var(--primary);
    min-width: 24px;
}

.game-type-select {
    padding: 4px 8px;
    background: var(--bg-card);
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.btn-icon-sm {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}

.btn-icon-sm:hover {
    color: var(--accent);
}

.game-numbers-input {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.game-numbers-input input {
    width: 100%;
    padding: 10px 4px;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: center;
}

.game-numbers-input input:focus {
    border-color: var(--primary);
    outline: none;
}

.game-numbers-input input::placeholder {
    color: var(--text-muted);
}

.purchase-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.empty-hint {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

/* 구매 게임 볼 스타일 */
.game-numbers-balls {
    display: flex;
    gap: 6px;
    align-items: center;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--border-radius-sm);
    transition: background 0.2s;
}

.game-numbers-balls:hover {
    background: var(--bg-card);
}

.game-numbers-balls .ball {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.game-numbers-balls .edit-hint {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.game-numbers-balls:hover .edit-hint {
    opacity: 1;
}

.purchase-game-input.has-numbers {
    background: var(--bg-hover);
}

/* 보관함 선택 모드 */
.storage-selection-mode .saved-number-item {
    cursor: pointer;
    position: relative;
}

.storage-selection-mode .saved-number-item:hover {
    background: var(--bg-hover);
}

.storage-selection-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.storage-selection-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.storage-selection-checkbox i {
    color: white;
    font-size: 0.75rem;
    opacity: 0;
}

.storage-selection-checkbox.checked i {
    opacity: 1;
}

/* 구매된 번호의 체크박스 - 표시만 다르게 (선택은 가능) */
.storage-selection-checkbox.has-purchased {
    border-color: var(--success);
}

.storage-selection-checkbox.has-purchased.checked {
    background: var(--success);
    border-color: var(--success);
}

.storage-selection-mode .saved-number-item {
    padding-left: 46px !important;
}

/* 세트 내 개별 게임에도 체크박스 공간 확보 */
.storage-selection-mode .game-row.saved-number-item {
    padding-left: 46px !important;
    position: relative;
}

/* 개별 번호 체크박스 더 잘 보이게 */
.storage-selection-mode .game-row .storage-selection-checkbox {
    top: 50%;
    transform: translateY(-50%);
    left: 10px;
    z-index: 5;
}

.selection-actions-bar {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border);
}

.selection-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.selection-info strong {
    color: var(--primary);
}

/* 세트 선택 체크박스 */
.set-selection-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.set-selection-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.set-selection-checkbox i {
    color: white;
    font-size: 0.8rem;
    opacity: 0;
}

.set-selection-checkbox.checked i {
    opacity: 1;
}

.set-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.2);
}

.set-card:has(.set-selection-checkbox) {
    padding-left: 46px;
    cursor: pointer;
    position: relative;
}

/* 미완성 구매 섹션 */
.incomplete-purchase-section {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    border: 1px dashed var(--primary);
}

.incomplete-purchase-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.incomplete-purchase-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.incomplete-purchase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.incomplete-purchase-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.incomplete-purchase-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.incomplete-round {
    font-weight: 600;
    color: var(--text-primary);
}

.incomplete-games {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.incomplete-slots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slots-remaining {
    padding: 4px 8px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.incomplete-divider {
    display: flex;
    align-items: center;
    margin-top: 12px;
    gap: 12px;
}

.incomplete-divider::before,
.incomplete-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.incomplete-divider span {
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* 구매 내역 반응형 */
@media (max-width: 480px) {
    .purchase-register-buttons {
        flex-direction: row;
    }

    .purchase-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .game-numbers-input {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   상태 배지 (저장됨/구매됨)
   ============================================ */
.status-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    margin-left: 4px;
    flex-shrink: 0;
}

.status-badge.saved {
    background: var(--primary);
    color: white;
}

.status-badge.purchased {
    background: var(--success);
    color: white;
}

/* 구매됨 번호 - 정보 표시용 (선택 가능) */
.saved-number-item.is-purchased {
    position: relative;
}

.saved-number-item.is-purchased::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(34, 197, 94, 0.06);
    border-radius: inherit;
    pointer-events: none;
}

/* ============================================
   아이콘 버튼 (.btn-icon)
   ============================================ */
.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-hover);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.btn-icon:hover {
    background: var(--bg-card);
}

.btn-icon-danger {
    color: var(--accent);
}

.btn-icon-danger:hover {
    background: rgba(var(--accent-rgb), 0.15);
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ============================================
   일괄 삭제 모달
   ============================================ */
.bulk-delete-modal-content {
    max-width: 360px;
}

.bulk-delete-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bulk-delete-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.bulk-delete-option:hover {
    background: var(--bg-card);
    border-color: var(--primary);
}

.bulk-delete-option i {
    font-size: 1.5rem;
    color: var(--primary);
    width: 36px;
    text-align: center;
}

.bulk-delete-option strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.bulk-delete-option p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bulk-delete-option.danger i {
    color: var(--accent);
}

.bulk-delete-option.danger:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

/* ============================================
   삭제 선택 모드
   ============================================ */
.selection-actions-bar.delete-mode {
    background: linear-gradient(135deg, var(--accent) 0%, #d32f2f 100%);
}

.storage-selection-checkbox.delete-mode.checked {
    background: var(--accent);
    border-color: var(--accent);
}

/* 삭제 모드 바 */
#deleteModeBar {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent) 0%, #d32f2f 100%);
    padding: 12px 20px;
    border-radius: 30px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    align-items: center;
    gap: 16px;
    color: white;
}

#deleteModeBar button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

#deleteModeBar button:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   생성 번호 일괄 선택
   ============================================ */
.generated-action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.generated-action-bar .btn {
    font-size: 0.85rem;
}

/* 생성된 번호 체크박스 */
.gen-checkbox {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-right: 8px;
}

.gen-checkbox i {
    display: none;
    color: white;
    font-size: 0.75rem;
}

.gen-checkbox:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.gen-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.gen-checkbox.checked i {
    display: block;
}

/* game-row에 체크박스가 있을 때 레이아웃 조정 */
#generatedNumbers .game-row {
    display: flex;
    align-items: center;
}

#generatedNumbers .game-row .game-info {
    flex: 1;
}

/* 이미 저장된 번호 스타일 (약간 흐리게) */
#generatedNumbers .game-row.already-saved {
    opacity: 0.7;
}

#generatedNumbers .game-row.already-saved:hover {
    opacity: 1;
}

/* ============================================
   생성 번호 세트 카드
   ============================================ */
.generated-set {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.set-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    border-bottom: 1px solid var(--border);
}

.set-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary);
}

.set-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: auto;
}

.set-games {
    padding: 8px;
}

.set-games .game-row {
    margin-bottom: 4px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-hover);
}

.set-games .game-row:last-child {
    margin-bottom: 0;
}

/* 세트 체크박스 */
.set-checkbox {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background: transparent;
}

.set-checkbox i {
    display: none;
    color: white;
    font-size: 0.85rem;
}

.set-checkbox:hover {
    background: rgba(var(--primary-rgb), 0.2);
}

.set-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.set-checkbox.checked i {
    display: block;
}

/* 일부 선택됨 (partial) */
.set-checkbox.partial {
    background: rgba(var(--primary-rgb), 0.5);
    border-color: var(--primary);
}

.set-checkbox.partial i {
    display: block;
    opacity: 0.7;
}

/* 삭제 모드 세트 체크박스 */
.set-checkbox.delete-mode {
    border-color: var(--accent);
}

.set-checkbox.delete-mode:hover {
    background: rgba(var(--accent-rgb), 0.2);
}

.set-checkbox.delete-mode.checked {
    background: var(--accent);
    border-color: var(--accent);
}

.set-checkbox.delete-mode.partial {
    background: rgba(var(--accent-rgb), 0.5);
    border-color: var(--accent);
}

/* 체크박스 placeholder (이미 저장된 경우) */
.gen-checkbox-placeholder {
    width: 24px;
    min-width: 24px;
    margin-right: 8px;
}

/* 세트 내 게임 레이아웃 조정 */
.set-games .game-row {
    display: flex;
    align-items: center;
}

.set-games .game-row .game-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.set-games .game-row .game-index {
    min-width: 24px;
    font-weight: 600;
    color: var(--primary);
}

.set-games .game-row .ball-container {
    display: flex;
    gap: 4px;
}

.set-games .game-row .ball {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

/* AI 보관함 세트 스타일 */
.ai-storage-set {
    margin-bottom: 12px;
}

.ai-storage-set .set-header {
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.ai-storage-set .set-title {
    color: #a855f7;
}

/* AI 컴팩트 게임 행 */
.game-row.ai-compact {
    padding: 6px 10px;
    margin-bottom: 2px;
}

.game-row.ai-compact .game-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.game-row.ai-compact .game-index {
    min-width: 18px;
    font-weight: 600;
    color: #a855f7;
    font-size: 0.85rem;
}

.game-row.ai-compact .ball-container {
    flex: 1;
    display: flex;
    gap: 3px;
}

.game-row.ai-compact .ball {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
}

.game-row.ai-compact .game-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.game-row.ai-compact .game-actions .btn {
    padding: 4px 8px;
    font-size: 0.7rem;
}

/* AI 컴팩트 선택됨 상태 */
.game-row.ai-compact.selected {
    background: rgba(var(--primary-rgb), 0.15);
    border-left: 3px solid var(--primary);
}

/* AI 컴팩트 구매됨 상태 */
.game-row.ai-compact.is-purchased {
    opacity: 0.85;
}

/* 반응형 */
@media (max-width: 480px) {
    .set-header {
        padding: 10px 12px;
    }

    .set-games {
        padding: 6px;
    }

    .set-games .game-row {
        padding: 6px 8px;
        flex-wrap: wrap;
    }

    .set-games .game-row .ball {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .set-games .game-row .game-actions {
        margin-left: auto;
    }
}

/* ============================================
   보관함 세트 스타일 (기존 카드 스타일 유지)
   ============================================ */
.storage-set {
    margin-bottom: 16px;
}

.storage-set .set-header {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.03) 100%);
}

.storage-set .set-games {
    padding: 8px;
}

.storage-set .set-games .game-row {
    padding: 12px;
    margin-bottom: 8px;
}

.storage-set .set-games .game-row:last-child {
    margin-bottom: 0;
}

/* 게임 인덱스 라벨 (A, B, C, D, E) */
.game-index-label {
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 6px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* ============================================
   Fortune (운세 행운번호) 스타일
   ============================================ */

/* 운세 컨텐츠 컨테이너 */
.fortune-content {
    min-height: 400px;
}

.fortune-loading {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
}

.fortune-loading i {
    font-size: 1.5rem;
    color: var(--primary);
}

.fortune-loading p {
    margin: 0;
}

/* 운세 헤더 */
.fortune-header {
    text-align: center;
    padding: 16px 0;
    margin-bottom: 16px;
}

.fortune-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.fortune-title i {
    color: var(--primary);
}

.fortune-round {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* 운세 메시지 박스 */
.fortune-message-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.fortune-message-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.fortune-message-icon {
    font-size: 1.5rem;
}

.fortune-message-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #92400e;
}

.fortune-message-advice {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.advice-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 20px;
    font-size: 0.85rem;
    color: #78350f;
    font-weight: 500;
}

[data-theme="dark"] .fortune-message-box {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(234, 179, 8, 0.15));
    border-color: #f59e0b;
}

[data-theme="dark"] .fortune-message-text {
    color: #fcd34d;
}

[data-theme="dark"] .advice-tag {
    background: rgba(0, 0, 0, 0.3);
    color: #fde68a;
}

/* 운세 탭 */
.fortune-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.fortune-tab {
    padding: 10px 16px;
    border: none;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.fortune-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.fortune-tab.active {
    background: var(--primary);
    color: #000;
}

/* 운세 카드 */
.fortune-card {
    background: var(--bg-hover);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.fortune-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fortune-card-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.fortune-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 게임 리스트 */
.fortune-games {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fortune-game-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border-radius: var(--border-radius-sm);
}

.fortune-game-row .game-label {
    min-width: 28px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    background: rgba(255, 215, 0, 0.1);
    border-radius: 6px;
    flex-shrink: 0;
}

.fortune-game-row .game-numbers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fortune-game-row .ball {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

/* 운세 액션 버튼 */
.fortune-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.fortune-actions .btn {
    flex: 1;
}

/* 설정 버튼 */
.fortune-settings {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-text:hover {
    color: var(--text-secondary);
}

/* 생년월일 설정 폼 */
.fortune-setup {
    text-align: center;
    padding: 40px 20px;
}

.fortune-setup-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.fortune-setup h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.fortune-setup p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.fortune-birthday-form {
    max-width: 360px;
    margin: 0 auto;
}

.birthday-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.birthday-select {
    flex: 1;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    background: var(--bg-hover);
    color: var(--text-primary);
    font-size: 1rem;
}

.birthday-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* 미리보기 */
.fortune-preview {
    background: var(--bg-hover);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.preview-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.preview-label {
    color: var(--text-muted);
}

.preview-value {
    font-weight: 600;
}

/* 생년월일 모달 */
.fortune-birthday-modal-content {
    max-width: 400px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions .btn {
    flex: 1;
}

/* 라이트 모드 */
[data-theme="light"] .fortune-card {
    background: #f5f5f7;
}

[data-theme="light"] .fortune-game-row {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .fortune-preview {
    background: #f5f5f7;
}

[data-theme="light"] .birthday-select {
    background: #f5f5f7;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

[data-theme="light"] .fortune-tab {
    background: #f5f5f7;
}

[data-theme="light"] .fortune-card-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* 반응형 */
@media (max-width: 480px) {
    .fortune-tabs {
        gap: 4px;
    }

    .fortune-tab {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .fortune-game-row .ball {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .birthday-inputs {
        flex-direction: column;
        gap: 12px;
    }

    .fortune-actions {
        flex-direction: column;
    }

    .fortune-message-box {
        padding: 12px;
    }

    .fortune-message-main {
        gap: 8px;
        margin-bottom: 8px;
    }

    .fortune-message-icon {
        font-size: 1.2rem;
    }

    .fortune-message-text {
        font-size: 0.95rem;
    }

    .advice-tag {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .fortune-header {
        padding: 12px 0;
        margin-bottom: 12px;
    }

    .fortune-title {
        font-size: 1.1rem;
    }

    .fortune-round {
        font-size: 0.85rem;
    }
}

/* ============================================
   전체 모바일 일관성 스타일
   ============================================ */
@media (max-width: 480px) {

    /* 기본 폰트 및 줄간격 */
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    /* 카드 패딩 축소 */
    .card {
        padding: 14px;
        border-radius: 12px;
    }

    /* 버튼 크기 조정 */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* 헤더 아이콘 버튼 */
    .header-btn,
    .icon-btn {
        width: 36px;
        height: 36px;
    }

    /* 공 크기 통일 */
    .ball {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    /* 토스트 메시지 */
    .toast {
        font-size: 0.85rem;
        padding: 10px 16px;
    }

    /* 모달 패딩 */
    .modal-content {
        padding: 16px;
        margin: 10px;
        max-height: calc(100vh - 40px);
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    /* 빈 상태 메시지 */
    .empty-state {
        padding: 32px 16px;
        font-size: 0.9rem;
    }

    /* 카테고리 탭 */
    .category-tab {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .category-tab i {
        font-size: 0.85rem;
    }

    .category-count {
        font-size: 0.7rem;
        padding: 2px 5px;
    }

    /* 리스트 아이템 */
    .saved-number-item,
    .purchase-card {
        padding: 12px;
    }

    /* 게임 라벨 */
    .game-label {
        font-size: 0.75rem;
        width: 20px;
    }

    /* ============================================
       보관함 탭 모바일 최적화
       ============================================ */

    /* 카테고리 탭 컨테이너 */
    .category-tabs {
        gap: 4px;
        padding: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .category-tab {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-width: auto;
        flex: 0 0 auto;
    }

    .category-tab i {
        font-size: 0.7rem;
        /* 모바일에서 아이콘 작게 */
    }

    .category-count {
        font-size: 0.65rem;
        padding: 1px 4px;
        min-width: 14px;
    }

    /* 저장된 번호 아이템 레이아웃 */
    .saved-number-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        position: relative;
    }

    /* 번호 표시 영역 */
    .saved-number-item .numbers {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        width: 100%;
        justify-content: flex-start;
    }

    /* 메소드 배지 (AI, 통계 등) */
    .method-badge {
        font-size: 0.65rem !important;
        padding: 2px 5px !important;
        position: absolute;
        top: 8px;
        right: 8px;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* AI 등급 배지 */
    .ai-grade-badge {
        font-size: 0.6rem !important;
        padding: 1px 4px !important;
        margin-left: 2px;
    }

    /* 저장된 번호 메타 정보 */
    .saved-number-meta {
        font-size: 0.7rem;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 4px;
    }

    /* 액션 버튼들 */
    .saved-number-item .actions,
    .saved-number-actions {
        position: absolute;
        bottom: 8px;
        right: 8px;
        display: flex;
        gap: 4px;
    }

    .saved-number-item .actions button,
    .saved-number-actions button {
        width: 28px !important;
        height: 28px !important;
        padding: 0 !important;
        font-size: 0.75rem !important;
    }

    /* 세트 카드 모바일 */
    .set-card {
        padding: 12px;
    }

    .set-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .set-card-title {
        font-size: 0.9rem;
    }

    .set-card .numbers-list {
        gap: 6px;
    }

    /* 세트 내 번호 행 */
    .set-number-row {
        flex-wrap: wrap;
        gap: 4px;
    }

    /* 뷰 전환 탭 */
    .view-toggle {
        gap: 4px;
    }

    .view-toggle button {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    /* 선택 모드 UI */
    .storage-selection-checkbox {
        width: 20px;
        height: 20px;
    }

    .selection-info-bar {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .selection-info-bar button {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    /* 빈 상태 */
    .storage-empty-state {
        padding: 24px 12px;
    }

    .storage-empty-state i {
        font-size: 2rem;
    }

    /* 당첨 결과 표시 */
    .winning-result {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    /* 구매됨 배지 */
    .purchased-badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    /* ============================================
       백테스트 탭 모바일 최적화
       ============================================ */

    /* 백테스트 컨트롤 */
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .form-group {
        width: 100%;
    }

    .form-group select,
    .form-group input {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px;
    }

    /* 백테스트 결과 테이블 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .backtest-table,
    .data-table {
        font-size: 0.75rem;
        min-width: 500px;
    }

    .backtest-table th,
    .backtest-table td,
    .data-table th,
    .data-table td {
        padding: 6px 4px;
    }

    /* 당첨 결과 그리드 */
    .wins-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .win-item {
        padding: 10px 6px;
    }

    .win-item .rank {
        font-size: 0.7rem;
    }

    .win-item .count {
        font-size: 1.1rem;
    }

    /* 통계 카드 */
    .backtest-result-card {
        padding: 14px;
    }

    /* ============================================
       패턴 분석 탭 모바일 최적화
       ============================================ */

    /* 클러스터 그리드 */
    .cluster-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cluster-card {
        padding: 12px;
    }

    .cluster-card-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cluster-card-title {
        font-size: 0.9rem;
    }

    /* 번호 히트맵 */
    .number-heatmap,
    .cluster-heatmap {
        padding: 8px;
    }

    .number-heatmap .ball,
    .cluster-heatmap .ball {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    /* 패턴 필터 */
    .pattern-filters,
    .cluster-filters {
        flex-direction: column;
        gap: 8px;
    }

    .pattern-filters select,
    .pattern-filters button,
    .cluster-filters select,
    .cluster-filters button {
        width: 100%;
        font-size: 0.85rem;
    }

    /* 패턴 통계 */
    .pattern-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pattern-stat-item {
        padding: 10px;
    }

    /* 백테스트 섹션 */
    .backtest-section {
        padding: 12px;
    }

    .backtest-grid {
        grid-template-columns: 1fr;
    }

    .backtest-item {
        padding: 10px;
    }
}

/* 아주 작은 화면 (380px 미만) */
@media (max-width: 380px) {
    body {
        font-size: 13px;
    }

    .ball {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .fortune-tab {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* 보관함 추가 최적화 */
    .category-tab {
        padding: 5px 6px;
        font-size: 0.7rem;
    }

    .category-count {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    .method-badge {
        font-size: 0.6rem !important;
        max-width: 50px;
    }

    .ai-grade-badge {
        font-size: 0.55rem !important;
    }

    .saved-number-item .actions button,
    .saved-number-actions button {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.7rem !important;
    }

    .set-card-title {
        font-size: 0.85rem;
    }

    /* 백테스트/패턴 분석 추가 최적화 */
    .backtest-table,
    .data-table {
        font-size: 0.7rem;
    }

    .wins-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .win-item {
        padding: 8px 4px;
    }

    .number-heatmap .ball,
    .cluster-heatmap .ball {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* ============================================
   백테스트 탭 모바일 추가 최적화
   ============================================ */

@media (max-width: 480px) {

    /* 백테스트 입력 섹션 */
    .backtest-input-section {
        padding: 12px;
    }

    .backtest-input-section h4 {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    /* 번호 입력 그리드 - 터치 영역 확대 */
    .number-input-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .number-input-grid input {
        padding: 14px 10px;
        font-size: 1.1rem;
        min-height: 48px;
        /* 터치 친화적 최소 높이 */
        border-radius: 10px;
    }

    /* 백테스트 실행 버튼 */
    .backtest-input-section .btn-large {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
        margin-top: 12px;
    }

    /* 백테스트 결과 카드 */
    .backtest-result-card {
        padding: 16px;
        margin-top: 16px;
    }

    .backtest-result-card h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .backtest-result-card .total-rounds {
        font-size: 0.85rem;
        color: var(--text-muted);
        margin-bottom: 16px;
    }

    /* 당첨 결과 그리드 */
    .wins-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }

    .win-item {
        padding: 10px 4px;
        border-radius: 8px;
    }

    .win-item .rank {
        font-size: 0.65rem;
        margin-bottom: 4px;
    }

    .win-item .count {
        font-size: 0.9rem;
    }

    /* 통계 요약 */
    .stats-summary {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .stats-summary .stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
    }

    .stats-summary .stat .label {
        font-size: 0.85rem;
        color: var(--text-muted);
    }

    .stats-summary .stat .value {
        font-size: 1rem;
        font-weight: 600;
    }

    .stats-summary .stat .value.positive {
        color: #22c55e;
    }

    .stats-summary .stat .value.negative {
        color: #ef4444;
    }

    /* 최고 성적 */
    .best-result {
        margin-top: 16px;
        padding: 12px;
        background: rgba(255, 215, 0, 0.1);
        border-radius: 8px;
    }

    .best-result h5 {
        font-size: 0.85rem;
        color: var(--primary);
        margin-bottom: 6px;
    }

    .best-result p {
        font-size: 0.9rem;
    }
}

/* ============================================
   패턴 분석 탭 모바일 추가 최적화
   ============================================ */

@media (max-width: 480px) {

    /* 클러스터 컨테이너 */
    .cluster-container {
        margin-top: 12px;
    }

    /* 예측 섹션 */
    .cluster-prediction {
        padding: 16px;
        margin-bottom: 16px;
    }

    .cluster-prediction h4 {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }

    .prediction-result {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .prediction-result .predicted-type {
        font-size: 1.1rem;
        font-weight: 600;
    }

    .prediction-result .probability {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--primary);
    }

    /* 클러스터 리스트 */
    .cluster-list {
        gap: 10px;
    }

    .cluster-list h4 {
        font-size: 0.85rem;
        padding: 0 4px;
        margin-bottom: 10px;
    }

    /* 클러스터 카드 */
    .cluster-card {
        padding: 14px;
    }

    .cluster-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    .cluster-name {
        font-size: 0.95rem;
    }

    .cluster-percentage {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    /* 클러스터 통계 */
    .cluster-stats {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .cluster-stats span {
        background: rgba(255, 255, 255, 0.05);
        padding: 4px 8px;
        border-radius: 4px;
    }

    /* 대표 조합 */
    .cluster-representative {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 10px;
    }

    .cluster-representative .label {
        font-size: 0.7rem;
    }

    .cluster-representative .numbers {
        gap: 3px;
    }

    .cluster-representative .ball-sm {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    /* 클러스터 설명 */
    .cluster-description {
        font-size: 0.75rem;
        line-height: 1.5;
        margin-bottom: 12px;
    }

    /* 생성 버튼 */
    .cluster-card .btn-small {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
        text-align: center;
    }
}

/* 아주 작은 화면 추가 최적화 */
@media (max-width: 380px) {

    /* 백테스트 */
    .number-input-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .number-input-grid input {
        padding: 12px 8px;
        font-size: 1rem;
    }

    .wins-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .win-item .rank {
        font-size: 0.6rem;
    }

    .win-item .count {
        font-size: 0.8rem;
    }

    /* 패턴 분석 */
    .cluster-prediction {
        padding: 12px;
    }

    .cluster-card {
        padding: 12px;
    }

    .cluster-representative .ball-sm {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
}

/* ============================================
   PWA 오프라인 상태 표시
   ============================================ */

.offline-status-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f59e0b;
    color: white;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.offline-status-bar i {
    margin-right: 6px;
}

[data-theme="dark"] .offline-status-bar {
    background: #d97706;
}

/* ============================================
   전역 로딩 오버레이
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner-container {
    text-align: center;
}

.loading-message {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 로딩 스피너 재사용 (이미 정의된 스타일 활용) */
.loading-overlay .loading-spinner {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.loading-overlay .spinner-dot {
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-overlay .spinner-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-overlay .spinner-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

[data-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* ============================================
   확인 다이얼로그 모달
   ============================================ */
.confirm-modal {
    max-width: 420px;
    text-align: center;
    padding: 32px 24px 24px;
}

.confirm-header {
    margin-bottom: 20px;
}

.confirm-icon {
    font-size: 3.5rem;
}

.confirm-icon-warning {
    color: #f59e0b;
}

.confirm-icon-danger {
    color: #ef4444;
}

.confirm-icon-info {
    color: var(--primary);
}

.confirm-body {
    margin-bottom: 28px;
}

.confirm-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
}

.confirm-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-footer .btn {
    min-width: 100px;
    padding: 10px 24px;
}

.confirm-footer .confirm-btn {
    background: var(--primary);
    color: white;
}

.confirm-footer .confirm-btn:hover {
    background: var(--primary-hover);
}

.confirm-footer .cancel-btn {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.confirm-footer .cancel-btn:hover {
    background: var(--bg-hover);
}

/* 다크모드 */
[data-theme="dark"] .confirm-footer .cancel-btn {
    background: var(--bg-card);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .confirm-footer .cancel-btn:hover {
    background: var(--bg-hover);
}

/* ============================================
   Pull-to-Refresh (iOS Native Style)
   ============================================ */

.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 9999;
    pointer-events: none;
    transition: none;
}

.pull-to-refresh.pulling {
    transition: none;
}

.pull-to-refresh.releasing {
    transition: transform 0.3s ease-out;
}

/* iOS Style Spinner */
.ios-spinner {
    width: 28px;
    height: 28px;
    position: relative;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pull-to-refresh.visible .ios-spinner {
    opacity: 1;
}

.ios-spinner .bar {
    position: absolute;
    width: 2.5px;
    height: 7px;
    left: 50%;
    top: 50%;
    background: var(--text-muted);
    border-radius: 2px;
    transform-origin: center -3px;
    margin-left: -1.25px;
    margin-top: 3px;
}

/* 12개 막대 위치 (30도씩) */
.ios-spinner .bar:nth-child(1) {
    transform: rotate(0deg);
    opacity: 1;
}

.ios-spinner .bar:nth-child(2) {
    transform: rotate(30deg);
    opacity: 0.92;
}

.ios-spinner .bar:nth-child(3) {
    transform: rotate(60deg);
    opacity: 0.83;
}

.ios-spinner .bar:nth-child(4) {
    transform: rotate(90deg);
    opacity: 0.75;
}

.ios-spinner .bar:nth-child(5) {
    transform: rotate(120deg);
    opacity: 0.67;
}

.ios-spinner .bar:nth-child(6) {
    transform: rotate(150deg);
    opacity: 0.58;
}

.ios-spinner .bar:nth-child(7) {
    transform: rotate(180deg);
    opacity: 0.5;
}

.ios-spinner .bar:nth-child(8) {
    transform: rotate(210deg);
    opacity: 0.42;
}

.ios-spinner .bar:nth-child(9) {
    transform: rotate(240deg);
    opacity: 0.33;
}

.ios-spinner .bar:nth-child(10) {
    transform: rotate(270deg);
    opacity: 0.25;
}

.ios-spinner .bar:nth-child(11) {
    transform: rotate(300deg);
    opacity: 0.17;
}

.ios-spinner .bar:nth-child(12) {
    transform: rotate(330deg);
    opacity: 0.08;
}

/* 회전 애니메이션 */
.pull-to-refresh.refreshing .ios-spinner {
    animation: ios-spin 1s steps(12) infinite;
}

@keyframes ios-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 당기는 동안 회전 효과 */
.pull-to-refresh.pulling .ios-spinner {
    transition: transform 0.1s ease-out;
}

/* ============================================
   스켈레톤 로딩 (Phase 1-3)
   ============================================ */
.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-header {
    width: 40%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 16px;
}

.skeleton-balls {
    display: flex;
    gap: 8px;
}

.skeleton-ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.skeleton-text {
    height: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 30%;
}

.skeleton-text.medium {
    width: 60%;
}

.skeleton-text.long {
    width: 90%;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* 라이트 테마 스켈레톤 */
[data-theme="light"] .skeleton-header,
[data-theme="light"] .skeleton-ball,
[data-theme="light"] .skeleton-text {
    background: rgba(0, 0, 0, 0.08);
}

/* ============================================
   글로벌 로더 (Phase 1-3)
   ============================================ */
#globalLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

#globalLoader.active {
    opacity: 1;
    visibility: visible;
}

.global-loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.global-loader-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   버튼 로딩 상태 (Phase 1-3)
   ============================================ */
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading span,
.btn.loading i {
    visibility: hidden;
}

/* ============================================
   마이크로인터랙션 (Phase 3-1)
   ============================================ */

/* 게임 행 호버 효과 */
.game-row {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-row:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--primary),
        0 4px 12px rgba(255, 215, 0, 0.15);
}

/* 버튼 리플 효과 */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    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-primary:active::after {
    width: 300px;
    height: 300px;
}

/* 번호 공 팝 애니메이션 */
@keyframes ballPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.ball.animate {
    animation: ballPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.ball.animate:nth-child(1) {
    animation-delay: 0.05s;
}

.ball.animate:nth-child(2) {
    animation-delay: 0.1s;
}

.ball.animate:nth-child(3) {
    animation-delay: 0.15s;
}

.ball.animate:nth-child(4) {
    animation-delay: 0.2s;
}

.ball.animate:nth-child(5) {
    animation-delay: 0.25s;
}

.ball.animate:nth-child(6) {
    animation-delay: 0.3s;
}

/* 카드 호버 효과 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 메뉴 아이템 호버 애니메이션 */
.menu-item {
    transition: all 0.2s ease;
}

.menu-item:hover {
    transform: translateX(4px);
}

.menu-item:hover i {
    transform: scale(1.1);
}

/* 번호 선택 버튼 효과 */
.number-grid button {
    transition: all 0.15s ease;
}

.number-grid button:hover {
    transform: scale(1.1);
    z-index: 1;
}

.number-grid button:active {
    transform: scale(0.95);
}

/* 당첨 축하 번호 공 강조 */
.ball.matched {
    animation: matchedPulse 1s ease-in-out infinite;
}

@keyframes matchedPulse {

    0%,
    100% {
        box-shadow: 0 0 0 3px var(--success), 0 0 12px var(--success);
    }

    50% {
        box-shadow: 0 0 0 6px var(--success), 0 0 20px var(--success);
    }
}

/* 페이드 인 애니메이션 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
}

/* 탭 전환 애니메이션 */
.tab-content {
    animation: fadeInUp 0.3s ease;
}

/* 햅틱 피드백 힌트 (터치 디바이스) */
@media (hover: none) {

    .btn:active,
    .menu-item:active,
    .nav-item:active {
        opacity: 0.8;
    }
}
/* ============================================
   GPT-5.2 분석 카드 스타일
   ============================================ */
.gpt-analysis-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.gpt-analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.gpt-analysis-header i {
    font-size: 1.1rem;
}

.gpt-analysis-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 라이트 테마 */
[data-theme="light"] .gpt-analysis-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

[data-theme="light"] .gpt-analysis-content {
    color: var(--text-primary);
}
