/* ================================================
   CRAFTn - common.css  v2
   全ページ共通スタイル
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Noto+Sans+JP:wght@400;700&display=swap');

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

/* ===== CSS VARIABLES ===== */
:root {
  --bg:          #0a1628;
  --bg2:         #0d1f3c;
  --surface:     #112244;
  --surface2:    #1a3060;
  --border:      #1e4080;
  --border-hi:   #2d6fc4;
  --accent:      #1e90ff;
  --accent-hi:   #00cfff;
  --accent-glow: rgba(30, 144, 255, 0.22);
  --gold:        #ffd700;
  --text:        #c8daf5;
  --text-muted:  #607090;
  --text-bright: #e8f4ff;
  --grid-line:   rgba(255, 255, 255, 0.028);
}

/* ===== BODY ===== */
body {
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(0deg,  transparent, transparent 31px, var(--grid-line) 31px, var(--grid-line) 32px),
    repeating-linear-gradient(90deg, transparent, transparent 31px, var(--grid-line) 31px, var(--grid-line) 32px);
  background-attachment: fixed;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ===== SITE HEADER ===== */
.site-header {
  background: linear-gradient(180deg, #0c2040 0%, #091830 55%, #061020 100%);
  border-bottom: 3px solid var(--border);
  position: relative;
  overflow: hidden;
  padding-bottom: 28px;
}

/* 星空エフェクト */
.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 15% 30%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 20%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 60%, rgba(255,255,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 25%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 70%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 90% 45%, rgba(255,255,255,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 60% 15%, rgba(100,180,255,0.4) 0%, transparent 100%);
  pointer-events: none;
}

/* ===== 全ページ共通：中央ロゴ ===== */
/* header-inner は非表示（全ページでheader-logoに統一） */
.header-inner { display: none; }
.site-title-link, .site-title { display: none; }

.header-logo {
  position: relative; z-index: 1;
  text-align: center;
  padding: 28px 20px 18px;
}

/* ② 全ページ同じロゴサイズ（topと統一） */
.site-logo-img {
  max-width: 320px; width: 80%; height: auto;
  display: block; margin: 0 auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 5px rgba(0,0,0,0.28)) drop-shadow(0 0 8px rgba(30,144,255,0.18));
}

.site-subtitle {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(7px, 1.4vw, 10px);
  color: var(--accent-hi);
  letter-spacing: 3px;
  margin-top: 12px;
  opacity: .8;
  display: block;
}

/* ===== 全ページ共通：ヘッダー内検索ボックス ===== */
/* ③ 横幅50%に制限 */
.global-search-outer {
  position: relative; z-index: 10;
  max-width: 460px;   /* 50%相当 */
  margin: 0 auto;
  padding: 0 20px;
}

/* ① 子ページの個別検索窓（.search-wrap）を非表示 */
.search-wrap { display: none; }
.count-label { display: none; }

.global-search-box {
  display: flex; align-items: stretch;
  background: var(--bg2);
  border: 2px solid var(--border-hi);
  border-radius: 3px; overflow: hidden;
  box-shadow: 0 0 24px var(--accent-glow), 0 6px 20px rgba(0,0,0,.55);
  transition: border-color .15s, box-shadow .15s;
}

.global-search-box:focus-within {
  border-color: var(--accent-hi);
  box-shadow: 0 0 32px rgba(0,207,255,.4), 0 6px 20px rgba(0,0,0,.55);
}

.gsearch-icon {
  display: flex; align-items: center;
  padding: 0 16px; font-size: 16px;
  background: var(--surface);
  border-right: 2px solid var(--border);
  flex-shrink: 0;
}

.global-search-box input {
  flex: 1; background: transparent;
  border: none; outline: none;
  color: var(--text-bright);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 16px; padding: 14px 12px;
}

.global-search-box input::placeholder { color: var(--text-muted); }

.gsearch-btn {
  background: var(--accent); border: none;
  color: #fff;
  font-size: 16px;
  width: 48px; flex-shrink: 0;
  cursor: pointer;
  transition: background .15s;
  display: flex; align-items: center; justify-content: center;
}
.gsearch-btn:hover { background: var(--accent-hi); color: #000; }

/* ===== メインタブナビ (トップページ) ===== */
.tab-nav-wrap {
  background: var(--bg2);
  padding-top: 30px;
  padding-bottom: 0;
  border-bottom: 3px solid var(--accent);
}

.tab-nav {
  max-width: 960px; margin: 0 auto;
  padding: 0 20px;
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  align-items: flex-end;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 18px 12px;
  background: #061020;
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: all .15s; letter-spacing: 1px;
  position: relative; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tab-btn:hover {
  color: var(--text); background: var(--surface);
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.tab-btn.active {
  color: #fff; background: var(--accent);
  border-color: var(--accent);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 14px; font-size: 9px;
  box-shadow: 0 -4px 12px rgba(30,144,255,0.35);
  z-index: 2;
}

.tab-badge {
  position: absolute; top: 4px; right: 4px;
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  background: rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.5);
  padding: 1px 4px; border-radius: 2px;
  pointer-events: none;
}

/* ===== タブパネル ===== */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== 横断検索結果 ===== */
.search-results-panel {
  display: none;
  max-width: 880px; margin: 0 auto;
  padding: 24px 20px 48px;
  position: relative;
  z-index: 10;
  background: var(--bg);
}
.search-results-panel.visible { display: block !important; }

.search-results-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; color: var(--accent-hi);
  margin-bottom: 14px;
}

.search-result-item {
  background: var(--surface); border: 1px solid var(--border);
  padding: 0;
  margin-bottom: 8px;
  display: flex; flex-direction: column;
  text-decoration: none; border-radius: 3px;
  transition: border-color .12s, background .12s;
  overflow: hidden;
}
.search-result-item:hover { border-color: var(--accent); background: var(--surface2); }

/* カード上段：カテゴリ・名前・矢印 */
.sri-top {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

/* カード下段：詳細情報 */
.sri-detail {
  padding: 8px 16px 10px;
  display: flex; flex-wrap: wrap; gap: 5px;
}
.sri-detail-tag {
  font-size: 10px; padding: 3px 8px;
  background: var(--bg2); border: 1px solid var(--border-hi);
  color: var(--text-muted); border-radius: 2px;
}

.sri-cat {
  font-family: 'Press Start 2P', monospace; font-size: 7px;
  color: var(--accent); background: var(--bg);
  border: 1px solid var(--border-hi);
  padding: 3px 7px; white-space: nowrap; flex-shrink: 0;
}
.sri-name {
  font-size: clamp(22px, 3.4vw, 32px);
  line-height: 1.35;
  color: var(--accent-hi);
  flex: 1;
  font-weight: 900;
  text-shadow: 2px 2px 0 #000, 0 0 12px var(--accent-glow);
}
.sri-arrow { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.no-results {
  font-family: 'Press Start 2P', monospace; font-size: 9px;
  color: var(--text-muted); text-align: center; padding: 40px 0;
}

/* ===== 子ページ用ナビ（④ topと同じ角丸タブ型） ===== */
.main-nav {
  background: var(--bg2);
  padding-top: 30px;
  padding-bottom: 0;
  border-bottom: 3px solid var(--accent);
}

.nav-inner {
  max-width: 960px; margin: 0 auto;
  padding: 0 20px;
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  align-items: flex-end;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-item {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 18px 12px;
  background: #061020;
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all .15s;
  letter-spacing: 1px;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.nav-item:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-hi);
  transform: translateY(-2px);
}
.nav-item.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  border-bottom: 3px solid var(--accent);
  padding-bottom: 14px;
  font-size: 9px;
  box-shadow: 0 -4px 12px rgba(30,144,255,0.35);
  z-index: 2;
}

/* ===== パンくず ===== */
.breadcrumb {
  max-width: 1000px; margin: 0 auto; padding: 10px 24px;
  font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-hi); }
.breadcrumb-sep { color: var(--border-hi); }

/* ===== ページヒーロー（コンパクト統一サイズ） ===== */
.page-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg2) 100%);
  border-bottom: 2px solid var(--border);
  padding: 18px 24px 14px;
  text-align: center;
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent) 30%, var(--accent-hi) 50%, var(--accent) 70%, transparent 100%);
}
.page-hero-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.page-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(12px, 2vw, 16px);
  color: var(--text-bright);
  text-shadow: 0 0 14px var(--accent-glow);
  margin-bottom: 4px;
}
.page-desc { font-size: 13px; color: var(--text-muted); }

