/* ============================================
   로또 전문가 웹사이트 - 프리미엄 디자인 시스템
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@600;700;800&family=Roboto+Mono:wght@500;600&display=swap');

/* ============================================
   CSS Variables - Design Tokens
   ============================================ */
:root {
    /* Colors - Light Mode */
    --color-primary: linear-gradient(135deg, #00ff15 0%, #00ff15 100%);
    --color-primary-solid: #4ddf20;
    --color-primary-dark: #FFA500;
    --color-secondary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --color-secondary-solid: #6366F1;
    --color-accent: #10B981;
    --color-accent-dark: #059669;

    /* Luxury Tokens */
    --color-gold: linear-gradient(135deg, #D4AF37 0%, #C5A028 100%);
    --color-gold-solid: #D4AF37;
    --color-platinum: linear-gradient(135deg, #E5E4E2 0%, #CECDC9 100%);
    --color-bronze: #CD7F32;
    --bg-luxury-card: rgba(255, 255, 255, 0.9);
    --shadow-luxury: 0 10px 30px -5px rgba(0, 0, 0, 0.05);

    /* Status Colors */
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-warning: #ffc107;
    --color-info: #17a2b8;

    /* Background */
    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.1);

    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Border */
    --border-color: #E2E8F0;
    --border-color-hover: #CBD5E1;

    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(255, 215, 0, 0.3);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    /* Lotto Ball Colors */
    --ball-yellow: #db8d19;
    --ball-blue: #2196F3;
    --ball-red: #F44336;
    --ball-gray: #9E9E9E;
    --ball-green: #4CAF50;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #64748B;

    --border-color: #334155;
    --border-color-hover: #475569;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-base), color var(--transition-base);
    min-height: 100vh;
    font-variant-numeric: lining-nums;
    font-feature-settings: 'zero' 0;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--space-md);
}

/* ============================================
   Layout Components
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-lg) 0;
    position: sticky;
    top: 0;
    z-index: 800;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.0 rem;
    font-weight: 400;
    background: var(--color-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
}

.logo-icon {
    font-size: 1.0 rem;
}

.nav {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 380;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--color-primary-solid);
    background: var(--bg-tertiary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--color-primary);
    border-radius: var(--radius-full);
}

/* Sub Navigation */
.sub-nav {
    display: flex;
    gap: 3px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    justify-content: flex-start;
    flex-wrap: wrap;
    overflow-x: visible;
    overflow-y: visible;
    position: relative;
    z-index: 1;
}

.sub-nav::-webkit-scrollbar {
    height: 8px;
}

.sub-nav::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    margin: 0 var(--space-sm);
}

.sub-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--color-primary-solid), var(--color-accent));
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-tertiary);
    transition: all var(--transition-base);
}

.sub-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary-solid));
    box-shadow: 0 0 8px rgba(77, 223, 32, 0.5);
}

.sub-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-size: 0.75rem;
    white-space: nowrap;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sub-nav-link:hover {
    color: var(--color-primary-solid);
    background: var(--bg-tertiary);
    border-color: var(--color-primary-solid);
    transform: translateY(-1px);
}

.sub-nav-link.active {
    color: var(--text-inverse);
    background: var(--color-primary-solid);
    border-color: var(--color-primary-solid);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Card Components
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

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

.card-glass {
    background: var(--bg-glass);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ============================================
   Button Components
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--color-primary);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--color-secondary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover:not(:disabled) {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-accent {
    background: var(--color-accent);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
}

.btn-accent:hover:not(:disabled) {
    background: var(--color-accent-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.btn-outline:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-color-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
}

.btn-xs {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: 1.125rem;
}

/* ============================================
   Form Components
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.form-input,
.form-select {
    width: 100%;
    padding: var(--space-md);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

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

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

/* ============================================
   Lotto Ball Component
   ============================================ */
.lotto-ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    font-feature-settings: 'zero' 0;
    /* 0에 점 제거 */
}

.lotto-ball:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-lg);
}

.lotto-ball.size-xs {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
}

.lotto-ball.size-sm {
    width: 36px;
    height: 36px;
    font-size: 0.875rem;
}

.lotto-ball.size-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

