/* ずかんの「くらべる」（/zukan/compare）。タブレット（768〜1180px）を基準に、スマホ幅でもくずれないようにする */

/* ずかん一覧にのせる入口カード */
.cmp-entry {
  display: flex; align-items: center; gap: 14px; min-height: 72px; color: var(--text); text-decoration: none;
  border: 2px solid #a7f3d0; background: linear-gradient(135deg, #ecfdf5, #eff6ff);
}
.cmp-entry:hover { text-decoration: none; border-color: #34d399; }
.cmp-entry .ico { font-size: 2.6rem; line-height: 1; }
.cmp-entry .body { flex: 1; min-width: 0; }
.cmp-entry .body b { display: block; font-size: 1.15rem; }
.cmp-entry .body small { color: var(--muted); }
.cmp-entry .go { font-size: 1.6rem; font-weight: 800; color: var(--primary-dark); }

/* hidden 属性を、display を持つ部品（.btn など）にも効かせる */
.cmp [hidden] { display: none !important; }

.cmp-hero { display: flex; align-items: center; gap: 16px; }
.cmp-hero-ico { font-size: 3.4rem; line-height: 1; flex: none; }
.cmp-set-card .chip { font-size: .8rem; }

/* あそびかたの切りかえ・ボタン（指でおしやすい 48px 以上） */
.cmp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cmp-tabs button {
  flex: 1 1 180px; min-height: 52px; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 800; cursor: pointer;
}
.cmp-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cmp-btn { min-height: 48px; }
.cmp-btn-lg { min-height: 56px; font-size: 1.1rem; padding: 12px 28px; }
.cmp-others { display: flex; flex-wrap: wrap; gap: 8px; }

/* ものさしの切りかえ */
.cmp-scale { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.cmp-scale-help { margin-top: 8px; font-size: .92rem; }

/* ぼうグラフ */
.cmp-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cmp-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 16px; border: 2px solid transparent; background: var(--surface);
}
.cmp-rows .cmp-row:nth-child(odd) { background: #fafbff; }
.cmp-pic { width: 56px; height: 56px; display: grid; place-items: center; font-size: 2.2rem; line-height: 1; border-radius: 14px; background: var(--surface-2); overflow: hidden; flex: none; }
.cmp-pic .illust-icon { width: 56px; height: 56px; vertical-align: top; }
.cmp-body { min-width: 0; }
.cmp-line { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.cmp-name { font-weight: 800; }
.cmp-val { font-weight: 800; color: var(--primary-dark); }
.cmp-track { height: 22px; margin-top: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cmp-bar {
  display: block; height: 100%; min-width: 6px; border-radius: 999px;
  background: linear-gradient(90deg, #34d399, #0ea5e9); transition: width .6s ease;
}
.cmp-rows.is-log .cmp-bar { background: linear-gradient(90deg, #a78bfa, #ec4899); }
.cmp-note { display: block; margin-top: 2px; line-height: 1.4; }
.cmp-link { min-height: 48px; white-space: nowrap; }

/* くらべる めやす（しるし付きの ぼう） */
.cmp-row.is-ref, .cmp-rows .cmp-row.is-ref:nth-child(odd) { border: 2px dashed #f59e0b; background: #fffbeb; }
.cmp-row.is-ref .cmp-bar, .cmp-rows.is-log .cmp-row.is-ref .cmp-bar {
  background: repeating-linear-gradient(45deg, #f59e0b 0 8px, #fcd34d 8px 16px);
}

/* ふたつを くらべる */
.cmp-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.cmp-pick {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 104px; padding: 10px 6px; border-radius: 16px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; text-align: center; cursor: pointer;
}
.cmp-pick .nm { font-weight: 800; font-size: .9rem; line-height: 1.3; }
.cmp-pick.is-ref { border-style: dashed; border-color: #f59e0b; }
.cmp-pick[aria-pressed="true"] { border-style: solid; border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
.cmp-pick[data-order]::after {
  content: attr(data-order); position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; font-size: .9rem;
}
.cmp-pair { display: grid; gap: 8px; }
.cmp-hint { text-align: center; color: var(--muted); padding: 16px 8px; background: var(--surface-2); border-radius: 14px; }
.cmp-sentence { margin: 0; padding: 14px 12px; border-radius: 16px; background: #fffbeb; border: 2px solid #fde68a; text-align: center; font-size: 1.25rem; font-weight: 700; line-height: 1.9; }
.cmp-times { display: inline-block; padding: 0 8px; border-radius: 10px; background: #f59e0b; color: #fff; font-weight: 800; }

/* どっちが 大きい？ クイズ */
.cmp-score { font-size: .9rem; padding: 6px 12px; }
.cmp-q { text-align: center; font-size: 1.4rem; font-weight: 800; margin: 10px 0 12px; }
.cmp-q b { color: var(--primary-dark); }
.cmp-duel { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px; }
.cmp-vs { align-self: center; font-weight: 900; color: var(--muted); }
.cmp-choice {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 220px; padding: 16px 8px; border-radius: 24px; border: 3px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; text-align: center; cursor: pointer;
}
.cmp-choice:not(:disabled):hover { border-color: var(--primary); background: var(--primary-soft); }
.cmp-choice:disabled { cursor: default; }
.cmp-choice .nm { font-weight: 800; font-size: 1.1rem; line-height: 1.35; }
.cmp-choice .val { min-height: 1.7em; font-weight: 800; color: var(--primary-dark); }
.cmp-pic-lg { width: 120px; height: 120px; font-size: 4.6rem; border-radius: 24px; }
.cmp-pic-lg .illust-icon { width: 120px; height: 120px; }
.cmp-mark { position: absolute; top: 8px; right: 12px; font-size: 2rem; line-height: 1; }
.cmp-choice.is-correct { border-color: var(--success); background: #ecfdf5; }
.cmp-choice.is-wrong { border-color: var(--danger); background: #fef2f2; }
.cmp-feedback { margin-top: 12px; padding: 12px 14px; border-radius: 16px; text-align: center; font-size: 1.05rem; line-height: 1.9; }
.cmp-feedback.ok { background: #ecfdf5; border: 2px solid #6ee7b7; }
.cmp-feedback.ng { background: #fef2f2; border: 2px solid #fecaca; }
.cmp-fb-title { font-size: 1.3rem; font-weight: 800; }
.cmp-final { text-align: center; padding: 12px 8px 16px; }
.cmp-final-stars { font-size: 2.2rem; letter-spacing: 4px; }
.cmp-final-score { font-size: 1.5rem; font-weight: 800; margin: 6px 0; }
.cmp-final-score b { font-size: 2.2rem; color: var(--primary-dark); }
.cmp-final-actions { justify-content: center; }

@media (max-width: 599px) {
  .cmp-hero-ico { font-size: 2.6rem; }
  .cmp-row { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 10px; }
  .cmp-pic { width: 44px; height: 44px; font-size: 1.7rem; }
  .cmp-pic .illust-icon { width: 44px; height: 44px; }
  .cmp-link { grid-column: 2; justify-self: start; }
  .cmp-picks { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .cmp-duel { gap: 6px; }
  .cmp-choice { min-height: 180px; padding: 12px 4px; border-radius: 18px; }
  .cmp-choice .nm { font-size: .98rem; }
  .cmp-pic-lg, .cmp-pic-lg .illust-icon { width: 84px; height: 84px; }
  .cmp-pic-lg { font-size: 3.2rem; }
  .cmp-sentence { font-size: 1.1rem; }
}

/* 動きをへらす設定のときは、ぼうを のばす アニメーションをしない */
@media (prefers-reduced-motion: reduce) {
  .cmp-bar { transition: none; }
}
