html, body { height: 100%; margin: 0; padding: 0; font-family: sans-serif; background: #023e8a; color: white; }
.container { height: 100%; width: 100%; box-sizing: border-box; }
h1 { text-align: center; margin: 0; padding: 15px 0; }
h3 { margin-top: 0; }
.box { background: rgba(0, 0, 0, 0.45); padding: 15px; border-radius: 10px; margin-bottom: 15px; }
.lobby-box { max-width: 420px; margin: 40px auto; text-align: center; }
.lobby-box input, .lobby-box button { width: 85%; box-sizing: border-box; }
input, select, button { padding: 8px 12px; font-size: 15px; border-radius: 6px; border: none; margin: 4px 0; }
button { background: #f77f00; color: white; font-weight: bold; cursor: pointer; transition: 0.15s; }
button:hover { filter: brightness(1.1); }
.flex-row { display: flex; flex-wrap: wrap; gap: 15px; align-items: flex-start; }
.player-card { background: rgba(255,255,255,0.12); padding: 8px 12px; border-radius: 6px; margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; }
.color-badge { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; margin-right: 8px; }
#errorBox { background: #d00000; color: white; padding: 10px; display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 999; }

/* BGA風フルスクリーン3カラムレイアウト */
.bga-fullscreen { display: flex; flex-direction: column; height: 100vh; padding: 8px; box-sizing: border-box; background: #03045e; }
.bga-topbar { background: rgba(0, 0, 0, 0.55); padding: 8px 16px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; margin-bottom: 8px; }
.turn-banner { background: #f77f00; color: #fff; padding: 6px 18px; border-radius: 20px; font-weight: bold; font-size: 16px; }
.dice-box { background: rgba(255,255,255,0.18); padding: 6px 14px; border-radius: 8px; font-size: 18px; }

.bga-grid { display: flex; flex: 1; gap: 10px; min-height: 0; }
/* 左：大きな手札パネル */
.bga-left-hand { width: 155px; flex-shrink: 0; background: rgba(0, 0, 0, 0.5); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.hand-title { text-align: center; font-weight: bold; font-size: 14px; color: #90e0ef; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 6px; }
.hand-card-big { flex: 1; border-radius: 8px; padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: bold; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.hand-card-big strong { font-size: 26px; }

/* 中央：鮮やかで深い青の海＆大きな盤面 */
.bga-center-board { flex: 1; background: radial-gradient(circle, #0096c7 0%, #0077b6 65%, #023e8a 100%); border-radius: 12px; display: flex; justify-content: center; align-items: center; overflow: hidden; box-shadow: inset 0 0 30px rgba(0,0,0,0.4); }
#hexMap { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }

/* 右：プレイヤー情報＆アクション */
.bga-right-panel { width: 250px; flex-shrink: 0; background: rgba(0, 0, 0, 0.5); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; }
.bga-player-box { background: rgba(255,255,255,0.1); border-left: 6px solid #ccc; padding: 8px 10px; border-radius: 6px; margin-bottom: 8px; }
.bga-player-box.active-turn { background: rgba(252, 191, 73, 0.28); box-shadow: 0 0 10px rgba(252,191,73,0.6); }
.bga-actions { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.bga-actions button { width: 100%; padding: 12px; font-size: 15px; margin: 0; }
.win-btn { background: linear-gradient(45deg, #f77f00, #fcbf49); color: #000; font-size: 17px !important; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.03); } 100% { transform: scale(1); } }

/* 勝利リザルトモーダル */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; justify-content: center; align-items: center; z-index: 100; }
.modal-box { background: #1d3557; border: 3px solid #fcbf49; padding: 25px; border-radius: 14px; width: 90%; max-width: 420px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.6); }
/* サイコロの回転・揺れアニメーション */
@keyframes diceShake { 0%, 100% { transform: rotate(0deg) scale(1); } 25% { transform: rotate(-12deg) scale(1.15); } 75% { transform: rotate(12deg) scale(1.15); } }
.dice-rolling { display: inline-block; animation: diceShake 0.12s infinite; color: #ffbe0b; }
/* 建設可能な頂点・辺の強調アニメーション */
@keyframes buildGlow { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }
.buildable-spot { animation: buildGlow 1.1s infinite; }
/* ゲームログ＆チャット欄 */
.bga-log-box { flex: 1; display: flex; flex-direction: column; min-height: 150px; background: rgba(0, 0, 0, 0.45); border-radius: 8px; padding: 8px; margin: 6px 0; border: 1px solid rgba(255,255,255,0.15); }
.bga-log-list { flex: 1; overflow-y: auto; font-size: 12px; line-height: 1.45; text-align: left; padding-right: 4px; }
.log-item { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.08); word-break: break-all; }
.log-sys { color: #90e0ef; }
.log-dice { color: #ffbe0b; font-weight: bold; }
.log-chat { color: #ffffff; background: rgba(255,255,255,0.08); padding: 4px 6px; border-radius: 4px; margin: 2px 0; }
/* 建設＆発展カード コスト早見表 */
.cost-guide-box { background: rgba(0, 0, 0, 0.45); border-radius: 8px; padding: 8px; margin-top: 4px; border: 1px solid rgba(255,255,255,0.15); }
.cost-title { font-size: 12px; font-weight: bold; color: #ffbe0b; text-align: center; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.15); padding-bottom: 4px; }
.cost-row { display: flex; justify-content: space-between; align-items: center; font-size: 11px; padding: 4px 6px; border-radius: 4px; margin-bottom: 3px; background: rgba(255,255,255,0.06); color: #bbb; }
.cost-row.can-afford { background: rgba(42, 157, 143, 0.35); color: #ffffff; font-weight: bold; border-left: 3px solid #ffbe0b; }
