body {
    margin: 0;
    overflow: hidden;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-image: url('../model/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

canvas {
    display: block;
}

.ui-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    color: white;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    user-select: none;
}

.ui-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    color: white;
    z-index: 1001;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
}

.ui-panel.hidden {
    transform: translateX(100%);
}

.ui-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

.ui-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.section {
    margin-bottom: 20px;
}

.control-item {
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.control-label {
    font-size: 14px;
    margin-right: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #555;
    border-radius: 5px;
    outline: none;
    margin-top: 5px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
}

.param-container {
    margin-bottom: 12px;
}

.param-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
}

.debug-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 80vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    color: white;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.debug-panel.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.debug-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.debug-header h3 {
    margin: 0;
    color: #2196F3;
}

.debug-hint {
    font-size: 12px;
    color: #888;
}

.debug-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.debug-content::-webkit-scrollbar {
    width: 8px;
}

.debug-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.debug-content::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.naming-panel {
    position: fixed;
    top: 20%;
    left: 20px;
    width: 320px;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    color: white;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.naming-panel.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.naming-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 12px 12px 0 0;
}

.naming-header h3 {
    margin: 0;
    font-size: 16px;
    color: #2196F3;
}

.naming-content {
    padding: 20px;
}

.naming-row {
    margin-bottom: 15px;
    display: flex;
}

.naming-label {
    width: 60px;
    color: #888;
    font-size: 14px;
}

.naming-id,
.naming-val {
    font-family: monospace;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

.naming-input-container {
    margin-bottom: 20px;
}

#naming-input {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
}

#naming-input:focus {
    border-color: #2196F3;
    background: rgba(255, 255, 255, 0.15);
}

.naming-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.naming-controls button {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.naming-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.naming-controls button:active {
    background: rgba(255, 255, 255, 0.05);
}

.naming-progress {
    font-size: 12px;
    color: #888;
}

.debug-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 6px;
}

.coord-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #2196F3;
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    backdrop-filter: blur(5px);
    z-index: 3000;
    pointer-events: auto;
    cursor: pointer;
    display: none;
    border: 1px solid rgba(33, 150, 243, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.coord-panel.visible {
    display: block;
}