/* Generic ball style for hot/cold display */
.ball {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    /* Smaller size for display in summary */
    height: 36px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-inverse);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
    /* Prevent shrinking in flex containers */
    will-change: transform;
    font-feature-settings: 'zero' 0;
    /* 0에 점 제거 */
}

/* Ball colors based on number ranges */
.ball.color-1,
.lotto-ball.color-1 {
    background-color: var(--ball-yellow);
}

.ball.color-2,
.lotto-ball.color-2 {
    background-color: var(--ball-blue);
}

.ball.color-3,
.lotto-ball.color-3 {
    background-color: var(--ball-red);
}

.ball.color-4,
.lotto-ball.color-4 {
    background-color: var(--ball-gray);
}

.ball.color-5,
.lotto-ball.color-5 {
    background-color: var(--ball-green);
}


/* Specific hot/cold/normal ball styles */
.ball.hot-ball {
    background: var(--color-danger);
}

.ball.cold-ball {
    background: var(--color-info);
}

.ball.normal-ball {
    background: var(--ball-gray);
    /* Using a neutral gray for normal numbers */
}

.bonus-separator {
    color: var(--text-tertiary);
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0 var(--space-sm);
}

/* ============================================
   Grid System
   ============================================ */
.grid {
    display: grid;
    gap: var(--space-lg);
}

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

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
}

.grid-cols-2>section>.card {
    height: 100%;
}

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

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-cols-9,
.grid-9-cols {
    grid-template-columns: repeat(9, 1fr);
}

.grid-cols-15 {
    grid-template-columns: repeat(15, 1fr);
}

