/* ゲーム便利ツール 共通スタイル
   世界観：工業用の安全標識。暗いアスファルト色の地に、属性ごとの安全色の標識帯。
   安全黄（caution）は「条件未達・注意」と残りポイント表示だけに使う。 */

:root {
  color-scheme: dark;
  --bg: #131517;
  --panel: #1b1e21;
  --panel-2: #22262a;
  --line: #31363b;
  --line-2: #42484e;
  --text: #ecebe6;
  --text-2: #bcb9b1;
  --text-3: #9a968d;

  /* 安全色（属性の識別色） */
  --per: #0b5cad;  /* 知覚：安全青 */
  --str: #c3172e;  /* 強さ：安全赤 */
  --for: #00804a;  /* 忍耐：安全緑 */
  --agi: #ec6a12;  /* 素早さ：安全橙（文字は黒） */
  --int: #6e2e94;  /* 知能：安全紫 */
  --gen: #e6e2d6;  /* 一般：白い掲示板（文字は黒） */
  --caution: #ffcc00;
  --caution-ink: #111111;
  --danger: #ff7a6b;

  --stripe: repeating-linear-gradient(-45deg, var(--caution) 0 5px, #1a1a1a 5px 10px);

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.1875rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --radius: 6px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-2) var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.7;
  caret-color: var(--caution);
}
::selection { background: var(--caution); color: var(--caution-ink); }
a { color: #8fc3ff; text-underline-offset: 0.2em; }
a:hover { color: #b8d9ff; }
:focus-visible { outline: 2px solid var(--caution); outline-offset: 2px; border-radius: 3px; }
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }
.num, output, .tnum { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }

/* サイトの帯 */
.site-bar { border-bottom: 1px solid var(--line); background: #0f1113; }
.site-bar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 3rem; }
.site-name { color: var(--text); font-weight: 700; text-decoration: none; letter-spacing: 0.02em; font-size: var(--fs-sm); display: inline-flex; align-items: center; gap: 0.5rem; }
.site-name::before { content: ""; width: 1.1rem; height: 0.7rem; background: var(--stripe); border-radius: 2px; }
.site-bar nav { margin-left: auto; font-size: var(--fs-sm); }
.site-bar nav a { color: var(--text-2); text-decoration: none; }
.site-bar nav a:hover { color: var(--text); text-decoration: underline; }

/* 見出し */
h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-feature-settings: "palt"; }
.page-head { padding-block: 1.75rem 1.25rem; }
.page-head h1 { font-size: var(--fs-2xl); letter-spacing: 0.01em; text-wrap: balance; }
.page-head p { margin: 0.5rem 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.version-tag { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.1rem 0.55rem; border-radius: 3px; background: var(--caution); color: var(--caution-ink); font-weight: 700; font-size: var(--fs-xs); vertical-align: 0.15em; }

/* 共通ボタン */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.5rem; padding: 0.45rem 0.9rem;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--panel-2); color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:hover { background: #2b3035; border-color: #555c63; }
.btn:active { background: #33393f; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 1.05rem; height: 1.05rem; }
.btn-primary { background: var(--caution); border-color: var(--caution); color: var(--caution-ink); }
.btn-primary:hover { background: #ffd83d; border-color: #ffd83d; }
.btn-primary:active { background: #e6b800; }
.btn-quiet { background: transparent; }

/* 文章ページ */
.prose { max-width: 42rem; padding-block: 1rem 3rem; }
.prose h2 { font-size: var(--fs-xl); margin-top: 2.5rem; margin-bottom: 0.75rem; }
.prose h3 { font-size: var(--fs-lg); margin-top: 1.75rem; margin-bottom: 0.5rem; }
.prose p, .prose li { color: var(--text-2); }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.prose strong { color: var(--text); }
.prose table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); margin: 0 0 1rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.5rem; text-align: left; font-variant-numeric: tabular-nums; }
.prose th { color: var(--text); font-weight: 600; }

/* フッター */
.site-foot { border-top: 1px solid var(--line); margin-top: 3rem; padding-block: 1.5rem 6rem; color: var(--text-3); font-size: var(--fs-xs); }
.site-foot p { margin: 0 0 0.4rem; }
.site-foot a { color: var(--text-2); }

/* トップページの道具一覧 */
.tool-list { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; gap: 0.75rem; }
.tool-list a { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); text-decoration: none; color: var(--text); transition: border-color 160ms var(--ease); }
.tool-list a:hover { border-color: var(--line-2); }
.tool-list .swatch { grid-row: span 2; width: 0.6rem; border-radius: 2px; background: linear-gradient(var(--per) 0 20%, var(--str) 20% 40%, var(--for) 40% 60%, var(--agi) 60% 80%, var(--int) 80%); }
.tool-list strong { font-size: var(--fs-lg); }
.tool-list span { color: var(--text-2); font-size: var(--fs-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
