:root {
    --bg-color: #f8fafc;
    /* White/Light Gray */
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --accent-color: #f97316;
    /* Orange 500 */
    --accent-glow: rgba(249, 115, 22, 0.4);
    --primary-color: #3b82f6;
    /* Blue 500 */
    --success-color: #10b981;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    /* Prevent horizontal scroll from background glow */
    position: relative;
}

/* Dynamic Background - Clean Gradient Mesh */
.background-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent 40%),
        radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.15), transparent 40%);
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Glass/Clean Card */
.glass-effect {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.1);
    width: 100%;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 40px;
}

/* Number Display */
.result-container {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.number-display {
    font-family: 'Inter', sans-serif;
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(249, 115, 22, 0.2);
    transition: all 0.3s ease;
}

/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Info Section */
.info-section {
    min-height: 60px;
    margin-bottom: 30px;
}

.status-text {
    font-size: 1.1rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.status-text.ready {
    color: var(--primary-color);
}

.status-text.locked {
    color: var(--text-secondary);
}

.timestamp {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

/* Buttons */
.glow-button {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.glow-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(249, 115, 22, 0.5);
}

.glow-button:active {
    transform: translateY(1px);
}

.glow-button:disabled {
    background: #e2e8f0;
    box-shadow: none;
    cursor: not-allowed;
    color: #94a3b8;
    transform: none;
}

.text-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    margin-top: 16px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    text-decoration: none;
}

.text-button:hover {
    color: var(--primary-color);
}

/* Footer */
footer {
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

footer img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.footer-text {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }

    .glass-effect {
        padding: 30px 20px;
        border-radius: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 30px;
    }

    .result-container {
        height: 140px;
        margin-bottom: 16px;
    }

    .number-display {
        font-size: 6rem;
        /* Smaller font for mobile */
    }

    .spinner {
        width: 50px;
        height: 50px;
    }

    .glow-button {
        padding: 14px 32px;
        font-size: 1.1rem;
    }
}

@media (max-width: 380px) {
    .number-display {
        font-size: 5rem;
        /* Even smaller for very small screens */
    }

    h1 {
        font-size: 1.8rem;
    }
}

/* Animation Effects */
.motion-blur {
    filter: blur(1px);
    transform: scale(0.98);
}