@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;600;700&family=Shippori+Mincho:wght@400;600;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', serif;
  background: linear-gradient(135deg, #f5e6d3 0%, #e8d4c0 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 桜の花びらアニメーション */
#sakura-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.sakura {
  position: absolute;
  width: 15px;
  height: 15px;
  background: radial-gradient(circle, #ffb7d5 0%, #ff9ec9 100%);
  border-radius: 50% 0 50% 0;
  opacity: 0.7;
  animation: fall linear infinite;
  transform-origin: center;
}

@keyframes fall {
  0% {
    transform: translateY(-100px) rotate(0deg);
    opacity: 0.7;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* 画面共通 */
.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 2;
}

.hidden {
  display: none !important;
}

/* タイトル画面 */
.title-content {
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 60px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 3px solid #8b4513;
  position: relative;
  max-width: 600px;
}

.title-content::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, #d4a574, #c9966f);
  border-radius: 22px;
  z-index: -1;
}

.main-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 4rem;
  font-weight: 800;
  color: #8b0000;
  margin-bottom: 10px;
  text-shadow: 3px 3px 6px rgba(139, 0, 0, 0.3);
  letter-spacing: 15px;
}

.title-char {
  display: inline-block;
  animation: titleFloat 3s ease-in-out infinite;
}

.title-char:nth-child(1) { animation-delay: 0s; }
.title-char:nth-child(2) { animation-delay: 0.2s; }
.title-char:nth-child(3) { animation-delay: 0.4s; }
.title-char:nth-child(4) { animation-delay: 0.6s; }

@keyframes titleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.subtitle {
  font-size: 1.2rem;
  color: #654321;
  margin-bottom: 40px;
  letter-spacing: 3px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.menu-buttons button {
  padding: 18px 40px;
  font-size: 1.3rem;
  font-family: 'Noto Serif JP', serif;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.btn-start {
  background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
  color: white;
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.4);
}

.btn-list {
  background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
  color: white;
}

.btn-list:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(218, 165, 32, 0.4);
}

.btn-settings {
  background: linear-gradient(135deg, #708090 0%, #556677 100%);
  color: white;
}

.btn-settings:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(112, 128, 144, 0.4);
}

.btn-icon {
  font-size: 1.5rem;
}

.high-score {
  margin-top: 20px;
  padding: 15px;
  background: rgba(139, 69, 19, 0.1);
  border-radius: 10px;
  font-size: 1.1rem;
  color: #654321;
  font-weight: 600;
}

/* クイズ画面 */
.quiz-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(139, 69, 19, 0.95);
  padding: 8px 15px;  /* パディングを減らす */
  z-index: 100;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.stats-container {
  display: flex;
  justify-content: space-around;
  max-width: 800px;
  margin: 0 auto;
  gap: 10px;
  padding: 8px 10px;  /* パディング追加 */
}

.stat-box {
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 15px;  /* 縦のパディングを減らす */
  border-radius: 8px;
  text-align: center;
  flex: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.stat-label {
  display: block;
  font-size: 0.7rem;  /* 小さく */
  color: #654321;
  margin-bottom: 3px;  /* 間隔を狭く */
}

.stat-value {
  display: block;
  font-size: 1.2rem;  /* 小さく */
  font-weight: 700;
  color: #8b0000;
}

.combo-box {
  position: relative;
}

.combo-flame {
  display: none;
  position: absolute;
  top: -8px;  /* 位置調整 */
  right: -8px;
  font-size: 1.5rem;  /* 小さく */
  animation: flameFlicker 0.5s infinite;
}

.combo-box.active .combo-flame {
  display: block;
}

@keyframes flameFlicker {
  0%, 100% { transform: scale(1) rotate(-10deg); }
  50% { transform: scale(1.2) rotate(10deg); }
}

#question-container {
  padding-top: 90px;  /* コンパクトなヘッダーに合わせて調整 */
  max-width: 900px;
  margin: 0 auto;
}

