/* =========================
   リセット & 基本設定
   ========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1b0936, #2e1e6a);
  color: #ddd;
  padding-top: 70px; /* ヘッダー分 */
  overflow-x: hidden;
}

/* =========================
   ヘッダー
   ========================= */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: auto;
  background: rgba(20, 12, 40, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  flex-wrap: wrap; /* 狭くなったら折り返す */
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  box-shadow: 0 0 15px #6747d9aa;
  z-index: 4000;
  border-bottom: 1px solid #4b399e;
  gap: 8px;
}
.logo {
  font-weight: 900;
  font-size: 1.8rem;
  color: #a69fff;
  letter-spacing: 0.1em;
  text-shadow: 0 0 6px #7a6fdf, 0 0 12px #7a6fdf;
  user-select: none;
  flex-shrink: 0;
}

/* =========================
   検索ボックス
   ========================= */
.search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  min-width: 140px;
}
.search-container input {
  flex-grow: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #2b2360, #1f1850);
  color: #ccc;
  box-shadow: inset 0 0 10px #4b399e;
  transition: 0.3s ease;
  outline: none;
  text-shadow: 0 0 4px #7a6fdf;
}
.search-container input::placeholder {
  color: #6d62a6;
  font-style: italic;
}
.search-container input:focus {
  background: linear-gradient(135deg, #453e9d, #372e85);
  box-shadow: 0 0 12px 2px #7a6fdf, inset 0 0 14px #6f62e5;
  color: white;
}
.search-container button {
  padding: 10px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7a6fdf, #5a4fbf);
  border: none;
  color: white;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px #5a4fbfaa;
  transition: background 0.3s ease, transform 0.2s ease;
  user-select: none;
}
.search-container button:hover {
  background: linear-gradient(135deg, #5a4fbf, #7a6fdf);
  transform: scale(1.05);
  box-shadow: 0 6px 20px #7a6fdfa0;
}

/* =========================
   ハンバーガーボタン
   ========================= */
.menu-btn {
  font-size: 2.2rem;
  color: #a69fff;
  cursor: pointer;
  user-select: none;
  background: rgba(50, 40, 80, 0.6);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 0 10px #7a6fdf99, inset 0 0 6px #5a4fbfaa;
  transition: background 0.3s ease;
  flex-shrink: 0;
}
.menu-btn:hover {
  background: rgba(70, 60, 120, 0.9);
  box-shadow: 0 0 15px #7a6fdfcc, inset 0 0 8px #5a4fbfcc;
}

/* =========================
   ナビメニュー
   ========================= */
nav {
  position: fixed;
  top: 70px;
  right: -280px;
  width: 280px;
  height: calc(100% - 70px);
  background: linear-gradient(180deg, #1a1640, #3a2e6e);
  box-shadow: inset 3px 0 15px #4b399e;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 1px solid #594db2;
  z-index: 4500;
  overflow-y: auto;
  user-select: none;
}
nav.open { right: 0; }
nav a {
  color: #bebefb;
  padding: 14px 0;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #594db2;
  transition: color 0.25s ease, padding-left 0.25s ease;
}
nav a:hover {
  color: #fff;
  padding-left: 14px;
  text-shadow: 0 0 8px #7a6fdf;
}

/* =========================
   トップ画像
   ========================= */
#topImageContainer {
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 18px #7a6fdfaa);
}
#topImageContainer img {
  max-width: 85%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 0 25px 8px #7a6fdfbb, 0 0 40px 15px #5a4fbf88;
  animation: floatGlow 6s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}
#topImageContainer img:hover {
  box-shadow: 0 0 35px 14px #7a6fdfdd, 0 0 60px 25px #5a4fbfff;
  cursor: pointer;
}
@keyframes floatGlow {
  0%,100 { box-shadow: 0 0 25px 8px #7a6fdfbb, 0 0 40px 15px #5a4fbf88; transform: translateY(0); }
  50% { box-shadow: 0 0 40px 14px #7a6fdfdd, 0 0 55px 20px #5a4fbfff; transform: translateY(-10px); }
}

/* =========================
   hero & block
   ========================= */
.hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px 4rem;
}
.hero h1 {
  font-size: 3rem;
  text-shadow: 0 0 6px #7a6fdf, 0 0 15px #5a4fbf;
  margin-bottom: 0.3em;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #dcdcff;
}
.hero p {
  font-size: 1.3rem;
  color: #bebefb;
  max-width: 400px;
  line-height: 1.5;
  text-shadow: 0 0 8px #7a6fdf77;
}
.block {
  min-height: 50vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 1.3em;
  padding: 2rem 20px;
  text-align: center;
  color: #ccc;
  user-select: none;
  transition: color 0.3s ease;
}
.block:hover { color: #fff; }
.icon {
  font-size: 5em;
  margin-bottom: 0.5em;
  color: #7a6fdf;
  text-shadow: 0 0 12px #7a6fdfaa, 0 0 25px #5a4fbf88;
  user-select: none;
}

/* =========================
   光るページヘッダー（共通）
   ========================= */
.glow-header {
  background: linear-gradient(90deg, #7a6fdf, #5a4fbf);
  color: white;
  padding: 40px 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 15px rgba(90,79,191,0.6);
  margin-bottom: 40px;
}
.glow-header h1 {
  margin: 0 0 10px;
  font-size: 2.8em;
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px #7a6fdf;
}
.glow-header p {
  font-size: 1.2em;
  opacity: 0.85;
}

/* =========================
   光るセクション見出し（共通）
   ========================= */
.glow-title {
  font-size: 1.8em;
  color: #7a6fdf;
  border-bottom: 3px solid #5a4fbf;
  padding-bottom: 8px;
  margin-bottom: 20px;
  text-shadow: 0 0 6px #5a4fbf;
}

/* =========================
   光るコンテンツボックス（共通）
   ========================= */
.glow-box {
  background: rgba(90,79,191,0.05);
  padding: 20px;
  border-radius: 12px;
  box-shadow: inset 0 0 10px rgba(90,79,191,0.2);
  font-size: 1.1em;
  line-height: 1.6;
  color: #ddd;
  margin-bottom: 40px;
}

/* =========================
   アイコンボタン（共通）
   ========================= */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 20px;
  color: #ccc;
  opacity: 0.85;
  transition: 0.2s ease;
}
.icon-btn:hover { opacity: 1; transform: scale(1.1); }
.icon-btn:active { transform: scale(0.95); }

/* =========================
   フッター
   ========================= */
footer {
  text-align: center;
  padding: 2rem 20px;
  color: #7a6fdfaa;
  font-size: 0.9rem;
  user-select: none;
}

/* =========================
   検索 & 履歴オーバーレイ
   ========================= */
#searchOverlay, #historyOverlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
#searchResults, #historyBox {
  background: #1e1e35;
  padding: 24px;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  color: #eee;
  box-shadow: 0 0 25px #000;
  position: relative;
  font-size: 1.1rem;
}
#closeBtn, #historyClose, #historyClear {
  background: #4444cc;
  border: none;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
  font-weight: 700;
  margin-top: 14px;
  transition: background-color 0.3s ease;
}
#historyClear { background: #cc4444; }
#closeBtn:hover { background-color: #ee5555; }
#historyClose:hover { background-color: #5555dd; }
#historyClear:hover { background-color: #ee5555; }
#historyList {
  list-style: none;
  margin: 15px 0;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 10px;
}
#historyList li {
  padding: 8px 10px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
#historyList li:hover {
  background: rgba(255,255,255,0.18);
}

/* =========================
   レスポンシブ
   ========================= */
@media screen and (max-width: 600px) {
  .search-container { width: 100%; }
  header { flex-direction: column; align-items: flex-start; }
  nav { width: 220px; top: 70px; height: calc(100% - 70px); }
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1rem; max-width: 280px; }
  .block { font-size: 1.1em; padding: 1.5rem 12px; }
}
