/* 共通配置 */
.rdpn-wrapper { position: fixed; z-index: 999999; inset: auto 16px 16px auto; max-width: 92vw; }
.rdpn-wrapper.rdpn-pos-bottom-left { inset: auto auto 16px 16px; }
.rdpn-wrapper.rdpn-pos-top-right   { inset: 16px 16px auto auto; }
.rdpn-wrapper.rdpn-pos-top-left    { inset: 16px auto auto 16px; }
.rdpn-wrapper.rdpn-hidden { display: none; }

.rdpn-card { box-sizing: border-box; background: #fff; padding: 14px; position: relative; outline: none; }
.rdpn-card.rdpn-clickable { cursor: pointer; }

/* 画像あり＝2:1 / 画像なし＝1列 */
.rdpn-wrapper.rdpn-has-img .rdpn-card { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: stretch; }
.rdpn-wrapper.rdpn-no-img  .rdpn-card { display: block; }

.rdpn-title { font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.rdpn-message { font-size: 14px; line-height: 1.5; }

.rdpn-media { overflow: hidden; border-radius: 8px; }
.rdpn-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* アスペクト比（中央トリミング）*/
.rdpn-img.rdpn-ar-1-1  { aspect-ratio: 1 / 1; }
.rdpn-img.rdpn-ar-4-3  { aspect-ratio: 4 / 3; }
.rdpn-img.rdpn-ar-16-9 { aspect-ratio: 16 / 9; }
.rdpn-img.rdpn-ar-3-2  { aspect-ratio: 3 / 2; }
/* auto は元比率優先 */
.rdpn-img.rdpn-ar-auto { height: auto; aspect-ratio: auto; object-fit: contain; }

.rdpn-close {
  position: absolute;
  right: 8px;
  top: 8px;
  /* サイズを大きめにしてタップしやすく */
  width: 32px;
  height: 32px;
  border-radius: 999px;

  /* 背景付きでどんな色にも乗るようにする */
  background: rgba(0, 0, 0, 0.55);
  color: #fff;

  border: 0;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  z-index: 2;

  /* 少しだけ浮かせてクリックしやすく */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);

  /* テキスト選択などの誤操作防止 */
  user-select: none;
}

/* ホバー・フォーカス時に少しだけ明るく */
.rdpn-close:hover,
.rdpn-close:focus-visible {
  background: rgba(0, 0, 0, 0.8);
  outline: none;
}

/* タッチデバイス向けにさらに少しだけ大きく */
@media (pointer: coarse) {
  .rdpn-close {
    width: 36px;
    height: 36px;
    font-size: 22px;
  }
}

/* スマホ */
@media (max-width: 480px) {
  .rdpn-wrapper { inset: auto 10px 10px auto; }
  .rdpn-wrapper.rdpn-has-img .rdpn-card { gap: 10px; }
  .rdpn-title { font-size: 14px; }
  .rdpn-message { font-size: 13px; }
}