/* General body styling */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    /* REMOVE the background from here */
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    /* position: relative; is no longer strictly necessary but can be kept */
}

/* ADD a ruleset for the new static background div */
#static-gradient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* MOVE the background here */
    background: linear-gradient(135deg, #3ab2eb 0%, #8f47c2 100%);
    /* Push it to the very back */
    z-index: 0;
}


/* Animated SVG background */
#bg-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Keep its z-index at -1. It will now be on top of the -2 layer */
    z-index: 1;
}

#bg-wrap svg {
    width: 100%;
    height: 100%;
}

/* Container for the input field */
#input-container {
    position: absolute;
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    padding: 2rem;
    width: 100%;
    max-width: 32rem;
    z-index: 10;
}

#input-container label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Styling for the number input field */
#number-input {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
    border-radius: 15px;
    display: block;
    width: 100%;
    padding: 1rem;
    box-sizing: border-box;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#number-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

#number-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Message shown for invalid number input */
#nan-message {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.75rem;
    text-align: center;
    padding: 0.4rem;
}

/* Container where the digits are displayed */
#digit-container {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    position: relative;
    touch-action: none;
    user-select: none; /* Standard */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    -webkit-user-drag: none;
}

/* Class for each individual digit image */
.digit {
    position: absolute;
    transform-origin: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: filter 0.3s ease;
    touch-action: none;
    user-select: none; /* Standard */
    -webkit-user-select: none; /* Safari */
    -ms-user-select: none; /* IE 10+ */
    -webkit-user-drag: none;
}

.digit:hover {
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4)) brightness(1.1);
}

/* Instructions */
.instructions {
    position: absolute;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}