body {
    margin: 0;
    overflow: hidden;
    background-color: #0f172a;
    color: white;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    position: relative;
}

.simulation-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.phone-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: #1e293b;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #0f172a;
}

/* 모바일 우선 - 하단 드로어 스타일 */
.controls-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px 24px 0 0;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow-y: auto;
    transform: translateY(calc(100% - 60px));
    transition: transform 0.3s ease;
}

.controls-sidebar.expanded {
    transform: translateY(0);
}

/* 드로어 핸들 */
.drawer-handle {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    margin: 0 auto 12px;
    cursor: pointer;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
}

.drawer-title {
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.drawer-toggle {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.controls-sidebar.expanded .drawer-toggle {
    transform: rotate(180deg);
}

/* 컨트롤 내용 */
.controls-content {
    display: none;
}

.controls-sidebar.expanded .controls-content {
    display: block;
}

/* 태블릿 이상 - 사이드바 스타일 */
@media (min-width: 768px) {
    body {
        flex-direction: row;
    }

    .controls-sidebar {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        width: 360px;
        max-height: 100vh;
        border-radius: 0;
        border-top: none;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding: 24px;
        transform: translateY(0);
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.2);
    }

    .drawer-handle {
        display: none;
    }

    .drawer-header {
        cursor: default;
        margin-bottom: 24px;
    }

    .drawer-toggle {
        display: none;
    }

    .controls-content {
        display: block !important;
    }

    .phone-frame {
        border-radius: 0;
    }

    canvas {
        border-radius: 0;
    }
}

/* 데스크톱 - 폰 프레임 복원 */
@media (min-width: 1024px) {
    .simulation-area {
        padding: 40px;
    }

    .phone-frame {
        max-width: 480px;
        aspect-ratio: 9 / 19.5;
        height: auto;
        max-height: 90vh;
        border-radius: 48px;
        box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.5), 0 0 0 10px #334155;
    }

    canvas {
        border-radius: 40px;
    }
}

/* 슬라이더 스타일 */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #60a5fa;
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
    border: 2px solid #1e293b;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #475569;
    border-radius: 2px;
}

input[type=range]:focus {
    outline: none;
}

/* 색상 피커 스타일 */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
}

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

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* 스크롤바 스타일 */
.controls-sidebar::-webkit-scrollbar {
    width: 6px;
}

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

.controls-sidebar::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 3px;
}

.controls-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* 터치 친화적 버튼 크기 */
@media (max-width: 767px) {
    button {
        min-height: 44px;
        min-width: 44px;
    }

    input[type=range]::-webkit-slider-thumb {
        height: 24px;
        width: 24px;
        margin-top: -10px;
    }

    input[type="color"] {
        width: 44px;
        height: 44px;
    }
}