:root {
  --border-color: #752e3c;
}

.type-chara {
  position: relative;
  /* max-width: 1920px;
  max-height: 1080px; */
}

@media screen and (max-width: 1150px) {
  .type-chara {
    padding: 0;
  }
}

/* 背景圖 */
.role {
  width: 100%;
  aspect-ratio: 16/9; /* 1920:1080 = 16:9 */
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  gap: 20px;
  opacity: 1;
  background-color: var(--border-color);
  /* Default background image, will be overridden by JS */
  background-image: url('./img/role/bg/Group1.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* max-width: 1920px;
  max-height: 1080px; */
}

/* 767px及以下時背景不鎖定比例，確保背景填滿無留白 */
@media screen and (max-width: 768px) {
  .role {
    aspect-ratio: auto;
    height: 100vh; /* Keep existing height */
    min-height: 500px; /* 設置一個最小高度以確保內容可見 */
    padding: 20px 0; /* Keep existing padding */
    /* Default background position for small screens */
    background-position: right bottom;
    background-size: cover; /* 確保背景覆蓋整個區域，可能會被裁切但不會有留白 */
    flex-direction: column; /* Keep existing flex-direction */
  }

  /* --- START: Specific background position adjustments for <= 767px --- */
  
  .role.bg-residential{
    background-position: 95% bottom;

  }
  .role.bg-shopping{
    background-position: 95% bottom;
  }
  .role.bg-department { /* 百貨商場 */
    background-position: 77% bottom;
  }

  .role.bg-office { /* 商辦大樓 */
    background-position: 66% bottom;
  }

  .role.bg-forest { /* 樹林小徑 - 往下移 (使用 calc) */
    /* 将图像的水平79%位置，定位在容器底部下方 20px 处 */
    background-position: 90% bottom;
  }

  .role.bg-convenience { /* 超商 - 左右不變(right), 往下移 (使用 calc) */
     /* 将图像的右边缘，定位在容器底部下方 30px 处 */
    background-position: 97% bottom;
  }
}
@media screen and (max-width: 600px) {
  .role.bg-residential{
    background-position: 88% bottom;
    /* height: 50vh; */

  }
  .role.bg-shopping{
    background-position: 91% bottom;
    /* height: 50vh; */
  }
}
@media screen and (max-width: 500px) {
  .role.bg-residential{
    background-position: 88% bottom;

  }
}
@media screen and (max-width: 400px) {
  .role.bg-residential{
    background-position: 90% bottom;
     /* height: 40vh; */
  }
}
/* ====================================================== */
/* ALL STYLES BELOW THIS LINE ARE UNCHANGED AS REQUESTED */
/* ====================================================== */

.role-content {
  width: 50%;
    display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px;
  }

@media screen and (max-width: 768px) {
  .role-content {
    width: 100%;
     padding: 0px;
  }
}

/* 按鈕 */
.role-content-button {
  display: flex;
  gap: 10px;
  z-index: 3;
}

@media screen and (max-width: 768px) {
  .role-content-button {
    justify-content: center;
    margin:0 20px
  }
}

@media screen and (max-width: 440px) {
  .role-content-button {
    gap: 0;
  }
}

.role-content-button button {
  width: 100px;
  background-color: transparent;
  border: none;
  cursor: pointer;
}

@media screen and (max-width: 440px) {
  .role-content-button button {
    width: 100%;
  }
}

/* 介紹 */
.role-content-introduce {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media screen and (max-width: 768px) {
  .role-content-introduce {
    align-items: center;
    margin: 0 30px;
  }
}
@media screen and (max-width: 550px) {
  .role-content-introduce {
    gap: 20px;
    
  }
}

/* 名字 */
.role-content-introduce-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background-image: url(../img/role/tap.webp);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  max-width: 330px;
  max-height: 110px;
}

@media screen and (max-width: 768px) {
  .role-content-introduce-name {
    justify-content: center;
    align-self: flex-start;
    padding:15px 50px;
    margin: 0 20px;
  }
}

.role-content-introduce-name img {
  width: 100px;
  z-index: 3;
}

@media screen and (max-width: 550px) {
  .role-content-introduce-name {
    margin: 0 0px;
  }
  .role-content-introduce-name img {
    width: 50px;
  }
}

.role-content-introduce-name p {
  font-size: 50px;
  font-weight: 900;
  z-index: 3;
  color: #000;
}

@media screen and (max-width: 550px) {
  .role-content-introduce-name p {
    font-size: 32px;
  }
}

/* 文字內容 */
.role-content-introduce-text {
  width: 550px;
  height: auto;
  padding: 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 3;
  background-color: rgba(0, 0, 0, 0.5);
}

@media screen and (max-width: 1300px) {
  .role-content-introduce-text {
    width: 100%;
    height: auto;
    padding: 25px;
  }
}

@media screen and (max-width: 1000px) {
  .role-content-introduce-text {
    height: auto;
    padding: 20px;
  }
}
@media screen and (max-width: 850px) {
  .role-content-introduce-text {
    height: auto;
    padding: 10px;
  }
}
@media screen and (max-width: 768px) {
  .role-content-introduce-text {
    height: auto;
    padding: 0px;
  }
}

.role-content-introduce-text p {
  font-size: 32px;
  font-weight: 900;
  margin: 0 20px;
  text-shadow:
    3px 3px 0 black,
    6px 6px 0 rgba(0, 0, 0, 0.8),
    9px 9px 5px rgba(0, 0, 0, 0.5);
}
@media screen and (max-width: 850px) {
  .role-content-introduce-text p {
    font-size: 28px;
    margin: 0 0px;
  }
}
@media screen and (max-width: 768px) {
  .role-content-introduce-text {
    height: auto;
    padding: 10px;
    
  }
  .role-content-introduce-text p {
    
    padding: 0 20px;
    margin: 0 20px;
  }
}

@media screen and (max-width: 550px) {
  .role-content-introduce-text p {
    font-size: 20px;
  }
}

.role-content-introduce-text-arrow {
  position: absolute;
  bottom: 10%;
  right: 10%;
}

/* 角色圖片容器 */
.role-img {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 角色圖片 - 所有尺寸下都隱藏 */
.role-img img {
  display: none; /* 默認隱藏所有人物圖片 */
  position: absolute;
  height: auto;
  z-index: 2;
  transform-origin: 0% 100%;
  transition: opacity 0.5s ease, width 0.3s ease, top 0.3s ease, right 0.3s ease;
}

