/* 色・面・罫はゲームのダークテーマ（ui/style/style_colors.gd の DARK）に合わせる */
:root {
  --bg: #1e1e1e;
  --panel: #272727;
  --inner: #212121;
  --header: #333333;
  --border: #4e4e4e;
  --border-strong: #8d8d8d;
  --text: #cecece;
  --group: #949494;
  --hover: #3f3f3f;
  --mod-prefix: #7ed489;
  --mod-suffix: #c2a0ef;
  --mod-arbiter: #8eb7db;
  --mod-prophet: #e091a2;
  --mod-chronicler: #f2a75c;
  --set-active: #7ec0ef;
  --set-inactive: #6a6a6a;
  --unique: #a67ee4;
  --link-red: #e0605a;
  --link-green: #6cc070;
  --link-blue: #5a9be0;
  --link-white: #e9e9e9;
  --cell-w: 64px;
  --cell-h: 56px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

main { max-width: 1360px; margin: 0 auto; padding: 10px; }
.note { color: var(--group); text-align: center; }

/* 上部の帯（ゲームの DarkBand） */
.band { display: flex; gap: 12px; align-items: center; background: #000; border-radius: 6px; padding: 6px 12px; margin-bottom: 10px; flex-wrap: wrap; }
.band img { width: 44px; height: 44px; object-fit: cover; object-position: top; border-radius: 4px; background: var(--header); }
.band .name { font-size: 16px; color: #fff; }
.band .sub { color: var(--group); font-size: 12px; }
.band .who { flex: 1; min-width: 180px; line-height: 1.35; }
button { background: #cfcfcf; color: #272727; border: 1px solid #9a9a9a; border-radius: 4px; padding: 5px 14px; font: inherit; cursor: pointer; }
button:hover { background: #e4e4e4; }

/* 区画（モーダルの面） */
section.block { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px; overflow: hidden; }
section.block > h2 { margin: 0; padding: 5px 12px; font-size: 14px; font-weight: 400; text-align: center; border-bottom: 1px solid var(--border); background: var(--bg); }
section.block > .body { padding: 10px; }

/* 詳細パネル（ゲームの ItemDetailPanel。上に絵の帯、名前、見出しつきの罫、中央ぞろえの行） */
.detail { background: var(--inner); border: 2px solid var(--border-strong); min-width: 0; }
.detail .art { position: relative; background: var(--header); height: 84px; display: flex; align-items: center; justify-content: center; }
.detail .art img.item { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.detail .art .tag { position: absolute; right: 8px; bottom: 4px; font-size: 13px; }
.detail .name { text-align: center; font-size: 16px; padding: 8px 8px 2px; }
.detail .name.unique { color: var(--unique); }
.detail .rows { padding: 0 10px 10px; }
.rule { display: flex; align-items: center; gap: 8px; color: var(--group); font-size: 11px; margin: 8px 0 3px; }
.rule::before, .rule::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.lines { margin: 0; padding: 0; list-style: none; text-align: center; font-size: 13px; }
.lines li.prefix { color: var(--mod-prefix); }
.lines li.suffix { color: var(--mod-suffix); }
.lines li.arbiter { color: var(--mod-arbiter); }
.lines li.prophet { color: var(--mod-prophet); }
.lines li.chronicler, .lines li.unique { color: var(--mod-chronicler); }
.lines li.set { color: var(--set-active); }
.lines li.off { color: var(--set-inactive); }
.stars { letter-spacing: 1px; }

/* 等級ごとの絵の地（equip_tier_bg_*） */
.tier-1 { background: linear-gradient(#f0c244, #8f5a0c); }
.tier-2 { background: linear-gradient(#7c50c4, #37205e); }
.tier-3 { background: linear-gradient(#3b72bd, #19345f); }
.tier-4 { background: linear-gradient(#3f8d4f, #1b4426); }
.tier-5 { background: linear-gradient(#8d939b, #4b5056); }
.tier-unique { background: linear-gradient(#a67ee4, #55368e); }

.cards { display: grid; gap: 8px; align-items: start; }
.cards.potions { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
@media (min-width: 1100px) {
  .cards.potions { grid-template-columns: repeat(4, 1fr); }
}

/* ルーン盤（左に詳細、右に盤。ゲームのルーンの画面と同じ並び） */
.pair { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 10px; align-items: stretch; }
@media (max-width: 600px) { .pair { grid-template-columns: 1fr; } }
.rune-wrap .desc { white-space: pre-line; text-align: center; font-size: 13px; }
.board-panel { background: var(--inner); border: 1px solid var(--border); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.board-scroll { overflow-x: auto; max-width: 100%; padding: 6px; }
.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: #2f2f2f; }
.cell.locked { background: #191919; }
.rune { position: absolute; width: 60px; height: 52px; margin: -26px 0 0 -30px; cursor: pointer; }
.rune-art { position: relative; width: 60px; height: 52px; }
.rune img, .rune-art img { position: absolute; image-rendering: pixelated; }
.rune img.frame, .rune-art img.frame { left: 0; top: 0; width: 60px; height: 52px; object-fit: none; object-position: center; }
.rune img.icon, .rune-art 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; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.rune.selected { filter: drop-shadow(0 0 5px #fffee6); }
.board svg { position: absolute; left: 0; top: 0; pointer-events: none; }
.rune-list { margin: 10px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 8px; font-size: 13px; }
.rune-list li { cursor: pointer; padding: 1px 6px; border-radius: 3px; display: flex; align-items: center; gap: 6px; }
.rune-list li:hover { background: var(--hover); }
.rune-list li.selected { background: #4a4a4a; }
.rune-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--group); }
.rune-list li.c-red::before { background: var(--link-red); }
.rune-list li.c-green::before { background: var(--link-green); }
.rune-list li.c-blue::before { background: var(--link-blue); }

/* 星座 */
.constellation .art { height: auto; padding: 8px; background: var(--inner); border-bottom: 1px solid var(--border); }
.constellation .title { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 8px 0; font-size: 16px; }
.constellation .title img { width: 28px; height: 28px; }
.starmap { display: block; max-width: 100%; height: auto; }
.notable-name { text-align: center; margin-top: 8px; }

/* 装備の盤（ゲームの装備の画面と同じ並び。マスは StyleEquipment の 68px・すき間 6px、角を落とした形） */
.equip-wrap .detail .art { height: 116px; }
.equip-wrap .detail .art img.item { width: 96px; height: 96px; }
.equip-board { display: grid; grid-template-columns: repeat(3, 68px); grid-auto-rows: 68px; gap: 6px; padding: 24px 6px;
  grid-template-areas: ". helm ." "weapon body gloves" ". boots ." "ring_1 amulet ring_2"; }
.equip-slot { display: flex; align-items: center; justify-content: center; cursor: pointer;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px); }
.equip-slot img { width: 48px; height: 48px; image-rendering: pixelated; }
.equip-slot.empty { background: #2f2f2f; cursor: default; }
.equip-slot.selected, .equip-slot:not(.empty):hover { filter: brightness(1.2); }
.potion-row { display: flex; gap: 6px; padding: 0 6px 20px; }
.potion-slot { width: 40px; height: 56px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 4px; }
.potion-slot img { width: 32px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.potion-slot.empty { cursor: default; }
.potion-slot.empty img { filter: brightness(0); }
.potion-slot.selected { background: #4a4a4a; }
.potion-slot:not(.empty):hover { background: var(--hover); }

/* 星座の全体の盤（ゲームの天体の盤） */
.board-panel.top { justify-content: flex-start; }
.tree { display: block; width: 100%; max-width: 560px; height: auto; position: sticky; top: 0; }
.tree-node { cursor: pointer; }
.tree-node .ring { display: none; }
.tree-node.selected .ring { display: inline; }
.tree-node:hover { filter: brightness(1.25); }
.board-panel { position: relative; }
.back { align-self: flex-start; margin: 6px; background: none; border: none; color: var(--text); padding: 2px 8px; }
.back:hover { background: var(--hover); }
.starmap.big { width: 100%; max-width: 520px; max-height: 70vh; padding: 0 8px 12px; }
.owned-list li { display: flex; align-items: center; gap: 8px; padding: 3px 8px; border-radius: 3px; cursor: pointer; text-align: left; font-size: 14px; }
.owned-list li:hover { background: var(--hover); }
.owned-list img { width: 22px; height: 22px; }
.owned-list .count { margin-left: auto; color: var(--group); }
