body {
    font-family: 'Orbitron', 'Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #111827;
    color: white;
    user-select: none;
    /* テキスト選択防止 */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Panel Styles */
.panel-section {
    border: 1px solid #374151;
    background-color: #1f2937;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    /* max-height: 48px; */
    overflow: hidden;
}

.panel-header {
    background-color: #374151;
    padding: 0.75rem 1rem;
    min-height: 48px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.panel-header:hover {
    background-color: #4b5563;
}

.panel-content {
    /* padding: 1rem; */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.panel-content.active {
    min-height: 300px;
    /* 十分な高さ */
    overflow-y: auto;
}

/* Draggable Items */
.draggable-item {
    cursor: grab;
    margin: 6px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.draggable-item:hover {
    border-color: #3b82f6;
    background-color: #ffffff;
    transform: scale(1.05);
}

.draggable-item:active {
    cursor: grabbing;
}

/* Canvas Area */
#canvas-container {
    background-image:
        linear-gradient(45deg, #1f2937 25%, transparent 25%),
        linear-gradient(-45deg, #1f2937 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1f2937 75%),
        linear-gradient(-45deg, transparent 75%, #1f2937 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #111827;
    overflow: hidden;
    position: relative;
    /* 中央配置用 */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 実際に編集するエリア（スケーリングして表示） */
#editor-stage {
    width: 1536px;
    height: 2018px;
    position: fixed;
    background-color: rgba(255, 255, 255, 0.05);
    /* 範囲がわかるように薄く表示 */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    /* 初期状態はCSSで縮小表示（JSで制御） */
    transform-origin: center center;
    /* transform: scale(0.3);  <-- JSでウィンドウサイズに合わせて計算します */
}

/* 配置されたパーツ */
/* .placed-part {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
    transition: filter 0.2s;
} */

/* 配置されたパーツ */
.placed-part {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    /* 中心基準 */
    pointer-events: auto;
    cursor: pointer;
    transition: filter 0.2s;

    /* --- 修正箇所: ここから --- */
    max-width: none !important;
    /* Tailwindによる自動縮小を防止 */
    height: auto;
    /* --- 修正箇所: ここまで --- */
}

/* 選択中のパーツ */
.placed-part.selected {
    filter: drop-shadow(0 0 5px rgb(221, 255, 0)) drop-shadow(0 0 10px #c3ff00);
    z-index: 1000 !important;
    /* 編集時は最前面へ（任意） */
}