.tarot-history { border:1px solid #ddd; padding:12px; border-radius:12px; }
.tarot-history__head { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
.tarot-history__ctrl { display:flex; gap:8px; flex-wrap:wrap; }

.th-btn { padding:6px 10px; border:1px solid #ccc; border-radius:10px; background:#fff; cursor:pointer; }
.th-btn--primary { border-color:#3b82f6; }
.th-btn--danger { border-color:#ef4444; color:#ef4444; }
.th-btn--sm { padding:4px 8px; font-size:.9em; }

#tarot-history-list { display:grid; grid-template-columns:1fr; gap:12px; }
@media (min-width:768px){ #tarot-history-list { grid-template-columns:1fr 1fr; } }

.th-item { border:1px solid #eee; padding:10px; border-radius:12px; background:#fafafa; }
.th-item__head { display:flex; gap:8px; align-items:center; justify-content:space-between; margin-bottom:6px; }
.th-item__date { font-weight:600; }
.th-item__cards { display:flex; flex-direction:column; gap:8px; }
.th-card { display:flex; gap:8px; }
.th-card__img img { width:80px; height:auto; border-radius:8px; display:block; }
.th-card__name { font-weight:600; margin-bottom:2px; }
.th-item__memo { margin-top:6px; opacity:0.9; }


/* モバイルは縦積み＆左寄せ */
.th-item__head {
  display: flex;
  flex-direction: column;   /* 縦積み */
  align-items: flex-start;  /* 左寄せ */
  gap: 6px;
}

/* 幅が広い時だけ旧来の横並びに */
@media (min-width: 640px) {
  .th-item__head {
    flex-direction: row;            /* 横並び */
    align-items: center;
    justify-content: space-between; /* 右端に削除ボタン等 */
    gap: 8px;
  }
}

/* モバイルで .th-item__head 直下の要素を幅100%にして折り返しやズレを防ぐ */
.th-item__head > * {
  width: 100%;
}
@media (min-width: 640px) {
  .th-item__head > * {
    width: auto;
  }
}

.th-card__name a.th-card__link { text-decoration: underline; }
.th-card__name a.th-card__link:hover { text-decoration: none; }