canvas {
    width: 100vw;
    height: 100vh;
    background: #1a1e33;  /* Updated: lighter than previous deep navy */
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    cursor: grab;
}

canvas:active {
    cursor: grabbing;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: #1c1c1c;  /* New dark grey background */
    position: relative; /* Added for absolute positioning of buttons */
}

/* Sound toggle button styled as circle */
.sound-toggle {
    position: absolute;
    top: 6%; /* Increased from 1% */
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: #3a3; /* green for sound on */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sound-toggle:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.sound-toggle img {
    width: 60%; /* Adjust size as needed */
    height: auto;
}

.sound-toggle.sound-off {
    background: red;
}

.reset-button {
    position: absolute;
    top: 6%; /* Increased from 1% */
    left: 65%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: #444;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.reset-button:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.reset-button img {
    width: 60%;
    height: auto;
}

/* Info panel styling */
.info-button {
    position: absolute;
    top: 6%;
    left: 35%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: #2b6ca3;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.info-button:hover {
    transform: translateX(-50%) scale(1.1);
}

.info-panel {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 500px;
    background: rgba(30, 34, 53, 0.9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    z-index: 10;
    font-family: Arial, sans-serif;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: none;
}

.info-panel.active {
    display: block;
}

.info-panel h2 {
    margin-top: 0;
    border-bottom: 1px solid #4a9eff;
    padding-bottom: 10px;
}

.info-panel .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* Keyboard shortcuts display */
.keyboard-shortcuts {
    margin-top: 15px;
}

.keyboard-shortcuts kbd {
    background: #333;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 0 3px;
}

/* Mobile note styling */
.mobile-note {
    margin-top: 15px;
    font-style: italic;
    color: #8effca;
}

/* Responsive adjustments for mobile devices */
@media screen and (max-width: 600px) {
    /* Fix overlapping buttons on mobile */
    .info-button {
        top: 4%;
        left: 25%;
        width: 40px;
        height: 40px;
    }
    
    .sound-toggle {
        top: 4%;
        left: 50%;
        width: 40px;
        height: 40px;
    }
    
    .reset-button {
        top: 4%;
        left: 75%;
        width: 40px;
        height: 40px;
    }
    
    /* Make button icons fit smaller buttons */
    .info-button img,
    .sound-toggle img,
    .reset-button img {
        width: 55%;
    }
    
    .info-panel {
        width: 90%;
        top: 15%;
    }
}

/* Smaller screens need even more adjustments */
@media screen and (max-width: 360px) {
    .info-button {
        left: 20%;
    }
    
    .reset-button {
        left: 80%;
    }
    
    .weight-control input[type="range"] {
        width: 160px;
    }
}