/* ═══════════════════════════════════════════
   cards.css — カードデザイン（v2: 白フチ＋色フチ）
   ═══════════════════════════════════════════ */

.card {
  --card-color:      #E0F0E8;
  --card-color-dark: #2d7a52;

  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background: #ffffff;
  border: 3px solid #ffffff;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18), 0 0 0 2px var(--card-color-dark);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: visible;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  user-select: none;
}

/* カード内側のクリッピング用ラッパー */
.card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ── 裏面 (bk.png) ── */
.card--back {
  background-image: url('card-pic/bk.png');
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(255,255,255,0.5);
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  cursor: default;
  overflow: hidden;
}
.card--back .card__inner { display: none; }

/* ─────────────────────────────────────────
   カテゴリ帯（上部・横長）
   ───────────────────────────────────────── */
.card__category {
  flex-shrink: 0;
  width: 100%;
  background: var(--card-color-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 5px 4px;
  line-height: 1.3;
}

/* ── イラストエリア（正方形・トリムなし） ── */
.card__illustration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  background: #fff;
  min-height: 0;
}
.card__illus-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  aspect-ratio: 1 / 1;
}

/* ── 説明文（下部・横長白枠） ── */
.card__text {
  font-size: 11px;
  font-weight: 700;
  color: var(--card-color-dark);
  text-align: center;
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: break-word;
  background: #fff;
  border-top: 2px solid var(--card-color);
  padding: 6px 5px 7px;
  width: 100%;
  flex-shrink: 0;
}

/* ── 選択可能 ── */
.card--selectable { cursor: pointer; }
.card--selectable:hover {
  box-shadow: 0 5px 16px rgba(0,0,0,0.22), 0 0 0 2px var(--card-color-dark);
}

/* ── 選択済み ── */
.card--selected {
  transform: translateY(-6px) scale(1.05);
  box-shadow: 0 8px 22px rgba(74,158,112,0.55), 0 0 0 3px #2d7a52;
  z-index: 2;
}

/* ── グレーアウト（重複カード） ── */
.card--greyed {
  opacity: 0.38;
  filter: grayscale(0.7);
  pointer-events: none;
}

/* ── 相互理解PT ハイライト（背景深緑でも視認できるよう明るい色＋発光） ── */
.card--highlight-mutual {
  box-shadow: 0 0 0 4px #FFD23F, 0 0 16px 4px rgba(255,210,63,0.85);
  transform: translateY(-2px);
}
.card--highlight-mutual::after {
  content: '✓';
  position: absolute;
  top: -10px; left: -10px;
  width: 24px; height: 24px;
  background: #FFD23F;
  color: #1a2e1e;
  font-size: 15px; font-weight: 900;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 24px; text-align: center;
  z-index: 11;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 0 0 2px #fff;
}

/* ── 自己開示PT ハイライト（明るいピンクで発光） ── */
.card--highlight-self {
  box-shadow: 0 0 0 4px #FF6FA8, 0 0 16px 4px rgba(255,111,168,0.85);
  transform: translateY(-2px);
}
.card--highlight-self::after {
  content: '★';
  position: absolute;
  top: -10px; left: -10px;
  width: 24px; height: 24px;
  background: #FF6FA8;
  color: #fff;
  font-size: 13px; font-weight: 900;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 24px; text-align: center;
  z-index: 11;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), 0 0 0 2px #fff;
}

/* ──────────────────────────────────
   Small variant（採点画面など）
   ────────────────────────────────── */
.card--small {
  width: 72px;
  height: 104px;
  aspect-ratio: unset;
  flex-shrink: 0;
  border-width: 2px;
}
.card--small .card__inner { border-radius: 9px; }
.card--small .card__category { font-size: 8px; padding: 3px 2px; }
.card--small .card__illustration { padding: 3px; }
.card--small .card__text { font-size: 8px; padding: 3px 3px 4px; border-top-width: 1.5px; }
.card--small.card--highlight-mutual,
.card--small.card--highlight-self {
  box-shadow: 0 0 0 3px #FFD23F, 0 0 10px 2px rgba(255,210,63,0.85);
}
.card--small.card--highlight-self {
  box-shadow: 0 0 0 3px #FF6FA8, 0 0 10px 2px rgba(255,111,168,0.85);
}
.card--small.card--highlight-mutual::after,
.card--small.card--highlight-self::after {
  width: 18px; height: 18px;
  font-size: 11px;
  line-height: 18px;
  top: -7px; left: -7px;
}

/* ──────────────────────────────────
   Large variant（モーダル拡大表示）
   ────────────────────────────────── */
.card--large {
  width: 240px;
  height: 348px;
  aspect-ratio: unset;
  border-radius: 18px;
  border-width: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), 0 0 0 2px var(--card-color-dark);
  cursor: default;
  flex-shrink: 0;
}
.card--large .card__inner { border-radius: 15px; }
.card--large .card__category { font-size: 15px; padding: 9px 6px; }
.card--large .card__illustration { padding: 12px; }
.card--large .card__text { font-size: 16px; padding: 10px 12px 12px; line-height: 1.5; border-top-width: 3px; }

/* ── Flip-in animation ── */
.card--flip-in {
  animation: cardFlipIn 0.32s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes cardFlipIn {
  0%   { opacity: 0; transform: rotateY(90deg) scale(0.85); }
  100% { opacity: 1; transform: rotateY(0deg)  scale(1); }
}
