* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --dark: #1e293b;
    --light: #f8fafc;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* 컨페티 컨테이너 */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    opacity: 0;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotateZ(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotateZ(720deg);
    }
}

/* 메인 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* 음악 컨트롤 */
.music-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.btn-music {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Noto Sans KR', sans-serif;
}

.btn-music:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-music i {
    font-size: 1.2rem;
}

.btn-music.muted {
    background: rgba(200, 200, 200, 0.95);
    color: #666;
}

.btn-music.muted i {
    color: #999;
}

/* 헤더 */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.header h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

.header h1 i {
    color: var(--gold);
    animation: bounce 2s infinite;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 업로드 섹션 */
.upload-section {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.upload-card {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.upload-icon {
    font-size: 5rem;
    color: #10b981;
    margin-bottom: 20px;
}

.upload-card h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.upload-card p {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f0fdf4;
    border-radius: 10px;
    color: #10b981;
    font-weight: 500;
    display: none;
    transition: all 0.3s ease;
}

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

/* 버튼 스타일 */
.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-start {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    font-size: 1.5rem;
    padding: 20px 60px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    50% { box-shadow: 0 0 0 20px rgba(245, 158, 11, 0); }
}

.btn-next {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 1.3rem;
    padding: 15px 50px;
    margin-top: 30px;
}

/* 추첨 섹션 */
.lottery-section {
    animation: fadeInUp 0.8s ease 0.2s both;
}

.prize-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.prize-card {
    background: white;
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.prize-card:hover {
    transform: translateY(-10px);
}

.prize-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 20px;
    border-radius: 20px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.prize-card.first .prize-badge {
    background: linear-gradient(135deg, var(--gold), #ffa500);
}

.prize-card.second .prize-badge {
    background: linear-gradient(135deg, var(--silver), #a8a8a8);
}

.prize-card.third .prize-badge {
    background: linear-gradient(135deg, var(--bronze), #8b5a00);
}

.prize-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.prize-card.first .prize-icon {
    color: var(--gold);
}

.prize-card.second .prize-icon {
    color: var(--silver);
}

.prize-card.third .prize-icon {
    color: var(--bronze);
}

.prize-card h3 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 10px;
}

.prize-count {
    font-size: 1.2rem;
    color: #64748b;
    font-weight: 500;
}

.lottery-control {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.participant-info {
    margin-bottom: 30px;
}

.participant-info p {
    font-size: 1.3rem;
    color: var(--dark);
}

.participant-info strong {
    color: var(--primary-color);
    font-size: 2rem;
}

/* 추첨 화면 컨테이너 */
.draw-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-top: 40px;
}

/* 추첨 화면 */
.draw-screen {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.current-prize {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.name-roller {
    font-size: 4rem;
    font-weight: 900;
    color: var(--dark);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: nameRoll 0.1s infinite;
}

@keyframes nameRoll {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.winner-display {
    animation: winnerAppear 0.8s ease;
}

.winner-text {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 20px;
    animation: tada 1s ease;
}

.winner-name {
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: scaleUp 0.5s ease;
}

@keyframes winnerAppear {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes tada {
    0%, 100% { transform: scale(1) rotate(0deg); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
}

@keyframes scaleUp {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* 실시간 당첨자 목록 */
.live-winners {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

.live-winners h3 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
}

.live-winners h3 i {
    color: var(--gold);
}

.live-winners-scroll {
    overflow-y: auto;
    flex: 1;
}

.live-winner-group {
    margin-bottom: 25px;
}

.live-winner-group h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 10px;
    text-align: center;
}

.live-winner-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.live-winner-item {
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    padding: 12px 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.5s ease both;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.live-winner-item.first {
    border-left-color: var(--gold);
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.live-winner-item.second {
    border-left-color: var(--silver);
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.live-winner-item.third {
    border-left-color: var(--bronze);
    background: linear-gradient(135deg, #fef7ed, #fed7aa);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 결과 섹션 */
.result-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-top: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease;
}

.result-section h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 40px;
}

.result-section h2 i {
    color: var(--gold);
}

.result-group {
    margin-bottom: 40px;
}

.result-group h3 {
    font-size: 1.8rem;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--primary-color);
}

.winner-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.winner-item {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    animation: fadeInScale 0.5s ease both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

/* 유틸리티 */
.hidden {
    display: none !important;
}

/* 반응형 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .prize-cards {
        grid-template-columns: 1fr;
    }
    
    .btn-start {
        font-size: 1.2rem;
        padding: 15px 40px;
    }
    
    .name-roller {
        font-size: 3rem;
    }
    
    .winner-name {
        font-size: 3.5rem;
    }
    
    .draw-container {
        grid-template-columns: 1fr;
    }
    
    .live-winners {
        order: -1;
        max-height: 300px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
}
