/* ---------- きくクイズ画面(choice-quiz)+ 選択肢の共通スタイル ---------- */

.practice-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  flex: 0 0 auto;
}

.activity-screen .choices {
  height: auto;
  min-height: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  flex: 1 1 auto;
}

.activity-screen .choice {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    var(--sun);
  box-shadow: 0 12px 28px rgba(39, 50, 72, 0.12);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.activity-screen .choice:focus-visible {
  outline: none;
  box-shadow:
    0 16px 28px rgba(39, 50, 72, 0.16),
    0 0 0 4px rgba(114, 201, 255, 0.32);
}

.activity-screen .choice strong {
  font-size: clamp(4.8rem, 24vw, 10rem);
  line-height: 1;
}

/* 数式・単語・時刻など長い文字は控えめなサイズ */
.activity-screen .choice strong.spec-text-word,
.activity-screen .choice strong.spec-text-time {
  font-size: clamp(2rem, 9vw, 3.8rem);
}

.target-card strong.spec-text-equation {
  font-size: clamp(2.6rem, 10vw, 4.6rem);
  letter-spacing: 0.04em;
}

.target-card strong.spec-text-word {
  font-size: clamp(2.2rem, 9vw, 4rem);
}

.spec-emoji {
  font-size: clamp(3.4rem, 18vw, 7rem);
  line-height: 1;
}

.visual-choices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activity-screen .visual-choice {
  align-content: center;
  min-height: 0;
  padding: 10px;
}

.activity-screen .visual-choice img {
  display: block;
  width: 100%;
  max-height: min(27vh, 190px);
  object-fit: contain;
  pointer-events: none;
}

.activity-screen .visual-choice .clock-face {
  width: auto;
  height: 100%;
  max-height: min(26vh, 180px);
  aspect-ratio: 1;
}

.activity-screen .choice .count-grid {
  display: grid;
  gap: 4px;
  font-size: clamp(1.1rem, 4vw, 1.8rem);
}

.activity-screen .choice.correct {
  background: #dfffee;
  outline: 6px solid var(--mint);
  transform: scale(0.98);
}

.activity-screen .choice.soft-wrong {
  background: #fff2f7;
  animation: softShake 280ms ease;
}

/* 出題ターゲットカード */

.target-card {
  display: grid;
  place-items: center;
  width: min(46vw, 210px);
  height: min(30vw, 150px);
  min-width: 150px;
  min-height: 104px;
  margin: 0 auto 14px;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 28px rgba(39, 50, 72, 0.16);
  font-size: clamp(5rem, 22vw, 9rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  flex: 0 0 auto;
}

.target-card[hidden] {
  display: none;
}

.target-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.target-card .clock-face {
  width: auto;
  height: 100%;
  aspect-ratio: 1;
}

body.has-visual-target .target-card {
  width: min(72vw, 360px);
  height: min(26vh, 190px);
  min-width: 210px;
  min-height: 96px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.target-card .count-grid {
  display: grid;
  gap: 6px;
  font-size: clamp(1.3rem, 4.6vw, 2.2rem);
  line-height: 1;
}

/* 選択肢数ごとのグリッド */

.activity-screen .choice-count-2 {
  grid-template-columns: 1fr;
}

.activity-screen .choice-count-3,
.activity-screen .choice-count-4,
.activity-screen .choice-count-5,
.activity-screen .choice-count-6,
.activity-screen .choice-count-7,
.activity-screen .choice-count-8 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.practice-bottom {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
  padding-top: 10px;
}

.practice-bottom button {
  min-width: 148px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  color: rgba(39, 50, 72, 0.76);
  background: rgba(255, 255, 255, 0.64);
  font-weight: 900;
  cursor: pointer;
}

@keyframes softShake {
  0%,
  100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(-6px);
  }

  70% {
    transform: translateX(6px);
  }
}

@media (max-width: 760px) {
  .practice-top {
    min-height: 68px;
    gap: 8px;
  }

  .hold-button {
    width: 56px;
    height: 56px;
  }

  .listen-button {
    width: 64px;
    height: 64px;
    min-width: 60px;
    min-height: 60px;
  }

  .mini-stats {
    gap: 5px;
  }

  .mini-stats span,
  .progress-text {
    font-size: 0.68rem;
  }

  .mini-stats b,
  .progress-text b {
    font-size: 0.95rem;
  }

  .activity-screen .choices {
    gap: 10px;
  }

  .target-card {
    width: min(52vw, 190px);
    height: 112px;
    min-height: 98px;
    margin-bottom: 10px;
  }

  .activity-screen .choice strong {
    font-size: clamp(4.1rem, 26vw, 8rem);
  }

  .activity-screen .choice strong.spec-text-word,
  .activity-screen .choice strong.spec-text-time {
    font-size: clamp(1.7rem, 8vw, 3rem);
  }

  .activity-screen .visual-choice {
    padding: 7px;
  }

  .activity-screen .visual-choice img {
    max-height: min(24vh, 128px);
  }
}

@media (orientation: landscape) and (max-height: 540px) {
  .practice-top {
    min-height: 68px;
  }

  .listen-button {
    min-width: 62px;
    min-height: 62px;
    width: 62px;
    height: 62px;
  }

  .hold-button {
    width: 48px;
    height: 48px;
  }

  .activity-screen .choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .activity-screen .visual-choice img {
    max-height: 102px;
  }
}
