.pc_view {
  display: none !important;
}
* {
  box-sizing: border-box;
}
div#phraseArea {
  display: none;
}
body {
  width: 100%;
  /* font-family: "Noto Sans JP", sans-serif; */
  font-family: "Noto Sans", "M PLUS Rounded 1c", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-size: 15px;
  line-height: 1.7;
  background: #fff5e0;
  overflow-x: hidden;
}
button {
  border: none;
  background: none;
}
img {
  width: 100%;
  max-width: 100%;
  height: auto;
}
a {
  color: #002d49;
  text-decoration: none;
}
header {
  width: 94%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 0;
}
header div.logo {
  width: 70%;
  max-width: 240px;
  margin: 0 auto;
}
header div.user {
  border-radius: 15px;
  background: #fff;
  padding: 5px;
  margin: 10px 0;
}

main {
  width: 94%;
  max-width: 1080px;
  margin: 0 auto 150px;
}
/*------------------------------------------
Login
------------------------------------------*/
form#login {
  margin: 20px auto;
}
form#login label {
  display: block;
}
form#login input.name,
form#login input.pass {
  width: 100%;
  padding: 5px;
  border: solid 1px #ccc;
  margin: 0 0 10px;
}
main div.mainMenu div.btn {
  text-align: center;
  margin: 0 0 15px;
}
main div.mainMenu div.btn a {
  display: block;
  padding: 10px;
  /* border: solid 1px #333; */
  background: #d95b10;
  color: #fff;
  border-radius: 8px;
  font-size: 1.2em;
}
main div#quizLang ul.choiceLang {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin: 0 0 10px;
}
main div#quizLang ul.choiceLang li a {
  padding: 5px 10px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  font-size: 1.1em;
}

main div#quiz-box {
  padding: 15px 15px;
  border: solid 1px #da455c;
  margin: 0 0 30px;
  border-radius: 12px;
  background: #fff;
  color: #333;
  font-size: 1.3em;
}
main div#quiz-box span#quiz-word {
  font-size: 1.3rem;
}
main div#quiz-box h3 {
  background: #da455c;
  color: #fff;
  margin: 0 0 10px;
  padding: 0px 5px 1px;
  border-radius: 5px;
}
main div#quiz-box span.lang {
  background: #da455c;
  color: #fff;
  font-size: 0.8em;
  display: inline-block;
  padding: 0px 5px 1px;
  margin: 0 5px 0 0;
  border-radius: 5px;
}

main div#quiz-box color,
.subBox color {
  color: #da455c;
}
table.phraseTable color {
  color: #d95b10;
}
main div#quiz-box color:hover,
.subBox color:hover,
table.phraseTable color:hover {
  cursor: pointer;
}
main div#quiz-box line,
.subBox line,
table.phraseTable line {
  border-bottom: solid 2px #d95b10;
}
main div#quiz-box div.subBox {
  font-size: 0.9em;
  margin: 10px 0 0;
  padding: 5px;
  border-radius: 5px;
  background: #f1f1f1;
}
main div#quiz-box div.subBox:first-child {
  border-top: dashed 1px #333;
}
button#nextBtn,
button#submit,
button#submitAnswer {
  background: #333;
  border-radius: 12px;
  display: block;
  width: 100%;
  padding: 12px 20px;
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
}

div.categoryName {
  margin: 10px 0 0;
  font-size: 0.7em;
  padding: 3px 5px;
  border-radius: 5px;
  background: #f1f1f1;
}
button#showFormBtn {
  font-size: 1.2rem;
  display: block;
}
button#showVoiceBtn {
  font-size: 1.2rem;
  display: block;
}
div.open-close {
  width: 70%;
  max-width: 300px;
  margin: 0 auto 20px;
  display: flex;
  justify-content: center;
  gap: 5px;
}
div.open-close button {
  width: 50%;
}
/****************************/
.answer-label {
  display: block;
  padding: 12px 20px;
  margin-bottom: 12px;
  border: 1px solid #da455c;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
  background-color: #fff;
}

.answer-label.selected {
  background-color: #da455c;
  border: 1px solid #da455c;
  color: #fff;
}
.answer-label:hover {
  border-color: #da455c;
}
.answer-label input[type="radio"] {
  display: none;
}

