* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans', sans-serif;
    user-select: none;
}

body {
    background-color: #121212;
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* 画面共通 */
.screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* タイトル画面 */
#title-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #2c3e50, #000000);
}
#title-screen h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 320px;
}
input[type="text"], input[type="number"] {
    padding: 0.8rem;
    border-radius: 5px;
    border: none;
    background-color: #222;
    color: #fff;
    font-size: 1rem;
}
button {
    padding: 0.8rem;
    border-radius: 5px;
    border: none;
    background-color: #2980b9;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
button:hover { background-color: #3498db; }

/* ゲーム画面ヘッダー */
.game-header {
    height: 60px;
    background-color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 2px solid #333;
}
.header-left, .header-right {
    display: flex;
    gap: 0.5rem;
}

/* メインレイアウト */
.game-layout {
    display: flex;
    flex: 1;
    height: calc(100vh - 90px);
}

/* 左側サイドバー（参加者） */
.sidebar {
    width: 25%;
    background-color: #161616;
    border-right: 2px solid #333;
    padding: 1rem;
    overflow-y: auto;
}
.sidebar h3 { margin-bottom: 1rem; border-bottom: 1px solid #444; padding-bottom: 0.5rem;}
#player-list li {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #222;
    border-radius: 4px;
    list-style: none;
}

/* 右側メインコンテンツ */
.main-content {
    width: 75%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

#lobby-view {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
.start-action-area {
    text-align: center;
    margin-bottom: 2rem;
}
#status-message {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #bbb;
}
#start-game-btn {
    font-size: 1.8rem;
    padding: 1rem 3rem;
}
#start-game-btn.disabled {
    background-color: #555 !important;
    cursor: not-allowed;
}
#start-game-btn.ready { background-color: #1dd1a1; }

/* 会議画面プレートグリッド (横3列、縦最大5列、溢れたらスライドスクロール) */
#player-plates-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* プレートデザイン */
.plate {
    background-color: #2c3e50;
    height: 70px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 10px;
    border: 2px solid transparent;
    cursor: pointer;
}
.plate .plate-left {
    width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.plate .plate-center {
    width: 50%;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plate .plate-right {
    width: 25%;
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* 投票用ボタン (半透明) */
.vote-action-btn {
    padding: 2px 6px;
    font-size: 0.8rem;
    border-radius: 4px;
}
.btn-yes { background-color: #2ecc71; }
.btn-no { background-color: #e74c3c; }

/* 投票済みドット */
.vote-dot {
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 5px #fff;
}

/* 状態クラス */
.plate.dead {
    background-color: #444 !important;
    opacity: 0.6;
}
.plate.dead .plate-center {
    text-decoration: line-through;
    color: #888;
}

/* チャットボックス */
.chat-box {
    position: absolute;
    top: 65px;
    right: 10px;
    width: 320px;
    height: 400px;
    background-color: rgba(20, 20, 20, 0.95);
    border: 2px solid #444;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.chat-header { padding: 0.5rem; background:#222; font-weight:bold; border-bottom:1px solid #444; }
.chat-logs { flex: 1; padding: 0.5rem; overflow-y: auto; font-size: 0.9rem; }
.chat-msg { margin-bottom: 0.4rem; word-break: break-all; }
.chat-input-area { display: flex; padding: 0.5rem; gap: 0.3rem; border-top:1px solid #444;}
.chat-input-area input { flex: 1; padding: 0.4rem; background:#333; border:none; color:#fff;}

/* フッター */
.game-footer {
    height: 30px;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: #666;
}

/* 暗転演出レイヤー */
.blackout-overlay {
    position: fixed;
    top:0; left:0; width:100vw; height:100vh;
    background-color: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}
.overlay-text {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: center;
    transition: color 1s ease; /* 滑らかな色変化用 */
}

/* 結果画面 */
.result-overlay {
    position: fixed;
    top:0; left:0; width:100vw; height:100vh;
    background-color: rgba(0,0,0,0.95);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}
#result-role-list {
    margin: 2rem 0;
    max-height: 50vh;
    overflow-y: auto;
    width: 300px;
}
.result-actions { display: flex; gap: 2rem; }

/* モーダル */
.modal {
    position: fixed;
    top:0; left:0; width:100vw; height:100vh;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.modal-content {
    background-color: #222;
    padding: 2rem;
    border-radius: 8px;
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.setting-item { display: flex; justify-content: space-between; align-items: center; }

/* ボタン・役職カラー */
.btn-danger { background-color: #c0392b; }
.btn-danger:hover { background-color: #e74c3c; }
.btn-success { background-color: #27ae60; }
.btn-success:hover { background-color: #2ecc71; }

.c-werewolf { color: #ff4d4d; } /* 人狼：赤 */
.c-madman { color: #ff4d4d; }   /* 狂人：最終は赤（演出時は特殊） */
.c-citizen { color: #1dd1a1; }  /* 市民：水色（ミント） */
.c-detective { color: #e67e22; }/* 探偵：茶色（オレンジ寄りの見やすい茶） */
.c-white { color: #ffffff; }