body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    font-family: Arial, sans-serif;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

canvas {
    border: 0px solid #000;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
    width: 300px; /* Increased width for better layout */
}

button, input {
    margin: 10px 0;
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button {
    background-color: #007bff;
    color: #fff;
    transition: transform 0.3s ease;
}

button:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

input[type="range"] {
    width: 88%;
    cursor: pointer;
    transition: transform 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-ms-thumb:hover {
    transform: scale(1.2);
}


input[type="range"]:active {
    cursor: grabbing;
}

label {
    margin-top: 10px;
    font-weight: bold;
}

.hidden {
    display: none;
}

#winScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    animation: fadeIn 1s ease-in-out, bounce 2s infinite;
    z-index: 10;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    40% {
        transform: translate(-50%, -50%) scale(1.07);
    }
    60% {
        transform: translate(-50%, -50%) scale(0.93);
    }
}

#confettiCanvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
    pointer-events: none;
    animation: fadeIn 1s ease-in-out, fadeOut 1s ease-in-out 7s forwards;
    border: 0cm;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#viewSourceCode {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    text-align: center;
    text-decoration: none;
    color: #000;
}

#viewSourceCode .iconify {
    width: 100%;
    height: 100%;
    color: #000;
    transition: transform 0.3s ease;
}

#viewSourceCode:hover .iconify {
    transform: scale(1.1);
}

/* From Uiverse.io by CYBWEBALI */ 
.btn {
    display: grid;
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: #e3edf7;
    padding: 1.4em;
    border-radius: 10px;
    box-shadow: 6px 6px 10px -1px rgba(0,0,0,0.15),
            -6px -6px 10px -1px rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0);
    cursor: pointer;
    transition: transform 0.5s;
  }
  
  .btn:hover {
    box-shadow: inset 4px 4px 6px -1px rgba(0,0,0,0.2),
            inset -4px -4px 6px -1px rgba(255,255,255,0.7),
            -0.5px -0.5px 0px rgba(255,255,255,1),
            0.5px 0.5px 0px rgba(0,0,0,0.15),
            0px 12px 10px -10px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    transform: translateY(0.5em);
    background: #e3edf7;
  }
  
  .btn svg {
    transition: transform 0.5s;
  }
  
  .btn:hover svg {
    transform: scale(0.9);
    fill: #333333;
  }
  