.card-container {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
}

.waka-card {
  background: linear-gradient(135deg, #fff9e6 0%, #fffaf0 100%);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 4px solid #8b4513;
  position: relative;
  max-width: 600px;
  width: 100%;
  animation: cardAppear 0.5s ease-out;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(30px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.card-ornament {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid #daa520;
}

.card-ornament.top-left {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
}

.card-ornament.top-right {
  top: 10px;
  right: 10px;
  border-left: none;
  border-bottom: none;
}

.card-ornament.bottom-left {
  bottom: 10px;
  left: 10px;
  border-right: none;
  border-top: none;
}

.card-ornament.bottom-right {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
}

.card-number {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.2rem;
  color: #8b4513;
  font-weight: 700;
}

.kami-text {
  font-size: 1.8rem;
  line-height: 2.2;
  color: #2c1810;
  text-align: center;
  margin: 20px 0;
  font-weight: 600;
  letter-spacing: 2px;
  writing-mode: horizontal-tb;
}

.kami-text ruby {
  ruby-position: over;
}

.kami-text rt {
  font-size: 0.5em;
  color: #654321;
  font-weight: 400;
}

.speak-btn {
  background: linear-gradient(135deg, #4169e1 0%, #1e3a8a 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px auto 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.speak-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(65, 105, 225, 0.4);
}

.speak-icon {
  font-size: 1.2rem;
}

.choices-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 30px;
}

.choices-container button {
  padding: 20px 30px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border: 3px solid #8b4513;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Serif JP', serif;
  color: #2c1810;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  letter-spacing: 1px;
  line-height: 1.6;
}

.choices-container button:hover:not(:disabled) {
  transform: translateX(10px);
  background: linear-gradient(135deg, #fff9e6 0%, #fffaf0 100%);
  border-color: #daa520;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.choices-container button:active {
  transform: scale(0.98);
}

.choices-container button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

/* 正解を選んだ時のハイライト */
.choices-container button.selected-correct {
  background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
  border-color: #dc143c;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.5);
  animation: correctPulse 0.5s ease-out;
}

@keyframes correctPulse {
  0%, 100% { transform: scale(1.05); }
  50% { transform: scale(1.1); }
}

/* 不正解を選んだ時のハイライト */
.choices-container button.selected-wrong {
  background: linear-gradient(135deg, #708090 0%, #556677 100%);
  border-color: #708090;
  color: white;
  transform: scale(0.95);
  box-shadow: 0 4px 10px rgba(112, 128, 144, 0.5);
}

.quit-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(139, 0, 0, 0.8);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  z-index: 1000;  /* disclaimerより前面に */
}

.quit-btn:hover {
  background: rgba(139, 0, 0, 1);
  transform: scale(1.05);
}

/* フィードバック表示 */
.feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3.2rem;
  font-weight: 800;
  z-index: 1000;
  animation: feedbackPop 0.8s ease-out;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.feedback.correct {
  color: #dc143c;
}

.feedback.wrong {
  color: #4169e1;
}

/* 正解表示 */
.correct-answer-display {
  margin-top: 30px;
  padding: 25px;
  background: linear-gradient(135deg, #fff0f0 0%, #ffe8e8 100%);
  border: 3px solid #dc143c;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.3);
  animation: answerSlideIn 0.5s ease-out;
}

/* 次へボタンコンテナ（正解時） */
.next-button-container {
  margin-top: 30px;
  padding: 20px;
  text-align: center;
  animation: answerSlideIn 0.5s ease-out;
}

@keyframes answerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.correct-label {
  font-size: 1rem;
  color: #dc143c;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.correct-shimo {
  font-size: 1.6rem;
  color: #dc143c;
  font-weight: 700;
  text-align: center;
  line-height: 1.8;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.next-question-btn {
  display: block;
  margin: 0 auto;
  padding: 15px 40px;
  background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  font-family: 'Noto Serif JP', serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(220, 20, 60, 0.3);
}

.next-question-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.5);
  background: linear-gradient(135deg, #ff1744 0%, #c62828 100%);
}

.next-question-btn:active {
  transform: translateY(-1px);
}

/* 正解時のボタンスタイル */
.next-question-btn.correct-style {
  background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
  box-shadow: 0 5px 15px rgba(218, 165, 32, 0.3);
}

.next-question-btn.correct-style:hover {
  background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
  box-shadow: 0 8px 20px rgba(218, 165, 32, 0.5);
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* 一覧画面 */
.list-content, .settings-content, .result-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  width: 100%;
  border: 3px solid #8b4513;
}

.section-title {
  font-size: 2rem;
  color: #8b0000;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 700;
}

.list-instruction {
  text-align: center;
  color: #654321;
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.list-actions {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.btn-secondary {
  padding: 10px 20px;
  background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: 'Noto Serif JP', serif;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(218, 165, 32, 0.4);
}

.selected-count {
  font-size: 1.1rem;
  color: #654321;
  font-weight: 600;
}

.list-container {
  max-height: 500px;
  overflow-y: auto;
  padding: 20px;
  background: rgba(255, 249, 230, 0.5);
  border-radius: 10px;
  margin-bottom: 25px;
}

.category-header {
  margin-top: 20px;
  margin-bottom: 10px;
}

.category-header:first-child {
  margin-top: 0;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: linear-gradient(135deg, #8b4513 0%, #654321 100%);
  border-radius: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.category-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  flex: 1;
}

.category-select-btn,
.category-deselect-btn {
  padding: 8px 16px;
  font-size: 0.9rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Serif JP', serif;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.category-select-btn {
  background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
  color: white;
}

.category-select-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(218, 165, 32, 0.4);
}

.category-deselect-btn {
  background: linear-gradient(135deg, #708090 0%, #556677 100%);
  color: white;
}

.category-deselect-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(112, 128, 144, 0.4);
}

.category-content {
  margin-bottom: 15px;
  padding-left: 10px;
  border-left: 3px solid #8b4513;
}

.list-item {
  padding: 15px;
  margin-bottom: 8px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #daa520;
  transition: all 0.3s ease;
}

.list-item:hover {
  background: #fff9e6;
  border-left-color: #dc143c;
  transform: translateX(3px);
}

.list-item label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
  color: #2c1810;
}

.list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.list-number {
  font-weight: 700;
  color: #8b4513;
  min-width: 35px;
  font-size: 0.95rem;
  margin-right: 8px;
}

.list-text {
  flex: 1;
  line-height: 1.7;
  font-size: 1rem;
}

/* 設定画面 */
.setting-item {
  padding: 20px;
  margin-bottom: 15px;
  background: rgba(255, 249, 230, 0.5);
  border-radius: 10px;
  border-left: 4px solid #8b4513;
}

.setting-item label {
  display: flex;
  align-items: center;
  font-size: 1.1rem;
  color: #2c1810;
  cursor: pointer;
}

.setting-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 15px;
  cursor: pointer;
}

.setting-item select {
  padding: 8px 15px;
  border: 2px solid #8b4513;
  border-radius: 5px;
  font-size: 1rem;
  font-family: 'Noto Serif JP', serif;
  background: white;
  cursor: pointer;
  margin-left: 10px;
}

/* 結果画面 */
.result-title {
  font-size: 2.5rem;
  color: #8b0000;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 700;
}

.result-card {
  background: linear-gradient(135deg, #fff9e6 0%, #fffaf0 100%);
  padding: 40px;
  border-radius: 15px;
  border: 3px solid #8b4513;
  margin-bottom: 30px;
}

.result-rank {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 30px;
  font-weight: 800;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.result-stat {
  text-align: center;
  padding: 20px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.result-label {
  display: block;
  font-size: 1rem;
  color: #654321;
  margin-bottom: 10px;
}

.result-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
}

.result-number.correct {
  color: #dc143c;
}

.result-number.wrong {
  color: #4169e1;
}

.result-number.rate {
  color: #daa520;
}

.result-number.combo {
  color: #ff4500;
}

.result-message {
  text-align: center;
  font-size: 1.3rem;
  color: #2c1810;
  font-weight: 600;
  line-height: 1.8;
}

.result-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-retry {
  padding: 15px 40px;
  background: linear-gradient(135deg, #dc143c 0%, #8b0000 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  font-family: 'Noto Serif JP', serif;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.btn-retry:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(220, 20, 60, 0.4);
}

.btn-back {
  padding: 15px 40px;
  background: linear-gradient(135deg, #708090 0%, #556677 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  font-family: 'Noto Serif JP', serif;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  font-weight: 600;
}

.btn-back:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(112, 128, 144, 0.4);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .main-title {
    font-size: 2.5rem;
    letter-spacing: 8px;
  }
  
  .kami-text {
    font-size: 1.2rem;  /* さらに小さく */
    line-height: 1.8;  /* 行間を狭く */
    margin: 10px 0;  /* マージンを削減 */
    letter-spacing: 1px;
  }
  
  .kami-text rt {
    font-size: 0.45em;  /* ルビも小さく */
  }
  
  .card-number {
    font-size: 0.9rem;  /* 番号も小さく */
    top: 10px;
    right: 15px;
  }
  
  .card-ornament {
    width: 20px;  /* 装飾も小さく */
    height: 20px;
    border-width: 2px;
  }
  
  .card-ornament.top-left,
  .card-ornament.top-right {
    top: 8px;
  }
  
  .card-ornament.bottom-left,
  .card-ornament.bottom-right {
    bottom: 8px;
  }
  
  .card-ornament.top-left,
  .card-ornament.bottom-left {
    left: 8px;
  }
  
  .card-ornament.top-right,
  .card-ornament.bottom-right {
    right: 8px;
  }
  
  .speak-btn {
    padding: 8px 20px;  /* ボタンも小さく */
    font-size: 0.85rem;
    margin: 10px auto 0;  /* マージン削減 */
  }
  
  .speak-icon {
    font-size: 1rem;
  }
  
  .card-container {
    margin-bottom: 20px;  /* カードの下マージン削減 */
  }
  
  .choices-container {
    gap: 10px;  /* 選択肢の間隔も狭く */
  }
  
  .choices-container button {
    font-size: 1rem;  /* 選択肢も少し小さく */
    padding: 12px 15px;
  }
  
  /* スマホではhover効果を無効化 */
  .choices-container button:hover:not(:disabled) {
    transform: none;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    border-color: #8b4513;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  }
  
  /* タップ時のactive効果は維持 */
  .choices-container button:active:not(:disabled) {
    transform: scale(0.98);
  }
  
  /* 各種ボタンのhover効果も無効化 */
  .speak-btn:hover,
  .hint-btn:hover,
  .detail-btn:hover,
  .btn-secondary:hover,
  .category-select-btn:hover,
  .category-deselect-btn:hover,
  .btn-retry:hover,
  .btn-back:hover,
  .quit-btn:hover,
  .footer-link:hover {
    transform: none;
    box-shadow: inherit;
  }
  
  .stats-container {
    flex-direction: row;  /* 横並びを維持 */
    gap: 8px;
    padding: 5px 8px;
  }
  
  .stat-box {
    padding: 6px 10px;  /* さらにコンパクトに */
  }
  
  .stat-label {
    font-size: 0.65rem;  /* さらに小さく */
    margin-bottom: 2px;
  }
  
  .stat-value {
    font-size: 1rem;  /* さらに小さく */
  }
  
  /* 結果画面 */
  .result-stats {
    grid-template-columns: 1fr 1fr;  /* 2列維持 */
    gap: 8px;  /* 間隔をさらに狭く */
    margin-bottom: 20px;  /* マージン削減 */
  }
  
  .result-title {
    font-size: 1.8rem;  /* タイトルを小さく */
    margin-bottom: 20px;
  }
  
  .result-card {
    padding: 20px 15px;  /* パディング削減 */
    margin-bottom: 20px;
  }
  
  .result-rank {
    font-size: 2rem;  /* ランクを小さく */
    margin-bottom: 20px;
  }
  
  .result-stat {
    padding: 10px 8px;  /* 横のパディングも削減 */
  }
  
  .result-label {
    font-size: 0.8rem;  /* さらに小さく */
    margin-bottom: 5px;
    display: inline-block;  /* 改行を防ぐ */
    white-space: nowrap;  /* 改行させない */
  }
  
  .result-number {
    font-size: 1.6rem;  /* 数字をさらに小さく */
    display: block;
  }
  
  .result-message {
    font-size: 1rem;  /* メッセージを小さく */
    line-height: 1.6;
  }
  
  .result-buttons {
    flex-direction: column;  /* 縦並びに */
    gap: 10px;
  }
  
  .btn-retry,
  .btn-back {
    padding: 12px 30px;  /* ボタンを小さく */
    font-size: 1rem;
    width: 100%;  /* 幅いっぱいに */
  }
  
  /* 一覧画面 */
  .section-title {
    font-size: 1.8rem;  /* タイトルを小さく */
    margin-bottom: 15px;
  }
  
  .list-instruction {
    font-size: 0.95rem;  /* 説明文を小さく */
    margin-bottom: 15px;
  }
  
  .list-actions {
    gap: 10px;
    margin-bottom: 15px;
  }
  
  .btn-secondary {
    padding: 8px 15px;  /* ボタンを小さく */
    font-size: 0.9rem;
  }
  
  .selected-count {
    font-size: 0.95rem;  /* カウントを小さく */
  }
  
  .list-container {
    max-height: 400px;  /* 高さを抑える */
    padding: 10px;  /* パディング削減 */
    margin-bottom: 15px;
  }
  
  .category-header {
    margin-top: 10px;  /* さらに削減 */
    margin-bottom: 8px;
  }
  
  .category-header:first-child {
    margin-top: 0;
  }
  
  .category-title {
    padding: 8px;  /* さらにコンパクトに */
    gap: 6px;
    flex-wrap: wrap;  /* 必要に応じて折り返し */
  }
  
  .category-name {
    font-size: 0.9rem;  /* さらに小さく */
    width: 100%;  /* 独立した行に */
    margin-bottom: 4px;
  }
  
  .category-select-btn,
  .category-deselect-btn {
    padding: 5px 10px;  /* さらに小さく */
    font-size: 0.75rem;
  }
  
  .category-content {
    margin-bottom: 10px;
    padding-left: 0;  /* パディング削除 */
    border-left: none;  /* 左ボーダー削除 */
  }
  
  .list-item {
    padding: 10px;  /* パディング削減 */
    margin-bottom: 6px;
    border-left: none;  /* 左ボーダー削除してスッキリ */
    border: 1px solid #daa520;  /* 全体を囲む細いボーダー */
  }
  
  /* スマホではhover効果を無効化 */
  .list-item:hover {
    background: white;
    border-left-color: #daa520;
    transform: none;
  }
  
  .list-item label {
    font-size: 0.9rem;  /* フォントを小さく */
  }
  
  .list-label {
    gap: 5px;  /* 要素間の間隔を狭く */
  }
  
  .list-item input[type="checkbox"] {
    width: 16px;  /* チェックボックスを小さく */
    height: 16px;
    margin-right: 6px;
  }
  
  .list-number {
    font-size: 0.8rem;  /* 番号をさらに小さく */
    min-width: 28px;
    margin-right: 5px;
  }
  
  .list-text {
    font-size: 0.85rem;  /* テキストをさらに小さく */
    line-height: 1.4;
  }
  
  /* 設定画面 */
  .setting-item {
    padding: 15px;  /* パディング削減 */
    margin-bottom: 10px;
  }
  
  .setting-item label {
    font-size: 1rem;  /* フォントを小さく */
  }
  
  .setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
  }
  
  .setting-item select {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  #question-container {
    padding-top: 75px;  /* さらに削減 */
  }
  
  .waka-card {
    padding: 15px 20px;  /* パディングをさらに削減 */
    border-width: 3px;  /* ボーダーも細く */
  }
  
  .quit-btn {
    bottom: 20px;  /* 通常の位置に戻す */
    right: 15px;
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .hint-btn {
    font-size: 0.9rem;
    padding: 8px 20px;
    margin: 15px auto 20px;  /* 下マージンを通常に戻す */
  }
  
  .hint-container {
    margin: 15px 15px 20px;  /* 下マージンを通常に戻す */
    padding: 12px 15px;
  }
  
  .hint-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  .detail-btn {
    padding: 5px 10px;  /* さらに小さく */
    font-size: 0.75rem;
  }
  
  /* タイトル画面のフッター */
  .title-footer {
    margin-top: 30px;
  }
  
  .footer-note {
    font-size: 0.7rem;
    padding: 0 15px;
  }
  
  /* スマホでは注意書きを短縮 */
  .footer-note::before {
    content: "※ 学習補助としてご利用ください";
  }
  
  .footer-note {
    font-size: 0;  /* 元のテキストを非表示 */
  }
  
  .footer-note::before {
    font-size: 0.7rem;  /* 短縮版のみ表示 */
  }
  
  .footer-links {
    flex-direction: row;  /* 横並びに戻す */
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .footer-link {
    font-size: 0.75rem;
  }
  
  .footer-separator {
    display: inline;  /* セパレーターを表示 */
    font-size: 0.75rem;
  }
}

/* タイトル画面のフッター */
.title-footer {
  margin-top: 40px;
  text-align: center;
}

.footer-note {
  font-size: 0.8rem;
  color: #8b4513;
  margin-bottom: 10px;
  line-height: 1.5;
  opacity: 0.8;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.footer-link {
  color: #8b4513;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #daa520;
  text-decoration: underline;
}

.footer-separator {
  color: #8b4513;
  opacity: 0.5;
}

/* ヒント表示ボタン */
.hint-btn {
  display: block;
  margin: 20px auto;
  padding: 12px 30px;
  background: linear-gradient(135deg, #4169e1 0%, #1e3a8a 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Noto Serif JP', serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(65, 105, 225, 0.3);
}

.hint-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(65, 105, 225, 0.5);
}

.hint-container {
  margin: 20px auto;
  max-width: 600px;
  padding: 20px 25px;
  background: linear-gradient(135deg, #e6f3ff 0%, #cce5ff 100%);
  border: 2px solid #4169e1;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(65, 105, 225, 0.2);
  animation: hintSlideIn 0.4s ease-out;
}

@keyframes hintSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hint-label {
  font-size: 0.9rem;
  color: #1e3a8a;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
}

.hint-text {
  font-size: 1.1rem;
  color: #2c5aa0;
  line-height: 1.8;
  text-align: center;
  font-weight: 500;
}

/* 一覧アイテムのレイアウト調整 */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.list-label {
  flex: 1;
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* 詳細ボタン */
.detail-btn {
  padding: 8px 16px;
  background: linear-gradient(135deg, #daa520 0%, #b8860b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Noto Serif JP', serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(218, 165, 32, 0.3);
  flex-shrink: 0;
}

.detail-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(218, 165, 32, 0.5);
  background: linear-gradient(135deg, #ffd700 0%, #daa520 100%);
}

.detail-btn:active {
  transform: translateY(0);
}
