.Back {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.Back a {
    background: #000;
    color: #fff;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.95rem;
    transition: background-color 0.2s, transform 0.2s;
}

.Back a:hover {
    background: #222;
    transform: translateY(-2px);
}

#confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;
}

.rng-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1f254f, #0f1220);
    padding: 20px;
}

.rng-card {
    background: #181c3a;
    padding: 35px 30px;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.rng-card h2 {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.rng-card p {
    opacity: 0.85;
    margin-bottom: 25px;
}

.inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.input-group label {
    font-size: 0.85rem;
    opacity: 0.8;
}

.input-group input {
    background: #0f1220;
    border: 1px solid #2a2f66;
    border-radius: 8px;
    padding: 8px;
    color: white;
    text-align: center;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #04AA6D;
}

button {
    background: #04AA6D;
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    font-size: 1.1rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

button:hover {
    background-color: #03995f;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.result {
    margin-top: 25px;
    font-size: 2.6rem;
    font-weight: bold;
    color: #04AA6D;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        filter 0.15s ease;
}

.result.rolling {
    text-shadow:
        0 0 8px rgba(4, 170, 109, 0.6),
        0 0 16px rgba(4, 170, 109, 0.4);
    animation: shake 0.15s infinite;
    filter: blur(2px);
}

.result.fast {
    filter: blur(4px);
}

.result.final {
    text-shadow:
        0 0 12px rgba(4, 170, 109, 0.9),
        0 0 30px rgba(4, 170, 109, 0.7);
    transform: scale(1.08);
    filter: blur(0);
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

@media (max-width: 420px) {
    .inputs {
        grid-template-columns: 1fr;
    }
}
