:root {
  --bg: #EAF6FF;
  --card: #FFFFFF;
  --ink: #2E3A46;
  --yellow: #FFC93C;
  --green: #479041;
  --coral: #FF6F5E;
  --pink: #dac801;
  --sky: #4EC5F1;
  --green: #6BCB77;
  --shadow: 0 8px 0 rgba(46, 58, 70, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "M PLUS Rounded 1c", sans-serif;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}

body {
  /* ふんわりした色の光を四隅に置いて、単色の背景より楽しい雰囲気に */
  background:
    radial-gradient(circle at 8% 12%, rgba(255,201,60,0.30), transparent 38%),
    radial-gradient(circle at 92% 8%, rgba(78,197,241,0.28), transparent 36%),
    radial-gradient(circle at 88% 85%, rgba(255,111,94,0.22), transparent 36%),
    radial-gradient(circle at 10% 88%, rgba(107,203,119,0.22), transparent 36%),
    var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* 背景の星（画像不要のCSSだけの装飾） */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.decor-star {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--yellow);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  opacity: 0.55;
  animation: twinkle 2.6s ease-in-out infinite;
}
.decor-star.star1 { top: 6%; left: 8%; animation-delay: 0s; }
.decor-star.star2 { top: 10%; left: 88%; width: 14px; height: 14px; background: var(--coral); animation-delay: 0.6s; }
.decor-star.star3 { top: 45%; left: 4%; width: 12px; height: 12px; background: var(--sky); animation-delay: 1.2s; }
.decor-star.star4 { top: 60%; left: 93%; width: 16px; height: 16px; background: var(--green); animation-delay: 1.8s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 0.75; transform: scale(1.15) rotate(12deg); }
}

/* リンクやアドレスバー遷移の手掛かりを与えない */
a { pointer-events: none; }

/* フッターの著作権リンクだけは例外的に有効化し、色も黒に */
footer a {
  pointer-events: auto;
  color: var(--ink);
  text-decoration: underline;
}

