* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 400vh;
    background: #1443FF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Встраиваемая страница: сохраняем высоту документа для эффекта скролла */
html[data-particle-embed="true"] body {
    min-height: 400vh;
}

canvas {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

#controls {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(20, 20, 20, 0.9);
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    min-width: 250px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

/* Стилизация скроллбара для панели управления */
#controls::-webkit-scrollbar {
    width: 8px;
}

#controls::-webkit-scrollbar-track {
    background: rgba(10, 10, 10, 0.5);
    border-radius: 4px;
}

#controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

#controls::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Для Firefox */
#controls {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(10, 10, 10, 0.5);
}

#controls h3 {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: #ccc;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.control-group select,
.control-group input[type="color"] {
    width: 100%;
    margin-bottom: 5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.control-group select {
    padding: 8px 10px;
}

.control-group input[type="color"] {
    height: 38px;
    padding: 4px;
    cursor: pointer;
}

.control-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.control-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.control-group input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

.control-group .value {
    font-size: 11px;
    color: #999;
    float: right;
}

#toggleControls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    backdrop-filter: blur(10px);
    z-index: 10;
}

#toggleControls:hover {
    background: rgba(30, 30, 30, 0.95);
}

#controls.hidden {
    display: none;
}

.apply-button {
    background: rgba(50, 150, 255, 0.8);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    width: 100%;
    margin-top: 10px;
    transition: background 0.2s;
}

.apply-button:hover {
    background: rgba(50, 150, 255, 1.0);
}

.apply-button:active {
    background: rgba(30, 120, 220, 1.0);
}

#curveEditor {
    width: 100% !important;
    height: 200px !important;
    background: rgba(10, 10, 10, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    cursor: crosshair !important;
    margin-top: 0px !important;
    display: block !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    box-sizing: content-box !important;
    overflow: visible !important;
    font-weight: 500 !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.preset-buttons {
    display: flex;
    gap: 5px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.preset-button {
    background: rgba(40, 40, 40, 0.8);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    flex: 1;
    min-width: 60px;
}

.preset-button:hover {
    background: rgba(60, 60, 60, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.preset-button:active {
    background: rgba(50, 150, 255, 0.3);
}

/* Performance Monitor Styles */
#performanceMonitor {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(20, 20, 20, 0.85);
    padding: 12px 16px;
    border-radius: 6px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    font-size: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    min-width: 180px;
    line-height: 1.6;
}

.perf-metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    white-space: nowrap;
}

.perf-metric:last-child {
    margin-bottom: 0;
}

.perf-label {
    color: #fff;
    margin-right: 8px;
}

.perf-value {
    color: #fff;
    font-weight: 500;
}

.perf-value-green {
    color: #4ade80;
}