/***********************/
div.answerImg {
  width: 70%;
  max-width: 150px;
  margin: 10px auto 20px;
}
div.answerImg p {
  text-align: center;
  font-size: 1.2rem;
}
/**クイズに戻る************************/
main div.back {
  text-align: center;
  margin: 15px 0;
}
main div.back a {
  display: block;
  padding: 10px;
  /* border: solid 1px #333; */
  background: #d95b10;
  color: #fff;
  border-radius: 8px;
  font-size: 1.2em;
}
/**insert*********************/
main#insert h2 {
  background: #da455c;
  font-size: 1.2em;
  padding: 5px;
  color: #fff;
  margin: 0 0 1px;
}
div.title.same_mean span.same_mean {
  background: url(../img/icon_same_mean_pi.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
  margin: 0 10px 0 0;
  display: inline-block;
}
div.title.sub_expr {
  background: url(../img/icon_sub_expr_pi.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.title.syn_word {
  background: url(../img/icon_syn_word_pi.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.title.explanation {
  background: url(../img/icon_explanation_pi.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.title.sub_mean {
  background: url(../img/icon_sub_mean_pi.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.title.response {
  background: url(../img/icon_response_pi.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
main#insert div.wbox {
  margin: 0 0 30px;
}
main#insert div.wbox input[type="text"],
main#insert div.wbox textarea {
  width: 100%;
  padding: 8px;
  border: solid 1px #bbb;
}
main#insert button#submit-btn {
  background: #333;
  border-radius: 12px;
  display: block;
  width: 100%;
  padding: 12px 20px;
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
}
/**totalling*********************/
div#totallingArea h3 {
  background: #2f92d1 !important;
  color: #fff !important;
  padding: 5px !important;
  border-radius: 5px !important;
  margin: 0 0 10px !important;
}
div#totallingArea #progressChart {
  width: 80% !important;
  max-width: 320px !important;
  margin: 0 auto !important;
}
div#totallingArea ul.date {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
div#totallingArea ul.date li {
  white-space: nowarp;
  background: #fff;
  padding: 2px;
  border-radius: 5px;
}
ul.wrong li {
  padding: 3px;
  border-bottom: dashed 1px #666;
}
/************************/
div.voiceBtn {
  margin: 20px auto;
  text-align: center;
  width: 40%;
}
#recBtn {
  font-size: 20px;
  padding: 40px 20px;
  border-radius: 10px;
  background: #da455c;
  color: #fff;
  border: none;
  width: 100%;
  margin-bottom: 15px;
}
#stopBtn {
  font-size: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #333;
  color: #fff;
  border: none;
  width: 100%;
  margin-bottom: 15px;
}
#clearBtn {
  font-size: 20px;
  padding: 12px 20px;
  border-radius: 10px;
  background: #aaa;
  color: #fff;
  border: none;
  width: 100%;
  margin-bottom: 15px;
}

#recognizedText {
  width: 100%;
  font-size: 18px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
}
#playback {
  display: none;
}

/* スピナーアニメ */
.recSpinner {
  display: inline-block;
  position: relative;
  width: 60px;
  height: 10px;
  margin-left: 6px;
}

.recSpinner div {
  position: absolute;
  top: 0;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.recSpinner div:nth-child(1) {
  left: 4px;
  animation: recSpinner1 0.6s infinite;
}

.recSpinner div:nth-child(2) {
  left: 4px;
  animation: recSpinner2 0.6s infinite;
}

.recSpinner div:nth-child(3) {
  left: 20px;
  animation: recSpinner2 0.6s infinite;
}

.recSpinner div:nth-child(4) {
  left: 36px;
  animation: recSpinner3 0.6s infinite;
}

@keyframes recSpinner1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes recSpinner2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(16px, 0);
  }
}

@keyframes recSpinner3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}
div#pronScore {
  text-align: right;
  padding: 0 5px 0 0;
}
/**select追加**********************/
/* もとの select を非表示（アクセス可能にするため opacity 0 が安全）*/
#bigCategorySelect,
#categorySelect {
  opacity: 0;
  position: absolute;
  pointer-events: none;
}
#bigCategorySelectWrap {
  position: relative;
  z-index: 99;
}
#categorySelectWrap {
  position: relative;
  z-index: 98;
}
/* カスタム UI コンテナ */
.custom-select {
  position: relative;
  width: 100%;
  font-size: 1.1em;
}

.custom-select-display {
  width: 100%;
  padding: 8px;
  border: 1px solid #666;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  position: relative;
  margin: 0 0 10px;
}

