/* みんなの図鑑ページ（ゲーム本体の見た目に合わせた専用スタイル） */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; padding: 18px 12px 44px;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Kaku Gothic ProN", sans-serif;
  color: #33302a; line-height: 1.7;
  background-color: #fdf3d8;
  background-image:
    radial-gradient(circle, rgba(242,166,90,.28) 3px, transparent 3.8px),
    radial-gradient(circle, rgba(93,162,74,.20) 3px, transparent 3.8px),
    linear-gradient(180deg, #fff6da 0%, #ffeeda 48%, #e8f9ec 100%);
  background-size: 46px 46px, 46px 46px, 100% 100%;
  background-position: 0 0, 23px 23px, 0 0;
  overflow-x: clip;
}
.wrap { max-width: 960px; margin: 0 auto; width: 100%; }

/* ---- ヒーロー ---- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  border: 3px solid #ffffff; border-radius: 24px;
  padding: 26px 14px 22px; margin-bottom: 16px;
  background: linear-gradient(125deg, #ffec99 0%, #ffd6a5 26%, #ffc7dd 55%, #bde0fe 82%, #c8f7dc 100%);
  box-shadow: 0 5px 0 rgba(176,137,104,.4), 0 14px 26px rgba(120,72,20,.16);
}
.hero-in { position: relative; z-index: 1; }
h1 {
  font-size: 26px; font-weight: 900; margin: 2px 0 8px; color: #53351f;
  text-shadow: 2px 2px 0 #ffffff, -1px -1px 0 #ffffff, 1px -1px 0 #ffffff, -1px 1px 0 #ffffff;
}
.hero-tag {
  display: inline-block; background: #ffffff; color: #d6336c; font-weight: bold;
  font-size: 13px; border-radius: 999px; padding: 3px 12px; margin: 0 0 10px;
  box-shadow: 0 3px 0 rgba(214,51,108,.25);
}
.sub {
  font-size: 13px; color: #5a4632; margin: 0 auto; max-width: 640px; text-align: center;
  background: rgba(255,255,255,.6); border-radius: 12px; padding: 8px 10px;
}
.back-links { margin: 12px 0 0; }
.btn-link {
  display: inline-block; background: linear-gradient(180deg, #69b96f, #35854a); color: #fff;
  font-weight: bold; font-size: 14px; text-decoration: none; border-radius: 999px;
  padding: 8px 16px; box-shadow: 0 4px 0 rgba(90,60,20,.25); margin: 2px;
}
.btn-link.sub-link { background: #ffffff; color: #6b4f2a; border: 2px solid #f2c14e; box-shadow: 0 4px 0 rgba(242,193,78,.55); }
.hero-deco span { position: absolute; z-index: 0; font-weight: bold; opacity: .9; animation: floaty 3.8s ease-in-out infinite; }
.hd1 { top: 10px; left: 14px; font-size: 20px; color: #ff5d8f; }
.hd2 { top: 46px; right: 16px; font-size: 18px; color: #1b9aaa; animation-delay: .7s; }
.hd3 { bottom: 14px; left: 66px; font-size: 16px; color: #f2b705; animation-delay: 1.3s; }
.hd4 { bottom: 12px; right: 20px; font-size: 15px; color: #ffffff; animation-delay: 1.9s; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-7px) rotate(8deg); } }

/* ---- セクション ---- */
section {
  background: #ffffff; border: 3px solid #f2a65a; border-radius: 20px;
  padding: 16px; margin-bottom: 16px; box-shadow: 0 5px 0 rgba(242,166,90,.22);
}
.pickup { border-color: #ffb703; border-style: dashed; background: #fffdf4; }
h2 { font-size: 18px; margin: 0 0 10px; color: #53351f; }
h2 small { font-size: 13px; color: #a08b62; font-weight: bold; margin-left: 4px; }
.list-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; justify-content: space-between; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; }
.controls label { font-size: 12px; font-weight: bold; color: #b25f00; display: flex; flex-direction: column; gap: 3px; }
.controls select, .controls input {
  font-size: 14px; font-family: inherit; padding: 8px 10px; min-height: 40px;
  border: 2px solid #ffc94d; border-radius: 10px; background: #fffdf4; color: #33302a;
}
.controls select:focus, .controls input:focus { outline: none; border-color: #ffb703; box-shadow: 0 0 0 4px rgba(255,183,3,.3); }

/* ---- カードグリッド ---- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.zcard {
  border: 2px solid #f0dfba; background: #fffdf4; border-radius: 14px;
  padding: 8px 6px 9px; cursor: pointer; font-family: inherit; color: inherit; text-align: center;
  transition: transform .15s ease, border-color .15s ease;
}
.zcard:hover { border-color: #ffb703; transform: translateY(-2px); }
.zcard:active { transform: scale(.97); }
.z-art { display: block; border-radius: 9px; overflow: hidden; background: #fff; }
.z-art svg { display: block; width: 100%; height: auto; }
.z-no { display: block; font-size: 11px; font-weight: bold; color: #a08b62; margin-top: 6px; }
.z-name { display: block; font-size: 13px; font-weight: bold; line-height: 1.4; overflow-wrap: anywhere; }
.z-meta { display: flex; gap: 5px; justify-content: center; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.z-type { font-size: 10px; font-weight: bold; color: #fff; border-radius: 999px; padding: 0 6px; line-height: 1.9; white-space: nowrap; }
.z-stars { font-size: 11px; color: #f2a007; letter-spacing: 1px; }
.pickup-grid .zcard { border-color: #ffd34d; background: linear-gradient(180deg, #fffbe8, #fff3c4); }

.empty { text-align: center; color: #8a7a5f; font-size: 14px; margin: 18px 0 6px; }
.hint { font-size: 13px; color: #8a7a5f; text-align: center; margin-top: 6px; }

/* ---- ページャー ---- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin-top: 16px; }
.pager-btn {
  min-width: 48px; min-height: 48px; padding: 6px 10px; font-family: inherit; font-size: 14px; font-weight: bold;
  border: 2px solid #f2c14e; border-radius: 999px; background: #fff3d6; color: #6b4f2a; cursor: pointer;
}
.pager-btn.current { background: linear-gradient(180deg, #69b96f, #35854a); color: #fff; border-color: #35854a; }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-dots { color: #a08b62; }
.pager-info { font-size: 13px; color: #8a7a5f; margin-left: 6px; }

/* ---- 詳細モーダル（ゲームの図鑑カードの流儀） ---- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(60, 40, 10, .5);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 18px 10px; z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative; background: #fffdf2; border: 3px solid #f2a65a; border-radius: 20px;
  padding: 24px 16px 16px; width: 100%; max-width: 480px; overflow-wrap: anywhere; word-break: break-word;
  box-shadow: 0 10px 30px rgba(60,40,10,.35);
}
.modal::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 9px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, #ef6f6c, #f2b705, #5da24a, #4cc9f0, #9b5de5);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid #f2c14e; background: #fff3d6; color: #6b4f2a; font-size: 20px; font-weight: bold; cursor: pointer; z-index: 1;
}
.art { background: #fff; border: 2px solid #f0dfba; border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.art svg { display: block; width: 100%; height: auto; }
.regno { font-size: 14px; color: #d6336c; font-weight: bold; }
.mname { font-size: 24px; font-weight: bold; margin: 2px 0; color: #53351f; }
.title { font-size: 14px; color: #b25f00; margin-bottom: 8px; }
.badge { display: inline-block; background: #e0e7ff; color: #2b3a67; border-radius: 999px; padding: 3px 12px; font-size: 14px; font-weight: bold; margin: 0 6px 8px 0; }
.stars { color: #f2a007; letter-spacing: 2px; font-weight: bold; }
.row { margin: 10px 0; font-size: 15px; }
.row b { display: block; font-size: 13px; color: #b25f00; }
blockquote { margin: 10px 0; padding: 10px 12px; background: #fff3d6; border-left: 5px solid #f2b705; font-size: 15px; border-radius: 0 10px 10px 0; }
.modal-actions { margin-top: 14px; }
.btn {
  display: block; width: 100%; min-height: 48px; font-size: 16px; font-weight: bold; text-align: center;
  border: none; border-radius: 999px; cursor: pointer; margin-bottom: 10px; padding: 12px 10px;
  font-family: inherit; text-decoration: none; box-shadow: 0 4px 0 rgba(90,60,20,.25);
}
.btn-primary { background: linear-gradient(180deg, #69b96f, #35854a); color: #fff; }
.btn-secondary { background: linear-gradient(180deg, #fff3d6, #ffe3a3); color: #6b4f2a; border: 2px solid #f2c14e; box-shadow: 0 4px 0 rgba(242,193,78,.55); }

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .controls { width: 100%; }
  .controls label { flex: 1; }
  .controls .q-label { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
