/* ==========================================================================
   Design System: 和風 (Japanese Gold Elegance)

   色はすべてトークン経由で参照する。生の色値をルールの中に直接書かないこと。
   ダークテーマは下の 2 ブロックで同じ値を上書きする（詳細は該当箇所のコメント）。
   ========================================================================== */

/* --------------------------------------------------------------------------
   Light — 和紙＋金（既定）
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Base */
  --bg-base: #faf8f5;                    /* 生成り・胡粉色 (Warm White) */
  --bg-card: rgba(255, 255, 255, 0.92);  /* 純白の透かし和紙 */

  /* Ink */
  --color-ink: #1a1a1e;                  /* 本文（ライトでは墨色） */
  --color-text-sub: #54585f;             /* 鈍色 / 鼠色 (Muted Slate) */

  /* Accent
     --color-gold      : 線・枠・装飾専用（コントラスト基準の対象外）
     --color-gold-ink  : 文字とアイコン用。白背景で 7.13:1（WCAG AAA）
                         AAA の 7:1 を満たすには金をここまで濃くする必要がある。
                         装飾線は基準の対象外なので --color-gold のまま明るい金を保つ */
  --color-gold: #c5a059;                 /* 箔金 (Refined Gold) */
  --color-gold-ink: #675123;             /* 文字用の濃い金 */
  --color-gold-light: #e5cc96;           /* 淡金 (Soft Gold Accent) */
  --color-vermilion: #b82635;            /* 珊瑚朱 / 落款赤 */

  /* Surfaces */
  --surface-back: #ffffff;
  --surface-btn: rgba(255, 255, 255, 0.85);
  --surface-btn-hover: #ffffff;
  --avatar-ring: #ffffff;

  /* Borders & Lines */
  --color-washi-border: rgba(197, 160, 89, 0.25);  /* 金糸枠 */
  --border-card-edge: rgba(255, 255, 255, 0.9);
  --border-card-hover: rgba(197, 160, 89, 0.4);
  --border-inner-hover: rgba(197, 160, 89, 0.6);
  --border-btn: rgba(197, 160, 89, 0.3);
  --gold-fade: rgba(197, 160, 89, 0.15);
  --ring-border: rgba(197, 160, 89, 0.08);
  --ring-glow: rgba(197, 160, 89, 0.03);
  --sheen: rgba(197, 160, 89, 0.12);

  /* Gradients — 霞と雲母引きを思わせる繊細な放射状・幾何学背景 */
  --bg-texture:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.95), transparent 70%),
    radial-gradient(circle at 10% 20%, rgba(197, 160, 89, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(184, 38, 53, 0.03) 0%, transparent 40%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.4) 0px, rgba(255, 255, 255, 0.4) 2px, transparent 2px, transparent 8px);
  --gradient-back: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 245, 0.9));
  --gradient-fallback: linear-gradient(135deg, #ffffff 0%, var(--bg-base) 100%);

  /* Shadows & Glows */
  --shadow-card:
    0 10px 30px -5px rgba(26, 26, 30, 0.05),
    0 20px 40px -10px rgba(197, 160, 89, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  --shadow-hover:
    0 20px 40px -5px rgba(26, 26, 30, 0.08),
    0 0 25px rgba(197, 160, 89, 0.25),
    inset 0 0 0 1px rgba(197, 160, 89, 0.4);
  --shadow-soft: 0 4px 15px rgba(26, 26, 30, 0.1);
  --shadow-btn: 0 2px 6px rgba(0, 0, 0, 0.02);
  --shadow-btn-hover: 0 6px 16px rgba(197, 160, 89, 0.18);
  --text-shadow-name: 0 2px 10px rgba(0, 0, 0, 0.02);

  /* Typography（テーマ非依存） */
  --font-mincho: 'Shippori Mincho', 'Noto Serif JP', serif;
  --font-roman: 'Cinzel', serif;
  --font-sans: 'Noto Sans JP', sans-serif;

  /* Transitions（テーマ非依存） */
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Dark — 墨＋金（夜の床の間・黒漆に金蒔絵）

   同じ値を 2 箇所に書いている。CSS にはメディアクエリとセレクタを 1 つの
   ルールに束ねる手段がなく、light-dark() は非対応ブラウザでカスタム
   プロパティごと壊れる（カスタムプロパティはパース時に検証されないため、
   通常プロパティで使える 2 段書きのフォールバックが効かない）。
   片方を直したらもう片方も必ず直すこと。

   (A) OS がダーク かつ 手動でライトを選んでいない
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg-base: #14141a;
    --bg-card: rgba(30, 30, 38, 0.92);

    --color-ink: #f0ede8;
    --color-text-sub: #b7b2ab;

    --color-gold: #d4b071;
    --color-gold-ink: #d4b071;
    --color-gold-light: #6b5836;
    --color-vermilion: #e25765;

    --surface-back: #1e1e26;
    --surface-btn: rgba(255, 255, 255, 0.04);
    --surface-btn-hover: rgba(255, 255, 255, 0.09);
    --avatar-ring: #2a2a34;

    --color-washi-border: rgba(212, 176, 113, 0.22);
    --border-card-edge: rgba(255, 255, 255, 0.07);
    --border-card-hover: rgba(212, 176, 113, 0.45);
    --border-inner-hover: rgba(212, 176, 113, 0.65);
    --border-btn: rgba(212, 176, 113, 0.28);
    --gold-fade: rgba(212, 176, 113, 0.15);
    --ring-border: rgba(212, 176, 113, 0.07);
    --ring-glow: rgba(212, 176, 113, 0.04);
    --sheen: rgba(212, 176, 113, 0.16);

    --bg-texture:
      radial-gradient(circle at 50% 0%, rgba(212, 176, 113, 0.06), transparent 70%),
      radial-gradient(circle at 10% 20%, rgba(212, 176, 113, 0.05) 0%, transparent 40%),
      radial-gradient(circle at 90% 80%, rgba(224, 74, 90, 0.05) 0%, transparent 40%),
      repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 2px, transparent 2px, transparent 8px);
    --gradient-back: linear-gradient(135deg, rgba(40, 40, 50, 0.9), rgba(20, 20, 26, 0.9));
    --gradient-fallback: linear-gradient(135deg, #2a2a34 0%, var(--bg-base) 100%);

    /* 暗背景では白の inset ハイライトが眩しい線になるため大幅に落とす */
    --shadow-card:
      0 10px 30px -5px rgba(0, 0, 0, 0.5),
      0 20px 40px -10px rgba(0, 0, 0, 0.35),
      inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-hover:
      0 20px 40px -5px rgba(0, 0, 0, 0.6),
      0 0 25px rgba(212, 176, 113, 0.18),
      inset 0 0 0 1px rgba(212, 176, 113, 0.35);
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.45);
    --shadow-btn: 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-btn-hover: 0 6px 16px rgba(0, 0, 0, 0.45);
    --text-shadow-name: none;
  }
}

