/* ぱぷちゃんのAIクイズ（ポップアップ版）
   ページ側の .card / .btn などとぶつからないよう、クラスは全部 hq- で始める。
   呼び出し口は [data-quiz-open]（値に basic / news を入れるとそのモードで即スタート）。 */

.hq-modal, .hq-cta {
  --hq-cream: #fbf2e6;
  --hq-cream-2: #f5e3cc;
  --hq-ink: #4a3226;
  --hq-ink-soft: #7d5b49;
  --hq-pink: #f4a8c0;
  --hq-pink-deep: #e87ca0;
  --hq-pink-pale: #fde1ea;
  --hq-butter: #ffb84d;
  --hq-coral: #ff9b8a;
  --hq-leaf: #7bbf8e;
  --hq-leaf-pale: #e3f3e8;
  --hq-line: #e9d2ba;
}

/* ────────── 呼び出し口（ページに置くカード） ────────── */
.hq-cta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0 auto;
  padding: 20px 26px 20px 20px;
  background: linear-gradient(135deg, #fff 0%, var(--hq-pink-pale) 100%);
  border: 2px solid var(--hq-pink);
  border-radius: 26px;
  box-shadow: 0 6px 0 rgba(232,124,160,0.18), 0 14px 30px -12px rgba(232,124,160,0.35);
  color: var(--hq-ink);
  font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', sans-serif;
  text-align: left;
  overflow: hidden;
}
.hq-cta-img {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  /* 立ち絵を正方形に切り出して184pxに縮めた papu_icon.webp を使う。縦長の立ち絵をそのまま縮めると線がつぶれる */
  object-fit: cover;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(232,124,160,0.3);
}
.hq-cta-body { flex: 1; min-width: 0; }
.hq-cta-eyebrow {
  display: block;
  font-family: 'Caveat', cursive;
  font-size: 20px;
  color: var(--hq-pink-deep);
  line-height: 1;
  margin-bottom: 4px;
}
.hq-cta-title {
  font-weight: 900;
  font-size: clamp(17px, 2.6vw, 21px);
  margin: 0 0 4px;
  line-height: 1.5;
}
.hq-cta-text {
  font-size: 13px;
  color: var(--hq-ink-soft);
  line-height: 1.8;
  margin: 0;
}
.hq-cta-btn {
  flex: 0 0 auto;
  appearance: none;
  cursor: pointer;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.06em;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--hq-pink-deep);
  color: #fff;
  border: 2px solid var(--hq-pink-deep);
  box-shadow: 0 4px 0 rgba(74,50,38,0.18);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(.3,1.4,.4,1), box-shadow 0.2s;
}
.hq-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(74,50,38,0.18); }
.hq-cta-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(74,50,38,0.18); }
@media (max-width: 600px) {
  .hq-cta { flex-wrap: wrap; justify-content: center; text-align: center; padding: 20px 18px; gap: 14px; }
  .hq-cta-body { flex-basis: 100%; }
}

/* ────────── ポップアップ本体 ────────── */
html.hq-lock, html.hq-lock body { overflow: hidden; }

.hq-modal {
  position: fixed;
  inset: 0;
  /* 言語案内の帯やオープニング演出（最大9999）より上に出す */
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', sans-serif;
  color: var(--hq-ink);
}
.hq-modal.is-open { display: flex; }
.hq-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74,50,38,0.55);
  backdrop-filter: blur(3px);
  animation: hq-fade 0.25s ease;
}
.hq-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--hq-cream);
  background-image: radial-gradient(circle, rgba(74,50,38,0.05) 1px, transparent 1.5px);
  background-size: 22px 22px;
  border: 3px solid var(--hq-pink);
  border-radius: 28px;
  box-shadow: 0 24px 60px -18px rgba(74,50,38,0.55);
  padding: 30px 30px 26px;
  animation: hq-pop 0.35s cubic-bezier(.3,1.4,.4,1);
}
@keyframes hq-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes hq-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  .hq-modal { padding: 0; }
  .hq-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    padding: 22px 16px 28px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hq-backdrop, .hq-panel, .hq-screen, .hq-judge.is-show, .hq-host { animation: none !important; }
}

