:root {
    --primary-color: #10b981;
    --secondary-color: #3b82f6;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-bg: #0a0a0b;
    --light-bg: #111112;
    --card-bg: #1a1a1c;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --text-light: #71717a;
    --border-color: #27272a;
    --metallic-silver: #94a3b8;
    --metallic-gold: #fbbf24;
    --metallic-copper: #ea580c;
    --metallic-dark: #18181b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.9);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.95);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.95);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.98);
    --gradient-primary: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --gradient-silver: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    --gradient-dark: linear-gradient(135deg, #18181b 0%, #27272a 100%);
}

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

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

body {
    font-family: 'NanumSquare Neo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden; /* 가로 스크롤 완전 차단 */
    max-width: 100vw;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(16, 185, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: radial-gradient(ellipse at center, 
        rgba(16, 185, 129, 0.4) 0%, 
        rgba(16, 185, 129, 0.2) 25%, 
        rgba(59, 130, 246, 0.15) 50%, 
        transparent 70%);
    animation: gentle-pulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--metallic-dark) 100%);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}


@keyframes gentle-pulse {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(1) rotate(0deg);
    }
    50% { 
        opacity: 0.6;
        transform: scale(1.2) rotate(180deg);
    }
}


.header-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.header h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.site-logo {
    width: 40px;
    height: 40px;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.logo-icon {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

.site-name {
    font-size: 28px;
    font-weight: 900;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
}

.site-name-en {
    font-size: 14px;
    font-weight: 700;
    color: var(--metallic-silver);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-tagline {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    border-left: 2px solid var(--border-color);
    padding-left: 12px;
    margin-left: 8px;
}

.header-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.info-item .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-item .value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Main Dashboard */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* AI Recommendation Section */
.recommendation-section {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.15);
    backdrop-filter: blur(15px);
    width: 100%;
    box-sizing: border-box;
}

.recommendation-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
    animation: rotate 40s linear infinite;
}

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

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.section-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 20px;
    padding: 0 4px;
    opacity: 0.9;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}

.section-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.badge {
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(100, 116, 139, 0.1) 100%);
    color: var(--metallic-silver);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Recommendation Layout */
.recommendation-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
    width: 100%;
    transition: all 0.3s ease;
}

.strategy-panel,
.results-panel {
    background: linear-gradient(135deg, rgba(26, 26, 28, 0.6) 0%, rgba(39, 39, 42, 0.4) 100%);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.strategy-panel h3,
.results-panel h3 {
    color: var(--text-primary);
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 600;
    text-shadow: 0 0 15px rgba(148, 163, 184, 0.3);
}

/* Strategy Options */
.strategy-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.strategy-option {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    background: linear-gradient(135deg, rgba(39, 39, 42, 0.4) 0%, rgba(24, 24, 27, 0.6) 100%);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.strategy-option:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.strategy-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.option-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.option-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.option-desc {
    font-size: 11px;
    color: var(--metallic-silver);
    line-height: 1.3;
    margin-top: 4px;
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 25%, #ff8c00 50%, #ff6b35 75%, #e73c7e 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(255, 107, 53, 0.4),
        0 4px 15px rgba(255, 215, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: pulse-glow 2s infinite;
}

.generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    transition: left 0.8s ease;
    animation: shimmer 3s infinite;
}

.generate-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate-shine 4s linear infinite;
}

.generate-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 35px rgba(255, 107, 53, 0.6),
        0 8px 25px rgba(255, 215, 0, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    animation: pulse-glow-intense 1s infinite;
}

.generate-btn:hover::before {
    left: 100%;
}

.generate-btn:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 
            0 8px 25px rgba(255, 107, 53, 0.4),
            0 4px 15px rgba(255, 215, 0, 0.3),
            inset 0 2px 0 rgba(255, 255, 255, 0.3),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 
            0 12px 35px rgba(255, 107, 53, 0.6),
            0 6px 20px rgba(255, 215, 0, 0.5),
            inset 0 2px 0 rgba(255, 255, 255, 0.4),
            inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    }
}

