/* =========================================================
   インライン麻雀牌（img方式）
   ========================================================= */

img.mti-tile {
  display: inline-block;

  /* 牌サイズ（文章中で自然に見える値） */
  height: 1.25em;
  width: auto;

  margin: 0 0.08em;

  /* 行内で中央に配置 */
  vertical-align: middle;

  /* ★回転の基準点はセンター */
  transform-origin: center center;
}

/* 回転（センター基準） */
img.mti-tile.rot-0 {
  transform: rotate(0deg);
}

img.mti-tile.rot-90 {
  transform: rotate(90deg);
	transform:transelateX(30px);
}

img.mti-tile.rot-180 {
  transform: rotate(180deg);
}

img.mti-tile.rot-270 {
  transform: rotate(270deg);
}

/* 赤ドラの軽い強調（任意） */
img.mti-tile.is-red {
  filter: saturate(1.05) contrast(1.02);
}


/* =========================================================
   麻雀牌モーダル（画面右端に出るサイドパネル）
   ========================================================= */

/* モーダル全体（WP標準の中央配置を解除） */
.mti-modal .components-modal__frame {
  position: fixed;

  top: 0;
  right: 0;
  bottom: 0;
  left: auto;

  height: 100vh;
  max-height: 100vh;

  width: min(420px, 36vw);
  max-width: 90vw;

  margin: 0;
  border-radius: 0;

  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
}

/* タイトルバー＋本文を含むエリア */
.mti-modal .components-modal__content {
  display: flex;
  flex-direction: column;

  height: 100%;
  padding: 12px;
  overflow: hidden;
}

/* =========================================================
   モーダル内UI
   ========================================================= */

/* 上部操作バー */
.mti-modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 8px;
  margin-bottom: 10px;
}

/* 向き切り替えボタンなど */
.mti-modal-top .components-button-group {
  display: flex;
  gap: 4px;
}

/* カテゴリボタン */
.mti-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin-bottom: 10px;
}

/* =========================================================
   牌一覧グリッド
   ========================================================= */

.mti-grid {
  flex: 1;

  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;

  overflow-y: auto;
  padding-right: 4px;
}

/* 画面が広いときは列を増やす */
@media (min-width: 1200px) {
  .mti-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* 牌カード */
.mti-card {
  border: 1px solid #d0d7de;
  border-radius: 6px;
  background: #fff;

  padding: 6px;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;

  font-size: 12px;
}

.mti-card:hover {
  border-color: #2271b1;
}

/* 画像サムネ */
.mti-card img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 無効（画像未設定） */
.mti-card:disabled,
.mti-card[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}