/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
  }
  .logo i {
    color: var(--accent);
    font-size: 2rem;
  }
  .logo-text {
    font-weight: 600;
  }
  
  /* Navigation tabs */
  .site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
  }
  .tabs {
    display: flex;
    list-style: none;
    gap: 2rem;
  }
  .tabs a {
    color: var(--text);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    position: relative;
    padding-bottom: 4px;
  }
  .tabs a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent2);
    transition: width var(--transition);
  }
  .tabs a:hover::after {
    width: 100%;
  }

  .primary-tabs { display: flex; gap:2rem; }
  
/* ── ハブメニュー本体 ── */
#hub-menu {
    position: absolute;
    top: 100%;            /* ボタンの真下 */
    /* hub-btn の right と揃える */
    right: 2rem;          /* header の padding-right が 2rem の場合 */
    pointer-events: none; /* closed 時はクリック無効 */
    z-index: 1000;
  }
  
  /* ── メニューカード群ラッパー ── */
  .menu-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end; /* カードの右端をそろえる */
  }
  
  /* ── 各カード ── */
  .menu-card {
    background: rgba(0,0,0,0.8);
    border: 1px solid var(--accent2);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    width: 200px;               /* お好みで */
    opacity: 0;
    transform-origin: top right;
    /* 互い違いスタート */
    transform: translateY(20px) rotate(var(--start-rot));
    transition:
      transform 0.5s cubic-bezier(0.2,1,0.3,1),
      opacity   0.5s ease-out;
    pointer-events: auto; /* open 時だけ有効に later via JS */
  }
  
  /* カード内リストは縦並び */
  .menu-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  /* カード内見出し */
  .menu-card h4 {
    margin: 0 0 0.5rem;
    color: var(--accent);
    font-size: 1.1rem;
  }

  .menu-card ul li {
    margin: 0.5rem 0;
  }

.menu-card ul li a:hover {
  background: var(--accent2);
}

  .menu-card ul li a {
    color: var(--text);
    text-decoration: none;
    display: block;
    padding: 0.25rem 0;
    display: block;  
    border-radius: 4px;
    transition: background 0.3s;
  }
  
  /* 互い違いの初期角度を custom property で指定 */
  .menu-card:nth-child(odd)  { --start-rot: -15deg; }
  .menu-card:nth-child(even) { --start-rot:  15deg; }
  
  /* open 状態で順番に浮上しつつ水平に戻る */
  #hub-menu.open .menu-card {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
  #hub-menu.open .menu-card:nth-child(1) { transition-delay: 0.05s; }
  #hub-menu.open .menu-card:nth-child(2) { transition-delay: 0.10s; }
  #hub-menu.open .menu-card:nth-child(3) { transition-delay: 0.15s; }
  /* ...必要なだけ nth-child(N) を追加してください */
  
/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}
#notification {
  position: relative;
  cursor: pointer;
}
#notification[data-count="0"]::after {
  display: none;
}
#notification::after {
  content: attr(data-count);
  position: absolute;
  top: -4px;
  right: -8px;
  width: 18px;
  height: 18px;
  background: var(--accent2);
  color: var(--bg);
  font-size: 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lang-select {
  padding: 0.25rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  color: var(--text);
}
.badge {
  position: relative;
  width: 28px;
  height: 28px;
  background: var(--accent2);
  border-radius: 50%;
  animation: wave 2s infinite;
}
.badge::after {
  content: attr(data-count);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg);
  font-size: 0.75rem;
}

.hub-btn {
    background: none;
    border: none;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    cursor: pointer;
  }

/* overlay for hub / nav menu */
#hub-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 999;
}
#hub-overlay.open { display: block; }
  
@keyframes wave {
  0% { box-shadow: 0 0 0 0 rgba(0,255,215,0.7); }
  100% { box-shadow: 0 0 0 20px transparent; }
}
.theme-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.25rem;
  cursor: pointer;
}
.btn-signin {
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  transition: background var(--transition), color var(--transition);
}
.btn-signin:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ── Profile Menu ── */
.profile-wrapper {
  position: relative;
  cursor: pointer;
}
.profile-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.profile-menu {
  position: absolute;
  top: 40px;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  display: none;
  min-width: 160px;
  z-index: 1001;
}
.profile-menu.open { display: block; }
.profile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.profile-menu li {
  margin: 0.25rem 0;
}
.profile-menu a,
.profile-menu button {
  color: var(--text);
  background: none;
  border: none;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

/* ── Notice Dropdown ── */
.notice-wrapper {
  position: relative;
}
.notice-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  display: none;
  min-width: 200px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
}
.notice-dropdown.open { display: block; }
.notice-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notice-dropdown li {
  margin: 0.25rem 0;
}
.notice-dropdown li.read {
  opacity: 0.6;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .primary-tabs { display: none; }
  #hub-toggle   { display: block; }
  .logo-text    { display: none; }
}

@media (min-width: 769px) {
  #hub-toggle { display: none; }
}