.grid-sidebar {
    grid-template-columns: 350px 1fr;
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mt-2xl {
    margin-top: var(--space-2xl);
}

.mb-sm {
    margin-bottom: var(--space-sm);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.mb-lg {
    margin-bottom: var(--space-lg);
}

.mb-xl {
    margin-bottom: var(--space-xl);
}

.mb-2xl {
    margin-bottom: var(--space-2xl);
}

.hidden {
    display: none;
}

.h-full {
    height: 100%;
}

.flex-1 {
    flex: 1;
}

/* ============================================
   Dark Mode Toggle
   ============================================ */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.theme-toggle:hover {
    background: var(--bg-card);
    transform: rotate(20deg);
}


/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    body {
        overflow-x: hidden;
    }

    .container {
        padding: 0 var(--space-sm);
        max-width: 100%;
        overflow-x: hidden;
    }

    .header {
        padding: var(--space-sm) 0;
        overflow-x: hidden;
    }

    .header-content {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* 메인 컨텐츠 여백 축소 */
    .mt-2xl {
        margin-top: var(--space-lg);
    }

    .mb-2xl {
        margin-bottom: var(--space-lg);
    }

    .mb-xl {
        margin-bottom: var(--space-md);
    }

    /* 로또 공 크기 축소 */
    .lotto-ball {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .lotto-ball.size-lg {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 6px 2px;
        font-size: 0.65rem;
        line-height: 1.2;
        min-height: 42px;
        max-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
        word-break: keep-all;
        overflow-wrap: anywhere;
        white-space: normal;
        box-sizing: border-box;
        hyphens: auto;
    }

    .nav-link.active::after {
        display: none;
    }

    .theme-toggle {
        grid-column: span 4;
        width: 100%;
        min-height: 42px;
        padding: 6px;
        font-size: 1.2rem;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .grid-sidebar {
        grid-template-columns: 1fr;
    }

    .card {
        padding: var(--space-md);
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Lotto Machine - 모바일에서 크기 축소 */
    .lotto-machine {
        width: 75vw;
        max-width: 300px;
        height: 75vw;
        max-height: 300px;
    }

    /* 번호 선택기 모바일 최적화 */
    .grid-5-cols,
    .grid-9-cols {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Lotto Paper 모바일 최적화 */
    .lotto-paper {
        padding: var(--space-sm) var(--space-md);
    }

    .lotto-row-numbers {
        font-size: 1.2rem;
    }

    /* 서브 네비게이션 모바일 최적화 */
    .sub-nav {
        padding: 10px;
        gap: 8px;
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
        border-width: 3px;
    }

    .sub-nav::-webkit-scrollbar {
        height: 12px;
    }

    .sub-nav::-webkit-scrollbar-thumb {
        background: var(--color-primary-solid);
        border-radius: var(--radius-full);
        border: 2px solid var(--bg-secondary);
    }

    .sub-nav-link {
        flex: 0 0 auto;
        padding: 12px 16px;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--text-primary);
        background: var(--bg-primary);
        border: 2px solid var(--border-color);
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

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

    .sub-nav-link:hover {
        background: var(--bg-tertiary);
        color: var(--color-primary-solid);
        border-color: var(--color-primary-solid);
    }

    .sub-nav-link.active {
        background: var(--color-primary-solid);
        color: white;
        border-color: var(--color-primary-solid);
        font-weight: 700;
        box-shadow: 0 2px 8px rgba(77, 223, 32, 0.4);
    }

    /* 버튼 터치 친화적 크기 */
    .btn {
        min-height: 44px;
        padding: var(--space-md) var(--space-lg);
    }

    .btn-sm {
        min-height: 36px;
    }

    .btn-xs {
        min-height: 32px;
    }
}

/* 매우 작은 화면 (아이폰 SE, 갤럭시 폴드 등) */
@media (max-width: 380px) {
    .nav {
        gap: 2px;
    }

    .nav-link {
        padding: 4px 1px;
        font-size: 0.6rem;
        min-height: 38px;
    }

    .container {
        padding: 0 2px;
    }

    .theme-toggle {
        font-size: 1rem;
        min-height: 38px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

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

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

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

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

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

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

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

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary-solid);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-card) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ============================================
   Additional Utility Classes
   ============================================ */
.sticky-top {
    position: sticky;
    top: 50px;
}

.grid-5-cols {
    grid-template-columns: repeat(7, 1fr);
}

.grid-5-cols {
    grid-template-columns: repeat(7, 1fr);
}

.gap-xs {
    gap: var(--space-xs);
}

.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.w-full {
    width: 100%;
}

.p-2xl {
    padding: var(--space-2xl);
}


/* ============================================
   Premium Frequency Chart
   ============================================ */
.freq-chart-container {
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    /* Subtle base shadow */
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.freq-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    /* Mobile default */
    gap: var(--space-sm);
}

@media (min-width: 768px) {
    .freq-grid {
        grid-template-columns: repeat(9, 1fr);
        /* 9 columns for 45 numbers */
        gap: var(--space-md);
    }
}

.freq-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 110px;
    /* Reduced height for compact view */
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-lg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    /* Removed background for clean look, only show on hover if needed */
}

.freq-item:hover {
    transform: translateY(-8px);
}

.freq-number {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    /* Reduced size for compact view */
    font-weight: 600;
    /* Bolder for better visibility when smaller */
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    transition: color 0.3s ease;
}

.freq-item:hover .freq-number {
    color: var(--text-primary);
    font-weight: 700;
}

.freq-bar-track {
    width: 14px;
    /* Doubled width */
    height: 100%;
    /* Fills the remaining space */
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}



.freq-bar {
    width: 100%;
    /* Default gradient is neutral/silver */
    background: var(--color-platinum);
    border-radius: var(--radius-full);
    transition: height 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    /* Slower, smoother */
}

/* Range-based Colors */
.freq-bar-yellow {
    background: linear-gradient(to top, #F59E0B, #FFD700);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.freq-bar-blue {
    background: linear-gradient(to top, #3B82F6, #60A5FA);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.freq-bar-red {
    background: linear-gradient(to top, #EF4444, #F87171);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.freq-bar-gray {
    background: linear-gradient(to top, #6B7280, #9CA3AF);
    box-shadow: 0 0 10px rgba(107, 114, 128, 0.2);
}

.freq-bar-green {
    background: linear-gradient(to top, #10B981, #34D399);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* Text Colors for Frequency Numbers */
.text-ball-yellow {
    color: #d97706;
}

/* Darker amber for visibility on white */
.text-ball-blue {
    color: #2563EB;
}

.text-ball-red {
    color: #DC2626;
}

.text-ball-gray {
    color: #4B5563;
}

.text-ball-green {
    color: #059669;
}

/* Horizontal Range Bars */
.range-bar-track {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.range-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

.freq-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    opacity: 1;
    /* Always visible */
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

/* Hover effect for count - maybe scale slightly? */
.freq-item:hover .freq-count {
    transform: scale(1.05);
}

/* Rank Indicator (Crown) */
.freq-rank {
    position: absolute;
    top: -5px;
    right: 50%;
    transform: translateX(50%);
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.5s ease;
}

.freq-item.is-top-3 .freq-rank {
    opacity: 1;
    top: -15px;
    /* Float up */
}

/* Pairing Frequency Grid */
.pairing-frequency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
}

.pairing-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.pairing-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pairing-rank {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    min-width: 35px;
}

.pairing-count {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-accent-dark);
    font-family: var(--font-mono);
}

/* Animation delays */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* Font sizes */
.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 2rem;
}

/* Font weights */
.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.font-mono {
    font-family: var(--font-mono);
    font-feature-settings: 'zero' 0;
    /* 0에 점 제거 */
}

/* Flex utilities */
.flex-1 {
    flex: 1;
}

/* Additional text sizes */
.text-5xl {
    font-size: 2.5rem;
}

.text-6xl {
    font-size: 3rem;
}

/* Margin utilities */
.m-0 {
    margin: 0;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Width utilities */
.w-20 {
    width: 5rem;
}

.w-24 {
    width: 6rem;
}

.w-30 {
    width: 30px;
}

/* Display utilities */
.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* Position utilities */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

/* Overflow utilities */
.overflow-hidden {
    overflow: hidden;
}

/* Transition utilities */
.transition-height {
    transition: height 0.5s ease;
}

/* Height utilities */
.h-60 {
    height: 60px;
}

/* Positioning helpers */
.bottom-0 {
    bottom: 0;
}

.left-0 {
    left: 0;
}

.right-0 {
    right: 0;
}

/* Gradient text */
.gradient-text-primary {
    background: var(--color-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-secondary {
    background: var(--color-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-accent {
    background: var(--color-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Text colors */
.text-danger {
    color: var(--color-danger);
}

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

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

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

/* Text decoration */
.no-underline {
    text-decoration: none;
}

.text-underline {
    text-decoration: underline !important;
}

/* Specific underline for h3 titles */
h3.text-underline {
    text-decoration: underline !important;
    text-underline-offset: 4px;
    font-size: 1rem;
}

/* Compact button style */
.btn-compact {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

/* Additional animation delays */
.delay-500 {
    animation-delay: 0.5s;
}

.delay-600 {
    animation-delay: 0.6s;
}

.delay-700 {
    animation-delay: 0.7s;
}

.delay-800 {
    animation-delay: 0.8s;
}

.delay-900 {
    animation-delay: 0.9s;
}

.delay-1000 {
    animation-delay: 1s;
}

.delay-1100 {
    animation-delay: 1.1s;
}

/* Background utilities */
.bg-tertiary {
    background: var(--bg-tertiary);
}

/* Border radius utilities */
.rounded-md {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

/* Color utilities */
.bg-primary {
    background: var(--color-primary);
}

.bg-secondary {
    background: var(--color-secondary);
}

.bg-accent {
    background: var(--color-accent);
}


/* Lotto Paper Component */
.lotto-paper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-xl);
    /* Minimized vertical padding */
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-md);
    color: #1a202c;
    width: 100%;
    /* Full width */
    max-width: none;
    /* Remove max-width limit */
    margin-left: auto;
    margin-right: auto;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
    overflow: hidden;
}

/* Zigzag border effect */
.lotto-paper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(-45deg, transparent 16px, #fff 0), linear-gradient(45deg, transparent 16px, #fff 0);
    background-size: 20px 20px;
    background-repeat: repeat-x;
}

.lotto-paper::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: repeating-linear-gradient(to right, transparent, transparent 4px, #e2e8f0 4px, #e2e8f0 8px);
}

.lotto-paper-header {
    border-bottom: 2px dashed #000;
    padding-bottom: 4px;
    /* Minimal padding */
    margin-bottom: var(--space-xs);
    position: relative;
    min-height: 40px;
}

.lotto-row {
    display: flex;
    align-items: center;
    padding: 0;
    border-bottom: 1px dashed #e2e8f0;
    height: 32px;
    /* Slightly increased height for better spacing */
}

.lotto-row:last-child {
    border-bottom: none;
    padding-bottom: var(--space-xs);
    /* Minimal bottom padding */
}

.lotto-row-label {
    font-weight: 800;
    width: 30px;
    /* Slightly wider */
    font-size: 1.25rem;
    color: #000;
}

.lotto-row-type {
    font-size: 0.8rem;
    color: #4a5568;
    margin-right: var(--space-md);
    width: 40px;
    font-weight: 600;
    text-align: center;
}

.lotto-row-numbers {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Center align items */
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1.5rem;
    /* Larger font size */
    font-weight: 700;
    color: #000;
    padding-right: var(--space-md);
    letter-spacing: -1px;
    /* Tighter letter spacing to prevent overflow if needed */
    font-feature-settings: 'zero' 0;
    /* 0에 점 제거 */
}

.paper-meta {
    margin-top: var(--space-sm);
    padding-top: var(--space-xs);
    border-top: 2px solid #000;
    text-align: center;
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: var(--space-lg);
}

.save-btn-mini {
    opacity: 0.2;
    transition: opacity 0.2s;
    cursor: pointer;
    font-size: 1rem;
    border: none;
    background: none;
    padding: 0;
}

.lotto-row:hover .save-btn-mini {
    opacity: 1;
}

/* ============================================
   Draw Range Filter
   ============================================ */
.draw-range-filter {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on smaller screens */
    align-items: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.draw-range-filter .form-group {
    margin-bottom: 0;
    /* Override default margin from .form-group */
    flex: 1 1 150px;
    /* Allow items to grow and shrink */
}

.draw-range-filter .btn {
    flex-shrink: 0;
    /* Prevent button from shrinking */
    height: calc(2 * var(--space-md) + 1rem + 2px);
    /* Match input height */
}


/* ============================================
   Scroll Container
   ============================================ */
.scroll-container {
    max-height: calc(200vh - 140px);
    overflow-y: auto;
    padding-right: var(--space-sm);
    /* Custom Scrollbar */
    /* Webkit-based browsers handled below */
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

.scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-full);
}

.scroll-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-tertiary);
}

/* ============================================
   Top Button
   ============================================ */
.btn-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(255, 165, 0, 0.4);
}

/* ============================================

   Lotto Machine

   ============================================ */

.lotto-machine {

    position: relative;

    width: 500px;

    height: 500px;

    margin: 0 auto;

    border: 5px solid var(--border-color);

    border-radius: 50%;

    background: var(--bg-glass);

    overflow: hidden;

}



.lotto-machine-body {

    width: 100%;

    height: 100%;

    position: relative;

}



#lotto-balls-container .ball.color-1 {
    background-color: var(--ball-yellow);
}

#lotto-balls-container .ball.color-2 {
    background-color: var(--ball-blue);
}

#lotto-balls-container .ball.color-3 {
    background-color: var(--ball-red);
}

#lotto-balls-container .ball.color-4 {
    background-color: var(--ball-gray);
}

#lotto-balls-container .ball.color-5 {
    background-color: var(--ball-green);
}



.lotto-machine-chute {

    position: absolute;

    bottom: -10px;

    left: 50%;

    transform: translateX(-50%);

    width: 50px;

    height: 60px;

    background: var(--border-color);

    border-radius: 5px 5px 0 0;

}



#drawn-numbers-container .lotto-ball {

    animation: fallIn 0.5s ease-out forwards;

    opacity: 0;

}



@keyframes fallIn {

    from {

        transform: translateY(-20px) scale(0.5);

        opacity: 0;

    }

    to {

        transform: translateY(0) scale(1);

        opacity: 1;

    }

}



/* Analyzer Specific Styles */

.score-text {

    font-size: 4rem;

    font-weight: 800;

    background: var(--color-primary);

    -webkit-background-clip: text;

    background-clip: text;

    -webkit-text-fill-color: transparent;

    margin-bottom: var(--space-md);

}



.text-gold-solid {
    color: var(--color-gold-solid);
}



.lotto-ball.analyzer-small {



    width: 2rem;



    height: 2rem;



    font-size: 0.875rem;



}







.heatmap-grid {



    grid-template-columns: repeat(9, 1fr);
    /* 9 columns for 1-45 numbers */



    gap: var(--space-xs);



    padding: var(--space-md);



    background: var(--bg-tertiary);



    border-radius: var(--radius-md);



}







.heatmap-cell {



    width: 100%;



    aspect-ratio: 1 / 1;
    /* Make cells square */



    background: var(--bg-secondary);
    /* Default background for unselected numbers */



    color: var(--text-primary);



    border: 1px solid var(--border-color);



    transition: all var(--transition-fast);



    cursor: default;
    /* Not interactive here, so default cursor */



    display: flex;
    /* Added for centering content */



    align-items: center;
    /* Added for centering content */



    justify-content: center;
    /* Added for centering content */



}







.heatmap-cell:hover {



    transform: scale(1.05);



    box-shadow: var(--shadow-sm);



    z-index: 1;
    /* Bring to front on hover */



}







.heatmap-cell.selected-number {



    background: var(--color-primary-solid);
    /* Primary color for selected numbers */



    color: var(--text-inverse);



    border-color: var(--color-primary-solid);



    box-shadow: var(--shadow-md);



    transform: scale(1.08);



}







/* Hot/Cold/Normal frequency colors */



.heatmap-cell.hot-freq {



    background-color: var(--color-danger);



    color: var(--text-inverse);



}



.heatmap-cell.normal-freq {



    background-color: var(--color-accent);



    color: var(--text-inverse);



}



.heatmap-cell.cold-freq {



    background-color: var(--color-info);



    color: var(--text-inverse);



}







/* Specific styling for when a selected number is also hot/normal/cold */



.heatmap-cell.selected-number.hot-freq {



    background: linear-gradient(135deg, var(--color-danger), #ff6f61);



    border-color: #ff6f61;



}



.heatmap-cell.selected-number.normal-freq {



    background: linear-gradient(135deg, var(--color-accent), #4CAF50);



    border-color: #4CAF50;



}



.heatmap-cell.selected-number.cold-freq {



    background: linear-gradient(135deg, var(--color-info), #5BCAFF);



    border-color: #5BCAFF;



}







/* Adjust text color for better contrast on hot/cold backgrounds if needed */



.heatmap-cell.hot-freq,



.heatmap-cell.normal-freq,



.heatmap-cell.cold-freq {



    color: var(--text-inverse);



}







/* Ensure hot/cold/normal styles apply to lotto-ball */



.lotto-ball.hot-ball {
    background-color: var(--color-danger);
}



.lotto-ball.normal-ball {
    background-color: var(--color-success);
}



.lotto-ball.cold-ball {
    background-color: var(--color-info);
}







/* Specific styling for lotto balls within the lotto paper rows */



.lotto-row-numbers .lotto-ball {



    width: 32px;
    /* Smaller size for paper display */



    height: 32px;



    font-size: 1.25rem;
    /* Matches old text-xl size */



    flex-shrink: 0;
    /* Prevent shrinking */
}

/* ============================================
   Prize Table Styles
   ============================================ */
.prize-table {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.prize-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1.5fr 2fr;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

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

.prize-row:hover:not(.prize-header) {
    background-color: var(--bg-tertiary);
}

.prize-header {
    background: #2d3748;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

/* Winner types cell styling */
.winner-types-cell {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
    justify-content: center;
}

/* Winner Type Icons */
.winner-type-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.winner-type-badge.auto {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.winner-type-badge.manual {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.winner-type-badge.semi {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.rank-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
}

.rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
    color: #000;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.4);
    color: #000;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
    color: #000;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.rank-badge.rank-4 {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
}

.rank-badge.rank-5 {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.prize-row>div {
    font-size: 0.95rem;
}

/* 모든 당첨금 셀에 동일한 스타일 적용 */
[id^="amount-"] {
    font-weight: 700;
    color: #059669;
}

/* Winner Type Stats */
.winner-type-stats-hidden {
    display: none;
}

/* Toggle Stores Button */
.toggle-stores-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.toggle-stores-btn:hover {
    background: var(--bg-card);
    border-color: var(--color-primary-solid);
}

.toggle-stores-btn:active {
    transform: scale(0.98);
}

#toggle-icon {
    font-size: 0.875rem;
    transition: transform var(--transition-base);
}

.toggle-stores-btn.active #toggle-icon {
    transform: rotate(180deg);
}

/* Winner Stores List */
.winner-stores-list {
    margin-top: var(--space-md);
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.winner-stores-hidden {
    max-height: 0;
    margin-top: 0;
}

.store-item {
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    transition: all var(--transition-base);
}

.store-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-primary-solid);
    transform: translateX(4px);
}

.store-item:last-child {
    margin-bottom: 0;
}

.store-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.store-type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-primary-solid);
    color: white;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.store-type.auto {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.store-type.manual {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.store-type.semi {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.store-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .prize-row {
        grid-template-columns: 80px 1fr 1fr;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }

    .rank-badge {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.8rem;
    }
}

/* ============================================
   Match Result Card Styles
   ============================================ */
.match-result-hidden {
    display: none;
}

.toggle-match-result-btn {
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    margin-bottom: var(--space-md);
}

.toggle-match-result-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--color-primary-solid);
}

.toggle-match-result-btn.active {
    border-color: var(--color-primary-solid);
}

.toggle-match-result-btn .toggle-icon {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.toggle-match-result-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.match-result-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, border-width 0.4s ease;
}

.match-result-content.match-result-collapsed {
    max-height: 0 !important;
    padding: 0 var(--space-xl);
    border-width: 0;
}

.match-result-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.match-result-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
}

.match-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.match-result-rank {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
}

.match-result-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
}

.match-winning-balls {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}

.match-bonus-ball {
    display: flex;
}

.match-plus {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 var(--space-xs);
}

.match-result-rank-badge {
    display: inline-block;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.match-result-rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.match-result-rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #000;
}

.match-result-rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: #000;
}

.match-result-rank-badge.rank-4 {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
}

.match-result-rank-badge.rank-5 {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.match-result-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-xs);
}

.match-result-round {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.match-result-count {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.no-match-message {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   Generator Page Optimizations
   ============================================ */
/* Reduce spacing in generator sidebar to fit buttons in viewport */
.grid-sidebar .card .form-group {
    margin-bottom: var(--space-md);
}

.grid-sidebar .card {
    padding: var(--space-lg);
}

.grid-sidebar .card .card-title {
    margin-bottom: var(--space-md);
}

/* Reduce top margin of action buttons section */
.grid-sidebar .card .form-group+.flex.flex-col {
    margin-top: var(--space-md);
}

/* Reduce text size in number selectors */
.grid-sidebar .form-group p {
    margin-top: var(--space-xs);
    font-size: 0.875rem;
}

/* 번호 생성 페이지 - 선택 박스와 입력 박스 크기 축소 */
.grid-sidebar .form-input,
.grid-sidebar .form-select {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.9rem;
}

/* 번호 생성 페이지 - 초기화 버튼 크기 축소 */
.grid-sidebar .btn-xs {
    padding: 8px 12px;
    font-size: 0.85rem;
    min-height: 0;
    line-height: 1.3;
}

/* Saved numbers section header alignment */
.saved-numbers-header {
    margin-left: var(--space-lg);
}

.saved-numbers-title {
    margin-left: var(--space-sm);
}

.saved-numbers-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    display: block;
    margin: 0;
    flex-shrink: 0;
}

/* 저장된 번호 섹션 하단 여백 (사이드바와 동일하게) */
#saved-section {
    margin-bottom: var(--space-2xl);
}

/* 저장된 번호 카드 간격 축소 */
#saved-container .card {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
}

#saved-container .flex {
    margin-bottom: var(--space-xs);
}

/* 저장된 번호 날짜/시간 다크모드 스타일 */
[data-theme="dark"] #saved-container span[style*="text-tertiary"] {
    color: #FFFFFF !important;
}

/* 생성된 번호 헤더 정렬 */
.scroll-container > .card:first-child .card-title {
    line-height: 1;
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

/* ============================================
   Progress Bar Styles
   ============================================ */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary-solid));
    transition: width 0.3s ease;
}

/* ============================================
   Number Statistics Styles
   ============================================ */
.number-stats {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: var(--space-sm);
    animation: fadeIn 0.5s ease-out;
}

.stat-item {
    flex: 1 1 auto;
    min-width: 100px;
    max-width: 140px;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.stat-item:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-solid);
}

