:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --accent: #10b981;
    --bg-dark: #030305;
    --glass-bg: rgba(15, 18, 35, 0.9);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-dim: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Pretendard', -apple-system, system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
    /* 배경 최적화: 블러 연산 부하 감소 */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%),
        url("https://www.transparenttextures.com/patterns/asfalt-dark.pattern");
}

/* Background Blobs - 최적화된 블러 처리 */
.blob-container {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; filter: blur(80px); /* 블러 강도 하향으로 성능 향상 */
    pointer-events: none;
    will-change: transform; /* 가속 유도 */
}
.blob {
    position: absolute; border-radius: 50%; opacity: 0.2;
    animation: move 25s infinite alternate ease-in-out;
}
.blob-1 { width: 600px; height: 600px; background: var(--primary); top: -200px; left: -150px; }
.blob-2 { width: 500px; height: 500px; background: var(--secondary); bottom: -100px; right: -100px; animation-delay: -5s; }

@keyframes move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

/* Navigation */
.top-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(3, 3, 5, 0.85);
    backdrop-filter: blur(15px); /* 성능을 위해 블러 값 하향 */
    border-bottom: 1px solid var(--glass-border);
}
.nav-container {
    max-width: 1300px; margin: 0 auto; padding: 1.1rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
}
.logo {
    font-size: 1.5rem; font-weight: 900; text-decoration: none; color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Card Style - 카드 자체의 호버 반응 제거 */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px); /* 부하를 줄이기 위해 값 하향 */
    border: 1px solid var(--glass-border);
    border-radius: 2.2rem;
    padding: 3rem; margin-bottom: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* AI 분석 창 - 명확하고 빠른 호버 피드백 */
.webcam-frame {
    width: 100%; max-width: 460px; aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.4); border-radius: 2.5rem; margin: 0 auto 2.5rem;
    position: relative; border: 2px dashed var(--glass-border);
    cursor: pointer; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s cubic-bezier(0.1, 0.7, 0.1, 1), border-color 0.2s;
    will-change: transform;
}

.webcam-frame:hover {
    transform: scale(1.015); /* 빠른 체감의 작은 스케일링 */
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.webcam-placeholder {
    transition: transform 0.2s;
}

.webcam-frame:hover .webcam-placeholder {
    transform: scale(1.05);
}

.webcam-placeholder .icon {
    font-size: 5.5rem; margin-bottom: 1.2rem;
    background: linear-gradient(to bottom, #fff, var(--primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Buttons - 빠른 반응의 빛번짐 효과 */
.ai-controls { display: flex; gap: 1.5rem; margin-bottom: 3.5rem; }

#start-btn, .upload-label {
    flex: 1; padding: 1.4rem; border-radius: 1.4rem; font-weight: 800;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative; overflow: hidden;
}

#start-btn:hover, .upload-label:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.5);
}

#start-btn::after, .upload-label::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    opacity: 0; transition: opacity 0.2s;
}

#start-btn:hover::after, .upload-label:hover::after {
    opacity: 1;
}

/* Lotto Ball - 빠른 애니메이션 */
.numbers-container {
    display: flex; gap: 1.2rem; justify-content: center; margin: 3rem 0; flex-wrap: wrap;
}

.lotto-ball {
    width: 65px; height: 65px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem; font-weight: 900; color: white;
    position: relative;
    box-shadow: 
        inset -8px -8px 15px rgba(0,0,0,0.4),
        inset 6px 6px 12px rgba(255,255,255,0.3),
        0 10px 20px rgba(0,0,0,0.4);
    animation: ballPop 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67) backwards;
}

#generate-btn {
    width: 100%; padding: 1.5rem; border-radius: 1.5rem; font-size: 1.3rem; font-weight: 900;
    background: white; color: black; border: none; cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}
#generate-btn:hover {
    background: var(--primary); color: white;
    transform: scale(1.01);
}

/* 나머지 정적 요소들은 트랜지션 최소화 */
.step, .result-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem; border-radius: 1.5rem;
}

@media (max-width: 1000px) {
    .page-wrapper { flex-direction: column; }
    h1 { font-size: 2.8rem; }
}
