:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.5);
    --accent: #818cf8;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    
    /* Lotto Ball Colors */
    --ball-1: #fbbf24; /* 1-10: Yellow */
    --ball-11: #3b82f6; /* 11-20: Blue */
    --ball-21: #ef4444; /* 21-30: Red */
    --ball-31: #64748b; /* 31-40: Gray */
    --ball-41: #10b981; /* 41-45: Green */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(129, 140, 248, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

header {
    text-align: center;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

p.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    font-weight: 400;
}

/* Main Game Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.lotto-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    min-height: 80px;
    flex-wrap: wrap;
}

.ball {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), inset 0 4px 6px rgba(255,255,255,0.3);
    transform: scale(0);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ball.active {
    transform: scale(1);
}

.ball.yellow { background: var(--ball-1); }
.ball.blue { background: var(--ball-11); }
.ball.red { background: var(--ball-21); }
.ball.gray { background: var(--ball-31); }
.ball.green { background: var(--ball-41); }

.btn-generate {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    padding: 1.25rem 3rem;
    border-radius: 3rem;
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px var(--primary-glow);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    outline: none;
}

.btn-generate:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn-generate:active {
    transform: translateY(0) scale(0.98);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* History Section */
.history-section {
    width: 100%;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.history-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-clear {
    background: transparent;
    border: 1px solid var(--text-dim);
    color: var(--text-dim);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-clear:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.4s ease-out;
}

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

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

.timestamp {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Mobile Adjustments */
@media (max-width: 640px) {
    h1 { font-size: 2.5rem; }
    .glass-card { padding: 2rem 1rem; }
    .ball { width: 50px; height: 50px; font-size: 1.1rem; }
    .mini-ball { width: 26px; height: 26px; font-size: 0.7rem; }
}
