/* ゲームツール — 夜空(ダーク) × きら星(金) の統一テーマ。
   シグネチャ＝結果の対決ビジュアル。スマホ最適化・没個性回避。 */

:root {
  --bg: #0a0d14;
  --bg-grad: radial-gradient(1100px 560px at 50% -8%, #1b2540 0%, rgba(10,13,20,0) 60%);
  --panel: #141926;
  --panel-2: #1b2230;
  --line: #2a3242;
  --line-soft: rgba(42, 50, 66, 0.55);
  --text: #e9edf5;
  --muted: #8b95a8;
  --accent: #ecc25a;            /* きら星の金 */
  --accent-2: #f3d78c;          /* 明るい金（数値の発光） */
  --accent-dim: #6b5526;
  --accent-glow: rgba(236, 194, 90, 0.18);
  --accent-line: rgba(236, 194, 90, 0.42);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 14px 34px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-grad), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 720px; margin: 0 auto; padding: 30px 16px 80px; }

/* 見出し（全ページ共通） */
.app h1,
.home .article-list h2 {            /* ホームの「記事」見出しも h1 と同サイズ・同スタイルに */
  font-size: clamp(1.35rem, 5.2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 6px 0 4px;
  color: var(--accent-2);          /* 金のベタ塗り（全ブラウザで確実に表示） */
  -webkit-text-fill-color: var(--accent-2);
  text-shadow: 0 0 18px var(--accent-glow);   /* ほのかな金の発光 */
}
.app h1::before,
.home .article-list h2::before { content: "✦ "; color: var(--accent); -webkit-text-fill-color: var(--accent); }
.home .article-list { margin-top: 34px; }
.lead { color: var(--muted); font-size: 0.9rem; margin: 0 0 20px; line-height: 1.65; }

/* セレクト（全ページ共通） */
select {
  appearance: none;
  background: var(--panel-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b95a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 12px center;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 34px 11px 12px;
  font-size: 16px;
  cursor: pointer;
}
select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.season-row { display: flex; align-items: center; gap: 10px; margin: 18px 0 22px; }
.season-row label { color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; }

/* カテゴリ（入力ブロック） */
.category {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.category-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.category-head h2 { font-size: 1rem; font-weight: 700; margin: 0; letter-spacing: 0.02em; }
.pts { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.pts strong { color: var(--accent); font-size: 1.05rem; font-variant-numeric: tabular-nums; margin-left: 4px; }

/* 入力 */
.char-inputs { display: flex; flex-wrap: wrap; gap: 12px; }
.char-inputs label { display: flex; flex-direction: column; gap: 6px; font-size: 0.76rem; color: var(--muted); flex: 1 1 150px; }
.char-inputs label.wide { flex: 1 1 100%; }   /* 桁数の多い入力（産出量など）は全幅 */
.char-inputs label.wide input { width: 100%; }   /* input[type=number] の 86px 指定を上書き */
.char-inputs select, .char-inputs input { width: 100%; }
.category-inputs { display: flex; flex-wrap: wrap; gap: 8px; }
.category-inputs.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }

input[type="number"] {
  background: #0c0f15;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 16px;            /* iOS自動ズーム防止 */
  width: 86px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-variant-numeric: tabular-nums;
}
.category-inputs:not(.grid) input { width: 72px; }
.category-inputs.grid input { width: 100%; }
input[type="number"]::placeholder { color: #4d5662; }
input[type="number"]:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* 結果（報酬計算機など） */
.results {
  margin-top: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 18px 16px;
  box-shadow: var(--shadow);
}
.result-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; }
.result-line + .result-line { border-top: 1px solid var(--line-soft); }
.result-line span { color: var(--muted); font-size: 0.9rem; }
.result-line strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.result-line.input-line input { width: 130px; }
.result-line.input-line label { color: var(--muted); font-size: 0.9rem; }
.result-line.total { border-top: 1px solid var(--accent-dim); margin-top: 6px; padding-top: 15px; }
.result-line.total span { color: var(--text); font-weight: 700; font-size: 0.98rem; }
.result-line.total strong {
  color: var(--accent);
  font-size: clamp(1.8rem, 7.5vw, 2.3rem);
  text-shadow: 0 0 22px var(--accent-glow);
  font-weight: 800;
}

/* シグネチャ：対決ビジュアル（市場計算機） */
.versus .verdict-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; margin-bottom: 18px;
  border: 1px solid var(--accent-line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(236,194,90,0.10), rgba(236,194,90,0.02));
}
.versus .verdict-banner.neutral { border-color: var(--line); background: var(--panel-2); }
.verdict-label { font-weight: 800; font-size: 1.2rem; color: var(--accent); letter-spacing: 0.02em; }
.verdict-banner.neutral .verdict-label { color: var(--muted); }
.verdict-diff { color: var(--accent-2); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.route { margin-bottom: 15px; }
.route-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.route-name { color: var(--muted); font-size: 0.9rem; }
.route-val { color: var(--muted); font-size: 0.82rem; }
.route-val strong { font-size: 1.3rem; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 3px; }
.bar { height: 16px; background: #0c0f15; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 999px; background: #39414f; transition: width 0.4s cubic-bezier(0.2,0.7,0.2,1); }
.route.win .route-val strong { color: var(--accent); }
.route.win .route-name::after { content: "  ✓"; color: var(--accent); font-weight: 700; }
.route.win .bar-fill { background: linear-gradient(90deg, #9c7726, var(--accent)); box-shadow: 0 0 16px var(--accent-glow); }
.route.lose { opacity: 0.82; }
.note { color: var(--muted); font-size: 0.8rem; margin: 10px 0 0; line-height: 1.55; }
.note.error { color: #ef8a5a; }

/* 各カテゴリのボタン（コピー／リセット） */
.cat-btns { display: flex; gap: 8px; margin-top: 10px; }
.fill-btn, .clear-btn, .reset-btn {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.fill-btn, .clear-btn { padding: 7px 14px; font-size: 0.78rem; }
.reset-btn { display: block; margin: 24px auto 0; padding: 11px 28px; font-size: 0.9rem; }
.fill-btn:hover, .fill-btn:focus-visible,
.clear-btn:hover, .clear-btn:focus-visible,
.reset-btn:hover, .reset-btn:focus-visible {
  color: var(--text); border-color: var(--accent); background: var(--accent-glow); outline: none;
}
.fill-btn:active, .clear-btn:active, .reset-btn:active { transform: translateY(1px); }

/* 共通ナビ */
.site-nav {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
  background: rgba(20,25,38,0.85); backdrop-filter: blur(6px);
}
.site-nav .site-title { color: var(--accent); font-weight: 800; text-decoration: none; letter-spacing: 0.04em; }
.site-nav nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-nav nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.site-nav nav a:hover { color: var(--text); }
.site-nav nav a[aria-current="page"] { color: var(--accent); }

/* ホームのツール一覧 */
.tool-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 30px; }
.tool-card {
  display: block; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); text-decoration: none; color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.tool-card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card h2 { margin: 0 0 6px; font-size: 1.08rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.article-list h2 { font-size: 1rem; }
.article-list a { color: var(--accent); }
.article { line-height: 1.8; }

/* スマホ */
@media (max-width: 520px) {
  .app { padding: 22px 13px 64px; }
  .char-inputs label { flex: 1 1 100%; }           /* 入力は縦1列・全幅 */
  .category-inputs.grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .pts { font-size: 0.72rem; }
  .tool-list { grid-template-columns: 1fr; }
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
