@charset "utf-8";

/* =========================
   全体
========================= */
.itqds-wrapper {
  width: 100%;
  max-width: 750px;
  margin: 24px 0;
  padding: 20px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.itqds-inner {
  width: 100%;
  box-sizing: border-box;
}

/* =========================
   ローディング / クイズ領域
========================= */
.itqds-loading {
  width: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  line-height: 1.8;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.itqds-quiz-area {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #eee;
}

.itqds-quiz.default {
  width: 100%;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

/* =========================
   タイトルまわり
========================= */
.itqds-title-wrap {
  margin: 0 0 10px;
}

.itqds-title {
  margin: 0 0 16px !important;
  padding: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.5;
}

.itqds-desc {
  margin: 0 0 16px;
  color: #555;
  line-height: 1.8;
}

.itqds-progress {
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.3;
}

p.itqds-progress {
  margin-bottom: 0 !important;
}

.itqds-source-title {
  margin-bottom: 18px !important;
}

/* =========================
   設定UI
========================= */
.itqds-config {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.itqds-config-row {
  display: grid;
  gap: 8px;
}

.itqds-config-label {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.5;
}

.itqds-config-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-size: 1rem;
  line-height: 1.5;
}

.itqds-config-check {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.5;
}

.itqds-config-check input[type="checkbox"] {
  margin: 0;
}

.itqds-start-button {
  display: inline-block;
  width: auto;
  max-width: 280px;
  padding: 12px 20px;
  box-sizing: border-box;
  border: none;
  border-radius: 8px;
  background: #222;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.itqds-start-button:hover {
  opacity: 0.9;
}

.itqds-start-button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.itqds-meta {
  margin-top: 10px;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* =========================
   問題文
========================= */
.itqds-question-text {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
}

/* =========================
   選択肢
========================= */
.itqds-question {
  display: flex;
  justify-content: space-evenly;
  gap: 10px;
  list-style: none;
  margin: 0 !important;
  margin-left: 0;
  padding: 20px 0 0 !important;
  padding-left: 0 !important;
}

.itqds-question-list {
  position: relative;
  flex: 1;
  margin: 0 0 5px 0 !important;
  padding: 14px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  color: inherit;
  text-align: center;
  font-weight: normal;
  line-height: 1.35;
  cursor: pointer;
  transition: 0.2s;
}

.itqds-question-list:last-child {
  margin-bottom: 0;
}

.itqds-question-list:not(.disabled):hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.18);
}

.itqds-question-list.disabled {
  cursor: auto;
}

.itqds-question-list.correct.disabled {
  background: #68AF15;
  color: #fff;
  border-color: #68AF15;
}

.itqds-question-list.incorrect.disabled.choice {
  background: #BE1515;
  color: #fff;
  border-color: #BE1515;
}

.itqds-question-list.incorrect.disabled:not(.choice) {
  background: #e2e2e2;
  color: #333;
  border-color: transparent;
}

/* =========================
   回答・解説
========================= */
.itqds-answer {
  display: none;
  margin: 4px 0 0 0 !important;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #bbb;
  border-radius: 5px;
  background: #fff;
  font-weight: normal;
  animation: itqds-appear 0.25s ease;
}

.itqds-result-wrap {
  margin: 0;
  padding: 0;
}

.itqds-result {
  display: none;
  margin: 0;
  padding: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.itqds-result.show {
  display: block;
}

.itqds-result.correct {
  margin-bottom: 10px;
  color: #68AF15;
}

.itqds-result.incorrect {
  margin-bottom: 10px;
  color: #BE1515;
}

.itqds-result-text {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.3;
}

.itqds-commentary {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.4;
}

.itqds-commentary p {
  margin: 0;
  padding: 0;
}

.itqds-continue-wrap {
  margin-top: 12px;
  text-align: center;
}

.itqds-continue {
  display: inline-block;
  margin: 0;
  padding: 0.55em 2.2em;
  border-radius: 5px;
  background: #68af15;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.itqds-continue:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

/* =========================
   結果画面
========================= */
.itqds-result-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  box-sizing: border-box;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.itqds-result-screen h3,
.itqds-result-screen p {
  margin: 0;
}

.itqds-restart {
  min-height: 44px;
  padding: 10px 18px;
  border: none;
  border-radius: 5px;
  background: #68af15;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* =========================
   画像
========================= */
.itqds-question-image {
  text-align: center;
}

.itqds-question-image img {
  width: 90%;
  height: auto;
}

/* =========================
   アニメーション
========================= */
@keyframes itqds-appear {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* =========================
   PCのみ
========================= */
@media (min-width: 768px) {
  .itqds-commentary {
    font-size: 16px;
  }
}

/* =========================
   タブレット以下
========================= */
@media (max-width: 768px) {
  .itqds-wrapper {
    padding: 20px 10px !important;
  }

  .itqds-config-select {
    display: block;
    margin: 0 auto;
  }

  .itqds-start-button {
    display: block;
    margin: 0 auto;
    width: 70%;
  }
}

/* =========================
   スマホ
========================= */
@media (max-width: 480px) {
  .itqds-quiz.default {
    padding: 14px;
  }

  .itqds-title {
    font-size: 18px;
  }

  .itqds-question-text {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 400;
  }

  .itqds-question-list {
    width: 90%;
    margin: 0 auto 14px !important;
    padding: 10px 12px;
    font-size: 14px;
  }

  .itqds-result {
    font-size: 17px;
  }

  .itqds-result-text,
  .itqds-commentary {
    font-size: 13px;
  }

  .itqds-continue {
    width: 100%;
    box-sizing: border-box;
  }
}