.hq-close {
  position: sticky;
  top: 0;
  float: right;
  /* 下マージンを負にして、見出しを押し下げないようにする */
  margin: -14px -14px -42px 0;
  z-index: 2;
  appearance: none;
  cursor: pointer;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--hq-pink);
  background: #fff;
  color: var(--hq-pink-deep);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(232,124,160,0.25);
  transition: transform 0.2s, background 0.2s;
}
.hq-close:hover { background: var(--hq-pink-pale); transform: rotate(90deg); }
@media (max-width: 600px) { .hq-close { margin: -6px -2px -42px 0; } }

.hq-head { text-align: center; margin: 0 0 18px; }
.hq-eyebrow {
  display: inline-block;
  font-family: 'Caveat', cursive;
  font-size: 24px;
  color: var(--hq-pink-deep);
  transform: rotate(-2deg);
}
.hq-title {
  font-weight: 900;
  font-size: clamp(22px, 4.5vw, 32px);
  margin: 2px 0 0;
  letter-spacing: 0.02em;
}
.hq-title .hq-accent {
  color: var(--hq-pink-deep);
  background: linear-gradient(transparent 65%, var(--hq-butter) 65%);
  padding: 0 4px;
}

.hq-btn {
  appearance: none;
  cursor: pointer;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  padding: 12px 24px;
  border-radius: 999px;
  background: var(--hq-pink-deep);
  color: #fff;
  border: 2px solid var(--hq-pink-deep);
  box-shadow: 0 4px 0 rgba(74,50,38,0.18);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s cubic-bezier(.3,1.4,.4,1), box-shadow 0.2s;
}
.hq-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(74,50,38,0.18); }
.hq-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(74,50,38,0.18); }
.hq-btn.hq-sub { background: #fff; color: var(--hq-pink-deep); }

.hq-card {
  background: #fff;
  border: 2px solid var(--hq-pink-pale);
  border-radius: 22px;
  box-shadow: 0 4px 16px rgba(232,124,160,0.08);
  padding: 24px 24px;
}
@media (max-width: 520px) { .hq-card { padding: 18px 16px; } }

.hq-screen { display: none; animation: hq-in 0.35s cubic-bezier(.3,1.4,.4,1); }
.hq-screen.is-show { display: block; }
@keyframes hq-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── スタート ── */
.hq-start-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-bottom: 22px;
}
.hq-host {
  width: min(130px, 34vw);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(232,124,160,0.35));
  animation: hq-bob 3.2s ease-in-out infinite;
}
@keyframes hq-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}
.hq-balloon {
  position: relative;
  max-width: 400px;
  background: #fff;
  border: 2px solid var(--hq-pink);
  border-radius: 20px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.9;
  box-shadow: 0 6px 18px rgba(232,124,160,0.16);
}
.hq-balloon::before, .hq-balloon::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 9px solid transparent;
}
.hq-balloon::before { left: -18px; border-right-color: var(--hq-pink); }
.hq-balloon::after { left: -14px; border-right-color: #fff; }
.hq-quote {
  display: block;
  font-family: 'Caveat', cursive;
  font-size: 19px;
  color: var(--hq-pink-deep);
  margin-bottom: 4px;
}
@media (max-width: 600px) {
  .hq-start-hero { flex-direction: column; gap: 14px; }
  .hq-balloon { order: -1; }
  .hq-balloon::before, .hq-balloon::after { display: none; }
  .hq-host { width: min(110px, 32vw); }
}

.hq-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.hq-mode {
  appearance: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  background: #fff;
  border: 2px solid var(--hq-pink-pale);
  border-radius: 22px;
  box-shadow: 0 4px 16px rgba(232,124,160,0.08);
  padding: 20px 22px;
  transition: transform 0.25s cubic-bezier(.3,1.4,.4,1), box-shadow 0.25s, border-color 0.25s;
}
.hq-mode:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(232,124,160,0.18);
  border-color: var(--hq-pink);
}
.hq-mode-icon { font-size: 30px; line-height: 1; display: block; margin-bottom: 8px; }
.hq-mode-name { font-weight: 900; font-size: 18px; margin: 0 0 6px; display: block; }
.hq-mode-tag {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  background: var(--hq-pink-deep);
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: 3px;
  margin-left: 8px;
}
.hq-mode-desc { font-size: 13px; color: var(--hq-ink-soft); line-height: 1.8; margin: 0; display: block; }
.hq-loading { text-align: center; padding: 18px 0 0; color: var(--hq-ink-soft); font-size: 14px; margin: 0; }

