body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #111;
    color: #eee;
    font-family: Arial, sans-serif;
    position: relative;
}

#controls {
    background: rgba(34, 34, 34, 0.8);
    padding: 10px;
    z-index: 10;
    border-radius: 4px;
}

#controls label,
#controls button,
#controls select,
#controls input,
#controls div:not(.controlRow) {
    margin-top: 4px;
    display: block;
}

#controlButtons,
#pulseRow {
    display: flex;
    gap: 6px;
}

#pulseRow {
    align-items: center;
}

#infoLinks {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    margin-bottom: 0;
    position: absolute;
    bottom: 10px;
    left: 10px;
}
#infoLinks a {
    color: #fff;
    text-decoration: none;
}

#grid {
    background: #000;
    display: block;
}

#tools {
    background: rgba(34, 34, 34, 0.8);
    padding: 10px;
    z-index: 10;
    border-radius: 4px;
}

#tools select,
#tools input,
#tools button {
    margin-top: 4px;
    display: block;
}

#patternSaver {
    background: rgba(34, 34, 34, 0.8);
    padding: 10px;
    z-index: 10;
    border-radius: 4px;
}

#patternSaver input,
#patternSaver button {
    margin-top: 4px;
    display: block;
}

.infoSection {
    background: rgba(34, 34, 34, 0.8);
    padding: 10px;
    z-index: 10;
    border-radius: 4px;
    color: #eee;
}

#menuToggle {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 20;
    background: rgba(34, 34, 34, 0.8);
    color: #eee;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
}

#slideMenu {
    position: fixed;
    top: 0;
    right: -260px;
    width: 250px;
    height: 100%;
    background: rgba(34, 34, 34, 0.9);
    padding: 10px;
    z-index: 15;
    overflow-y: auto;
    transition: right 0.3s ease;
}

#slideMenu.open {
    right: 0;
}

#slideMenu > div {
    position: static;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    #slideMenu {
        top: auto;
        bottom: -260px;
        right: 10px;
        left: 10px;
        width: auto;
        height: auto;
        max-height: 50vh;
        transition: bottom 0.3s ease;
    }

    #slideMenu.open {
        bottom: 60px;
        right: 10px;
    }
}

.popupOverlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(34, 34, 34, 0.95);
    padding: 20px;
    border-radius: 4px;
    z-index: 30;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
    display: none;
}

.popupOverlay.show {
    display: block;
}

.popupOverlay .closePopup {
    position: absolute;
    top: 5px;
    right: 8px;
    background: transparent;
    color: #eee;
    border: none;
    font-size: 18px;
    cursor: pointer;
}
