@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #fbbf24; /* Amber Gold */
    --secondary: #6366f1; /* Indigo */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #f59e0b;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --ball-size: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(251, 191, 36, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    width: 90%;
    padding: 3rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.balls-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 3rem;
    min-height: 100px;
}

.lotto-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--glass);
    border-radius: 1.5rem;
    border: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease forwards;
}

.lotto-row-label {
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ball {
    width: var(--ball-size);
    height: var(--ball-size);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff, transparent),
                linear-gradient(135deg, var(--secondary), #4338ca);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
    transform: scale(0);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Ball colors based on value (similar to actual Lotto) */
.ball.range-1-10 { background: radial-gradient(circle at 30% 30%, #fef3c7, transparent), #f59e0b; }
.ball.range-11-20 { background: radial-gradient(circle at 30% 30%, #e0f2fe, transparent), #0ea5e9; }
.ball.range-21-30 { background: radial-gradient(circle at 30% 30%, #fee2e2, transparent), #ef4444; }
.ball.range-31-40 { background: radial-gradient(circle at 30% 30%, #f1f5f9, transparent), #64748b; }
.ball.range-41-45 { background: radial-gradient(circle at 30% 30%, #f0fdf4, transparent), #22c55e; }

@keyframes popIn {
    to { transform: scale(1); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

button {
    padding: 0.8rem 1.5rem;
    border-radius: 1rem;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-grow: 1;
    max-width: 250px;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--accent));
    color: #000;
    box-shadow: 0 10px 15px -3px rgba(251, 191, 36, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(251, 191, 36, 0.4);
}

.btn-secondary {
    background: var(--glass);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.history {
    text-align: left;
    margin-top: 2rem;
    border-top: 1px solid var(--glass-border);
    padding-top: 2rem;
}

.history h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    background: var(--glass);
    padding: 1rem;
    border-radius: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.history-numbers {
    display: flex;
    gap: 0.5rem;
}

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

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

@media (max-width: 640px) {
    .container {
        padding: 1.5rem;
    }
    h1 { font-size: 2rem; }
    .balls-container { gap: 0.5rem; }
    .ball { --ball-size: 45px; font-size: 1.1rem; }
}