.stat-sum {
    background: linear-gradient(135deg, rgba(77, 223, 32, 0.05) 0%, rgba(77, 223, 32, 0.02) 100%);
}

.stat-ratio {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
}

.stat-highlow {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, rgba(236, 72, 153, 0.02) 100%);
}

.stat-zone {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.stat-consecutive {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(168, 85, 247, 0.02) 100%);
}

.stat-ac {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.05) 0%, rgba(244, 114, 182, 0.02) 100%);
}

.stat-icon {
    font-size: 1.5rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}


.stat-item:hover .stat-icon {
    animation: spin 0.6s ease-in-out;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.stat-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, #00ff15 0%, #4ddf20 50%, #00ff15 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-ratio .stat-value {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #6366F1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-highlow .stat-value {
    background: linear-gradient(135deg, #EC4899 0%, #F472B6 50%, #EC4899 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-zone .stat-value {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 50%, #3B82F6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-consecutive .stat-value {
    background: linear-gradient(135deg, #A855F7 0%, #C084FC 50%, #A855F7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-ac .stat-value {
    background: linear-gradient(135deg, #F472B6 0%, #FBCFE8 50%, #F472B6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

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

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

.stat-sum {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.stat-ratio {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.stat-highlow {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.stat-zone {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.stat-consecutive {
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.stat-ac {
    animation: fadeInUp 0.6s ease-out 0.6s both;
}

@media (max-width: 1024px) {
    .number-stats {
        flex-wrap: wrap;
    }

    .stat-item {
        min-width: 90px;
        max-width: 130px;
    }
}

@media (max-width: 768px) {
    .number-stats {
        gap: var(--space-xs);
        flex-wrap: wrap;
    }

    .stat-item {
        min-width: 80px;
        max-width: 110px;
        padding: var(--space-xs) var(--space-sm);
    }

    .stat-icon {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }
}

@media (max-width: 640px) {
    .number-stats {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .stat-item {
        min-width: calc(33% - 8px);
        max-width: calc(33% - 8px);
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-icon {
        font-size: 1rem;
    }
}

/* ============================================
   Analysis Card Styles (Statistics Page)
   ============================================ */
.analysis-card {
    padding: var(--space-lg);
}

.analysis-title {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-color);
    display: inline-block;
}

.analysis-hint {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

.cycle-result-box {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.cycle-result-box.hidden {
    display: none;
}

.cycle-result-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.cycle-count-info {
    font-size: 0.85rem;
    color: var(--color-accent);
    margin-bottom: var(--space-md);
    font-weight: 600;
}

.cycle-rounds-detail {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

/* ============================================
   Scroll to Top Button
   ============================================ */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, var(--color-primary-solid) 0%, var(--color-accent) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 20px rgba(77, 223, 32, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 1000;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary-solid) 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 0 30px rgba(77, 223, 32, 0.5);
    transform: translateY(-3px) scale(1.05);
}

.scroll-to-top:active {
    transform: translateY(-1px) scale(0.98);
}

@media (max-width: 768px) {
    .scroll-to-top {
        width: 3rem;
        height: 3rem;
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 1.25rem;
    }
}

/* ============================================
   Prediction Analysis Warning Cards
   ============================================ */
.warning-card {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

[data-theme="dark"] .warning-card {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
}

.analysis-detail-box {
    background: #f8f9fa;
    border-radius: 4px;
}

[data-theme="dark"] .analysis-detail-box {
    background: rgba(255, 255, 255, 0.05);
}

.analysis-text {
    color: #495057;
}

[data-theme="dark"] .analysis-text {
    color: var(--text-secondary);
}

/* ============================================
   Lotto Loading Indicator (Auto Update)
   ============================================ */
.lotto-loading-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 900;
    background: var(--bg-secondary);
    border: 2px solid var(--color-primary-solid);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 20px rgba(77, 223, 32, 0.2);
    animation: slideInRight 0.3s ease-out;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.lotto-loading-content {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.lotto-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary-solid);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.lotto-loading-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.lotto-fade-out {
    animation: fadeOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

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

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@media (max-width: 768px) {
    .lotto-loading-indicator {
        top: 70px;
        right: 10px;
        left: 10px;
        padding: var(--space-sm) var(--space-md);
    }

    .lotto-loading-text {
        font-size: 0.75rem;
    }

    .lotto-spinner {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
}