/* (B) 手動でダークを選んだ（OS 設定より優先）— 上の (A) と同じ値 */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-base: #14141a;
  --bg-card: rgba(30, 30, 38, 0.92);

  --color-ink: #f0ede8;
  --color-text-sub: #b7b2ab;

  --color-gold: #d4b071;
  --color-gold-ink: #d4b071;
  --color-gold-light: #6b5836;
  --color-vermilion: #e25765;

  --surface-back: #1e1e26;
  --surface-btn: rgba(255, 255, 255, 0.04);
  --surface-btn-hover: rgba(255, 255, 255, 0.09);
  --avatar-ring: #2a2a34;

  --color-washi-border: rgba(212, 176, 113, 0.22);
  --border-card-edge: rgba(255, 255, 255, 0.07);
  --border-card-hover: rgba(212, 176, 113, 0.45);
  --border-inner-hover: rgba(212, 176, 113, 0.65);
  --border-btn: rgba(212, 176, 113, 0.28);
  --gold-fade: rgba(212, 176, 113, 0.15);
  --ring-border: rgba(212, 176, 113, 0.07);
  --ring-glow: rgba(212, 176, 113, 0.04);
  --sheen: rgba(212, 176, 113, 0.16);

  --bg-texture:
    radial-gradient(circle at 50% 0%, rgba(212, 176, 113, 0.06), transparent 70%),
    radial-gradient(circle at 10% 20%, rgba(212, 176, 113, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(224, 74, 90, 0.05) 0%, transparent 40%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0px, rgba(255, 255, 255, 0.015) 2px, transparent 2px, transparent 8px);
  --gradient-back: linear-gradient(135deg, rgba(40, 40, 50, 0.9), rgba(20, 20, 26, 0.9));
  --gradient-fallback: linear-gradient(135deg, #2a2a34 0%, var(--bg-base) 100%);

  --shadow-card:
    0 10px 30px -5px rgba(0, 0, 0, 0.5),
    0 20px 40px -10px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-hover:
    0 20px 40px -5px rgba(0, 0, 0, 0.6),
    0 0 25px rgba(212, 176, 113, 0.18),
    inset 0 0 0 1px rgba(212, 176, 113, 0.35);
  --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.45);
  --shadow-btn: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-btn-hover: 0 6px 16px rgba(0, 0, 0, 0.45);
  --text-shadow-name: none;
}