.custom-select-display::after {
  content: "▼";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
}

/* 選択肢 */
.custom-select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #666;
  border-radius: 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
}

.custom-select-options div {
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.custom-select-options div:hover {
  background: #f5f5f5;
}
/**フレーズ一覧************************/
table.phraseTable {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-spacing: 0;
  width: 100%;
  border: 2px #ec9f1c solid;
  border-width: 2px 0 0;
  font-size: 1.1em;
  background: #fff;
}
table.phraseTable th {
  width: 30%;
  padding: 15px 12px;
  border: 2px #ec9f1c solid;
  border-width: 0 0 2px;
  text-align: left;
  vertical-align: top;
}
table.phraseTable td {
  width: 70%;
  padding: 15px 12px;
  border: 2px #ec9f1c solid;
  border-width: 0 0 2px;
  vertical-align: top;
}
table.phraseTable tr:nth-child(odd) {
  /* background: #e7ffd0 !important; */
  background: #fffbc2 !important;
}
div.scrollControls {
  display: none;
}
div.w_word,
div.w_meaning {
  font-weight: bold;
  font-size: 1.1em;
}
div.w_same_mean span.same_mean {
  background: url(../img/icon_same_mean.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
  margin: 0 10px 0 0;
  display: inline-block;
}
div.w_sub_expr {
  background: url(../img/icon_sub_expr.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.w_syn_word {
  background: url(../img/icon_syn_word.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.w_explanation {
  background: url(../img/icon_explanation.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.w_sub_mean {
  background: url(../img/icon_sub_mean.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div.w_response {
  background: url(../img/icon_response.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
}
div#scrollControls {
  display: none;
}
div.scrollControls {
  display: block;
  /* position: fixed;
  bottom: 0px;
  left: 0; */
  width: 100%;
  padding: 0 0 10px;
  background: #fff5e0;
  text-align: center;
}
div.scrollControls button {
  padding: 8px;
  background: #ec9f1c;
  color: #fff;
  border-radius: 8px;
  display: block;
  width: 94%;
  margin: 0 auto;
}
td button {
  font: initial;
  /* position: relative;
  top: -2px; */
}
img.speaker {
  width: 26px;
  display: block;
}
img.voice {
  width: 36px;
}
@media screen and (max-width: 1079px) {
  div#scrollTable {
    overflow-x: scroll;
    overflow-y: hidden;
  }
  table.phraseTable {
    width: 188vw;
  }
  table.phraseTable th {
    width: 94vw;
    padding: 15px 10px;
  }
  table.phraseTable td {
    width: 94vw;
    padding: 15px 10px;
  }
  #scrollTable {
    cursor: grab;
  }
  #scrollTable:active {
    cursor: grabbing;
  }
}
/*----------------------------------
footer
----------------------------------*/
footer {
  width: 100%;
  padding: 5px 0;
  background: #fff5e0;
}
footer nav {
  position: fixed;
  bottom: 0 !important;
  width: 100%;
  background: #fff5e0;
}
footer nav ul {
  width: 80%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  gap: 4%;
}
footer nav ul li {
  width: 32%;
}
/*----------------------------------
loading
----------------------------------*/
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  display: none;
}

#loadingOverlay .loadingBox {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

#loadingOverlay .spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #ccc;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 10px;
}

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

#loadingOverlay .loadingText {
  font-size: 14px;
}
/*-----------------------------------------
登録画面
-----------------------------------------*/
table.list {
  width: 100%;
  margin: 20px auto;
  table-layout: fixed;
  border-spacing: 0;
  width: 100%;
  border: 1px #ccc solid;
  font-size: 1.1em;
  background: #fff;
}
table.list th {
  width: 30%;
  padding: 5px 10px;
  border: 1px #ccc solid;
  border-width: 0 0 1px 1px;
  text-align: left;
  vertical-align: top;
  background: #000;
  color: #fff;
}
table.list td {
  width: 70%;
  padding: 5px 10px;
  border: 1px #ccc solid;
  border-width: 0 0 1px 1px;
  vertical-align: top;
}
table.list tr:nth-child(odd) {
  background: #e7ffd0 !important;
}
div.title.same_mean_regist {
  background: url(../img/icon_same_mean.svg) no-repeat;
  background-size: 18px 18px;
  background-position: left 6px;
  padding: 0 0 0 22px;
  margin: 0 10px 0 0;
  display: inline-block;
}
/*-----------------------------------
自身の音声再生ボタン
-----------------------------------*/
.voicePlayBtn {
  width: 100%;
  padding: 8px 12px;
  margin: 0 0 15px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
}
.voicePlayBtn:active {
  transform: translateY(1px);
}
/*音声ボタン非表示*/
.tts-hidden {
  display: none !important;
}
button.showFormBtn {
  display: none !important;
}
/**想定会話****************************************/
.scList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  font-size: 1.1em;
}
.scRow {
  border: 2px solid #35b387;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
}
.scRow:hover {
  background: #fafafa;
}
.scEn {
  font-weight: 700;
}
.scJp {
  color: #666;
  font-size: 0.95em;
  margin-top: 4px;
}
.scenarioBox {
  padding: 5px;
  /* border: 1px solid #ddd; */
  border-radius: 10px;
  background: #fff;
}
.scenarioHead {
  margin-bottom: 10px;
}
.scenarioCats {
  font-size: 0.9em;
  opacity: 0.85;
  margin-bottom: 4px;
}
.scenarioScene {
  font-size: 1.05em;
}
.scLine {
  display: flex;
  gap: 10px;
  /* border: 1px dashed #ccc; */
  margin: 0 0 10px;
}
.scSp {
  width: 36px;
  font-weight: bold;
}
.scText {
  border: solid 2px #35b387;
  border-radius: 8px;
  padding: 8px;
  width: calc(100% - 48px);
  position: relative;
  display: inline-block;
}
.scText::before {
  content: "";
  position: absolute;
  left: -13px; /* しっぽを外に出す */
  top: 25%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 13px 7px 0; /* 上 右 下 左 */
  border-color: transparent #35b387 transparent transparent;
}
.scText::after {
  content: "";
  position: absolute;
  left: -8px; /* beforeより少し内側へ */
  top: 25%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 10px 6px 0;
  border-color: transparent #fff transparent transparent;
}
.scEn {
  font-size: 1.05em;
}
.scJp {
  font-size: 0.95em;
  opacity: 0.9;
  margin-top: 2px;
}

.scLine.hit .scText {
  background: #fff8cc;
}
.scLine.hit .scText::after {
  border-color: transparent #fff8cc transparent transparent;
}
.scenarioNotes {
  margin-top: 10px;
  font-size: 0.9em;
  opacity: 0.85;
}

/* ★英語フレーズ部分だけ */
.hitPhrase {
  font-weight: 700;
  color: #d35400;
  background: linear-gradient(transparent 60%, #ffd59e 60%);
  padding: 0 2px;
  border-radius: 3px;
}

/* ★日本語側も必要なら */
.hitPhraseJp {
  font-weight: 700;
  color: #8e44ad;
}

/* ===== 想定会話モーダル ===== */
.dlgModal {
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* 最大級 */
  display: none;
  font-size: 1.1em;
}
.dlgModal.is-open {
  display: block;
}

.dlgOverlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.45);
}
.dlgBox {
  position: relative;
  width: min(920px, calc(100vw - 24px));
  max-height: min(80vh, 720px);
  margin: 60px auto;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 1;
  pointer-events: auto;
}

.dlgHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #eee;
  background: #35b387;
  color: #fff;
  font-size: 1.2rem;
}

.dlgTitle {
  font-weight: 700;
}
.dlgClose {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.dlgBody {
  padding: 14px;
  overflow: auto;
  max-height: calc(min(80vh, 720px) - 52px); /* header分を引く */
  -webkit-overflow-scrolling: touch;
}

/* モーダル中の内容が崩れる場合の保険 */
.dlgBody img {
  max-width: 100%;
  height: auto;
}
.dlgOverlay {
  pointer-events: auto; /* 念のため */
}
.dlgBox {
  pointer-events: auto;
}
/* モーダルを最前面に固定（iOSの変な重なり対策） */
.dlgModal {
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* 最大級 */
}

.dlgOverlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
}

.dlgBox {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}
body.modal-open #scenarioList {
  pointer-events: none;
}
button.vBtn{
  padding: 6px 8px;
  border-radius: 8px;
  margin: 0 0 0 5px;
  display: inline-block;
}
button.vBtn.pink{
  border: solid 1px #da455c;
}
button.vBtn.orange{
  border: solid 1px #ec9f1c;
  background: #fff;
}
button.vBtn.green{
  border: solid 1px #35b387;
  background: #fff;
}