body {
    font-family: 'Roboto', sans-serif;
    background-color: #0a0a10;
    color: #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent scrollbars from canvas */
}

#star-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#game-container {
    background: rgba(15, 15, 25, 0.55);
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 20px rgba(173, 216, 230, 0.1) inset;
    max-width: 500px;
    width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.1s linear;
}

h1 {
    font-family: 'Playfair Display', serif;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

p {
    color: #ccc;
    line-height: 1.6;
}

#roll-button {
    background: linear-gradient(45deg, #5f72be, #9921e8);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(120, 70, 200, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

#roll-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(120, 70, 200, 0.6);
}

#roll-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(120, 70, 200, 0.4);
}

#roll-button:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: translateY(0);
}

#result-container {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background-color: rgba(0,0,0,0.2);
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#result-container.visible {
    opacity: 1;
    transform: translateY(0);
}

#result-container.hidden, #loader.hidden {
    display: none;
}

#chance {
    font-family: 'Playfair Display', serif;
    color: #87CEEB; /* Sky Blue */
    text-align: center;
    margin-top: 0;
}

#scenario, #outcome {
    min-height: 1.2em; /* Reserve space to prevent layout shift */
}

#outcome {
    font-weight: bold;
    font-size: 1.1em;
    margin-top: 1em;
}

#outcome.lucky {
    color: #2ecc71; /* Bright Green */
}

#outcome.unlucky {
    color: #e74c3c; /* Bright Red */
}

#loader {
    border: 4px solid #444;
    border-top: 4px solid #87CEEB;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 30px auto 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}