@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@300&display=swap');

body {
    font-family: 'Zen Kaku Gothic New', sans-serif; /* ここを変更 */
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f0f0f0;
    margin: 20px;
}

/* h1, h2, h3, button, input も同様に変更 */
h1, h2, h3, button, input {
    font-family: 'Zen Kaku Gothic New', sans-serif; /* ここを変更 */
}

/* ゲームルールのセクションに少しスタイルを追加して見やすくします */
#game-rules {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-top: 30px; /* 他のコンテンツとの間にスペースを設ける */
    max-width: 600px; /* 幅を制限して読みやすくする */
    text-align: left; /* テキストを左寄せにする */
}

#game-rules ul {
    list-style: disc; /* リストのスタイルを通常の黒丸に */
    margin-left: 20px;
    margin-bottom: 10px;
}

#game-rules li {
    margin-bottom: 5px;
}

#game-rules p {
    font-size: 0.9em; /* 注意書きを少し小さくする */
    color: #666;
}


#game-container {
    background-color: #eee;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#board {
    display: grid;
    /* JavaScriptでgrid-template-columnsを設定します */
    /* ↓↓ この行を以下の新しい設定に置き換えてください ↓↓ */
    grid-template-columns: repeat(10, 30px); /* 各列の幅を30pxに固定 */
    
    /* ↓↓ 以下を追加してください ↓↓ */
    width: 302px; /* 10列 * 30px/列 + 左右のボーダー2px = 302px */
    height: 302px; /* 高さと幅を同じに */
    
    border: 2px solid #999;
    gap: 0px;
    grid-gap: 0px;
}

.cell {
    width: 30px;
    /* セルの幅 */
    height: 30px;
    /* セルの高さ */
    background-color: #ccc;
    border: 2px solid #fff;
    box-sizing: border-box;
    /* パディングとボーダーを幅に含める */
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 1.2em;
    cursor: pointer;
    user-select: none;
    /* テキスト選択を無効にする */
}

.cell.open {
    background-color: #ddd;
    border: 1px solid #bbb;
    cursor: default;
}

.cell.mine {
    background-color: #f00;
    /* 地雷を踏んだ時の色 */
    color: white;
}

.cell.flagged {
    background-color: #ffc;
    /* 旗を立てた時の色 */
    color: orange;
}

/* 数字の色分け */
.cell.number-1 {
    color: blue;
}

.cell.number-2 {
    color: green;
}

.cell.number-3 {
    color: red;
}

.cell.number-4 {
    color: darkblue;
}

.cell.number-5 {
    color: darkred;
}

.cell.number-6 {
    color: teal;
}

.cell.number-7 {
    color: black;
}

.cell.number-8 {
    color: gray;
}

#message {
    margin-top: 15px;
    font-size: 1.2em;
    color: #d9534f;
    /* エラーメッセージなど */
    min-height: 1.5em;
    /* メッセージが表示されていないときに高さが変動しないように */
}

#reset-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 5px;
}

#reset-button:hover {
    background-color: #4cae4c;
}

#auth-container,
#game-lobby,
#game-container {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    /* max-width: 600px; ★この行を削除またはコメントアウト */
    /* もし削除したくない場合は、以下のように非常に大きな値にする */
    /* max-width: 9999px; */
    text-align: center;
}

#auth-container input,
#game-lobby input {
    padding: 8px;
    margin-right: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#auth-container button,
#game-lobby button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
}

#auth-container button:hover,
#game-lobby button:hover {
    background-color: #0056b3;
}

#game-lobby p {
    margin-top: 15px;
    font-size: 1.1em;
}

#join-game-section {
    margin-top: 15px;
    border-top: 1px dashed #eee;
    padding-top: 15px;
}

#game-id-display {
    font-weight: bold;
    color: #28a745;
}

#start-game-button {
    width: 100%;
}

#scoreboard {
    margin-top: 20px;
    text-align: left;
    width: 100%;
}

#player-scores {
    list-style: none;
    padding: 0;
}

#player-scores li {
    padding: 5px 0;
    border-bottom: 1px dotted #eee;
}

#player-scores li:last-child {
    border-bottom: none;
}

.player-game-over {
    color: #dc3545;
    font-weight: bold;
}

.winner {
    color: #28a745;
    font-weight: bold;
    font-size: 1.1em;
}

/* 既存のCSSに以下を追加 */

#available-games-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

#game-list {
    list-style: none;
    padding: 0;
    max-height: 200px; /* スクロール可能にする */
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
}

#game-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#game-list li:last-child {
    border-bottom: none;
}

#game-list li button {
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #28a745; /* 参加ボタンの色 */
}

#game-list li button:hover {
    background-color: #218838;
}