/* ── 出題 ── */
.hq-q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.hq-q-count {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--hq-pink-deep);
}
.hq-q-count .hq-total { color: var(--hq-ink-soft); font-weight: 700; }
.hq-q-issue {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  background: var(--hq-butter);
  border-radius: 999px;
  padding: 4px 12px;
}
.hq-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--hq-pink-pale);
  overflow: hidden;
  margin-bottom: 20px;
}
.hq-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hq-pink), var(--hq-pink-deep));
  transition: width 0.4s cubic-bezier(.3,1.4,.4,1);
}
.hq-q-text {
  font-weight: 900;
  font-size: clamp(16px, 3vw, 20px);
  line-height: 1.75;
  margin: 0 0 20px;
}
.hq-choices { display: flex; flex-direction: column; gap: 10px; }
.hq-choice {
  appearance: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--hq-ink);
  background: #fff;
  border: 2px solid var(--hq-line);
  border-radius: 18px;
  padding: 13px 16px;
  transition: transform 0.2s cubic-bezier(.3,1.4,.4,1), border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.hq-choice:hover:not(:disabled) {
  border-color: var(--hq-pink);
  background: var(--hq-pink-pale);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(232,124,160,0.16);
}
.hq-choice:disabled { cursor: default; }
.hq-abc {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hq-cream-2);
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hq-choice.is-correct { border-color: var(--hq-leaf); background: var(--hq-leaf-pale); }
.hq-choice.is-correct .hq-abc { background: var(--hq-leaf); color: #fff; }
.hq-choice.is-wrong { border-color: var(--hq-coral); background: #ffe9e5; }
.hq-choice.is-wrong .hq-abc { background: var(--hq-coral); color: #fff; }
.hq-choice.is-dim { opacity: 0.5; }

.hq-judge {
  display: none;
  margin-top: 20px;
  border-top: 1.5px dashed var(--hq-line);
  padding-top: 18px;
}
.hq-judge.is-show {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  animation: hq-in 0.3s cubic-bezier(.3,1.4,.4,1);
}
.hq-judge-img {
  flex: 0 0 auto;
  height: 110px;
  width: auto;
  filter: drop-shadow(0 4px 10px rgba(232,124,160,0.3));
}
.hq-judge-body { flex: 1; min-width: 0; }
.hq-judge-mark { font-weight: 900; font-size: 20px; margin: 0 0 6px; }
.hq-judge-mark.is-ok { color: var(--hq-leaf); }
.hq-judge-mark.is-ng { color: var(--hq-coral); }
.hq-judge-comment {
  font-size: 14px;
  line-height: 1.9;
  background: var(--hq-cream-2);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 0;
}
.hq-judge-source { margin: 10px 0 0; font-size: 13px; }
.hq-judge-source a { color: var(--hq-pink-deep); font-weight: 700; text-decoration-color: var(--hq-pink); }
.hq-judge-next { margin-top: 14px; text-align: right; }
@media (max-width: 520px) {
  .hq-judge.is-show { flex-direction: column; align-items: center; text-align: center; }
  .hq-judge-img { height: 96px; }
  .hq-judge-next { text-align: center; }
}

.hq-quit-wrap { text-align: center; margin-top: 12px; }
.hq-quit {
  appearance: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--hq-ink-soft);
  padding: 8px 12px;
  border-radius: 999px;
}
.hq-quit:hover { color: var(--hq-pink-deep); background: var(--hq-pink-pale); }

/* ── 結果 ── */
.hq-result { text-align: center; }
.hq-result-img {
  width: min(170px, 42vw);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(232,124,160,0.35));
}
.hq-result-score {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 900;
  font-size: clamp(36px, 8vw, 52px);
  margin: 4px 0 0;
  color: var(--hq-pink-deep);
  line-height: 1.1;
}
.hq-result-score .hq-small { font-size: 0.45em; color: var(--hq-ink-soft); font-weight: 800; }
.hq-result-rank { font-weight: 900; font-size: clamp(17px, 3.4vw, 22px); margin: 10px 0 4px; }
.hq-result-msg { font-size: 14px; color: var(--hq-ink-soft); line-height: 1.9; max-width: 460px; margin: 0 auto; }
.hq-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
