:root {
    --bg-color: #1a1a1a;
    --panel-bg: #2c3e50;
    --accent-color: #2ecc71;
    --text-color: #ecf0f1;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
}

/* 全画面固定 */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: 60px;
    min-height: 60px;
    padding: 0 25px;
    background: var(--panel-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--accent-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    z-index: 10;
}

.logo { font-size: 1.5em; font-weight: 900; letter-spacing: 2px; color: var(--accent-color); }
.logo span { color: #fff; font-weight: 300; }

main {
    display: flex;
    flex: 1; /* 残りの高さをすべて使う */
    overflow: hidden;
}

/* 左側のパーツリスト */
#palette {
    width: 160px;
    background: var(--panel-bg);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-right: 1px solid #444;
}

.part-btn {
    background: #34495e;
    color: #fff;
    border: 1px solid #555;
    padding: 12px 5px;
    text-align: center;
    cursor: pointer;
    font-size: 0.8em;
    border-radius: 4px;
    transition: 0.2s;
}

.part-btn:hover {
    background: var(--accent-color);
    transform: translateX(5px);
}

/* キャンバスの親要素 */
#viewport {
    flex: 1;
    background: #333;
    position: relative;
    overflow: hidden;
}

/* キャンバス自体 */
canvas {
    background: #fafafa;
    display: block;
    cursor: crosshair;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-action {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-action.active {
    background: var(--warning-color);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.4);
}

.btn-del { background: var(--danger-color); }
.btn-del:disabled { opacity: 0.3; cursor: not-allowed; }

/* 編集エリア（数値入力＋ドロップダウン） */
.edit-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #111;
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--accent-color);
    visibility: hidden;
}

.edit-zone input {
    width: 70px;
    background: transparent;
    color: var(--accent-color);
    border: none;
    outline: none;
    text-align: right;
    font-family: monospace;
    font-size: 1.1em;
}

.stats {
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
    font-size: 0.85em;
    min-width: 180px;
    text-align: right;
}
