/* ===== カード配布セクション ===== */
.card-distribution-section {
  height: 300vh;
  position: relative;
  background: var(--bg);
  --section-title-top: clamp(6%, 9vh, 11%);
  --section-title-left: clamp(8%, 12vw, 16%);
  --section-title-max-width: clamp(18rem, 30vw, 26rem);
}

.card-distribution-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  gap: 3rem;
  padding-top: 5rem; /* 上部に余白 */
}

/* === 手札表示エリア === */
.hand-cards {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 3;
}

/* 手札カードスロット */
.card-slot {
  width: 120px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-slot img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  display: block;
  transform-origin: center;
  backface-visibility: hidden;
  /* 初期状態：非表示 + 縮小 + 回転 */
  opacity: 0;
  transform: scale(0) rotate(180deg);
  transform-origin: center;
}

/* === 裏面説明エリア === */
.card-backs-explanation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 2;
  margin-top: 0.1rem; /* 手札との距離 */
}

/* 裏面カードスロット */
.back-card-slot {
  width: 120px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: none;
  transform-origin: center;
}

.back-card-slot img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  display: block;
  transform-origin: center;
  backface-visibility: hidden;
  /* 初期状態：手札と同じ */
  opacity: 0;
  transform: scale(0) rotate(180deg);
  transform-origin: center;
}

/* === 説明ラベル === */
/* 表面説明テキスト */
.front-label {
  position: absolute;
  z-index: 4;
  opacity: 0;
  transform: translateY(-10px);
}

.front-label-span {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px; /* 丸みのある背景 */
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
  display: inline-block;
}

/* 裏面説明テキスト */
.back-label {
  position: relative;
  z-index: 4;
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(10px);
  display: flex;
  justify-content: center;
}

.back-label-span {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  line-height: 1.2;
  display: inline-block;
}

.parenthesis-start {
  margin-left: 6px;
  margin-right: 4px;
}

.parenthesis-end {
  margin-left: -4px;
  margin-right: -0px;
}


/* ===== レスポンシブ対応 ===== */

/* === 大型デスクトップ（1200px以上） === */
@media (min-width: 1200px) {
  .card-distribution-container {
    gap: 4rem;
  }

  .hand-cards {
    gap: 1.5rem;
  }

  .card-slot {
    width: 140px;
    height: 210px;
  }

  .card-backs-explanation {
    gap: 1.5rem;
  }

  .back-card-slot {
    width: 140px;
    height: 210px;
  }

  .front-label span,
  .back-label span {
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
  }
}

/* === タブレット（768px以下） === */
@media (max-width: 768px) {
  .card-distribution-container {
    gap: 2rem;
  }

  .hand-cards {
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 90%;
  }
  
  .card-slot {
    width: 80px;
    height: 120px;
  }
  
  .card-slot img {
    border-radius: 8px;
  }

  .card-backs-explanation {
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 90%;
  }
  
  .back-card-slot {
    width: 80px;
    height: 120px;
  }
  
  .back-card-slot img {
    border-radius: 8px;
  }

  .front-label span,
  .back-label span {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* === スマートフォン（480px以下） === */
@media (max-width: 480px) {
  .card-distribution-section .section-title p {
    font-size: clamp(0.8rem, 4.2vw, 0.95rem);
    line-height: 1.5;
  }

  .card-distribution-container {
    gap: 1.5rem;
    padding: 0 0.5rem;
  }

  .hand-cards {
    gap: 0.3rem;
  }
  
  .card-slot {
    width: 60px;
    height: 90px;
  }
  
  .card-slot img {
    border-radius: 6px;
  }

  .card-backs-explanation {
    gap: 0.3rem;
  }
  
  .back-card-slot {
    width: 60px;
    height: 90px;
  }
  
  .back-card-slot img {
    border-radius: 6px;
  }

  .front-label span,
  .back-label span {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .parenthesis-start {
  margin-left: -4px;
  margin-right: -6px;
}

.parenthesis-end {
  margin-left: -12px;
  margin-right: -8px;
}

}

/* === 極小スマートフォン（360px以下） === */
@media (max-width: 360px) {
  .card-distribution-section .section-title p {
    font-size: clamp(0.75rem, 4.6vw, 0.9rem);
  }

  .hand-cards {
    gap: 0.2rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .card-slot {
    width: 50px;
    height: 75px;
  }
  
  .card-slot img {
    border-radius: 4px;
  }

  .card-backs-explanation {
    gap: 0.2rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .back-card-slot {
    width: 50px;
    height: 75px;
  }
  
  .back-card-slot img {
    border-radius: 4px;
  }

  .front-label span,
  .back-label span {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
}
