:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --accent-gold: #ffd700;
    --accent-pink: #ff6b9d;
    --accent-blue: #00d4ff;
    --accent-green: #00ff88;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 20%, rgba(255, 107, 157, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    color: var(--text-primary);
    overflow-x: hidden;
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.5;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-pink) 50%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
    margin-bottom: 8px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.2);
    }
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(40px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 215, 0, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.card-icon.gold {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

.card-icon.pink {
    background: linear-gradient(135deg, #ff6b9d, #ff4f7a);
}

.card-icon.blue {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
}

.card-icon.green {
    background: linear-gradient(135deg, #00ff88, #00cc6a);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    border: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.input-hint {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--accent-gold);
    opacity: 0.8;
}

.mode-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    min-width: 100px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: var(--accent-blue);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), #0088aa);
    border-color: transparent;
    color: white;
}

.quick-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quick-btn {
    padding: 12px 18px;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.quick-btn.hot {
    border-color: rgba(255, 107, 157, 0.4);
}

.quick-btn.hot:hover {
    background: rgba(255, 107, 157, 0.15);
    color: var(--accent-pink);
}

.quick-btn.cold {
    border-color: rgba(0, 212, 255, 0.4);
}

.quick-btn.cold:hover {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-blue);
}

.quick-btn.luck {
    border-color: rgba(255, 215, 0, 0.4);
}

.quick-btn.luck:hover {
    background: rgba(255, 215, 0, 0.15);
    color: var(--accent-gold);
}

.number-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    margin: 20px 0;
}

.num-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.num-btn:hover {
    transform: scale(1.15);
    border-color: var(--accent-gold);
}

.num-btn.include {
    background: linear-gradient(135deg, var(--accent-green), #00cc6a);
    border-color: transparent;
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.num-btn.exclude {
    background: linear-gradient(135deg, #ff4757, #c0392b);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.3);
}

.legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.action-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn {
    padding: 16px 28px;
    border-radius: 16px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #ffaa00);
    color: #000;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.results-area {
    min-height: 200px;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    animation: fadeSlide 0.5s ease;
}

@keyframes fadeSlide {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.result-label {
    font-weight: 600;
    color: var(--accent-gold);
    min-width: 50px;
    font-size: 0.95rem;
}

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.ball::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 10px;
    width: 12px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: rotate(-30deg);
}

.ball-1 {
    background: linear-gradient(135deg, #feca57, #ff9f43);
}

.ball-2 {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
}

.ball-3 {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
}

.ball-4 {
    background: linear-gradient(135deg, #a55eea, #8854d0);
}

.ball-5 {
    background: linear-gradient(135deg, #26de81, #20bf6b);
}

/* 실제 로또 645 색상 (번호 범위 기반) */
.ball-yellow {
    background: linear-gradient(135deg, #fbc531, #f39c12);
    /* 1-10 */
}

.ball-blue {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    /* 11-20 */
}

.ball-red {
    background: linear-gradient(135deg, #ff6b6b, #e74c3c);
    /* 21-30 */
}

.ball-gray {
    background: linear-gradient(135deg, #636e72, #4a5055);
    /* 31-40 */
}

.ball-green {
    background: linear-gradient(135deg, #26de81, #20bf6b);
    /* 41-45 */
}

.ball-bonus {
    background: linear-gradient(135deg, #fd79a8, #e84393);
}

.copy-btn {
    margin-left: auto;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.hot-cold-preview {
    display: flex;
    gap: 20px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.preview-section {
    flex: 1;
    min-width: 140px;
}

.preview-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview-balls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mini-ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
}

.mini-ball.hot {
    background: linear-gradient(135deg, #ff6b9d, #ff4f7a);
}

.mini-ball.cold {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
}

.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--bg-secondary);
    border: 1px solid var(--accent-gold);
    color: var(--text-primary);
    padding: 18px 32px;
    border-radius: 16px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.data-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.status-dot.error {
    background: #ff4757;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.footer {
    text-align: center;
    margin-top: 50px;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.winning-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.winning-round {
    font-weight: 700;
    color: var(--accent-gold);
    min-width: 80px;
}

.winning-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

/* 누적 통계 섹션 */
.cumulative-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.cumulative-item {
    text-align: center;
    padding: 20px 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.cumulative-value {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.cumulative-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.seo-section {
    border: 1px solid rgba(255, 215, 0, 0.1);
}

@media (max-width: 600px) {
    .logo {
        font-size: 2.5rem;
    }

    .number-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .ball {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cumulative-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}