:root {
    --primary: rgb(162, 76, 255);
    --secondary: rgb(255, 125, 0);
}

body {
    font-family: 'Montserrat', 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
}

canvas {
    display: block;
}

/* Dark Mode UI Styles */
#ui-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(29, 35, 42, 0.75);
    /* Dark background */
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    width: 280px;
    /* Fixed width */
    transition: height 0.3s ease;
}

.info-text {
    font-size: 0.9rem;
    color: #d1d5db;
    /* Light grey text */
}

.stat-label {
    font-weight: 600;
    color: var(--primary);
}

.water-button {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 4px 15px rgba(162, 76, 255, 0.4);
    overflow: hidden;
    position: relative;
}

.water-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(162, 76, 255, 0.5);
}

.water-button:disabled {
    background: #4b5563;
    cursor: not-allowed;
    transform: translateY(0);
    box-shadow: none;
}

#mute-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    color: #e5e7eb;
}

#mute-button:hover {
    transform: scale(1.1);
}

.reset-button {
    background-color: #991b1b;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.reset-button:hover {
    background-color: #7f1d1d;
}

/* Modal Styles (also dark) */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

#modal {
    background: #1f2937;
    color: #d1d5db;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

#final-reset-button {
    background-color: #4b5563;
    cursor: not-allowed;
}

#final-reset-button.enabled {
    background-color: #ef4444;
    cursor: pointer;
}

#cancel-reset {
    background-color: #374151;
    color: #d1d5db;
}

#cancel-reset:hover {
    background-color: #4b5563;
}

label[for="reset-checkbox"] {
    color: #9ca3af;
}

#reset-checkbox {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

/* Tutorial Styles (also dark) */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tutorial-box {
    background: #1f2937;
    color: #d1d5db;
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--primary);
}

/* --- NEW STYLES --- */

/* Menu Minimizing */
#ui-container.minimized .space-y-2,
#ui-container.minimized #water-button,
#ui-container.minimized .mt-4 {
    display: none;
}

#ui-container.minimized {
    height: auto;
}

#minimize-button svg {
    transition: transform 0.3s ease;
}

#ui-container.minimized #minimize-button svg {
    transform: rotate(180deg);
}

/* Mobile Controls */
#mobile-controls button {
    -webkit-user-select: none;
    /* Safari */
    -ms-user-select: none;
    /* IE 10+ */
    user-select: none;
    /* Standard */
    touch-action: manipulation;
    /* Prevent double-tap zoom */
}