@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

:root {
    --bg-color-main: #0b0f19;
    --panel-bg: rgba(20, 26, 43, 0.6);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-red: #ff4b4b;
    --accent-blue: #3b82f6;
    --accent-purp: #8b5cf6;
    --accent-cyan: #06b6d4;
    --glow-cyan: rgba(6, 182, 212, 0.5);
    
    /* Lotto Colors */
    --lotto-yellow: #fbc400;
    --lotto-blue: #69c8f2;
    --lotto-red: #ff7272;
    --lotto-gray: #aaa;
    --lotto-green: #b0d840;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color-main);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* Background Animations */
.background-effects {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px; height: 400px;
    background: var(--accent-purp);
    top: -100px; left: -100px;
}

.orb-2 {
    width: 300px; height: 300px;
    background: var(--accent-blue);
    bottom: -50px; right: -50px;
    animation-delay: -5s;
}

.orb-3 {
    width: 250px; height: 250px;
    background: var(--accent-cyan);
    top: 40%; left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(50px, 50px) rotate(10deg); }
}

/* Container & Glassmorphism */
.container {
    max-width: 600px;
    width: 100%;
    border-radius: 20px;
    padding: 40px;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purp));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Controls */
.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 12px;
}

.control-group label, .advanced-settings summary {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Advanced Settings Dropdown */
details {
    cursor: pointer;
}

summary {
    color: var(--text-muted);
    transition: color 0.2s;
}

summary:hover {
    color: var(--text-main);
}

.settings-content {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-main);
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-item input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px var(--glow-cyan);
}

/* Primary Button */
.generator-action {
    display: flex;
    justify-content: center;
}

.primary-btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-purp), var(--accent-blue));
    color: white;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.primary-btn:active {
    transform: translateY(1px);
}

.btn-glow {
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: skewX(-20deg);
    animation: btnGlow 3s infinite;
}

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

/* Results Area */
.results-area {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--panel-border);
}

.status-display {
    font-size: 1.1rem;
    color: var(--accent-cyan);
    margin-bottom: 25px;
    height: 25px;
    font-weight: 600;
}

.balls-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
    min-height: 70px;
}

.ball {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    box-shadow: inset -5px -5px 15px rgba(0,0,0,0.5), inset 5px 5px 15px rgba(255,255,255,0.4);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    transition: transform 0.3s;
    position: relative;
}

.ball.empty {
    color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    background: rgba(0, 0, 0, 0.2);
}

.ball.color-1 { background: radial-gradient(circle at 30% 30%, #ffd94d, var(--lotto-yellow)); }
.ball.color-2 { background: radial-gradient(circle at 30% 30%, #89d9ff, var(--lotto-blue)); }
.ball.color-3 { background: radial-gradient(circle at 30% 30%, #ff9595, var(--lotto-red)); }
.ball.color-4 { background: radial-gradient(circle at 30% 30%, #cccccc, var(--lotto-gray)); }
.ball.color-5 { background: radial-gradient(circle at 30% 30%, #cbee6d, var(--lotto-green)); }

.ball.pop-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Stats */
.stats-panel {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    animation: fadeIn 0.5s ease-out;
}

.stats-panel h3 {
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--text-muted);
}

.stat-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.stat-bar > span {
    min-width: 60px;
    text-align: right;
}

.progress-wrap {
    flex-grow: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 4px;
    transition: width 1s ease-out;
}

/* History */
.history-section {
    margin-top: 20px;
}

.history-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

#history-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    gap: 15px;
}

.history-nums {
    display: flex;
    gap: 5px;
    flex-grow: 1;
}

.history-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-weight: 700; font-size: 0.8rem;
    color: white;
}

.hn-1 { background: var(--lotto-yellow); }
.hn-2 { background: var(--lotto-blue); }
.hn-3 { background: var(--lotto-red); }
.hn-4 { background: var(--lotto-gray); }
.hn-5 { background: var(--lotto-green); }

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

/* Responsiveness */
@media (max-width: 480px) {
    .ball { width: 50px; height: 50px; font-size: 1.2rem; }
    .balls-container { gap: 10px; }
    .container { padding: 25px 20px; }
    h1 { font-size: 1.5rem; }
}
