body {
    font-family: sans-serif;
    background-color: #f0f2f5;
    padding: 20px;
    color: #333;
    margin: 0;
}

h1 { text-align: center; margin-top: 0; margin-bottom: 15px; }

/* 上部コントロールエリア */
.dashboard-controls {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 25px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.host-controls {
    border-right: 2px solid #eee;
    padding-right: 25px;
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.room-id-display {
    font-size: 14px;
    margin-left: 5px;
}

/* メインワークスペース */
.workspace {
    display: flex;
    gap: 20px;
    height: calc(100vh - 140px);
    min-height: 500px;
}

/* 💡 パーツが自動でグリッド配置されるエリア */
.dashboard-grid {
    flex: 3;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 15px;
    overflow-y: auto;
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    align-content: start;
}

/* 動的に追加されるカードの共通デザイン */
.dashboard-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 2px solid #ced4da;
}

/* カードの種類ごとに枠線の色を変えて見やすく */
.dashboard-card.live-type { border-color: #dc3545; } /* ライブ動画は赤枠 */
.dashboard-card.text-type { border-color: #17a2b8; } /* テキストは青緑枠 */

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.card-close-btn {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 2px 6px;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
}
.card-close-btn:hover { background: #e0a800; }

/* ビデオコンテナ */
.video-container {
    background: #000;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
}
.video-container video { width: 100%; height: 100%; object-fit: contain; }

/* 動的テキストエリア */
.card-textarea {
    width: 100%;
    flex: 1;
    min-height: 140px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    font-size: 13px;
}

/* チャットサイドバー */
.chat-sidebar {
    flex: 1;
    max-width: 320px;
    min-width: 250px;
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}
.chat-sidebar h3 { margin: 0 0 10px 0; font-size: 15px; border-bottom: 2px solid #333; padding-bottom: 5px; }

.chat-list {
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    border-radius: 4px;
}

.chat-input-area { display: flex; gap: 5px; }
button { padding: 6px 12px; font-size: 13px; cursor: pointer; color: white; border: none; border-radius: 4px; }
input { padding: 6px; font-size: 13px; border: 1px solid #ccc; border-radius: 4px; }

/* 💡 「配信を開始」ボタンの文字をはっきり読めるようにピンポイント修正 */
#start-btn {
    background-color: #28a745 !important; /* ボタンの背景色をはっきりとした緑色に */
    color: #ffffff !important;           /* 文字色を真っ白に */
    font-weight: bold !important;        /* 文字を太字にしてクッキリさせる */
    border: 1px solid #1e7e34 !important;/* 枠線をつけてボタンの輪郭を強調 */
}

/* ボタンの上にマウスを乗せたとき（ホバー時）の色も調整 */
#start-btn:hover {
    background-color: #218838 !important;
}

/* 💡 「配信を開始」ボタンの文字をはっきり読めるようにピンポイント修正 */
#watch-btn {
    background-color: #28a745 !important; /* ボタンの背景色をはっきりとした緑色に */
    color: #ffffff !important;           /* 文字色を真っ白に */
    font-weight: bold !important;        /* 文字を太字にしてクッキリさせる */
    border: 1px solid #1e7e34 !important;/* 枠線をつけてボタンの輪郭を強調 */
}

/* ボタンの上にマウスを乗せたとき（ホバー時）の色も調整 */
#watch-btn:hover {
    background-color: #218838 !important;
}