/* ==========================================================================
   Global Reset & Base Setup
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100dvh; /* iOS Safari のアドレスバー分のずれを吸収 */
  font-family: var(--font-sans);
  color: var(--color-ink);
  background-color: var(--bg-base);
  background-image: var(--bg-texture);
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4.5rem 1.5rem 3rem; /* 上は固定配置のテーマトグル分を空ける */
  overflow-x: hidden;
  position: relative;
}

/* 画面背景の静かな和風アクセント */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  height: 90vw;
  max-width: 1000px;
  max-height: 1000px;
  border-radius: 50%;
  border: 1px solid var(--ring-border);
  box-shadow: inset 0 0 120px var(--ring-glow);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Accessibility Utilities
   ========================================================================== */

/* 視覚的には隠すがスクリーンリーダーには読ませる */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* キーボード操作時の現在位置。朱はライト 5.9:1 / ダーク 4.2:1 で
   非テキスト UI の基準 3:1 を両テーマで満たす */
:focus-visible {
  outline: 2px solid var(--color-vermilion);
  outline-offset: 3px;
}

/* ==========================================================================
   Theme Toggle
   ========================================================================== */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 44px;  /* タッチ標的の下限 */
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-btn);
  background: var(--surface-btn);
  color: var(--color-gold-ink);
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.35s var(--ease-smooth),
              border-color 0.35s var(--ease-smooth),
              box-shadow 0.35s var(--ease-smooth),
              transform 0.35s var(--ease-smooth);
}

.theme-toggle:hover {
  background: var(--surface-btn-hover);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-2px);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 表示するのは「切り替えた先」のアイコン。JS で差し替えると初回描画で
   ちらつくため、両方 DOM に置いて CSS で出し分ける */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun  { display: block; }
}

:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

/* ==========================================================================
   Layout Container (Responsive: Mobile Column / PC Row)
   ========================================================================== */
.container {
  width: 100%;
  max-width: 440px; /* スマホデフォルト：縦一列 */
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 1;
  position: relative;
}

/* PC・タブレット（横画面レイアウト） */
@media (min-width: 768px) {
  .container {
    max-width: 1240px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 2rem;
  }

  .tarot-wrapper {
    flex: 1 1 340px;
    max-width: 380px;
    display: flex;
  }

  /* row 方向の flex item になるため、単独行に落ちることを明示する */
  .footer {
    flex: 0 0 100%;
  }
}

