body {
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
    overflow: hidden;
    font-family: sans-serif;
}

h3 {
    font-family: sans-serif;
    margin-top: 2.5em;
}


.container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    flex-grow: 1;
    overflow-y: auto;
    padding: 80px 20px 30px 330px;
    box-sizing: border-box;
}

.particle-container {
    position: relative;
    background-color: transparent;
    border-radius: 8px;
    margin-bottom: 20px;
    box-sizing: border-box;
    cursor: pointer;
    /* Temporarily removing overflow: hidden for testing */
    /* overflow: hidden; */
    display: block;
}

.text-to-cover {
    font-family: sans-serif;
    color: #1a1a1a;
    margin: 0;
    position: relative;
    z-index: 3;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    display: block;
    padding: 5px 10px;
}

#main-text {
    font-size: 4vw;
}

.secondary-text {
    font-size: 2vw;
}

.tertiary-text {
    font-size: 1.3vw;
}

/* 
 * Этот класс больше не нужен, так как скрытие текста управляется библиотекой
 * Оставлен для обратной совместимости с существующим кодом
 */
.text-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: none;
    background-color: transparent;
}

@media (max-width: 800px) {
    .container-wrapper {
        width: 100%;
        padding: 20px 20px 30px 20px;
        gap: 20px;
    }
    #main-text { font-size: 8vw; }
    .secondary-text { font-size: 5vw; }
    .tertiary-text { font-size: 3.5vw; }
}

#controls-container {
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10;
    font-family: sans-serif;
    font-size: 14px;
    color: #333;
    max-width: 300px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding-bottom: 30px;
}

#controls-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
    color: #000;
}

/* Container for each settings row */
#controls-container > div {
    margin-bottom: 15px; /* Slightly increased margin */
    display: flex;
    flex-direction: column; /* Label and control stacked vertically */
    align-items: stretch; /* Stretch across width */
    /* justify-content: flex-start; */ /* Not needed for column layout */
    /* gap: 10px; */ /* Not needed for column layout */
}

/* Main labels */
#controls-container label:not(.sub-label) {
    font-weight: bold;
    flex-shrink: 0;
    /* width: 160px; */ /* Removing width */
    text-align: left;
    margin-bottom: 5px; /* Margin below label */
}

/* Removing global rule, it will be inside control-pair */
/*
#controls-container input[type="range"] {
    vertical-align: middle;
}
*/

/* Container for slider + input pair */
.control-pair {
    display: flex;
    align-items: center;
    /* flex-grow: 1; */ /* Not needed, parent stretches */
    gap: 10px;
    width: 100%; /* Takes full width */
}

.control-pair input[type="range"] {
    flex-grow: 1;
    min-width: 50px;
    vertical-align: middle; /* Adding alignment */
}

.control-pair .value-input {
    flex-shrink: 0;
}

/* Container for Min/Max groups */
.range-group { /* Now just a container for Min/Max rows */
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* width: auto; */
    /* flex-grow: 1; */
    gap: 8px;
    width: 100%; /* Takes full width */
}

/* Min or Max row inside range-group */
.range-group div {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 5px; /* Gap between sub-label and control-pair */
}

/* Min/Max label */
.range-group .sub-label {
    display: inline-block;
    width: 35px;
    font-weight: normal;
    margin-bottom: 0;
    flex-shrink: 0;
    text-align: left;
}

/* Slider + input pair inside Min/Max row */
.range-group .control-pair {
    flex-grow: 1;
    gap: 10px;
    /* width: auto; */ /* Already set globally */
}

.range-group .value-input {
    flex-shrink: 0;
}


#controls-container div:last-child {
    margin-bottom: 0;
}

/* New styles for value inputs */
.value-input {
    width: 50px;
    text-align: right;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    -moz-appearance: textfield;
}

.value-input::-webkit-outer-spin-button,
.value-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}