:root {
  --bg: #14131a;
  --panel: #1e1c27;
  --panel-2: #272433;
  --line: #3a3649;
  --text: #e8e4f0;
  --muted: #9a94ad;
  --accent: #e0b860;
  --unique: #e0a050;
  --base: #b9b3cc;
  --tree-blue: #7fb2ff;
  --tree-red: #ff8f8f;
  --link-red: #e0605a;
  --link-green: #6cc070;
  --link-blue: #5a9be0;
  --link-white: #e8e4f0;
  --cell-w: 64px;
  --cell-h: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

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

.top { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-size: 16px; font-weight: 700; color: var(--text); }

main { max-width: 1120px; margin: 0 auto; padding: 16px; }
.note { color: var(--muted); }

h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3 { font-size: 14px; margin: 0; }

/* 詳細 */
.hero { display: flex; gap: 16px; align-items: center; background: var(--panel); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.hero img { width: 72px; height: 72px; object-fit: cover; object-position: top; border-radius: 8px; background: var(--panel-2); }
.hero .who { flex: 1; min-width: 200px; }
.hero .who .name { font-size: 18px; font-weight: 700; }
.hero .who .sub { color: var(--muted); font-size: 12px; }
.code { display: flex; gap: 8px; align-items: center; }
button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); }

section.block { background: var(--panel); border-radius: 8px; padding: 16px; margin-bottom: 16px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.card .head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.card .head img { width: 40px; height: 40px; image-rendering: pixelated; flex: none; }
.card .head .sub { color: var(--muted); font-size: 12px; }
.card.unique h3 { color: var(--unique); }
.lines { margin: 0; padding: 0; list-style: none; font-size: 13px; }
.lines li.base { color: var(--base); }
.lines li.unique { color: var(--unique); }
.lines li.arbiter { color: var(--tree-blue); }
.lines li.prophet { color: var(--tree-red); }
.lines li.off { color: var(--muted); }
.lines li.sep { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.stars { color: var(--accent); letter-spacing: 1px; }

/* ルーン盤 */
.board-wrap { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.board-scroll { overflow-x: auto; max-width: 100%; }
.board { position: relative; flex: none; }
.cell { position: absolute; width: var(--cell-w); height: var(--cell-h); margin: calc(var(--cell-h) / -2) 0 0 calc(var(--cell-w) / -2);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: #2c2939; }
.cell.locked { background: #1a1822; }
.rune { position: absolute; width: 60px; height: 52px; margin: -26px 0 0 -30px; cursor: pointer; }
.rune img { position: absolute; image-rendering: pixelated; }
.rune img.frame { left: 0; top: 0; width: 60px; height: 52px; object-fit: none; object-position: center; }
.rune img.icon { left: 50%; top: 50%; transform: translate(-50%, -50%); image-rendering: auto; }
.rune .lv { position: absolute; right: 6px; bottom: 0; font-size: 10px; font-weight: 700; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.rune.selected { filter: drop-shadow(0 0 4px var(--accent)); }
.board svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.rune-detail { flex: 1; min-width: 260px; }
.rune-detail .desc { white-space: pre-line; font-size: 13px; }
.rune-list { margin: 12px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 2px 12px; font-size: 13px; }
.rune-list li { cursor: pointer; }
.rune-list li:hover { color: var(--accent); }
.rune-list .c-red::before, .rune-list .c-green::before, .rune-list .c-blue::before { content: "●"; margin-right: 4px; }
.c-red::before { color: var(--link-red); }
.c-green::before { color: var(--link-green); }
.c-blue::before { color: var(--link-blue); }

/* 星座 */
.constellation .head img { image-rendering: auto; }
.starmap { display: block; margin: 0 auto 8px; max-width: 100%; }
.notable { margin-top: 8px; }
.notable .name { font-weight: 700; }
