/* ==========================================================
   FTBCツールズ 共通スタイル
   base: 濃紺チャコール / accent: 藤色 / signature: 玉(オーブ)
   ========================================================== */
:root {
  --bg: #131521;
  --bg-deep: #0e101a;
  --surface: #1b1e2e;
  --surface-hover: #222639;
  --border: #2c3047;
  --text: #e9e8f2;
  --text-muted: #9b99b0;
  --fuji: #a08de0;
  --fuji-bright: #c3b4f2;
  --fuji-dim: rgba(160, 141, 224, 0.14);
  --danger: #e08d9b;
  --ok: #8dd0b0;
  --radius: 10px;
  --font-display: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", sans-serif;
  --font-body: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic Medium", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

/* .btn { display:inline-block } 等の明示指定がUAの [hidden]{display:none} に勝つのを全ページで防ぐ */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

a { color: var(--fuji-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--fuji); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.4; }
h1 { font-size: 1.7rem; margin: 0 0 0.5em; }
h2 { font-size: 1.3rem; margin: 2.2em 0 0.7em; }
h3 { font-size: 1.05rem; margin: 1.8em 0 0.5em; }

/* --- 玉 (signature orb) --- */
.tama {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, var(--fuji-bright), var(--fuji) 55%, #5b4a9e);
  vertical-align: -0.06em;
  flex: none;
}

/* --- Header --- */
.site-header {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
}
.logo:hover { text-decoration: none; color: var(--fuji-bright); }
.global-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.global-nav a {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 5px 11px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}
.global-nav a:hover,
.global-nav a[aria-current="page"] {
  background: var(--fuji-dim);
  color: var(--fuji-bright);
  text-decoration: none;
}

/* --- Hero (top page) --- */
.hero { padding: 48px 0 8px; text-align: center; }
.hero h1 { font-size: 1.9rem; letter-spacing: 0.02em; }
.hero .lead { color: var(--text-muted); margin: 0 auto; max-width: 640px; }

/* --- Search --- */
.search-wrap { max-width: 560px; margin: 24px auto 8px; position: relative; }
.search-input {
  width: 100%;
  padding: 13px 18px 13px 44px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--fuji); }
.search-wrap::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -9px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
}
.search-wrap::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 50%;
  width: 7px;
  height: 2px;
  margin-top: 4px;
  background: var(--text-muted);
  transform: rotate(45deg);
}
.search-empty { text-align: center; color: var(--text-muted); padding: 32px 0; display: none; }

/* --- Category section / tool cards --- */
.category-section { margin-top: 40px; }
.category-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.category-head h2 { margin: 0; display: inline-flex; align-items: center; }
.category-head .count { color: var(--text-muted); font-size: 0.85rem; }
.category-head .more { margin-left: auto; font-size: 0.85rem; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.tool-card > a, .tool-card > .card-body {
  display: block;
  padding: 16px 18px;
  color: inherit;
  height: 100%;
}
.card-thumb {
  display: block;
  width: calc(100% + 36px);
  height: auto;
  aspect-ratio: 16 / 9;
  margin: -16px -18px 12px;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
}
.tool-card > a:hover { text-decoration: none; }
.tool-card:has(> a):hover {
  border-color: var(--fuji);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.tool-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--fuji-bright); }
.tool-card p { margin: 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.tool-card.is-planned { opacity: 0.55; }
.tool-card .badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: 0.1em;
}

/* --- Tool page --- */
.breadcrumb { font-size: 0.82rem; color: var(--text-muted); margin: 20px 0 4px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--border); }

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0 32px;
}

.tool-panel textarea,
.tool-panel input[type="text"],
.tool-panel input[type="number"],
.tool-panel select {
  width: 100%;
  background: var(--bg-deep);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--font-mono);
}
.tool-panel textarea { min-height: 180px; resize: vertical; line-height: 1.7; }
.tool-panel textarea:focus,
.tool-panel input:focus,
.tool-panel select:focus { outline: none; border-color: var(--fuji); }

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.95rem;
  color: #14101f;
  background: linear-gradient(135deg, var(--fuji-bright), var(--fuji));
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: none;
  color: var(--fuji-bright);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--fuji); filter: none; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.stat {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}
.stat b { display: block; font-size: 1.4rem; font-family: var(--font-display); color: var(--fuji-bright); }
.stat span { font-size: 0.78rem; color: var(--text-muted); }

.tool-desc { max-width: 760px; }
.tool-desc p, .tool-desc li { color: var(--text); font-size: 0.95rem; }
.tool-desc .faq dt { font-weight: 700; margin-top: 1.2em; color: var(--fuji-bright); }
.tool-desc .faq dd { margin: 0.3em 0 0 0; color: var(--text-muted); }

.related { margin-top: 48px; }

/* --- Ad slot placeholder --- */
.ad-slot {
  max-width: 1080px;
  margin: 36px auto;
  padding: 0 20px;
  min-height: 0; /* 審査通過後、広告サイズに合わせて調整 */
}

/* --- Static pages --- */
.page-body { max-width: 760px; padding: 8px 0 40px; }
.page-body h1 { margin-top: 40px; }

/* --- Footer --- */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 36px 0 28px;
}
.footer-inner { text-align: center; }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  margin: 0 0 8px;
}
.footer-note { color: var(--text-muted); font-size: 0.82rem; margin: 0 0 16px; }
.footer-nav { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; font-size: 0.85rem; }
.copyright { color: var(--text-muted); font-size: 0.78rem; margin-top: 20px; }

@media (max-width: 560px) {
  .hero { padding-top: 32px; }
  .hero h1 { font-size: 1.5rem; }
  .tool-panel { padding: 16px; }
}