/* ==========================================================================
   Tarot Card Wrapper & 3D Flip Animation
   ========================================================================== */
.tarot-wrapper {
  perspective: 1200px;
  width: 100%;
}

.tarot-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  animation: tarotFlipIn 1.2s var(--ease-out-back) forwards;
  animation-delay: var(--flip-delay, 0s);
  opacity: 0;
}

@keyframes tarotFlipIn {
  0% {
    opacity: 0;
    transform: rotateY(-90deg) translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) translateY(0) scale(1);
  }
}

/* カード裏面 (和風幾何学・神聖な神社文様デザイン) */
.tarot-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  background: var(--surface-back);
  border-radius: 16px;
  border: 2px solid var(--color-gold);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.tarot-back::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px dashed var(--color-gold);
  border-radius: 10px;
  background:
    radial-gradient(circle, var(--color-gold-light) 1px, transparent 1px) 0 0 / 16px 16px,
    var(--gradient-back);
}

/* カード表面 (Front Card) */
.tarot-front {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backface-visibility: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 2.25rem 2rem;
  border: 1px solid var(--border-card-edge);
  box-shadow: var(--shadow-card);
  transition: transform 0.5s var(--ease-smooth), box-shadow 0.5s var(--ease-smooth), border-color 0.5s var(--ease-smooth);
  overflow: hidden;
}

/* 和風二重枠線 (金色と内側グラデーション) */
.tarot-front::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid var(--color-washi-border);
  border-radius: 14px;
  pointer-events: none;
  transition: border-color 0.4s ease;
}

/* 四隅の和風飾り角 (Corner Ornaments) */
.tarot-front::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid transparent;
  border-top-color: var(--color-gold);
  border-bottom-color: var(--color-gold);
  border-radius: 10px;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.tarot-wrapper:hover .tarot-front {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-card-hover);
}

.tarot-wrapper:hover .tarot-front::before {
  border-color: var(--border-inner-hover);
}

.tarot-wrapper:hover .tarot-front::after {
  opacity: 0.9;
}

/* ==========================================================================
   Card Decoration (Top & Bottom Header/Footer)
   ========================================================================== */
.card-deco-top,
.card-deco-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.card-deco-top {
  margin-bottom: 1.5rem;
}

.card-deco-bottom {
  margin-top: 1.75rem;
}

.card-roman {
  font-family: var(--font-roman);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-gold-ink);
  letter-spacing: 0.15em;
  line-height: 1;
}

.deco-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--gold-fade) 100%);
}

.card-deco-bottom .deco-line {
  background: linear-gradient(90deg, var(--gold-fade) 0%, var(--color-gold) 100%);
}

.card-label {
  font-family: var(--font-roman);
  font-size: 0.75rem;
  color: var(--color-gold-ink);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* カード見出し（3 枚とも同じ体裁で使う） */
.section-title {
  font-family: var(--font-mincho);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-ink);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--color-gold);
}

/* ==========================================================================
   Profile Card Content (Card I)
   ========================================================================== */
.profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  justify-content: center;
}

/* アイコン */
.avatar {
  width: 100px;
  height: 100px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--avatar-ring);
  box-shadow: var(--shadow-soft);
  transition: transform 0.4s var(--ease-out-back);
}

.avatar:hover {
  transform: scale(1.05);
}

/* 画像読み込み失敗時のフォールバック (和風の朱印風デザイン) */
.avatar-fallback {
  display: none;
  width: 100px;
  height: 100px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--gradient-fallback);
  border: 2px solid var(--color-gold);
  color: var(--color-vermilion);
  font-family: var(--font-mincho);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 96px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.no-img .avatar {
  display: none;
}

.no-img .avatar-fallback {
  display: block;
}

