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

        body {
            min-height: 100vh;
            background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 50%, #0a0a2e 100%);
            font-family: 'Noto Sans KR', sans-serif;
            overflow-x: hidden;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 10px 15px;
        }

        header {
            text-align: center;
            padding: 10px 0;
        }

        .header-top {
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            margin-bottom: 5px;
        }

        .back-btn {
            position: absolute;
            left: 0;
            display: flex;
            align-items: center;
            gap: 5px;
            color: rgba(255,255,255,0.7);
            text-decoration: none;
            font-size: 0.9rem;
            transition: color 0.3s;
        }

        .back-btn:hover {
            color: #ffd700;
        }

        .back-btn svg {
            width: 20px;
            height: 20px;
        }

        h1 {
            font-family: 'Black Han Sans', sans-serif;
            font-size: 2.2rem;
            color: #ffd700;
            text-shadow: 
                0 0 10px #ffd700,
                0 0 20px #ffd700,
                0 0 40px #ff8c00,
                2px 2px 0 #c41e3a;
            letter-spacing: 4px;
            animation: glow 2s ease-in-out infinite alternate;
        }

        @keyframes glow {
            from { text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 40px #ff8c00, 2px 2px 0 #c41e3a; }
            to { text-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700, 0 0 60px #ff8c00, 2px 2px 0 #c41e3a; }
        }

        .subtitle {
            color: #87ceeb;
            font-size: 0.95rem;
            margin-top: 5px;
            letter-spacing: 2px;
        }

        .main-content {
            display: flex;
            gap: 20px;
            align-items: flex-start;
            margin-top: 15px;
        }

        .left-panel {
            flex: 0 0 auto;
        }

        .right-panel {
            flex: 1;
            min-width: 0;
        }

        .machine-wrapper {
            position: relative;
            width: 320px;
        }

        #canvas-container {
            width: 320px;
            height: 320px;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 15px 40px rgba(0,0,0,0.5);
        }

        #canvas-container canvas {
            display: block;
            width: 100% !important;
            height: 100% !important;
        }

        .machine-label {
            position: absolute;
            top: -12px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(180deg, #ffd700, #daa520);
            padding: 5px 20px;
            border-radius: 15px;
            font-weight: bold;
            color: #8b0000;
            font-size: 0.9rem;
            box-shadow: 0 3px 10px rgba(0,0,0,0.3);
            white-space: nowrap;
            z-index: 10;
        }

        .controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-top: 15px;
        }

        .draw-button {
            padding: 14px 35px;
            font-family: 'Black Han Sans', sans-serif;
            font-size: 1.5rem;
            color: white;
            background: linear-gradient(180deg, #ff4444, #cc0000);
            border: none;
            border-radius: 40px;
            cursor: pointer;
            box-shadow: 
                0 6px 0 #8b0000,
                0 10px 20px rgba(0,0,0,0.4);
            transition: all 0.1s;
            position: relative;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .draw-button:hover:not(:disabled) {
            transform: translateY(2px);
            box-shadow: 0 4px 0 #8b0000, 0 8px 15px rgba(0,0,0,0.4);
        }

        .draw-button:active:not(:disabled) {
            transform: translateY(5px);
            box-shadow: 0 1px 0 #8b0000, 0 3px 10px rgba(0,0,0,0.4);
        }

        .draw-button:disabled {
            background: linear-gradient(180deg, #888, #666);
            cursor: not-allowed;
        }

        .draw-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            animation: buttonShine 3s infinite;
        }

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

        .ad-icon {
            font-size: 0.7rem;
            background: rgba(255,255,255,0.25);
            padding: 2px 6px;
            border-radius: 8px;
            display: none;
            align-items: center;
            gap: 3px;
        }

        .ad-icon.show {
            display: inline-flex;
        }

        .ad-icon svg {
            width: 12px;
            height: 12px;
        }

        .wind-control {
            display: flex;
            align-items: center;
            gap: 8px;
            background: rgba(255,255,255,0.1);
            padding: 8px 15px;
            border-radius: 25px;
            font-size: 0.85rem;
        }

        .wind-control label {
            color: white;
        }

        .wind-slider {
            width: 100px;
            accent-color: #ffd700;
        }

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

        .game-row {
            background: rgba(255,255,255,0.1);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 12px 15px;
            border: 2px solid rgba(255,215,0,0.3);
            transition: all 0.4s ease;
        }

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

        .game-label {
            font-family: 'Black Han Sans', sans-serif;
            color: #ffd700;
            font-size: 1rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .game-label::before {
            content: '🎯';
        }

        .game-draw-btn {
            padding: 10px 24px;
            font-family: 'Black Han Sans', sans-serif;
            font-size: 1rem;
            color: #1a1a2e;
            background: linear-gradient(135deg, #ffd700, #ffb300, #ffc107, #ffd700);
            background-size: 300% 300%;
            border: 2px solid #daa520;
            border-radius: 25px;
            cursor: pointer;
            box-shadow:
                0 4px 0 #b8860b,
                0 0 20px rgba(255, 215, 0, 0.4),
                inset 0 1px 0 rgba(255,255,255,0.5);
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
            animation: goldGradient 3s ease infinite;
            min-width: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

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

        .game-draw-btn::before {
            content: '✨';
            margin-right: 4px;
        }

        .game-draw-btn:hover:not(:disabled) {
            transform: translateY(-2px) scale(1.02);
            box-shadow:
                0 6px 0 #b8860b,
                0 0 30px rgba(255, 215, 0, 0.6),
                0 0 50px rgba(255, 215, 0, 0.3);
        }

        .game-draw-btn:active:not(:disabled) {
            transform: translateY(3px);
            box-shadow:
                0 1px 0 #b8860b,
                0 0 15px rgba(255, 215, 0, 0.4);
        }

        .game-draw-btn:disabled {
            background: linear-gradient(135deg, #888, #666);
            border-color: #555;
            box-shadow: 0 2px 0 #444;
            cursor: not-allowed;
            animation: none;
        }

        .game-draw-btn:disabled::before {
            content: '';
        }

        /* 반짝이는 광선 효과 */
        .game-draw-btn::after {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 50%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
            animation: goldShine 2s infinite;
        }

        @keyframes goldShine {
            0% { left: -100%; }
            50%, 100% { left: 150%; }
        }

        .game-draw-btn .spinner {
            width: 14px;
            height: 14px;
            border-width: 2px;
            border-color: rgba(26,26,46,0.3);
            border-top-color: #1a1a2e;
            margin-right: 6px;
        }

        .balls-row {
            display: flex;
            gap: 6px;
            justify-content: flex-start;
            flex-wrap: wrap;
        }

        .result-ball {
            width: 42px;
            height: 42px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Black Han Sans', sans-serif;
            font-size: 1.1rem;
            color: white;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
            box-shadow: 
                inset -4px -4px 10px rgba(0,0,0,0.4),
                inset 4px 4px 10px rgba(255,255,255,0.4),
                0 5px 15px rgba(0,0,0,0.3);
            opacity: 0;
            transform: scale(0) rotate(-180deg);
        }

        .result-ball.pop {
            animation: ballPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
        }

        @keyframes ballPop {
            0% { opacity: 0; transform: scale(0) rotate(-180deg) translateY(-30px); }
            60% { transform: scale(1.15) rotate(10deg) translateY(0); }
            80% { transform: scale(0.95) rotate(-5deg); }
            100% { opacity: 1; transform: scale(1) rotate(0deg); }
        }

        .ball-yellow { background: linear-gradient(135deg, #ffd700, #ffb300, #ffd700); }
        .ball-blue { background: linear-gradient(135deg, #4169e1, #1e40af, #4169e1); }
        .ball-red { background: linear-gradient(135deg, #dc2626, #991b1b, #dc2626); }
        .ball-gray { background: linear-gradient(135deg, #6b7280, #4b5563, #6b7280); }
        .ball-green { background: linear-gradient(135deg, #22c55e, #16a34a, #22c55e); }

        .falling-ball {
            position: fixed;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Black Han Sans', sans-serif;
            font-size: 1rem;
            color: white;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
            z-index: 1000;
            pointer-events: none;
            box-shadow: 
                inset -4px -4px 10px rgba(0,0,0,0.4),
                inset 4px 4px 10px rgba(255,255,255,0.4),
                0 5px 15px rgba(0,0,0,0.3);
        }

        .confetti {
            position: fixed;
            z-index: 999;
            pointer-events: none;
        }

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

        /* 전면 동영상 광고 오버레이 */
        .ad-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.95);
            z-index: 10000;
            display: none;
            align-items: center;
            justify-content: center;
            flex-direction: column;
        }

        .ad-overlay.show {
            display: flex;
        }

        .ad-content {
            background: linear-gradient(135deg, #1a1a2e, #16213e);
            border-radius: 20px;
            padding: 25px;
            max-width: 450px;
            width: 95%;
            text-align: center;
            position: relative;
            border: 2px solid rgba(255,215,0,0.3);
            box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        }

        .ad-content h3 {
            color: #ffd700;
            margin-bottom: 15px;
            font-size: 1.2rem;
            font-family: 'Black Han Sans', sans-serif;
        }

        .ad-video-placeholder {
            width: 100%;
            aspect-ratio: 16/9;
            background: linear-gradient(135deg, #000, #1a1a2e);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #666;
            font-size: 0.9rem;
            margin-bottom: 15px;
            position: relative;
            overflow: hidden;
        }

        .ad-video-placeholder::before {
            content: '▶';
            font-size: 3rem;
            color: rgba(255,215,0,0.5);
            position: absolute;
        }

        .ad-video-placeholder span {
            position: absolute;
            bottom: 10px;
            right: 10px;
            background: rgba(0,0,0,0.7);
            padding: 3px 8px;
            border-radius: 5px;
            font-size: 0.75rem;
        }

        .ad-close-btn {
            background: linear-gradient(180deg, #4CAF50, #388E3C);
            color: white;
            border: none;
            padding: 14px 35px;
            border-radius: 30px;
            font-size: 1.1rem;
            cursor: pointer;
            font-family: 'Black Han Sans', sans-serif;
            transition: all 0.2s;
            box-shadow: 0 4px 0 #2E7D32;
        }

        .ad-close-btn:disabled {
            background: linear-gradient(180deg, #666, #444);
            box-shadow: 0 4px 0 #333;
            cursor: not-allowed;
        }

        .ad-close-btn:hover:not(:disabled) {
            transform: translateY(2px);
            box-shadow: 0 2px 0 #2E7D32;
        }

        .ad-timer {
            color: #87ceeb;
            font-size: 0.9rem;
            margin-top: 12px;
        }

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

        /* 기록 위 배너 광고 */
        .ad-banner {
            width: 100%;
            min-height: 100px;
            margin: 25px 0 15px 0;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255,255,255,0.3);
            font-size: 0.8rem;
            flex-direction: column;
            gap: 5px;
        }

        .ad-banner-label {
            font-size: 0.65rem;
            color: rgba(255,255,255,0.2);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* 기록 섹션 */
        .history-section {
            background: rgba(255,255,255,0.05);
            border-radius: 20px;
            padding: 20px;
            border: 1px solid rgba(255,215,0,0.2);
        }

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

        .history-title {
            font-family: 'Black Han Sans', sans-serif;
            color: #ffd700;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .history-title::before {
            content: '📋';
        }

        .history-count {
            color: rgba(255,255,255,0.6);
            font-size: 0.85rem;
        }

        .clear-history-btn {
            background: rgba(255,68,68,0.2);
            border: 1px solid rgba(255,68,68,0.5);
            color: #ff6b6b;
            padding: 6px 12px;
            border-radius: 15px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .clear-history-btn:hover {
            background: rgba(255,68,68,0.4);
        }

        .history-list {
            max-height: 300px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

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

        .history-list::-webkit-scrollbar-track {
            background: rgba(255,255,255,0.1);
            border-radius: 3px;
        }

        .history-list::-webkit-scrollbar-thumb {
            background: rgba(255,215,0,0.5);
            border-radius: 3px;
        }

        .history-item {
            background: rgba(255,255,255,0.05);
            border-radius: 10px;
            padding: 10px 12px;
            display: flex;
            align-items: center;
            gap: 10px;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .history-date {
            color: rgba(255,255,255,0.5);
            font-size: 0.75rem;
            min-width: 70px;
        }

        .history-game-label {
            color: #87ceeb;
            font-size: 0.8rem;
            font-weight: bold;
            min-width: 50px;
        }

        .history-balls {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }

        .history-ball {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Black Han Sans', sans-serif;
            font-size: 0.75rem;
            color: white;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
        }

        .history-empty {
            text-align: center;
            color: rgba(255,255,255,0.4);
            padding: 30px;
            font-size: 0.9rem;
        }

        .delete-item-btn {
            margin-left: auto;
            background: none;
            border: none;
            color: rgba(255,255,255,0.3);
            cursor: pointer;
            font-size: 1rem;
            padding: 5px;
            transition: color 0.2s;
        }

        .delete-item-btn:hover {
            color: #ff6b6b;
        }

        footer {
            text-align: center;
            padding: 20px 15px;
            color: rgba(255,255,255,0.4);
            font-size: 0.8rem;
        }

        footer a {
            color: rgba(255,255,255,0.5);
            text-decoration: none;
        }

        footer a:hover {
            color: rgba(255,255,255,0.8);
        }

        .spinner {
            display: inline-block;
            width: 18px;
            height: 18px;
            border: 3px solid rgba(255,255,255,0.3);
            border-radius: 50%;
            border-top-color: white;
            animation: spin 1s linear infinite;
            margin-right: 8px;
        }

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

        /* 모바일 레이아웃 */
        @media (max-width: 750px) {
            .container {
                padding: 8px 10px;
            }
            
            header {
                padding: 8px 0;
            }
            
            h1 { 
                font-size: 1.8rem; 
            }
            
            .subtitle {
                font-size: 0.85rem;
            }
            
            .main-content {
                flex-direction: column;
                align-items: center;
                gap: 15px;
            }
            
            .left-panel {
                width: 100%;
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            
            .right-panel {
                width: 100%;
            }
            
            .machine-wrapper {
                width: 280px;
            }
            
            #canvas-container {
                width: 280px;
                height: 280px;
            }
            
            .controls {
                width: 100%;
                flex-direction: row;
                justify-content: center;
                flex-wrap: wrap;
                margin-top: 12px;
            }
            
            .draw-button { 
                font-size: 1.3rem; 
                padding: 12px 30px; 
            }
            
            .results {
                width: 100%;
            }
            
            
            .balls-row {
                justify-content: center;
            }
            
            .result-ball { 
                width: 40px; 
                height: 40px; 
                font-size: 1rem; 
            }

            .ad-banner {
                min-height: 80px;
            }

            .history-section {
                padding: 15px;
            }

            .history-item {
                flex-wrap: wrap;
            }

            .history-date {
                width: 100%;
                margin-bottom: 5px;
            }
            
            footer {
                padding: 15px 10px;
                font-size: 0.7rem;
            }
        }
        
        @media (max-width: 400px) {
            .machine-wrapper {
                width: 250px;
            }
            
            #canvas-container {
                width: 250px;
                height: 250px;
            }
            
            h1 {
                font-size: 1.5rem;
            }
            
            .draw-button {
                font-size: 1.1rem;
                padding: 10px 25px;
            }
            
            .result-ball {
                width: 36px;
                height: 36px;
                font-size: 0.9rem;
            }

                    .history-ball {
                        width: 24px;
                        height: 24px;
                        font-size: 0.65rem;
                    }
                }
            
                /* Content Section for SEO/AdSense */
                .lotto-info {
                    margin-top: 30px;
                    background: rgba(255,255,255,0.05);
                    border-radius: 20px;
                    padding: 30px;
                    border: 1px solid rgba(255,215,0,0.2);
                    color: rgba(255,255,255,0.8);
                }
            
                .lotto-info h2 {
                    font-family: 'Jua', sans-serif;
                    color: #ffd700;
                    font-size: 1.4rem;
                    margin-bottom: 15px;
                    border-bottom: 1px solid rgba(255,255,255,0.1);
                    padding-bottom: 10px;
                }
            
                .lotto-info h2:not(:first-child) {
                    margin-top: 25px;
                }
            
                .lotto-info p {
                    line-height: 1.7;
                    margin-bottom: 15px;
                    word-break: keep-all;
                    font-size: 0.95rem;
                }
            
                .lotto-info .info-box {
                    background: rgba(0,0,0,0.2);
                    padding: 20px;
                    border-radius: 10px;
                    margin-top: 15px;
                }
            
                .lotto-info h3 {
                    color: #87ceeb;
                    margin-bottom: 10px;
                    font-size: 1.1rem;
                }