/* === HydeyTools Common Header ===
   hydey-gacha / panel-opener と揃えた共通ヘッダ。
   ロゴクリックで HydeyTools ツール一覧へ。
   中央にツール名（pref47）。右側に各画面固有のナビ要素を slot 配置。 */

.ht-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(
    180deg,
    rgba(15, 25, 45, 0.95),
    rgba(15, 25, 45, 0.85)
  );
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.ht-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 12px;
  min-height: 52px;
  gap: 8px;
}

.ht-logo-wrap {
  position: relative;
  flex-shrink: 0;
}
.ht-logo {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 5px 8px 11px 12px;
  margin: -5px -8px -11px -12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.ht-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid rgba(106, 183, 255, 0.22);
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(106, 183, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}
.ht-logo::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 3px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6ab7ff, #7ee7c6, #c6e6ff);
  box-shadow: 0 0 10px rgba(106, 183, 255, 0.42);
  opacity: 0;
  transform: scaleX(0.34);
  transform-origin: center;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ht-logo img {
  position: relative;
  z-index: 1;
  top: 2px;
  height: 36px;
  display: block;
  transition: filter 180ms ease, transform 180ms ease;
}
.ht-logo:hover::before,
.ht-logo:focus-visible::before,
.ht-logo[aria-expanded="true"]::before {
  opacity: 1;
  transform: scale(1);
}
.ht-logo:hover::after,
.ht-logo:focus-visible::after,
.ht-logo[aria-expanded="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}
.ht-logo:hover img,
.ht-logo:focus-visible img {
  filter: brightness(1.08) saturate(1.06) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.28));
  transform: translateY(-1px);
}
.ht-logo:active img,
.ht-logo[aria-expanded="true"] img {
  filter: brightness(1.14) saturate(1.12) drop-shadow(0 0 12px rgba(126, 231, 198, 0.42));
  transform: translateY(1px);
}
.ht-logo[aria-expanded="true"]::before {
  border-color: rgba(126, 231, 198, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(106, 183, 255, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.26);
}

/* ドロップダウンメニュー */
.ht-logo-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: rgba(15, 25, 45, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  z-index: 1200;
  backdrop-filter: blur(8px);
}
.ht-logo-menu[hidden] { display: none; }
.ht-logo-menu a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  padding: 8px 12px;
  color: #e6f0ff;
  text-decoration: none;
  border-radius: 8px;
  transition: background 120ms;
}
.ht-logo-menu a:hover { background: rgba(255, 255, 255, 0.08); }
.ht-logo-menu a:focus-visible { outline: 2px solid #6ab7ff; outline-offset: -2px; }
.ht-logo-menu .ht-menu-icon {
  grid-row: 1 / 3;
  font-size: 22px;
  line-height: 1;
}
.ht-logo-menu .ht-menu-name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.ht-logo-menu .ht-menu-desc {
  font-size: 11px;
  opacity: 0.65;
  line-height: 1.3;
}
.ht-menu-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 6px;
}

.ht-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}
.ht-tool {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: #e6f0ff;
  font-family: "Kosugi Maru", system-ui, sans-serif;
  text-shadow:
    0 0 6px rgba(0, 166, 255, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.4);
}

.ht-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.ht-nav .btn,
.ht-nav .ht-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.ht-nav .ht-status {
  color: #b8c5dc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

/* モバイル: ロゴ縮小、タイトル非表示 (nav が幅を取るため) */
@media (max-width: 640px) {
  .ht-logo img { height: 28px; }
  .ht-title { display: none; }
  .ht-header-inner { padding: 8px 10px; }
  .ht-nav .btn { padding: 4px 8px; font-size: 11px; }
}
