body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    text-align: center;
    margin: 30px;
    background-color: transparent;
    margin: 0;
    padding: 10px; /* 親ページとの間に少しだけ隙間が欲しい場合は、paddingで調整 */
}

h1 {
    color: #444;
}

#start-screen, #quiz-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background-color: transparent;
    border-radius: 12px;
    box-shadow: none;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 20px;
    transition: background-color 0.2s, transform 0.1s;
}

#start-button, #play-question-button, #next-question-button {
    background-color: #007aff;
    color: white;
    margin-bottom: 20px;
}
#start-button:hover, #play-question-button:hover, #next-question-button:hover {
    background-color: #005ecb;
}
#start-button:active, #play-question-button:active, #next-question-button:active {
    transform: scale(0.98);
}

/* 既存の #choices-container と .chord-btn のスタイルを、以下の内容に置き換えてください */

#choices-container {
    display: grid;
    /* 画面幅に応じて、120px幅のボタンを可能な限り詰め込み、均等に配置する */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px; /* 上の要素との隙間 */
}

.choice-category-group {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
}

.category-title {
    font-size: 16px;
    font-weight: bold;
    text-align: left;
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.button-grid {
    display: grid;
    /* 画面幅に応じて、列の数を自動調整 */
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

/* ボタンのスタイルは、基本的には既存のものを流用 */
.chord-btn {
    padding: 10px 5px;
    color: #333;
    border: 1px solid #ddd;
}
/* (以下、.chord-btn:disabled や .chord-button-text などのスタイルが続く) */

#loading-message, #result-message {
    font-size: 16px;
    min-height: 24px;
    margin-top: 15px;
}

/* === ボタンの色分けとテキストスタイル === */

.chord-button-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.chord-symbol {
    font-size: 1.1em;
    font-weight: bold;
}
.chord-name {
    font-size: 0.7em;
    opacity: 0.8;
}

/* Major系のボタン（通常時とホバー時） */
.chord-btn.major-type,
.category-select-btn.major-type,
.switch-category-btn.major-type {
    background-color: #e6f2ff;
    border-color: #b3d7ff;
}
.chord-btn.major-type:hover,
.category-select-btn.major-type:hover,
.switch-category-btn.major-type:hover {
    background-color: #d1e7ff;
}

/* Minor系のボタン（通常時とホバー時） */
.chord-btn.minor-type,
.category-select-btn.minor-type,
.switch-category-btn.minor-type {
    background-color: #e3f9e3;
    border-color: #b8e6b8;
}
.chord-btn.minor-type:hover,
.category-select-btn.minor-type:hover,
.switch-category-btn.minor-type:hover {
    background-color: #d1f2d1;
}

/* Dominant系のボタン（通常時とホバー時） */
.chord-btn.dominant-type,
.category-select-btn.dominant-type,
.switch-category-btn.dominant-type {
    background-color: #fff4e0;
    border-color: #ffe0b3;
}
.chord-btn.dominant-type:hover,
.category-select-btn.dominant-type:hover,
.switch-category-btn.dominant-type:hover {
    background-color: #ffebcc;
}

/* === ログ機能のスタイル === */

.footer-actions {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* ご指定のパターンのリセットボタン */
#reset-log-button {
    font-size: 12px;
    padding: 5px 10px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 5px;
}
#reset-log-button:hover {
    background-color: #e0e0e0;
}

#log-container {
    max-width: 500px;
    margin: 20px auto;
    text-align: left;
}
#log-container h2 {
    text-align: center;
    font-size: 18px;
    margin-bottom: 10px;
}
#log-list {
    list-style-type: none;
    padding: 0;
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
}
#log-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
#log-list li:last-child {
    border-bottom: none;
}
#log-list .correct { color: green; }
#log-list .incorrect { color: red; }
#log-list .log-answer { font-weight: bold; }

.log-playable-chord {
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
    color: #005ecb;
}
.log-playable-chord:hover {
    color: #007aff;
}

#switch-category-container {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.switch-category-btn {
    font-size: 14px;
    padding: 8px 15px;
    opacity: 0.9;
}
