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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #000;
    position: relative;
}

/* Fullscreen canvas container */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1;
}

#threejs-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#threejs-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Controls Panel */
.controls-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 1000;
    min-width: 280px;
    max-width: 320px;
    max-height: calc(100vh - 40px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.minimize-btn {
    background: #000;
    border: 1px solid #9a9a9a;
    color: #9a9a9a;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.minimize-btn:hover {
    background: #0a0a0a;
    border-color: #b0b0b0;
}

.controls-panel .minimize-btn {
    align-self: flex-end;
    margin-bottom: 16px;
}

.panel-content {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: calc(100vh - 120px);
    padding-right: 4px;
}

/* Custom scrollbar for panel content */
.panel-content::-webkit-scrollbar {
    width: 6px;
}

.panel-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb {
    background: rgba(74, 158, 255, 0.4);
    border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 158, 255, 0.6);
}

.controls-panel.minimized .panel-content {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.controls-panel.minimized {
    padding: 0;
    min-width: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
}

.controls-panel.minimized .minimize-btn {
    margin-bottom: 0;
}


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

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

/* Mode selector */
.mode-selector label:first-child {
    margin-bottom: 10px;
}

.mode-options {
    display: flex;
    gap: 12px;
}

.mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.mode-option input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
    accent-color: #4a9eff;
}

.mode-option span {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-left: 0;
}

.mode-settings {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    color: #fff;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.control-group label span {
    color: #4a9eff;
    font-weight: 600;
    margin-left: 8px;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #5fb0ff;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(74, 158, 255, 0.6);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4a9eff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(74, 158, 255, 0.4);
    transition: all 0.2s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
    background: #5fb0ff;
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(74, 158, 255, 0.6);
}

/* Checkbox styling */
.control-group .checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.control-group .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #4a9eff;
    border-radius: 4px;
}

.control-group .checkbox-label span {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-left: 0;
}

/* Screenshot button */
.screenshot-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(74, 158, 255, 0.2);
    border: 1px solid rgba(74, 158, 255, 0.4);
    border-radius: 8px;
    color: #4a9eff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.screenshot-btn:hover {
    background: rgba(74, 158, 255, 0.3);
    border-color: rgba(74, 158, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.screenshot-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 158, 255, 0.2);
}

/* Reset button */
.reset-btn {
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.reset-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.json-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.json-modal-content {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.json-modal-title {
    color: #fff;
    font-size: 14px;
    margin: 0;
}

.json-modal-content textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    background: #0a0a0a;
    color: #fff;
    border: 1px solid #333;
    border-radius: 8px;
    font-family: monospace;
    font-size: 12px;
    resize: vertical;
}

.json-modal-content textarea:focus {
    outline: 1px solid #4a9eff;
}


