html {
    overflow: hidden;
}

#container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
    padding: var(--padding-outside);
    height: calc(100svh - 52px);
    box-sizing: border-box;
}

#container > div {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 60px;
}

#container > div > svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

div {
    min-width: 20px;
}

.double-centering {
    display: flex; 
    justify-content: center; 
    align-items: center;
}

.home-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--my-black);
    color: var(--my-white) !important;
    text-decoration: none !important;
    border: var(--border-style);
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 14px;
    height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-button:hover {
    background-color: var(--my-white);
    color: var(--my-black) !important;
    transform: translateY(-1px);
    box-shadow: 2px 2px 0 var(--my-black);
}

.explore-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: var(--my-black);
    color: var(--my-white) !important;
    text-decoration: none !important;
    border: var(--border-style);
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 14px;
    height: 48px;
    box-sizing: border-box;
}

.explore-button:hover {
    background-color: var(--my-white);
    color: var(--my-black) !important;
    transform: translateY(-1px);
    box-shadow: 2px 2px 0 var(--my-black);
}

.controls-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: var(--my-black);
    color: var(--my-white);
    border: var(--border-style);
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    font-family: sans-serif;
    height: 48px;
    box-sizing: border-box;
}

.controls-button:hover {
    background-color: var(--my-white);
    color: var(--my-black);
    transform: translateY(-1px);
    box-shadow: 2px 2px 0 var(--my-black);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    right: 20px;
    bottom: 74px;
    width: 300px;
    background-color: var(--my-white);
    border: var(--border-style);
    box-shadow: 4px 4px 0 var(--my-black);
}

.modal-content {
    background-color: var(--my-white);
    width: 100%;
}

.modal-header {
    padding: 15px;
    border-bottom: var(--border-style);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}

.close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 15px;
}

.control-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group input[type="range"] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    border-radius: 0;  
    background: none;
    outline: var(--border-style);
    margin: 0;
    cursor: pointer;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 11px;
    border-radius: 0; 
    background: var(--my-black);
    border: none;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 11px;
    border-radius: 0; 
    background: var(--my-black);
    border: none;
    cursor: pointer;
}

.control-group span {
    font-size: 12px;
    color: #666;
    margin-left: auto;
    min-width: 30px;
    text-align: right;
}

.control-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--my-white);
    cursor: pointer;
    position: relative;
    border: 2px solid var(--my-black);
}

.control-group input[type="checkbox"]:checked {
    background-color: var(--my-black);
}

.control-group input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    left: 1px;
    top: -1px;
    color: var(--my-white);
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}

.reset-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--my-black);
    color: var(--my-white);
    border: var(--border-style);
    transition: all 0.2s ease;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    font-family: sans-serif;
    width: 100%;
    text-align: center;
}

.reset-button:hover {
    background-color: var(--my-white);
    color: var(--my-black);
    transform: translateY(-1px);
    box-shadow: 2px 2px 0 var(--my-black);
}

/* Bottom Button Bar */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 52px;
    background-color: var(--my-white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 4px 4px 4px;
    box-sizing: border-box;
}

.bottom-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Full width button for library page */
.explore-button.full-width {
    flex: 1;
    width: 100%;
}

/* Ensure consistent button heights */
.controls-button, .explore-button, .home-button {
    height: 48px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop layout - all buttons in a row */
@media (min-width: 801px) {
    .bottom-bar {
        flex-direction: row;
    }
    
    .controls-button {
        order: 2;
    }
    
    .bottom-buttons {
        display: contents;
    }
    
    .explore-button {
        order: 1;
    }
    
    .home-button {
        order: 3;
    }
}

/* Library page specific layout (no controls button) */
.bottom-bar:not(:has(.controls-button)) {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.bottom-bar:not(:has(.controls-button)) .explore-button.full-width {
    flex: 1;
}

.bottom-bar:not(:has(.controls-button)) .home-button {
    padding: 4px 8px;
    flex-shrink: 0;
}

/* Responsive - Below 1024px: Show text, hide icons */
@media (max-width: 1024px) {
    .home-icon, .controls-icon, .explore-icon {
        display: none !important;
    }
    
    .home-text, .controls-text, .explore-text {
        display: inline !important;
    }
}
