* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
  background: #f5f0e8;
  min-height: 100vh;
  color: #333;
}

/* ===== ヘッダー ===== */
.header {
  background: #2c1810;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f5e6c8;
  font-weight: bold;
  font-size: 16px;
}

.logo-bubble-wrap {
  position: relative;
}

.hato-btn {
  width: 32px;
  height: 32px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.2s;
}

.hato-btn:hover { transform: scale(1.15); }

/* ===== 吹き出し ===== */
.hato-balloon {
  display: none;
  position: absolute;
  top: 44px;
  left: -8px;
  width: 280px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 200;
  animation: balloon-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hato-balloon.open { display: block; }

@keyframes balloon-pop {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.balloon-arrow {
  position: absolute;
  top: -8px;
  left: 16px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

.balloon-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balloon-content p {
  font-size: 12px;
  color: #444;
  line-height: 1.6;
}

.balloon-content a {
  color: #d4436a;
  text-decoration: none;
}

.balloon-content a:hover { text-decoration: underline; }

.header-nav {
  display: flex;
  gap: 16px;
}

.header-nav a {
  color: #f5e6c8;
  text-decoration: none;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.05));
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.2s;
}

.header-nav a:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
  border-color: rgba(255,255,255,0.45);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
}

.header-nav a.active {
  background: #f5e6c8;
  border-color: #f5e6c8;
  color: #2c1810;
  box-shadow: 0 3px 10px rgba(0,0,0,0.35);
}

/* ===== メイン ===== */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

/* ===== タイトル ===== */
.library-title {
  text-align: center;
  margin-bottom: 28px;
}

.library-title h1 {
  font-size: 28px;
  color: #2c1810;
  margin-bottom: 4px;
}

.library-title p {
  font-size: 13px;
  color: #888;
}

/* ===== 検索 ===== */
.search-area {
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #d4b896;
  border-radius: 16px;
  padding: 10px 16px;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: border-color 0.2s;
}

.search-box:focus-within {
  border-color: #2c1810;
}

.search-icon { font-size: 18px; }

#search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  color: #333;
}

.search-clear {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  display: none;
}

/* ===== フィルター ===== */
.filter-area {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border: 2px solid #d4b896;
  border-radius: 20px;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.filter-btn:hover { border-color: #2c1810; color: #2c1810; }

.filter-btn.active {
  background: #2c1810;
  border-color: #2c1810;
  color: white;
}

/* ===== あいうえお ===== */
.aiueo-area {
  background: white;
  border: 1px solid #e0d0b8;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 28px;
}

.aiueo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.aiueo-label {
  font-size: 11px;
  color: #aaa;
  margin-right: 4px;
}

.aiueo-btn {
  width: 36px;
  height: 36px;
  border: 1px solid #e0d0b8;
  border-radius: 8px;
  background: #faf7f2;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  color: #555;
}

.aiueo-btn:hover { background: #f0e8d8; border-color: #c0a880; }

.aiueo-btn.active {
  background: #2c1810;
  border-color: #2c1810;
  color: white;
}

.aiueo-clear {
  background: #f0e8d8;
  border-color: #c0a880;
  color: #2c1810;
  font-size: 11px;
  width: auto;
  padding: 0 10px;
}

/* ===== セクションタイトル ===== */
.section-title {
  font-size: 18px;
  color: #2c1810;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e0d0b8;
}

/* ===== グリッド ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: block;
  border: 1px solid #e8dcc8;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.card-img-wrap {
  aspect-ratio: 1;
  background: #faf7f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-info {
  padding: 8px 10px;
}

.card-name {
  font-size: 11px;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-type {
  font-size: 10px;
  color: #aaa;
  margin-top: 3px;
}

/* ===== もっと見る ===== */
.btn-more {
  display: block;
  width: 100%;
  padding: 14px;
  background: white;
  border: 2px solid #d4b896;
  border-radius: 12px;
  font-size: 14px;
  color: #2c1810;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 40px;
}

.btn-more:hover { background: #f0e8d8; }

/* ===== かな段落ヘッダー ===== */
.kana-heading {
  grid-column: 1 / -1;
  font-size: 20px;
  font-weight: bold;
  color: #2c1810;
  padding: 16px 0 8px;
  border-bottom: 2px solid #e0d0b8;
  margin-bottom: 4px;
}


/* ===== PickUp ===== */
.pickup-area { margin-bottom: 40px; }
.results-area { margin-bottom: 40px; }

/* ===== スマホ ===== */
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .header-nav { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding-bottom: 6px; }
  .header-nav a { font-size: 11px; padding: 5px 10px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .library-title h1 { font-size: 22px; }
  .aiueo-btn { width: 30px; height: 30px; font-size: 12px; }
}