@keyframes pulse-glow-intense {
    0%, 100% {
        box-shadow: 
            0 12px 35px rgba(255, 107, 53, 0.6),
            0 8px 25px rgba(255, 215, 0, 0.5),
            inset 0 2px 0 rgba(255, 255, 255, 0.4),
            inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 16px 45px rgba(255, 107, 53, 0.8),
            0 12px 35px rgba(255, 215, 0, 0.7),
            inset 0 2px 0 rgba(255, 255, 255, 0.5),
            inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: -100%; }
    100% { left: 100%; }
}

@keyframes rotate-shine {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.btn-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: bounce-icon 2s infinite;
}

@keyframes bounce-icon {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

/* Results Panel */
.number-sets {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(156, 163, 175, 0.6);
    font-size: 14px;
    font-style: italic;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px dashed rgba(99, 102, 241, 0.2);
}

.number-set {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.set-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.set-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.rec-number {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Recommendation Stats */
.recommendation-stats {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.recommendation-stats h4 {
    color: white;
    margin-bottom: 12px;
    font-size: 14px;
}

.rec-stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.rec-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.rec-stat .label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

.rec-stat .value {
    font-weight: 700;
    color: white;
    font-size: 12px;
}

/* Stats Section */
.stats-section {
    margin: 20px 0;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--metallic-dark) 100%);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
    min-height: 90px;
    width: 100%;
    box-sizing: border-box;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-gold);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px 16px 0 0;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.stat-card.highlight {
    background: var(--gradient-gold);
    color: var(--metallic-dark);
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stat-icon {
    font-size: 32px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(100, 116, 139, 0.1) 100%);
    border-radius: 16px;
    flex-shrink: 0;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.stat-card.highlight .stat-icon {
    background: linear-gradient(135deg, rgba(24, 24, 27, 0.3) 0%, rgba(39, 39, 42, 0.2) 100%);
    border-color: rgba(24, 24, 27, 0.3);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
}

.stat-content h3 {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card.highlight .stat-content h3 {
    color: rgba(24, 24, 27, 0.8);
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    white-space: nowrap;
}

.stat-card.highlight .stat-value {
    color: var(--metallic-dark);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.stat-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card.highlight .stat-desc {
    color: rgba(24, 24, 27, 0.7);
}

/* Chart Sections */
.chart-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--metallic-dark) 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.1);
    margin: 24px 0;
    width: 100%;
    box-sizing: border-box;
}

.chart-section .section-header {
    border-bottom: 2px solid var(--border-color);
}

.chart-section .section-header h2 {
    color: var(--text-primary);
}

.chart-wrapper {
    position: relative;
    height: 200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chart-wrapper canvas {
    max-height: 200px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* Heatmap */
.heatmap {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    padding: 2px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.cell-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    font-size: 6px;
    font-weight: 700;
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

.cell-content small {
    font-size: 0.6em;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hot/Cold Numbers */
.hot-cold-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}

.hot-numbers-card,
.cold-numbers-card {
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.hot-numbers-card h3 {
    color: var(--danger-color);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
}

.cold-numbers-card h3 {
    color: var(--info-color);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
}

.number-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.number-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.number-ball.hot {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

.number-ball.cold {
    background: linear-gradient(135deg, #4dabf7, #74c0fc);
}

/* Pattern Dashboard */
.pattern-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
}

.pattern-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.pattern-item h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pattern-item canvas {
    max-height: 120px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

/* Chart.js 범례 스타일 (가로 배치) */
.pattern-item .chartjs-legend,
.chart-wrapper .chartjs-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 8px 0 !important;
    padding: 0 !important;
}

.pattern-item .chartjs-legend ul,
.chart-wrapper .chartjs-legend ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 8px !important;
}

.pattern-item .chartjs-legend li,
.chart-wrapper .chartjs-legend li {
    display: flex !important;
    align-items: center !important;
    font-size: 10px !important;
    margin: 0 !important;
    padding: 2px 4px !important;
}

/* Association Grid - 새로운 매트릭스 대체 */
.association-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.association-item {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.association-item:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.association-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.association-ball {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.association-plus {
    color: #a5b4fc;
    font-size: 16px;
    font-weight: bold;
}

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

.association-count {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
}

.association-rank {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Matrix Wrapper - 45x45 매트릭스용 */
.matrix-wrapper {
    overflow: auto;
    max-height: 600px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid rgba(99, 102, 241, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.matrix-wrapper table {
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 auto;
}

.matrix-wrapper th {
    background: rgba(25, 25, 25, 0.9);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 3px;
    font-size: 11px;
    text-align: center;
    font-weight: 600;
    width: 24px;
    height: 24px;
    min-width: 24px;
    max-width: 24px;
}

.matrix-wrapper th:first-child {
    width: 30px;
    min-width: 30px;
    max-width: 30px;
}

.matrix-wrapper td {
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0;
    text-align: center;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    color: #e2e8f0;
    width: 24px;
    height: 24px;
    min-width: 24px;
    max-width: 24px;
    overflow: hidden;
}

.matrix-wrapper td.diagonal {
    background: rgba(139, 92, 246, 0.4) !important;
    color: #ffffff !important;
}

.matrix-wrapper td.has-value {
    color: #ffffff;
}

/* PC 환경에서 매트릭스 크기 더 크게 */
@media screen and (min-width: 1024px) {
    .matrix-wrapper {
        max-height: 700px;
        padding: 24px;
    }
    
    .matrix-wrapper th {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        font-size: 12px;
        padding: 4px;
    }
    
    .matrix-wrapper th:first-child {
        width: 35px;
        min-width: 35px;
        max-width: 35px;
    }
    
    .matrix-wrapper td {
        width: 28px;
        height: 28px;
        min-width: 28px;
        max-width: 28px;
        font-size: 11px;
    }
}

@media screen and (min-width: 1200px) {
    .matrix-wrapper {
        max-height: 800px;
        padding: 32px;
    }
    
    .matrix-wrapper th {
        width: 32px;
        height: 32px;
        min-width: 32px;
        max-width: 32px;
        font-size: 13px;
        padding: 5px;
    }
    
    .matrix-wrapper th:first-child {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    
    .matrix-wrapper td {
        width: 32px;
        height: 32px;
        min-width: 32px;
        max-width: 32px;
        font-size: 12px;
    }
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 11px;
    margin-top: 40px;
    line-height: 1.6;
}

/* Select Controls */
.select-control {
    padding: 6px 12px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    background: rgba(10, 10, 10, 0.8);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.select-control:hover {
    border-color: var(--primary-color);
}

.select-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Responsive Design */
@media screen and (min-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .heatmap {
        grid-template-columns: repeat(9, 1fr);
        gap: 3px;
        padding: 12px;
    }
    
    .cell-content {
        font-size: 8px;
    }
    
    .hot-cold-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 768px) {
    .container {
        padding: 24px;
    }
    
    .header-main {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .site-logo {
        width: 36px;
        height: 36px;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
    }
    
    .site-name {
        font-size: 28px;
    }
    
    .site-name-en {
        font-size: 14px;
    }
    
    .site-tagline {
        font-size: 13px;
    }
    
    .header-info {
        flex-direction: row;
        gap: 24px;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-end;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .stat-card {
        padding: 20px;
        min-height: 90px;
    }
    
    .stat-icon {
        font-size: 32px;
        width: 70px;
        height: 70px;
    }
    
    .stat-value {
        font-size: 32px;
    }
    
    .chart-wrapper {
        height: 250px;
        max-width: 100%;
    }
    
    .chart-wrapper canvas {
        max-height: 250px !important;
        max-width: 100% !important;
    }
    
    .heatmap {
        grid-template-columns: repeat(15, 1fr);
        gap: 8px;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .cell-content {
        font-size: 12px;
    }
    
    .pattern-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rec-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (min-width: 1024px) {
    .container {
        padding: 32px;
    }
    
    .site-logo {
        width: 44px;
        height: 44px;
    }
    
    .logo-icon {
        width: 44px;
        height: 44px;
    }
    
    .site-name {
        font-size: 32px;
    }
    
    .site-name-en {
        font-size: 16px;
    }
    
    .site-tagline {
        font-size: 15px;
    }
    
    .recommendation-wrapper {
        display: grid !important;
        grid-template-columns: 1fr 2fr;
        gap: 24px;
        flex-direction: initial;
    }
    
    .strategy-panel,
    .results-panel {
        padding: 24px;
        width: auto;
        margin-bottom: 0;
    }
    
    .chart-wrapper {
        height: 300px;
        max-width: 100%;
    }
    
    .chart-wrapper canvas {
        max-height: 300px !important;
        max-width: 100% !important;
    }
    
    .heatmap {
        max-width: 1000px;
        gap: 10px;
    }
    
    .cell-content {
        font-size: 14px;
    }
    
    .pattern-item canvas {
        max-height: 150px !important;
    }
}

@media screen and (min-width: 1200px) {
    .heatmap {
        max-width: 1200px;
        gap: 12px;
    }
    
    .cell-content {
        font-size: 16px;
    }
}

/* 회차 정보 섹션 */
.draw-info-section {
    margin-top: 2rem;
}

.draw-info-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* 좌측 회차 목록 패널 */
.draw-list-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.draw-list-panel h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.draw-list-container {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    -webkit-overflow-scrolling: touch;  /* iOS 부드러운 스크롤 */
    position: relative;
    z-index: 1;
}

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

.draw-list-container::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;
}

.draw-list-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.draw-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.draw-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.draw-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    touch-action: manipulation;  /* 더블탭 줌 방지, 터치 반응성 향상 */
    position: relative;
    z-index: 2;
    min-height: 60px;  /* 터치 영역 확보 */
}

/* hover 효과 제거 - 선택된 항목만 표시 */

.draw-list-item.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--primary-color);
    font-weight: 600;
}

.draw-list-item.latest {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.draw-list-item.latest.active {
    background: rgba(251, 191, 36, 0.2);
    border-color: var(--metallic-gold);
    font-weight: 600;
}

.draw-list-round {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.draw-list-item.active .draw-list-round {
    font-weight: 700;  /* 선택된 항목만 더 굵게 */
}

.draw-list-numbers {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.draw-list-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.draw-list-bonus {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    margin-left: 0.3rem;
}

/* 우측 상세 정보 패널 */
.draw-detail-panel {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.draw-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.draw-detail-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.draw-round-badge {
    background: var(--gradient-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
}

.draw-detail-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.draw-basic-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.draw-date {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.draw-date .label,
.draw-numbers .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 80px;
}

.draw-date .value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.draw-numbers {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.winning-numbers {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.winning-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-dark);
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.winning-number:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    border-color: var(--primary-color);
}

.winning-number.bonus {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.winning-number.bonus::before {
    content: '+';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.draw-prize-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: var(--light-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.prize-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--dark-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.prize-stat .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

.prize-stat.highlight {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.prize-stat.highlight .value {
    color: var(--metallic-gold);
    font-size: 1.3rem;
}

/* 반응형 디자인 - 회차 정보 섹션 */
@media (max-width: 768px) {
    .draw-info-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .draw-list-container {
        max-height: 300px;
    }
    
    .draw-prize-info {
        grid-template-columns: 1fr;
    }
    
    .prize-stat.highlight {
        grid-column: span 1;
    }
    
    .winning-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* 모바일에서 히트맵 가독성 개선 */
    .heatmap {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 12px;
    }
    
    .cell-content {
        font-size: 16px;
        font-weight: 800;
    }
    
    .cell-content small {
        font-size: 11px;
        font-weight: 700;
        margin-top: 2px;
        display: block;
    }
    
    .heatmap-cell {
        padding: 6px;
        min-height: 40px;
    }
}