
/* 基本設定 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  color: #514735;
  background:
    radial-gradient(circle at 50% 0%, #ffffff 0%, transparent 60%),
    linear-gradient(135deg, #e8e0cc, #f8f5eb, #d8c9a8);
}

/* メイン画面 */
.container {
  width: min(92%, 650px);
  margin: 50px auto;
  padding: 45px 35px;
  text-align: center;
  background: rgba(255, 253, 246, 0.94);
  border: 2px solid #c5a66b;
  border-radius: 18px;
  box-shadow: 0 15px 45px rgba(76, 59, 30, 0.15);
}

/* タイトル */
h1 {
  margin: 0;
  font-size: 42px;
  letter-spacing: 5px;
  color: #8c7040;
}

.subtitle {
  margin-top: 15px;
  font-size: 16px;
}

.update {
  display: inline-block;
  padding: 8px 20px;
  color: #98763e;
  background: #f5edda;
  border: 1px solid #d7bd84;
  border-radius: 30px;
  font-size: 14px;
}

/* 難易度選択 */
.difficulty {
  margin-top: 45px;
}

h2 {
  margin-bottom: 25px;
  font-size: 21px;
  font-weight: normal;
}

.difficulty button {
  display: block;
  width: 100%;
  margin: 14px 0;
  padding: 17px;
  border: 1px solid #b89a62;
  border-radius: 10px;
  background: linear-gradient(135deg, #fffdf6, #eee3ca);
  color: #665233;
  font-size: 19px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.difficulty button:hover {
  background: #e8d5a9;
  transform: translateY(-2px);
}

/* 更新情報 */
.schedule {
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px solid #d9c9a7;
  font-size: 14px;
  color: #82745d;
}

/* YouTube */
footer {
  margin-top: 35px;
  font-size: 14px;
}

footer a {
  color: #96703b;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* スマートフォン対応 */
@media (max-width: 600px) {
  .container {
    margin: 20px auto;
    padding: 35px 20px;
  }

  h1 {
    font-size: 32px;
    letter-spacing: 3px;
  }

  .difficulty button {
    padding: 18px;
  }
}

/* クイズ画面 */

#quiz-screen {
  margin-top: 30px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #8c7040;
  font-size: 15px;
  font-weight: bold;
}

.progress-track {
  width: 100%;
  height: 10px;
  margin: 20px 0 35px;
  background: #e9dfc9;
  border-radius: 20px;
  overflow: hidden;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #b79a62, #e5c782);
  border-radius: 20px;
  transition: width 0.3s ease;
}

#question-text {
  margin: 30px 0;
  font-size: 22px;
  line-height: 1.7;
}

#answer-options {
  display: grid;
  gap: 14px;
}

.answer-button {
  width: 100%;
  padding: 18px 15px;
  background: #fffaf0;
  border: 1px solid #c5a66b;
  border-radius: 10px;
  color: #514735;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.answer-button:hover:not(:disabled) {
  background: #f2e5c9;
  transform: translateY(-2px);
}

.answer-button:disabled {
  cursor: default;
}

.answer-button.correct {
  background: #d7efdc;
  border-color: #64a775;
  color: #245b32;
}

.answer-button.incorrect {
  background: #f8d9d9;
  border-color: #cf7777;
  color: #8b3030;
}

#answer-feedback {
  margin-top: 25px;
  padding: 20px;
  background: #f7f0df;
  border: 1px solid #d8c49b;
  border-radius: 12px;
  text-align: left;
}

#answer-result {
  font-size: 20px;
  font-weight: bold;
}

#answer-explanation {
  font-size: 15px;
  line-height: 1.8;
}

#next-question {
  width: 100%;
  margin-top: 15px;
  padding: 15px;
  background: #b89a62;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

#next-question:hover {
  background: #9d7c45;
}

/* hidden属性を確実に反映 */
[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  #question-text {
    font-size: 19px;
  }

  .answer-button {
    font-size: 16px;
  }

  .quiz-header {
    font-size: 13px;
  }
}

/* ===== 結果発表画面 ===== */

#result-screen {
  padding: 15px 0;
  text-align: center;
}

.result-heading {
  color: #b89a62;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 5px;
}

#result-title {
  margin: 15px 0 25px;
  color: #665233;
  font-size: 28px;
}

#result-difficulty {
  color: #8c7040;
  font-size: 16px;
}

.result-score-box {
  margin: 30px auto;
  padding: 30px 20px;
  background: linear-gradient(135deg, #fffdf5, #f0e3c3);
  border: 2px solid #c5a66b;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(110, 83, 34, 0.12);
}

.result-score-label {
  margin: 0;
  color: #a38651;
  font-size: 13px;
  letter-spacing: 4px;
}

#final-score {
  margin: 15px 0;
  color: #9b7738;
  font-size: 52px;
  font-weight: bold;
}

#final-correct {
  color: #75654a;
  font-size: 15px;
}

.result-rank-label {
  margin-top: 35px;
  color: #9b8255;
  font-size: 14px;
}

#result-rank {
  margin: 15px 0;
  color: #a17a34;
  font-size: 27px;
  font-weight: bold;
  line-height: 1.5;
}

#result-message {
  margin: 20px 0 35px;
  color: #76684f;
  font-size: 15px;
  line-height: 1.8;
}

.result-buttons {
  display: grid;
  gap: 13px;
}

.result-buttons button {
  width: 100%;
  padding: 17px;
  border: 1px solid #b89a62;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.result-buttons button:hover {
  transform: translateY(-2px);
}

#retry-quiz {
  background: #b89a62;
  color: white;
}

#retry-quiz:hover {
  background: #9b7b45;
}

#back-home,
#share-result {
  background: #fffaf0;
  color: #665233;
}

#back-home:hover,
#share-result:hover {
  background: #f0e3c3;
}

@media (max-width: 600px) {
  #final-score {
    font-size: 43px;
  }

  #result-rank {
    font-size: 23px;
  }
}
