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

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: #0a0a1a;
    color: white;
    overflow: hidden;
}

#container {
    width: 100vw;
    height: calc(100vh - var(--sui-header-height, 52px));
    margin-top: var(--sui-header-height, 52px);
    position: relative;
}

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

/* 로딩 화면 → shared-ui.css .sui-loading 사용 */

/* 상단 헤더 — 레이아웃은 .sui-header (shared-ui.css) 에서 처리 */
/* #header 고유 스타일만 유지 */

/* 컨트롤 패널 */
#controls {
    position: fixed;
    bottom: calc(var(--sui-footer-height, 28px) + 10px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.control-btn {
    padding: 10px 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--sui-radius-pill, 999px);
    color: #888;
    cursor: pointer;
    font-size: 0.82rem;
    font-family: var(--sui-font, 'Noto Sans KR', sans-serif);
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.3);
    color: #ccc;
}

.control-btn.active {
    background: rgba(255, 215, 0, 0.25);
    border-color: var(--sui-gold, #ffd700);
    color: var(--sui-gold, #ffd700);
}

.control-btn.active:hover {
    background: rgba(255, 215, 0, 0.35);
}

/* 조작 안내 */
#help {
    position: fixed;
    bottom: calc(var(--sui-footer-height, 28px) + 10px);
    right: 30px;
    padding: 12px 16px;
    background: rgba(10,10,26,0.82);
    border: 1px solid var(--sui-border-panel, rgba(255,215,0,0.12));
    border-radius: var(--sui-radius-md, 10px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 0.78rem;
    color: var(--sui-text-muted, #a0a0b0);
    z-index: 90;
}

#help p {
    margin: 5px 0;
}

/* 조명 프리셋 패널 */
#light-panel {
    position: fixed;
    top: calc(var(--sui-header-height, 52px) + 12px);
    left: 30px;
    padding: 10px;
    background: rgba(10,10,26,0.82);
    border: 1px solid var(--sui-border-panel, rgba(255,215,0,0.12));
    border-radius: var(--sui-radius-md, 10px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
}

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

.preset-btn {
    padding: 8px 14px;
    background: var(--sui-gold-bg, rgba(255,215,0,0.10));
    border: 1px solid var(--sui-border, rgba(255,215,0,0.20));
    border-radius: var(--sui-radius-pill, 999px);
    color: var(--sui-text-muted, #a0a0b0);
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.25s ease;
    min-height: 36px;
}

.preset-btn:hover {
    background: var(--sui-gold-bg-hover, rgba(255,215,0,0.20));
    border-color: var(--sui-gold, #ffd700);
    color: white;
}

.preset-btn.active {
    background: rgba(255, 215, 0, 0.25);
    border-color: var(--sui-gold, #ffd700);
    color: var(--sui-gold, #ffd700);
}

/* 절단 컨트롤 패널 */
#clip-panel {
    position: fixed;
    top: calc(var(--sui-header-height, 52px) + 12px);
    right: 30px;
    width: 220px;
    padding: 15px;
    background: rgba(10, 10, 26, 0.82);
    border: 1px solid var(--sui-border, rgba(255,215,0,0.20));
    border-radius: var(--sui-radius-md, 10px);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: none;
}

#clip-panel.visible {
    display: block;
}

.clip-panel-title {
    font-size: 0.85rem;
    color: var(--sui-gold, #ffd700);
    margin-bottom: 12px;
    font-weight: 500;
}

.clip-mode-btns {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.clip-mode-btn {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #888;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
}

.clip-mode-btn:hover {
    background: var(--sui-gold-bg, rgba(255,215,0,0.10));
    border-color: var(--sui-border, rgba(255,215,0,0.20));
}

.clip-mode-btn.active {
    background: var(--sui-gold-bg-hover, rgba(255,215,0,0.20));
    border-color: var(--sui-gold, #ffd700);
    color: var(--sui-gold, #ffd700);
}

.clip-slider-group {
    margin-bottom: 10px;
}

.clip-slider-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 6px;
}

.clip-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.clip-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--sui-gold, #ffd700);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.clip-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.clip-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--sui-gold, #ffd700);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* 반응형 */
@media (max-width: 768px) {
    /* 조명 프리셋: 상단 중앙 배치 */
    #light-panel {
        top: calc(var(--sui-header-height, 52px) + 8px);
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        padding: 6px 10px;
    }

    .preset-buttons {
        justify-content: center;
        flex-wrap: nowrap;
    }

    .preset-btn {
        padding: 6px 14px;
        font-size: 0.68rem;
        white-space: nowrap;
    }

    #help {
        display: none;
    }

    /* 컨트롤 버튼: 하단 전체 너비 */
    #controls {
        bottom: calc(var(--sui-footer-height, 28px) + 6px);
        left: 10px;
        right: 10px;
        transform: none;
        gap: 6px;
        justify-content: center;
    }

    .control-btn {
        padding: 7px 14px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    #btn-fullscreen {
        display: none;
    }

    #clip-panel {
        position: fixed;
        top: auto;
        bottom: calc(var(--sui-footer-height, 28px) + 55px);
        right: 10px;
        left: 10px;
        width: auto;
        z-index: 130;
    }
}
