:root {
  --bg: #17141f; --panel: #221d2e; --panel2: #2c2639; --line: #443b58; --text: #ece8f4; --muted: #a9a0bd;
  --accent: #b79cff; --accent2: #6d4fd1; --demon: #c86b8a; --gold: #ffd76a;
  --rowH: 48px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans JP", system-ui, sans-serif; font-size: 15px; }
body { padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom); max-width: 900px; margin: 0 auto; }
header h1 { font-size: 18px; margin: 12px 0 8px; }
header small { color: var(--muted); font-weight: normal; font-size: 12px; }
a { color: var(--accent); }
.pick { background: var(--panel); border-radius: 8px; padding: 10px; }
.pickRow { margin-bottom: 8px; }
.lbl { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
button { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font: inherit; cursor: pointer; min-height: 40px; }
button.on { background: var(--accent2); border-color: var(--accent); }
.mute { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.mute input { width: 22px; height: 22px; }

/* 通常：左にクラス、右にデモンのカード */
#lists { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
#lists h2 { font-size: 14px; margin: 0 0 6px; }
/* カード名の一覧。クラスデッキは常に光らせ、デモンデッキは契約済みにしたものだけ光らせる */
.names { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.nameItem { min-height: 40px; display: flex; align-items: center; padding: 6px 10px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.3; word-break: break-all; }
.nameItem.inDeck { background: #2f2a48; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.demonItem { cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; color: var(--muted); }
.demonItem.pacted { color: var(--text); background: #3a2232; border-color: var(--demon); box-shadow: 0 0 0 1px var(--demon) inset; }
.demonItem.pacted::before { content: "契"; font-size: 11px; background: var(--demon); color: #fff; border-radius: 3px; padding: 0 3px; margin-right: 6px; flex: none; }
#lists .hint { margin-top: 6px; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }

/* ミュトモード：山札の8枚の一覧 */
#muteView { margin-top: 10px; background: var(--panel); border-radius: 8px; padding: 10px; }
#muteView h2 { font-size: 15px; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 6px; }
.tbl { width: 100%; }
/* 列の幅は文字の大きさによらず揃える（見出しと行で em が違うので px。名前の列は長い名前で広がらないよう minmax(0, 1fr)） */
.thead, .row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 64px 56px; align-items: center; gap: 4px; }
.thead { color: var(--muted); font-size: 11px; padding: 0 8px 4px; white-space: nowrap; border: 1px solid transparent; border-top: 0; border-bottom: 0; }
.thead span:not(:first-child), .row span:not(:first-child) { text-align: center; }
.row { height: var(--rowH); margin-bottom: 4px; padding: 0 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; cursor: pointer; }
.row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .num { font-size: 18px; font-weight: bold; border-radius: 4px; line-height: 30px; }
/* ミュトのカードが参照する数字：意識条件1以下は弱く（いんじぇくとぅーまで宣言できない）、意識コスト1（りすこれぷしー）と防御力2以上（はるしねらりあ）は強調 */
.row .num.weak { opacity: .35; font-weight: normal; }
.row .num.hot { color: #1b1426; background: var(--gold); justify-self: center; min-width: 36px; padding: 0 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.legend .num { display: inline-block; min-width: 22px; text-align: center; font-weight: bold; border-radius: 4px; padding: 0 4px; }
.legend .num.hot { color: #1b1426; background: var(--gold); }
.legend .num.weak { opacity: .35; font-weight: normal; }
.row.gone { opacity: .35; filter: grayscale(1); }
.row.gone .nm { text-decoration: line-through; }
.row.pacted { border-color: var(--demon); }
.row.pacted .nm::before { content: "契"; font-size: 11px; background: var(--demon); color: #fff; border-radius: 3px; padding: 0 3px; margin-right: 4px; }
.row.pressing { outline: 2px solid var(--accent); }
.row.taken { opacity: .35; cursor: default; }
.row.blank { visibility: hidden; }
.row.act { justify-content: center; display: flex; }
.row.act button { width: 100%; height: 100%; min-height: 0; }
.row.act.split { display: flex; gap: 4px; padding: 0; background: none; border: 0; }
.row.act.split button { flex: 1; font-size: 13px; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; font-size: 13px; }
.stats b { font-size: 16px; }
.tools { display: flex; gap: 6px; margin-top: 6px; }
.demonHead { color: var(--demon); }

footer { color: var(--muted); font-size: 11px; margin: 16px 0 12px; line-height: 1.6; }
footer p { margin: 0 0 6px; }
footer a { word-break: break-all; }
