:root {
    --bg-color: #050510;
    --card-bg: rgba(20, 20, 35, 0.6);
    --primary: #ffd700;
    /* Gold */
    --primary-hover: #ffb700;
    --accent: #00f3ff;
    /* Cyan Neon */
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --glass-border: 1px solid rgba(255, 215, 0, 0.15);
    --shadow-glow: 0 0 25px rgba(255, 215, 0, 0.2);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    background: radial-gradient(circle at 50% -20%, #1a1a40, #000000);
}

/* Moving Background Effect */
.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 50%, rgba(139, 92, 246, 0.1), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 243, 255, 0.1), transparent 25%);
    animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
    background: linear-gradient(to right, #fff, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.description {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 215, 0, 0.3);
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 18px;
    border-radius: 16px;
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.primary-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.5s;
}

.primary-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
}

.primary-btn:hover::after {
    transform: rotate(45deg) translateY(100%);
}

.primary-btn:active {
    transform: scale(0.98);
}

.secondary-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 3D Balls */
.balls-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: nowrap;
    perspective: 1000px;
}

.ball {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
    position: relative;
    box-shadow:
        inset -5px -5px 10px rgba(0, 0, 0, 0.5),
        inset 5px 5px 10px rgba(255, 255, 255, 0.4),
        0 8px 15px rgba(0, 0, 0, 0.5);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);

    /* Animation Initial State */
    opacity: 0;
    transform: translateY(20px) rotateX(-90deg);
    animation: ballPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Staggered Delay done in JS, but here is the keyframe */
@keyframes ballPop {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

/* Premium Ball Colors */
.ball.range-1-10 {
    background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
}

/* Gold */
.ball.range-11-20 {
    background: radial-gradient(circle at 30% 30%, #00f3ff, #0077be);
}

/* Neo Blue */
.ball.range-21-30 {
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #8b0000);
}

/* Ruby Red */
.ball.range-31-40 {
    background: radial-gradient(circle at 30% 30%, #a8a8a8, #484848);
}

/* Silver */
.ball.range-41-45 {
    background: radial-gradient(circle at 30% 30%, #00ff88, #006400);
}

/* Emerald */

/* Inputs */
.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.lotto-input {
    width: 100%;
    padding: 12px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
    transition: 0.3s;
}

.lotto-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

/* Results Area */
.result-area,
.result-report {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.badges {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--accent);
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.status-message {
    text-align: center;
    padding: 15px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.status-message.pass {
    background: rgba(0, 255, 136, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.2);
}

.status-message.fail {
    background: rgba(255, 77, 77, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.detail-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-list li:last-child {
    border-bottom: none;
}

.detail-score {
    color: var(--text-main);
    font-weight: 600;
}

/* Footer */
footer {
    opacity: 0.6;
    font-size: 0.8rem;
    margin-top: 30px;
}

/* Recent History Styles */
.spinner {
    text-align: center;
    padding: 20px;
    color: var(--accent);
    font-weight: 600;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

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

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

.history-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.drw-no {
    color: var(--primary);
    font-weight: 700;
}

.history-balls {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.ball.small {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.plus {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.history-prize {
    text-align: right;
    font-size: 0.95rem;
}

.prize-amount {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
}