/* --- 全体のリセットとスマホ画面フル対応 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background-color: #050505;
    color: #eee;
    font-family: sans-serif;
    overflow: hidden;
}

/* --- 大枠のレイアウト：左右分割 --- */
#main-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    padding: 5px;
    gap: 8px;
}

/* --- 左側：戦闘ログ・コマンド --- */
#left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

/* --- 右側：ステータス・在庫 --- */
#right-panel {
    width: 260px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    border-left: 1px solid #444;
    padding-left: 8px;
}

/* --- 左パネル内の要素 --- */
#header-title {
    font-size: 13px;
    font-weight: bold;
    color: #fa0;
    margin-bottom: 4px;
}

.boss-header {
    background: #1a1a1a;
    border: 1px solid #444;
    padding: 4px;
    margin-bottom: 4px;
    border-radius: 3px;
}

#boss-info-text {
    font-size: 11px;
    margin-bottom: 4px;
}

.hp-bar-container {
    width: 100%;
    height: 6px;
    background: #000;
}

#boss-hp-bar {
    height: 100%;
    background: #f55;
    width: 0%;
    transition: width 0.2s ease-out;
}

#screen {
    flex: 1;
    background: #000;
    border: 1px solid #444;
    padding: 8px;
    font-size: 11px;
    line-height: 1.6;
    overflow-y: auto;
    margin-bottom: 4px;
    border-radius: 3px;
}

#command-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 60px;
}
#command-area > div {
    display: flex;
    gap: 4px;
}

/* --- ボタンの共通デザイン --- */
button {
    padding: 10px;
    border: 1px solid #555;
    background-color: #2c3e50;
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    border-radius: 4px;
    flex: 1;
    touch-action: manipulation;
}
button:active { filter: brightness(0.7); }
.btn-time { background-color: #2c3e50; }
.btn-warning { background-color: #8a3b22; }
.btn-danger { background-color: #721c24; }
.btn-party { background-color: #27ae60; }
.btn-equip { background-color: #2980b9; padding: 6px; }

/* --- 右パネル内の要素 --- */
.status-title {
    font-size: 12px;
    font-weight: bold;
    color: #8cf;
    border-bottom: 1px solid #444;
    margin-bottom: 6px;
    padding-bottom: 2px;
    position: sticky;
    top: 0;
    background: #050505;
}

.member-card {
    background: #181818;
    border: 1px solid #444;
    padding: 6px;
    margin-bottom: 6px;
    font-size: 10px;
    line-height: 1.4;
    border-radius: 3px;
}
.member-row {
    display: flex;
    justify-content: space-between;
}

/* --- スマホ縦画面の保険 --- */
@media screen and (orientation: portrait) {
    #main-layout {
        flex-direction: column;
    }
    #left-panel { height: 60%; }
    #right-panel {
        width: 100%;
        height: 40%;
        border-left: none;
        border-top: 1px solid #444;
        padding-left: 0;
        padding-top: 8px;
    }
}