/* 既存のCSSスタイル */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* スクロール対応 */
    max-width: 1000px; /* 全体の横幅を1200pxに制限 */
    margin: 0 auto; /* 中央寄せ */
}

h1 {
    font-size: 28px;
    color: white;
    background-color: #4CAF50;
    text-align: center;
    padding: 10px;
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
    color: black;
}

td {
    font-size: 0.9rem;
}

input[type="text"], input[type="checkbox"] {
    padding: 5px;
    margin: 0;
    box-sizing: border-box;
    font-size: 0.9rem; /* フォントサイズを少し小さく調整 */
}

/* ボタンスタイル */
button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 32px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    width: 300px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

.center-button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

/* ロード中画面 */
#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 1000;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* モーダルのオーバーレイ */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明の黒背景 */
    z-index: 999; /* ローディング表示よりも奥に配置 */
    display: none; /* 初期状態では非表示 */
}
#loading {
    z-index: 1000; /* ローディング表示を最前面に配置 */
}

/* 統計ページへのリンク関連 */
.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
}

/* リンクボタンのスタイル */
.page-link .link-button {
    padding: 12px 60px;           /* ボタンサイズを小さく調整 */
    font-size: 16px;            /* 小さめの文字サイズ */
    color: #666;                /* 控えめな文字色 */
    background-color: #e0e0e0;  /* 目立たない薄い背景色 */
    border-radius: 30px;
    text-decoration: none;
    margin-top: 10px;
}

.page-link .link-button:hover {
    background-color: #cccccc;  /* ホバー時に少し濃くして強調 */
}


/* 無効な入力スタイル */
.invalid-input {
    border-color: red;
    background-color: #ffe6e6;
    color: darkred;
}

/* ポップアップメッセージ */
#popupMessage {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    color: #4CAF50;
    padding: 10px;
    border-radius: 5px;
    z-index: 1000;
}

/* 入力フィールドの幅を調整 */
.character-input {
    width: 13ch; /* キャラ名を12文字程度の幅に広げる */
}

.small-input {
    width: 10ch; /* 脚質と評価点も8文字程度の幅に広げる */
}

/* スマホ向けのレスポンシブデザイン */
@media (max-width: 768px) {
    body {
        max-width: 100%; /* スマホ画面で横幅いっぱいに表示 */
    }

    table {
        display: table;
        width: 100%;
    }

    th, td {
        padding: 6px;
    }

    input[type="text"] {
        font-size: 0.9rem;
    }

    .small-input {
        width: 10ch; /* スマホでも広めに */
    }

    button {
        font-size: 1rem;
        padding: 10px;
    }

    /* スマホでも入力フィールドの幅を少し広げる */
    .character-input {
        width: 14ch;
    }

    .small-input {
        width: 10ch;
    }
}

/* 更に小さい画面向け */
@media (max-width: 480px) {
    h1 {
        font-size: 1.2rem;
    }

    button {
        font-size: 1rem;
    }

    .small-input {
        width: 35px;
    }
}

/* 名前と条件のフォームコンテナ */
.form-container {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    margin-bottom: 20px;
    gap: 30px;
}

/* ラベルのスタイル（丸みを減らす） */
.form-label {
    background-color: #eaeaea;
    padding: 10px 20px;
    border-radius: 10px; /* 丸みを少し減らす */
    font-weight: bold;
    color: #5a3d2b;
    margin-right: 10px;
}

/* 入力欄とリストの高さを揃える */
.form-input,
.form-select {
    background-color: transparent; /* 背景を透明に */
    padding: 10px 20px;
    border: none;
    border-bottom: 2px solid #d3d3d3;
    color: #5a3d2b;
    font-weight: bold;
    outline: none;
    width: 150px;
    text-align: center;
    appearance: none;
    box-shadow: none;
    height: 40px; /* 高さを統一 */
    line-height: 1.5; /* 下線の位置を揃える */
}

/* 下線の色を薄くしたまま維持 */
.form-underline {
    display: block;
    border-top: 1px solid #d3d3d3;
    margin-top: 10px;
    width: 100%;
}

/* チェックボックスのサイズを大きくする */
input[type="checkbox"] {
    width: 20px;  /* チェックボックスの幅 */
    height: 20px; /* チェックボックスの高さ */
    transform: scale(1.0); /* チェックボックスを拡大 */
    margin-right: 10px; /* 必要に応じて間隔を調整 */
}

input[type="text"], input[type="checkbox"] {
    flex: 1;
    margin: 0 5px;
    text-align: center;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

/* 下線のみのスタイルに変更（キャラ・脚質・評価点に限定） */
.character-input, .small-input {
    border: none;
    border-bottom: 2px solid #d3d3d3; /* 下線を追加 */
    background-color: transparent; /* 背景を透明に */
    padding: 5px;
    margin: 0;
    box-sizing: border-box;
    text-align: center;
    font-size: 1rem;
    width: 100%; /* 入力欄の幅を調整 */
}

.form-input:focus,.form-select:focus,
.character-input:focus, .small-input:focus {
    outline: none; /* フォーカス時に枠を表示しない */
    border-bottom: 2px solid #4CAF50; /* フォーカス時の下線色を変更 */
}

/* トレーナーコンテナ間の間隔を調整 */
.trainer-container + .trainer-container {
    margin-top: 20px;
}

.trainer-container {
    border-radius: 10px; /* 角を少し丸める */
    padding: 20px; /* 内側の余白 */
    margin-bottom: 20px; /* 各トレーナー間の余白 */
}

.trainer-container-1 {
    border: 2px solid #5dade2; /* 薄い青の枠線 */
}

.trainer-container-2 {
    border: 2px solid #f1948a; /* 薄い赤の枠線 */
}

.trainer-title {
    font-size: 14px;
    font-weight: bold;    
    text-align: left;
    color: #999;
    padding-left: 10px; /* 罫線とのスペースを追加 */
    padding-bottom: 0px; /* 罫線とのスペースを追加 */
    margin-bottom: 4px; /* 下にスペースを追加 */
}

.trainer-row-header {
    display: flex;
    justify-content: space-between;
    background-color: #4CAF50; /* 色を#4CAF50に変更 */
    font-size: 16px;
    color: white;
    font-weight: bold;
    padding-bottom: 0px; /* 罫線とのスペースを追加 */
}

/* ヘッダ画像 */
.trainer-row-header img {
    max-height: 28px; /* 高さを最大28pxに制限 */
    max-width: 100%; /* 幅をセル内に収める */
    height: auto; /* 高さを自動調整 */
    object-fit: contain; /* 画像がセル内に収まるように */
}

/* ヘッダと明細の幅調整 */
.trainer-row-header-grid,
.trainer-row {
    display: grid;
    grid-template-columns: 2fr 2fr 2fr 1fr 1fr 1fr; /* 6列に変更 */
    align-items: center; /* 中央揃え */
    text-align: center; /* テキストや画像を中央揃え */
    width: 100%; /* 親要素の幅に合わせる */
    box-sizing: border-box; /* パディングを含む幅を調整 */
}

/* ヘッダのスタイル */
.trainer-row-header-grid {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

.trainer-header {
    padding: 8px; /* 高さ調整 */
}

/* 明細のセルスタイル */
.trainer-row .trainer-cell {
    padding: 8px; /* セル内の余白 */
    overflow: hidden; /* 内容がはみ出る場合非表示 */
}

.icon {
    height: 30px; /* 画像の高さ */
    display: block;
    margin: 0 auto;  /* 画像を中央に配置 */
}
