
.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #ccc;
  padding: 2px 8px;
  color: #333;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  user-select: none;
  touch-action: manipulation;
  position: relative;
  box-sizing: border-box;
}


.favorite-button .fav-star {
    color: #555;
    transition: color 0.2s;
    font-size: 16px;
    vertical-align: middle;             /* ← 星自体も中央揃え補正 */
}

.favorite-button.favorited .fav-star {
color: gold;
}

.favorite-button:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.favorite-button.mini-star.favorited .fav-star {
    color: gold; /* または #ffd700 */
}

.favorite-button.favorited {
    background-color: #fff;
}

.favorite-button .fav-text {
  display: inline; /* ← display: none をやめて inline に */
  position: static;
  margin-left: 4px;
  background: none;
  color: #555;
  font-size: 14px;
  opacity: 1;
  pointer-events: auto;
}

/* hover用の制御を無効化（モバイルではhoverがそもそも効かない） */
.favorite-button:hover .fav-text {
  display: inline;
  opacity: 1;
}

#fav-feedback {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    display: none;
    max-width: 80%;              /* 横幅の制限 */
    text-align: center;
    display: none; 
}

#fav-logintooltip {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  display: none;
  max-width: 80%;              /* 横幅の制限 */
  text-align: center;
  display: none; 
}
  
/* 詳細ページ用の星 */
/* デスクトップのみ、シングルページのテキストは常時表示 */
@media screen and (min-width: 768px) {
    .favorite-button.fav-single {
      display: inline-flex !important;  /* ← inline ではなく inline-flex */
      background: #fff !important;      /* 透け防止 */
    }
    
    .favorite-button.fav-single .fav-text {
      display: inline !important;  /* ← ここは inline に戻すのが吉 */
      position: static;
      margin-left: 4px;
      background: none;
      color: #555;
      font-size: 14px;
      opacity: 1;
      pointer-events: auto;
    }
  
    .favorite-button.fav-single:hover .fav-text {
      /* hoverしても変化しないように */
      display: inline !important;  /* ← ここは inline に戻すのが吉 */
      opacity: 1;
    }
}

  /* ログインしていないユーザーにだけ hover で表示する */
.favorite-button.not-logged-in:hover .fav-text {
    display: block;
    opacity: 1;
}


.favorite-button .fav-tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
  }
  
  /* 未ログインユーザーがホバーしたときだけ表示 */
  .favorite-button.not-logged-in:hover .fav-tooltip {
    display: block;
    opacity: 1;
  }
  
  .team-page-header-wrapper {
    display: flex;
    align-items: center;             /* 縦中央揃え */
    justify-content: flex-end;   /* 右寄せ */
    gap: 12px;                       /* チーム名とボタンの間隔 */
    margin-bottom: 10px;
  }
  
  @media screen and (max-width: 767px) {
    .favorite-button .fav-text {
      display: none !important;
    }
  }