:root {
    --primary: #2B4C9B;
    --primary-glow: rgba(43, 76, 155, 0.5);
    --secondary: #FEE533;
    --accent: #4FBBEB;
    --danger: #D32F2F;
    --bg-dark: #050a1b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #b0c4de;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    background: var(--primary);
    top: -10%;
    left: -10%;
}

.blob-2 {
    background: var(--secondary);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    background: var(--accent);
    top: 40%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.2);
    }
}

/* Layout */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-header {
    text-align: center;
    margin-bottom: 1rem;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
    margin-top: 1rem;
}

.app-logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(79, 187, 235, 0.3));
}

.accent {
    background: linear-gradient(to right, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
}

/* Control Panel */
.control-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    color: white;
    font-size: 1.2rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--accent);
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: flex-end;
}

.stat-item {
    text-align: right;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--accent);
}

.action-buttons {
    grid-column: span 2;
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 14px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    flex: 2;
    background: linear-gradient(135deg, var(--primary), var(--primary));
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(43, 76, 155, 0.4);
}

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

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

/* Rolling Area */
.display-area {
    display: flex;
    justify-content: center;
}

.roller-container {
    width: 350px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.rolling-number {
    font-size: 8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px var(--primary-glow);
}

.rolling-number.active {
    animation: pulse 0.1s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: 0.8;
    }

    to {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Results Area */
.results-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.winners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.8rem;
}

.winner-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Overlay & Announcement */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: none;
    /* Controlled by JS */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.overlay.active {
    display: flex;
}

.winner-announcement {
    /* max-width: 800px; */
    width: 90%;
    text-align: center;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.winner-announcement h3 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, gold, white, gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.announcement-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.large-winner {
    font-size: 3rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 20px;
    border: 2px solid var(--accent);
}

/* Responsiveness */
@media (max-width: 600px) {
    .control-panel {
        grid-template-columns: 1fr;
    }

    .stats {
        justify-content: space-around;
    }

    .action-buttons {
        grid-column: 1;
    }

    .app-header h1 {
        font-size: 2.5rem;
    }

    .roller-container {
        width: 250px;
        height: 250px;
    }

    .rolling-number {
        font-size: 6rem;
    }
}
