/* 全体リセット */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: #333;
    color: #333;
    overflow-x: hidden;
    user-select: none;
}

/* トップ画面：科目ボタン（横2列×縦3行） */
#top_subject_grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
}

.subject-card {
    background-color: #f8f8f8;
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    box-shadow: 0 4px #222;
}

.subject-card img {
    width: 64px;
    height: 64px;
    margin-right: 5px;
}

.subject-card span {
    font-size: 16px;
    font-weight: bold;
}

/* ダンジョン進行エリア */
#top_dungeon_container {
    background-color: #444;
    margin: 10px 15px;
    padding: 15px;
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
}

#dungeon_gauge_container {
    width: 100%;
    height: 20px;
    background-color: #222;
    border-radius: 10px;
    overflow: hidden;
    margin: 5px 0;
}

#dungeon_gauge_bar {
    height: 100%;
    transition: width 0.3s ease;
}

#dungeon_image_area img {
    max-width: 376px;
    width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
}

/* 記録・手帳ボタン（大きなボタン） */
#btn_analysis {
    display: flex;
    align-items: center;
    width: 90%;
    margin: 15px auto;
    background-color: #f8f8f8;
    border-radius: 14px;
    height: 130px;
    padding: 0 20px;
    cursor: pointer;
    box-shadow: 0 6px #222;
}

#btn_analysis img {
    width: 100px;
    height: 100px;
    margin-right: 20px;
}

#btn_analysis span {
    font-size: 22px;
    font-weight: bold;
}

#btn_reward {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    margin: 15px auto;
    background-color: #f8f8f8;
    border-radius: 14px;
    height: 190px;
    cursor: pointer;
    box-shadow: 0 6px #222;
}

#btn_reward img {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
}

#btn_reward span {
    font-size: 19px;
    font-weight: bold;
}

/* ヘッダー・ナビゲーション */
.header-nav, #quiz_header {
    display: flex;
    align-items: center;
    background-color: #222;
    color: #fff;
    padding: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.btn_back, .btn_back_quiz {
    font-size: 18px;
    padding: 10px;
    cursor: pointer;
}

/* 科目別背景色 */
.bg-jpn { background-color: #d88; }
.bg-mth { background-color: #88c; }
.bg-sci { background-color: #8a8; }
.bg-soc { background-color: #d94; }
.bg-eng { background-color: #98b; }

/* クイズ・単元ボタン */
#quiz_question_area {
    background-color: #f8f8f8;
    margin: 20px 15px;
    padding: 30px 15px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    min-height: 120px;
}

.choice-btn {
    width: 90%;
    background-color: #f8f8f8;
    border-radius: 10px;
    padding: 15px;
    margin: 10px auto;
    font-size: 18px;
    font-weight: bold;
    display: block;
    border: none;
    box-shadow: 0 4px #ccc;
    cursor: pointer;
}

/* 報酬・シール関連 */
.reward-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #444;
}

.reward-header img {
    width: 100px;
    height: 100px;
    margin-right: 20px;
}

#goto_history, #goto_seal {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    text-decoration: underline;
    cursor: pointer;
}

#seal_total_count {
    color: #fff;
    padding: 10px 15px;
    font-weight: bold;
}

#seal_grid_container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 15px;
}

.seal-slot {
    width: 100%;
    aspect-ratio: 1;
    background-color: #222;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-img {
    width: 80%;
    height: 80%;
}

/* モーダル */
#modal_quiz {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    width: 85%;
}

.modal-content button {
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
}