/* ============================================================
   ガチャ沼レーダー — シンプル・モバイルファースト CSS
   ============================================================ */

:root {
  --color-bg:        #f8f8f8;
  --color-surface:   #ffffff;
  --color-border:    #e0e0e0;
  --color-text:      #1a1a1a;
  --color-muted:     #666666;
  --color-accent:    #0066cc;
  --color-accent-bg: #e8f0fb;

  --color-stock:     #1a7a3f;
  --color-stock-bg:  #e6f4ec;
  --color-refill:    #795500;
  --color-refill-bg: #fff3cd;
  --color-lottery:   #8b0000;
  --color-lottery-bg:#fce8e8;

  /* スピードバッジ (0=最速 → 8=遅い) */
  --speed-0: #d4281e; /* 最速：赤 */
  --speed-1: #e05c00;
  --speed-2: #e07800;
  --speed-3: #c89000;
  --speed-4: #8a9a00;
  --speed-5: #4a9a20;
  --speed-6: #3a8a40;
  --speed-7: #447799;
  --speed-8: #556688;
  --speed-9: #888888;

  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Meiryo", sans-serif;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { background: var(--color-bg); color: var(--color-text); font-family: var(--font); line-height: 1.6; }

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ── レイアウト ── */
.container { max-width: 900px; margin: 0 auto; padding: 0 16px; }

/* ── ヘッダー ── */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
  position: sticky; top: 0; z-index: 100;
}
.site-logo {
  font-size: 1.1rem; font-weight: 700;
  color: var(--color-text); text-decoration: none;
}

/* ── フッター ── */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--color-border);
  padding: 16px 0;
  color: var(--color-muted);
  font-size: .8rem;
  text-align: center;
}

/* ── ページ見出し ── */
.page-head { padding: 20px 0 12px; }
.page-head h1 { font-size: 1.3rem; }
.page-sub { color: var(--color-muted); font-size: .9rem; margin-top: 4px; }

/* ── 検索窓 ── */
.search-wrap { margin-top: 10px; }
.search-input {
  width: 100%; max-width: 480px;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  -webkit-appearance: none;
}
.search-input:focus { border-color: var(--color-accent); }

/* ── アイテム一覧グリッド ── */
.item-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding-bottom: 8px;
}
@media (min-width: 540px)  { .item-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px)  { .item-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .item-grid { grid-template-columns: repeat(5, 1fr); } }

.item-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--color-text);
  text-decoration: none;
  transition: border-color .15s;
}
.item-card:hover { border-color: var(--color-accent); text-decoration: none; }

.item-thumb {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  overflow: hidden;
  background: #f0f0f0;
  display: flex; align-items: flex-start; justify-content: center;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }
.item-thumb--no-img { color: var(--color-muted); font-size: .8rem; }

.item-info { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 5px; }
.item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 480px) { .item-title { font-size: 14px; } }

.item-meta-row, .item-stats-row {
  display: flex; flex-wrap: wrap; gap: 4px;
}

/* ── チップ・バッジ ── */
.meta-chip {
  font-size: .75rem;
  background: #f0f0f0;
  color: var(--color-muted);
  padding: 2px 7px; border-radius: 20px;
}

.stat-badge {
  font-size: .78rem; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.stat-stock   { background: var(--color-stock-bg);   color: var(--color-stock);   }
.stat-refill  { background: var(--color-refill-bg);  color: var(--color-refill);  }
.stat-lottery { background: var(--color-lottery-bg); color: var(--color-lottery); }

/* ── 在庫なしセクション ── */
.no-stock-section { margin-top: 32px; }
.section-title {
  font-size: 1rem; font-weight: 700;
  border-left: 3px solid var(--color-accent);
  padding-left: 10px;
  margin-bottom: 12px;
}
.no-stock-list { list-style: none; padding: 0; }
.no-stock-list li { padding: 6px 0; border-bottom: 1px solid var(--color-border); font-size: .9rem; }

/* ── アイテム詳細ページ ── */
.breadcrumb { padding: 12px 0; font-size: .85rem; color: var(--color-muted); }
.breadcrumb a { color: var(--color-muted); }

.item-header {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 0;
  flex-wrap: wrap;
}
.item-header-img {
  width: 180px; flex-shrink: 0;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--color-border);
}
.item-header-info { flex: 1; min-width: 200px; }
.item-header-info h1 { font-size: 1.15rem; margin-bottom: 8px; }

.lottery-badge {
  background: var(--color-lottery-bg);
  color: var(--color-lottery);
  font-size: .85rem; font-weight: 600;
  padding: 6px 10px; border-radius: var(--radius);
  margin-bottom: 8px; display: inline-block;
}

.item-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; margin: 8px 0; }
.item-dl dt { color: var(--color-muted); white-space: nowrap; }
.item-dl dd { font-weight: 500; }

.item-stat-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.stat-pill {
  font-size: .82rem; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
}
.stat-pill--stock   { background: var(--color-stock-bg);   color: var(--color-stock);   }
.stat-pill--refill  { background: var(--color-refill-bg);  color: var(--color-refill);  }
.stat-pill--date    { background: var(--color-accent-bg);  color: var(--color-accent);  }

/* ── 関連ポスト ── */
.posts-section { margin-top: 20px; }
.posts-list { display: flex; flex-direction: column; gap: 8px; }
.post-link {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: .9rem; font-weight: 600;
  color: var(--color-accent);
}
.post-link:hover { background: var(--color-accent-bg); }

/* ── 店舗リスト ── */
.shops-section { margin-top: 20px; }

.pref-heading {
  font-size: .85rem; font-weight: 600;
  color: var(--color-muted);
  background: #f4f4f4;
  padding: 4px 10px;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
}

.shop-list { list-style: none; padding: 0; }
.shop-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.shop-item:last-child { border-bottom: none; }

.shop-main {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.shop-name { font-weight: 600; font-size: .95rem; }
.shop-chain {
  font-size: .75rem; color: var(--color-muted);
  background: #f0f0f0; padding: 1px 7px; border-radius: 20px;
}

.shop-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: .8rem; color: var(--color-muted);
}

/* スピードバッジ */
.speed-badge {
  font-size: .72rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  color: #fff;
}
.speed-tier-0 { background: var(--speed-0); }
.speed-tier-1 { background: var(--speed-1); }
.speed-tier-2 { background: var(--speed-2); }
.speed-tier-3 { background: var(--speed-3); }
.speed-tier-4 { background: var(--speed-4); }
.speed-tier-5 { background: var(--speed-5); }
.speed-tier-6 { background: var(--speed-6); }
.speed-tier-7 { background: var(--speed-7); }
.speed-tier-8 { background: var(--speed-8); }
.speed-tier-9 { background: var(--speed-9); }

.refill-chip {
  background: var(--color-refill-bg);
  color: var(--color-refill);
  padding: 1px 6px; border-radius: 20px;
  font-size: .72rem; font-weight: 600;
}

.shop-address { font-size: .78rem; }

.map-link {
  font-size: .78rem; font-weight: 600;
  background: var(--color-accent-bg);
  color: var(--color-accent);
  padding: 2px 8px; border-radius: 4px;
  white-space: nowrap;
}

.back-link {
  margin-top: 24px; margin-bottom: 8px;
  font-size: .9rem;
}

.no-data { color: var(--color-muted); font-size: .9rem; padding: 16px 0; }

/* ── レスポンシブ ── */
@media (max-width: 480px) {
  .item-header { flex-direction: column; }
  .item-header-img { width: 100%; max-width: 200px; }
}
