
/* =====================================
   基本設定
===================================== */

html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

body {
    font-family: sans-serif;
    font-size: 16px;
    line-height: 1.8;
    touch-action: manipulation;
}

.app {
    max-width: 900px;
    margin: auto;
}

#main {
    flex: 1;
}

#header {
    background-color: #ee7800;
    color: white;
    text-align: center;
    padding: 0.1px;
    position: relative;
}

#header h2 {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
}

#footer {
    background-color: #ee7800;
    color: white;
    text-align: center;
    line-height: 100px;
}


/* =====================================
   見出し
===================================== */

h1 {
    font-size: 150%;
    text-align: center;
    margin-bottom: 0;
}

h2 {
    font-size: 130%;
}

p.title {
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    font-weight: bold;
}


/* =====================================
   リンク
===================================== */

a {
    color: blue !important;
    text-decoration: none;
}

a:hover {
    color: red;
}

a:visited {
    color: #9ABACC !important;
}


/* =====================================
   本文・画像
===================================== */

.text {
    font-size: 20px;
    line-height: 1.5;
    padding: 16px;
    background: #c8e6c9;
    border-radius: 8px;
    margin: 12px 0 18px;
}

.sub-section {
    border-bottom: 0;
    margin-bottom: 50px;
}

.image {
    font-size: 20px;
    line-height: 1.5;
    padding: 16px;
    background: #CCCCCC;
    border-radius: 8px 8px 10% 10%;
    margin: 12px 0 0;
    text-align: center;
}

.image u {
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 5px;
}

.image b {
    color: red;
    font-weight: bold;
    display: inline-block;
    transform: scale(1.2);
    margin: 0 10px;
}


/* =====================================
   矢印
===================================== */

.rotate90up,
.rotate90down {
    display: inline-block;
    transform: rotate(90deg);
}

.rotate90down {
    margin: 10px 0 0;
}


/* =====================================
   問題・選択肢
===================================== */

.question,
.next {
    margin: 0 5px !important;
}

.question {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.question-title {
    position: relative;
    font-size: 20px;
    font-weight: bold;
    color: #ee7800;
    margin-bottom: 15px;
    padding-right: 100px;
}

.question-choice {
    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    text-align: left;
    padding: 12px 100px 12px 12px;
    margin: 8px 0;
    border: 1px solid #ee7800;
    border-radius: 6px;
    background: #fff;
    font-size: 17px;
    cursor: pointer;
}

.question-choice:hover {
    background: #f0f0f0;
}

.question-choice.selected:hover {
    background-color: black;
    color: white;
}

button.question-choice.selected.speaking-highlight {
    color: black;
}


/* =====================================
   次の問題・戻るボタン
===================================== */

button#nextButton,
button#backButton {
    margin-top: 50px;
    width: 100%;
    height: 44px;
    background: #006DF0;
    color: white;
    font-size: 16px;
    padding: 8px 12px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
}


/* =====================================
   カード問題
===================================== */

.blank {
    display: inline-flex;
    min-width: 120px;
    min-height: 35px;
    padding: 0 8px;
    border-bottom: 2px solid #ee7800;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
}

.blank.over {
    background: #fff3cd;
}

.blank.correct {
    padding: 0 3px;
    border: 2px solid #CCCCCC;
    border-radius: 6px;
    background: #ee7800;
    color: white;
    font-size: 18px;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 40px;
}

.card {
    padding: 3px 10px;
    border: 1px solid #ee7800;
    border-radius: 6px;
    background: #ee7800;
    color: white;
    cursor: grab;
    font-size: 18px;
    user-select: none;
    touch-action: none;
}

.card:active {
    cursor: grabbing;
}


/* =====================================
   メッセージ・採点
===================================== */

.message,
.question-message {
    text-align: center;
    font-size: 25px;
    height: 30px;
    margin-bottom: 20px;
    color: red;
    font-weight: bold;
}

.message:empty,
.question-message:empty {
    display: none;
}

#score {
    font-size: 18px;
    font-weight: bold;
    color: red;
    margin-bottom: 20px;
    text-align: center;
}

.correct-mark {
    color: yellow;
    font-weight: bold;
}


/* =====================================
   2択問題
===================================== */

.image-choice-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    vertical-align: middle;
    padding: 0 10px 6px;
    margin-top: 0;
}

.image-choice {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid #ee7800;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    font-size: 20px;
}

.image-choice.selected {
    background: #ee7800;
    color: white;
}

.image-choice.correct {
    background: #ee7800;
    color: white;
    margin: 0 5px;
}

.image-choice.incorrect {
    margin: 0 5px;
    background-color: #69b076;
    border-color: #69b076;
}


/* =====================================
   正誤・選択状態
===================================== */

.incorrect,
.selected {
    background: grey;
    color: white;
}

.correct {
    background: #ee7800;
    color: white;
}


/* =====================================
   音声ボタン
===================================== */

.sound-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sound-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sound-all-button {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sound-all-button img {
    display: block;
    width: 100%;
    object-fit: contain;
}


/* =====================================
   読み上げ中のハイライト
===================================== */

.speaking-highlight {
    background-color: #fffacd !important;
}


/* =====================================
   PC表示
===================================== */

@media (min-width: 700px) {
    .text,
    button.question-choice,
    .question-title {
        text-align: justify;
    }
}


/* =====================================
   スマートフォン表示
===================================== */

@media (max-width: 600px) {
    .app {
        transform: scale(.8);
        transform-origin: top center;
        width: 125%;
        margin-left: -12.5%;
    }

    body {
        line-height: 1.5;
    }

    h1 {
        font-size: 130% !important;
    }
}

@media screen and (max-width: 480px) {
    body {
        font-size: 16px;
    }
}


/* =====================================
   iOS対策
===================================== */

@media screen and (max-width: 1024px) {
    html,
    body,
    .app {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

html,
body,
.app {
    -webkit-tap-highlight-color: transparent;
}









/* 日本語表示中は音声ボタンを非表示 */
body.japanese-mode .sound-button,
body.japanese-mode .sound-all-button {
    display: none !important;
}


button.language-button{
    background-color: blue;
    color: white;
    font-weight: bold;
    border-radius: 4px;
    border: 0px solid blue;
    width: 60px;
    height: 20px;
    margin-right: 10px;
    font-size: 11px;
}




button.language-button {
    flex-shrink: 0;
}