* {
  box-sizing: border-box;
}

#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #07ae6e;
  display: flex;
  align-items: center;
  justify-content: space-between; /* 左・中央・右に分散 */
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ロゴの左余白 */
#logo {
  height: 40px;
  width: auto;
  margin-left: 15px;  /* 左端からの距離 */
  margin-right: 10px;
  justify-content: center;
  align-items: center;
}

/* 右側ボタングループ */
#header-right {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;   /* 固定幅で縮まらない */
  margin-left: auto; 
  margin-right: 20px; 
}


/* ログインボタン */
#back-to-home-btn,
#loginBtn {
  background: white;
  color: #07ae6e;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  white-space: nowrap; 
}

#back-to-home-btn:hover,
#loginBtn:hover {
  transform: scale(1.01);
}

/* 言語選択, 使い方, メニューボタン */
#language-wrapper {
  position: relative;
  display: inline-block;
}

#menu-container {
  position: relative;
  display: inline-block;
}

#language-btn,
#help-btn,
#menu-btn {
  background: none;        /* 背景削除 */
  border: none;            /* 枠線削除 */
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

#language-btn img,
#help-btn img,
#menu-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none; /* クリック判定をボタンに通す */
}

#language-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2; 
}

/* メニューリスト */
#menu-list {
  position: absolute;
  right: 0; /* ボタン右端に表示 */
  top: 40px; /* ボタン下に表示 */
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  list-style: none;
  padding: 0;
  margin: 0;
  min-width: 140px;
  z-index: 1000;
  transition: opacity 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none; /* 非表示時にクリック不可 */
}

/* メニュー表示 */
#menu-list.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* メニュー項目 */
#menu-list li {
  border-bottom: 1px solid #eee;
}

#menu-list li:last-child {
  border-bottom: none;
}

#menu-list li a {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#menu-list li a:hover {
  background-color: #007bff;
  color: #fff;
  border-radius: 6px;
}


/* ===============================
   モバイル対応
   =============================== */
@media (max-width: 820px) {

  /* ヘッダー（縦に2段構成） */
  #header {
    height: 45px;
    flex-wrap: wrap;
    justify-content: space-between;
    flex-shrink: 0; 
    flex-grow: 0;
  }

  #logo {
    height: 33px;
    justify-content: flex-start;
    margin-left: 3px;
    margin-right: 3px;
    padding: 2px;
    flex-shrink: 0; 
    flex-grow: 0; 
  }

  /* ボタン群を1行で表示（折り返さない） */
  #header-right {
    display: flex;
    flex-wrap: nowrap;         /* 折り返し禁止 */
    justify-content: flex-end;   
    gap: 6px;                  /* ボタン間の隙間 */
    margin-left: auto; 
    margin-right: 8px; 
  }

  #back-to-home-btn,
  #loginBtn {
    font-size: 11px;
    padding: 4px 4px 8px;
  }
}