/* panel-hero（index.html タブ内用、page-heroと同サイズ） */
.panel-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg2) 100%);
  border-bottom: 2px solid var(--border);
  padding: 18px 24px 14px;
  text-align: center;
  position: relative; overflow: hidden;
}
.panel-hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent) 30%, var(--accent-hi) 50%, var(--accent) 70%, transparent 100%);
}
.panel-hero-icon { font-size: 24px; display: block; margin-bottom: 6px; }
.panel-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(12px, 2vw, 16px);
  color: var(--text-bright);
  text-shadow: 0 0 14px var(--accent-glow);
  margin-bottom: 4px;
}
.panel-desc { font-size: 13px; color: var(--text-muted); }

/* ===== セクションタイトル ===== */
.sec-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; color: var(--accent);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
  letter-spacing: 2px;
}
.sec-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-hi), transparent);
}

/* ===== 子ページ内検索 ===== */
.search-wrap { max-width: 960px; margin: 28px auto 0; padding: 0 24px; }

.search-box {
  display: flex; align-items: stretch;
  background: var(--bg2); border: 2px solid var(--border-hi); overflow: hidden;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--accent-hi); box-shadow: 0 0 16px var(--accent-glow); }

.search-box-icon {
  display: flex; align-items: center;
  padding: 0 14px; font-size: 15px;
  background: var(--surface); border-right: 2px solid var(--border); flex-shrink: 0;
}
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text-bright); font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px; padding: 12px 14px;
}
.search-box input::placeholder { color: var(--text-muted); }
.count-label {
  text-align: right; font-family: 'Press Start 2P', monospace;
  font-size: 7px; color: var(--text-muted); margin-top: 8px;
}