/* 名前 */
.name {
  font-family: var(--font-mincho);
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--color-ink);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  text-shadow: var(--text-shadow-name);
}

/* プロフィール本文 */
.bio {
  font-family: var(--font-mincho);
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-sub);
  margin-bottom: 1.25rem;
}

/* ==========================================================================
   Links Card Content (Card II)
   ========================================================================== */
.links-card .links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  justify-content: center;
}

.link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--surface-btn);
  border: 1px solid var(--border-btn);
  border-radius: 12px;
  color: var(--color-ink);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-btn);
  transition: all 0.35s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

/* ホバー時の和風金の斜め光彩スライド */
.link-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--sheen), transparent);
  transition: left 0.6s ease;
}

.link-btn:hover::before {
  left: 100%;
}

.link-btn:hover {
  background: var(--surface-btn-hover);
  border-color: var(--color-gold);
  color: var(--color-ink);
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-3px);
}

.link-btn .icon {
  width: 20px;
  height: 20px;
  fill: var(--color-gold-ink);
  transition: transform 0.3s ease, fill 0.3s ease;
}

.link-btn:hover .icon {
  fill: var(--color-vermilion);
  transform: scale(1.15) rotate(-4deg);
}

/* ==========================================================================
   Video Card Content (Card III - Special Recommendation)
   ========================================================================== */
.video-card {
  display: flex;
  flex-direction: column;
}

/* 高さは padding-top で先に確保されるので、中身が後から入っても
   レイアウトシフトは起きない */
.video-embed-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-gold-light);
  box-shadow: var(--shadow-soft);
  background: var(--surface-btn);
}

.video-embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* サムネイル（クリックされるまで YouTube は一切読み込まない） */
.video-thumb-btn {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.video-thumb-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* hqdefault.jpg は 4:3 なので上下を切って 16:9 にする */
}

/* サムネイル写真の上に載るため、テーマに依存しない固定色でよい */
.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(26, 26, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s var(--ease-smooth), transform 0.3s var(--ease-out-back);
}

.video-play-icon svg {
  width: 22px;
  height: 22px;
  fill: #ffffff;
  margin-left: 3px; /* 三角形の視覚的な中心合わせ */
}

.video-thumb-btn:hover .video-play-icon {
  background: var(--color-vermilion);
  transform: translate(-50%, -50%) scale(1.08);
}

/* 取得に失敗したときもカードは残し、チャンネルへの導線に差し替える */
.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  text-align: center;
  text-decoration: none;
  font-family: var(--font-mincho);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--color-text-sub);
}

.video-fallback strong {
  font-weight: 700;
  color: var(--color-gold-ink);
}

/* 2 行分の高さを先に確保しておく（title が入っても高さが動かない） */
.video-title {
  margin-top: 0.85rem;
  min-height: 2.72rem;
  font-family: var(--font-mincho);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-sub);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  padding: 1rem 0;
}

.footer p {
  font-family: var(--font-mincho);
  font-size: 0.85rem;
  color: var(--color-gold-ink);
  letter-spacing: 0.15em;
}

/* ==========================================================================
   Responsive Mobile Adjustments
   ========================================================================== */
@media (max-width: 767px) {
  body {
    /* 上は固定配置のテーマトグル（16px + 44px）と重ならない値 */
    padding: 4.5rem 1rem 2rem;
  }

  .tarot-front {
    padding: 1.75rem 1.25rem;
  }

  .name {
    font-size: 1.8rem;
  }

  .avatar,
  .avatar-fallback {
    width: 86px;
    height: 86px;
    line-height: 82px;
  }
}

/* ==========================================================================
   Reduced Motion

   .tarot-inner は opacity: 0 から animation の forwards で現れる設計のため、
   アニメーションを止めるだけだとカードが永久に見えなくなる。
   opacity: 1 の明示が必須。
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tarot-inner {
    animation: none;
    opacity: 1;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