/* 保護者向けモーダル内のリンクも例外的に有効化 */
.parent-modal-body a {
  pointer-events: auto;
  color: var(--ink);
  text-decoration: underline;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ヘッダー */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
}
.topbar h1.bubble-title {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: clamp(23px, 7.5vw, 36px);
  font-weight: 800;
  letter-spacing: 1px;
}
.bubble-title span {
  display: inline-block;
  -webkit-text-stroke: 4.5px #fff;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(46,58,70,0.18);
}
.bubble-title .c1 { color: #1EA7C4; transform: rotate(-4deg); }
.bubble-title .c2 { color: var(--sky); transform: rotate(3deg); }
.bubble-title .c3 { color: #34B994; transform: rotate(-3deg); }
.bubble-title .c4 { color: var(--green); transform: rotate(4deg); }
.bubble-title .c5 { color: #2E86D1; transform: rotate(-2deg); }
.sun-badge {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.sun { transition: transform 0.3s ease; object-fit: contain; cursor: pointer; }
.stars {
  background: linear-gradient(160deg, var(--yellow), #ffdd7a);
  color: var(--ink);
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  transition: transform 0.2s ease;
}
.stars.bump { animation: bump 0.4s ease; }
@keyframes bump {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.3) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 再生スピード選択 */
.speed-select {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.speed-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 0 rgba(46,58,70,0.12);
}
.speed-btn[data-speed="ultra"] { background: #ffffff; }
.speed-btn[data-speed="slow"] { background: #ffffff; }
.speed-btn[data-speed="normal"] { background: #ffffff; }
.speed-btn.active {
  background: var(--green);
  color: #fff;
}
.speed-btn:active { transform: translateY(2px); box-shadow: none; }

/* 画面切り替え */
.screen { display: none; animation: fadein 0.25s ease; }
.screen.active { display: block; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.lead {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  margin: 8px 0 20px;
}

/* ふくろう先生マスコット */
.mascot-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.mascot-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 6px 0 rgba(46,58,70,0.10));
  animation: floaty 3.2s ease-in-out infinite;
}

/* モード選択カード */
.mode-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 560px) {
  .mode-cards { grid-template-columns: 1fr 1fr; }
}

.mode-card {
  border: none;
  border-radius: 28px;
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
  border: 3px solid rgba(255,255,255,0.5);
}
.mode-card:active { transform: translateY(4px) !important; box-shadow: none; }
.mode-card.mode-name { background: linear-gradient(160deg, var(--coral), #ff8f7a); transform: rotate(-1.5deg); }
.mode-card.mode-listen { background: linear-gradient(160deg, var(--sky), #6accea); transform: rotate(1.5deg); }
.mode-card.mode-random { background: linear-gradient(160deg, var(--green), #378e31); transform: rotate(-1.5deg); }
.mode-card.mode-talk { background: linear-gradient(160deg, var(--pink), #b4b41f); transform: rotate(1.5deg); }
.mode-icon-badge {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floaty 3s ease-in-out infinite;
}
.mode-card.mode-listen .mode-icon-badge { animation-delay: 0.4s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.mode-icon-img {
  width: 52px;
  height: 52px;
  display: block;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.12));
}
.mode-title { font-size: 19px; font-weight: 800; }
.mode-sub { font-size: 14px; opacity: 0.9; }

/* 戻るボタン */
.back-btn {
  border: none;
  background: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  padding: 8px 4px;
  margin-bottom: 8px;
  cursor: pointer;
}

/* カード共通 */
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  text-align: center;
}

.prompt-ja { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.prompt-en { font-size: 26px; font-weight: 800; color: var(--coral); margin: 0 0 6px; }
.prompt-kana { font-size: 16px; color: #6b7784; margin: 0 0 16px; }
.prompt-kana b { color: var(--ink); font-weight: 800; }

/* 「これはなんですか？」用のイラスト表示 */
.this-illustration { margin-top: 18px; display: flex; justify-content: center; }
.this-illustration.hidden { display: none; }
.this-illustration-img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 6px 0 rgba(46,58,70,0.12));
}

.play-btn, .mic-btn, .hint-btn {
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
  background: var(--sky);
  box-shadow: 0 6px 0 rgba(46,58,70,0.15);
}
.play-btn:active, .mic-btn:active, .hint-btn:active { transform: translateY(4px); box-shadow: none; }

.question-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hint-btn {
  background: var(--yellow);
  color: var(--ink);
  font-size: 16px;
}
.hint-display {
  margin: 14px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  min-height: 20px;
}

.mic-btn {
  background: var(--coral);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
}
.mic-btn.listening {
  background: var(--green);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.hint { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.hint-en { font-size: 15px; color: #6b7784; margin: 0 0 16px; }

.recognized {
  min-height: 22px;
  font-size: 15px;
  color: #6b7784;
  margin: 14px 0 0;
}

.feedback {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 800;
  min-height: 26px;
}
.feedback.correct { color: var(--green); }
.feedback.retry { color: var(--coral); }

/* 発音練習リスト */
.phrase-list { display: flex; flex-direction: column; gap: 12px; }
.phrase-card {
  background: var(--card);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.phrase-text { flex: 1; }
.phrase-en { font-size: 19px; font-weight: 800; margin: 0 0 4px; }
.phrase-kana { font-size: 14px; color: #6b7784; margin: 0; }
.phrase-kana b { color: var(--ink); font-weight: 800; }
.phrase-meaning { font-size: 13px; color: #8a94a0; margin: 4px 0 0; }
.phrase-play {
  border: none;
  background: var(--yellow);
  color: var(--ink);
  font-size: 20px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(46,58,70,0.15);
}
.phrase-play:active { transform: translateY(3px); box-shadow: none; }
.phrase-play.playing { background: var(--green); }

.loading { text-align: center; color: #6b7784; }

/* しつもんタブ */
.question-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 16px;
}
.question-tab {
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
}
.question-tab.active {
  background: var(--coral);
  color: #fff;
}
.question-tab:active { transform: translateY(3px); box-shadow: none; }

/* 回答サンプルボタン */
.sample-answers {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.sample-btn {
  border: none;
  border-radius: 18px;
  padding: 14px 10px;
  min-width: 88px;
  background: var(--yellow);
  color: var(--ink);
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(46,58,70,0.15);
}
.sample-btn:active { transform: translateY(3px); box-shadow: none; }
.sample-btn.playing { background: var(--green); color: #fff; }
.sample-card.hidden { display: none; }

/* ランダムモードの「つぎの しつもん」ボタン */
.next-btn {
  display: block;
  margin: 4px auto 0;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 0 6px 0 rgba(46,58,70,0.15);
}
.next-btn:active { transform: translateY(4px); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* かいわを してみよう */
.talk-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.talk-card {
  background: var(--card);
  border-radius: 20px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
}
.talk-card:active { transform: translateY(3px); box-shadow: none; }
.talk-card-icon { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.talk-card-title { font-size: 17px; font-weight: 800; color: var(--ink); }
.talk-card-sub { font-size: 13px; color: #8a94a0; margin-top: 2px; }

.hidden { display: none; }

.talk-progress {
  text-align: center;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 12px;
}

.talk-npc-card { text-align: left; }
.talk-npc-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.talk-npc-avatar {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 0 rgba(46,58,70,0.12));
}
.talk-npc-bubble {
  background: #F3F8FC;
  border-radius: 18px;
  padding: 12px 16px;
  flex: 1;
}
.talk-npc-bubble .prompt-en { margin: 0 0 4px; font-size: 22px; }
.talk-npc-bubble .prompt-kana { margin: 0; }

.talk-complete-card { text-align: center; }
.talk-complete-title { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.talk-complete-sub { font-size: 15px; color: #6b7784; margin: 0 0 18px; }

/* 保護者の方へ ボタン＆モーダル */
.parent-notice-btn {
  border: none;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 0 rgba(46,58,70,0.10);
  cursor: pointer;
}
.parent-notice-btn:active { transform: translateY(2px); box-shadow: none; }

.parent-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(46, 58, 70, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.parent-modal-overlay.hidden { display: none; }

.parent-modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px 22px;
  max-width: 520px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  text-align: left;
  -webkit-user-select: text;
  user-select: text;
}
.parent-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: #F0F3F6;
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
}
.parent-modal-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 14px;
  padding-right: 30px;
}
.parent-modal-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.parent-modal-body p { margin: 0 0 12px; }
.parent-modal-body ul { margin: 0; padding-left: 18px; }
.parent-modal-body li { margin-bottom: 12px; }
.parent-modal-body li:last-child { margin-bottom: 0; }
.parent-modal-body strong.notice-highlight { color: var(--coral); }