/* ===== 子ページ内フィルタータブ ===== */
.filter-tabs {
  display: flex; gap: 6px;
  max-width: 960px; margin: 20px auto 0; padding: 0 24px;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.filter-tabs::-webkit-scrollbar { display: none; }

.ftab {
  font-family: 'Press Start 2P', monospace; font-size: 8px;
  padding: 10px 16px 8px;
  border: 2px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer; transition: all .15s; white-space: nowrap;
  position: relative;
}
.ftab.active {
  background: var(--surface2); color: var(--accent-hi);
  border-color: var(--accent);
  border-bottom: 2px solid var(--surface2);
  z-index: 2; margin-bottom: -2px;
}
.ftab:hover:not(.active) { background: var(--surface); color: var(--text); border-color: var(--border-hi); }

/* ===== カテゴリグリッド ===== */
.cat-section { max-width: 960px; margin: 0 auto; padding: 36px 20px 60px; }

.cat-section-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px; color: var(--accent);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px; letter-spacing: 2px;
}
.cat-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border-hi), transparent);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 700px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: 4px;
  padding: 24px 12px 18px; text-align: center; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; overflow: hidden; min-height: 128px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.cat-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(30,144,255,.05) 0%, transparent 60%);
  pointer-events: none;
}
.cat-card:not(.coming):hover {
  transform: translateY(-5px); border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,.5), 0 0 16px var(--accent-glow);
}
.cat-card.active {
  background: var(--accent);
  border-color: var(--accent-hi);
  box-shadow: 0 0 18px rgba(0, 207, 255, .35);
}
.cat-card.active .cat-label,
.cat-card.active .cat-desc { color: #fff; }
.cat-card.coming { opacity: .5; pointer-events: none; }

.cat-icon-wrap { font-size: 32px; margin-bottom: 10px; line-height: 1; }
.cat-label {
  font-family: 'Press Start 2P', monospace; font-size: 9px;
  color: var(--text-bright); display: block; margin-bottom: 5px;
}
.cat-desc { font-size: 10px; color: var(--text-muted); display: block; line-height: 1.5; }

.term-link {
  color: var(--accent-hi);
  text-decoration: none;
  border-bottom: 1px dotted rgba(0, 207, 255, .75);
}
.term-link:hover { color: #fff; border-bottom-color: #fff; }
.term-link-chip {
  cursor: pointer;
  color: var(--accent-hi);
  border-color: var(--accent-hi) !important;
  background: rgba(0, 207, 255, .08) !important;
}
.term-link-chip:hover {
  color: #fff;
  background: rgba(30, 144, 255, .22) !important;
}

.badge-coming {
  position: absolute; top: 7px; right: 7px;
  font-family: 'Press Start 2P', monospace; font-size: 6px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); padding: 2px 5px; border-radius: 2px;
}

/* ===== COMING SOON ===== */
.coming-panel { max-width: 880px; margin: 0 auto; padding: 80px 20px; text-align: center; }
.coming-icon { font-size: 54px; display: block; margin-bottom: 20px; opacity: .5; }
.coming-title {
  font-family: 'Press Start 2P', monospace; font-size: 13px;
  color: var(--text-muted); margin-bottom: 12px;
}
.coming-desc { font-size: 12px; color: #3a5070; line-height: 1.9; }

/* ===== カード共通 ===== */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px; max-width: 960px; margin: 20px auto 60px; padding: 0 24px;
}
.card {
  background: var(--surface); border: 2px solid var(--border);
  position: relative; overflow: hidden;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 6px 0 #000, 0 0 16px var(--accent-glow);
}
.card-top {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: linear-gradient(90deg, var(--surface2) 0%, var(--surface) 100%);
  border-bottom: 2px solid var(--border);
}
.card-name {
  font-family: 'Press Start 2P', monospace; font-size: 9px;
  color: var(--text-bright); text-shadow: 1px 1px 0 #000; line-height: 1.7;
}
.card-body { padding: 12px 16px; }
.mat-label {
  font-family: 'Press Start 2P', monospace; font-size: 7px;
  color: var(--accent-hi); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.mat-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.materials { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mat-tag {
  font-size: 11px; padding: 4px 10px;
  background: var(--bg2); border: 1px solid var(--border-hi); color: var(--text);
}
.effect-label {
  font-family: 'Press Start 2P', monospace; font-size: 7px; color: #88cc44;
  margin: 10px 0 8px; display: flex; align-items: center; gap: 6px;
}
.effect-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.effect-text {
  font-size: 11px; color: #b8e0b0;
  background: rgba(0,40,0,0.4); border: 1px solid #2a4a2a; padding: 6px 10px;
}

/* ===== フッター ===== */
.site-footer {
  background: var(--bg2); border-top: 2px solid var(--border);
  padding: 24px; text-align: center;
}
.site-footer p {
  font-family: 'Press Start 2P', monospace; font-size: 7px; color: var(--text-muted);
}

/* ===== ユーティリティ ===== */
.hidden { display: none !important; }

@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .cat-grid  { grid-template-columns: repeat(2, 1fr); }
}

/* ポーションページ独自検索（グローバル検索で代替するため非表示） */
.search-wrap-portion { display: none; }

/* 検索結果カードの効果表示 */
.sri-effect {
  padding: 6px 16px 10px;
  display: flex; align-items: center; gap: 8px;
  border-top: 1px solid var(--border);
}
.sri-effect-label {
  font-family: 'Press Start 2P', monospace; font-size: 7px;
  color: #88cc44; white-space: nowrap; flex-shrink: 0;
}
.sri-effect-text {
  font-size: 11px; color: #b8e0b0;
}


/* ===== スマホ用：カテゴリ式ナビ見本 ===== */
@media (max-width: 700px) {
  .tab-nav-wrap,
  .main-nav {
    padding: 14px 14px 16px;
    border-top: 1px solid rgba(45,111,196,0.55);
    border-bottom: 3px solid var(--accent);
  }

  .tab-nav-wrap::before,
  .main-nav::before {
    content: 'カテゴリ';
    display: block;
    max-width: 520px;
    margin: 0 auto 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: var(--accent-hi);
    letter-spacing: 1px;
  }

  .tab-nav,
  .nav-inner {
    max-width: 520px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    align-items: stretch;
  }

  .tab-btn,
  .nav-item {
    min-height: 46px;
    padding: 10px 8px;
    border: 2px solid var(--border);
    border-radius: 6px;
    background: rgba(6,16,32,0.88);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: normal;
    text-align: center;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 4px 10px rgba(0,0,0,0.24);
  }

  .tab-btn:hover,
  .nav-item:hover {
    transform: none;
  }

  .tab-btn.active,
  .nav-item.active {
    padding: 10px 8px;
    border: 2px solid var(--accent-hi);
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 0 18px rgba(30,144,255,0.32), inset 0 1px 0 rgba(255,255,255,0.2);
  }

  .tab-badge {
    position: static;
    margin-left: 4px;
    font-size: 8px;
    padding: 2px 5px;
  }

  .filter-tabs,
  .tabs {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: visible !important;
    border-bottom: none !important;
  }

  .ftab,
  .tab {
    min-height: 40px;
    border: 2px solid var(--border) !important;
    border-radius: 6px !important;
    padding: 9px 8px !important;
    margin: 0 !important;
    white-space: normal;
    text-align: center;
    font-family: 'Noto Sans JP', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
  }

  .ftab.active,
  .tab.active {
    border-color: var(--accent-hi) !important;
    background: var(--surface2) !important;
    color: var(--accent-hi) !important;
  }
}



/* ===== Search Result Visibility ===== */
.page-search-results-panel {
  display: none;
  width: min(920px, calc(100% - 40px));
  margin: 18px auto 0;
  padding: 0 0 22px;
  position: relative;
  z-index: 20;
}
.page-search-results-header,
.search-results-header {
  background: rgba(0, 207, 255, .12);
  border: 1px solid var(--accent-hi);
  border-left: 5px solid var(--accent-hi);
  padding: 10px 12px;
  box-shadow: 0 0 18px rgba(0, 207, 255, .18);
}
body.search-active .tab-nav-wrap,
body.search-active .main-nav,
body.search-active .breadcrumb,
body.search-active .page-hero,
body.search-active .page-header,
body.search-active .tabs,
body.search-active .filter-tabs,
body.search-active .search-wrap,
body.search-active .search-wrap-portion,
body.search-active .section-heading,
body.search-active .section-header,
body.search-detail-active .tab-nav-wrap,
body.search-detail-active .main-nav,
body.search-detail-active .breadcrumb,
body.search-detail-active .page-hero,
body.search-detail-active .page-header,
body.search-detail-active .tabs,
body.search-detail-active .filter-tabs,
body.search-detail-active .search-wrap,
body.search-detail-active .search-wrap-portion,
body.search-detail-active .section-heading,
body.search-detail-active .section-header {
  display: none !important;
}
.search-results-header,
.page-search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 12px;
}
.search-results-header span,
.page-search-results-header span {
  min-width: 0;
}
.search-results-top-btn {
  appearance: none;
  flex: 0 0 auto;
  border: 2px solid var(--accent-hi);
  background: var(--accent);
  color: #ffffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  line-height: 1;
  padding: 9px 12px;
  min-width: 82px;
  white-space: nowrap;
  border-radius: 3px;
  cursor: pointer;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 0 12px rgba(0, 207, 255, .22);
}
.search-results-top-btn:hover,
.search-results-top-btn:focus-visible {
  background: var(--accent-hi);
  color: #061020;
  outline: none;
}

.search-results-panel.visible {
  border-top: 3px solid var(--accent-hi);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
@media (max-width: 700px) {
  .search-results-panel {
    margin: 0;
    max-width: none;
    padding: 14px 14px 20px;
    border-bottom: 3px solid var(--accent);
  }
  .page-search-results-panel {
    width: auto;
    margin: 16px 14px 0;
    padding-bottom: 18px;
  }
  .search-results-header,
  .page-search-results-header {
    font-size: 8px;
    line-height: 1.8;
    margin-bottom: 10px;
    padding-right: 8px;
  }
  .search-results-top-btn {
    font-size: 8px;
    padding: 9px 10px;
    min-width: 76px;
  }
  #globalSearch,
  #pageSearch {
    font-size: 16px !important;
    line-height: 1.4;
  }
  .search-result-item {
    margin-bottom: 10px;
    border-width: 2px;
  }
}



/* ===== Category result pages ===== */
.main-nav,
.tabs,
.filter-tabs {
  display: none !important;
}

/* ===== Search-only mode cleanup ===== */
body.search-active:not(.search-detail-active) .tab-panel,
body.search-active:not(.search-detail-active) .cat-section,
body.search-active:not(.search-detail-active) .card-grid,
body.search-active:not(.search-detail-active) .item-grid,
body.search-active:not(.search-detail-active) .content-section,
body.search-active:not(.search-detail-active) .section,
body.search-active:not(.search-detail-active) main,
body.search-active:not(.search-detail-active) .site-footer {
  display: none !important;
}

body.search-detail-active h2,
body.search-detail-active .mob-name,
body.search-detail-active .armor-name,
body.search-detail-active .biome-name,
body.search-detail-active .animal-name,
body.search-detail-active .villager-name,
body.search-detail-active .food-name,
body.search-detail-active .tool-name,
body.search-detail-active .potion-name,
body.search-detail-active .item-name,
body.search-detail-active .dye-name {
  font-size: clamp(24px, 4vw, 36px) !important;
  line-height: 1.35 !important;
  font-weight: 900;
  color: var(--accent-hi) !important;
  text-shadow: 2px 2px 0 #000, 0 0 14px var(--accent-glow);
}


@media (min-width: 701px) {
  .home-page .tab-nav-wrap {
    display: none !important;
  }
}

@media (max-width: 700px) {
  .home-page #panel-craft .panel-hero,
  .home-page #panel-craft .cat-section {
    display: none !important;
  }
}

/* ===== Mobile Input Zoom Guard ===== */
input,
textarea,
select {
  font-size: 16px !important;
}
