:root {
  --bg: #13201a; --felt: #1d3a2b; --felt2: #183224; --panel: #101814; --line: #2e4a3a;
  --text: #e8efe9; --muted: #9fb3a6; --accent: #f2c14e; --p0: #5ab0ff; --p1: #ff7a6b;
  --cand: #4dff9a; --sel: #f2c14e; --danger: #ff5d5d;
  /* カードの大きさは画面の高さに合わせて決める（1プレイヤー分 = 情報欄 + 戦場 + 領地 + 手札 が画面の半分に収まるように） */
  --ch: clamp(40px, calc((50vh - 84px) / 2.95), 112px); --cw: calc(var(--ch) * .716);
  --hh: calc(var(--ch) * 1.05); --hw: calc(var(--hh) * .716);
  --lh: calc(var(--ch) * .82); --lw: calc(var(--lh) * .716);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif; font-size: 13px; }
button { background: #2a4033; color: var(--text); border: 1px solid #456b55; border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; }
button:hover { background: #355241; }
button.primary { background: #b88a1e; border-color: #e0b44a; color: #111; font-weight: bold; }
button.primary:hover { background: #d4a32a; }
button.danger { background: #6b2a2a; border-color: #a44; }
button:disabled { opacity: .45; cursor: default; }
select, input[type=text], input:not([type]) , textarea { background: #0d1611; color: var(--text); border: 1px solid #3d5c4a; border-radius: 5px; padding: 4px 6px; font: inherit; }
.hidden { display: none !important; }
.screen { height: 100vh; }

/* ===== メニュー ===== */
#menu { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, #24452f, #0f1a14); }
.menu-box { background: rgba(10, 20, 15, .85); border: 1px solid var(--line); border-radius: 14px; padding: 28px 34px; width: min(620px, 94vw); }
.menu-box h1 { margin: 0 0 18px; font-size: 26px; text-align: center; color: var(--accent); }
.menu-box h1 small { font-size: 14px; color: var(--muted); }
.menu-grid { display: grid; grid-template-columns: 170px 1fr; gap: 10px 14px; align-items: center; }
.radios { display: flex; flex-direction: column; gap: 4px; }
.menu-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.menu-buttons button { padding: 9px 22px; font-size: 15px; }
.help { margin-top: 16px; color: var(--muted); }
.help li { margin: 4px 0; }

/* ===== 対戦画面 ===== */
#game { display: grid; grid-template-columns: 290px 1fr 330px; }
#board { position: relative; background: radial-gradient(ellipse at 50% 110%, #2a5a3e, #12261a 70%); overflow: hidden; min-width: 0; perspective: 1300px; perspective-origin: 50% 20%; }
#plane { display: grid; grid-template-rows: 1fr auto 1fr; height: 100%; background: linear-gradient(var(--felt2), var(--felt) 50%, var(--felt2)); transform-origin: 50% 100%; transition: transform .4s; box-shadow: 0 0 40px rgba(0,0,0,.6) inset; }
#game.tilt #plane { height: 104%; margin-top: -4%; transform: rotateX(18deg); }
#detail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#detail .dhead { padding: 6px 10px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 12px; }
#detail #preview { flex: 1; flex-direction: column; max-height: none; border-bottom: none; padding: 10px; }
#detail #preview img { width: 100%; max-width: 270px; align-self: center; border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.6); }
#detail #preview .ptext { font-size: 13px; }
#detail #preview .ptext .nm { font-size: 16px; }
#detail .pempty { color: var(--muted); padding: 10px; }
.side { display: flex; flex-direction: column; padding: 2px 6px; gap: 2px; min-height: 0; overflow: hidden; }
.side > * { flex-shrink: 0; }
.side.top { justify-content: flex-start; }
.side.bottom { justify-content: flex-end; }
.pinfo { display: flex; align-items: center; gap: 10px; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .3); border: 2px solid transparent; flex-wrap: nowrap; white-space: nowrap; overflow: hidden; min-height: 30px; }
.pinfo .pname { font-weight: bold; font-size: 15px; }
.side[data-pidx="0"] .pname { color: var(--p0); }
.side[data-pidx="1"] .pname { color: var(--p1); }
.pinfo .life { font-size: 20px; font-weight: bold; color: #fff; min-width: 54px; }
.pinfo .life::before { content: "♥ "; color: var(--danger); font-size: 16px; }
.pinfo .zc { color: var(--muted); }
.pinfo .zc b { color: var(--text); }
.pinfo button { padding: 2px 7px; font-size: 12px; }
.pinfo.active-turn { border-color: var(--accent); }
.pinfo.cand { border-color: var(--cand); box-shadow: 0 0 10px var(--cand); cursor: pointer; }
.pinfo.sel { border-color: var(--sel); box-shadow: 0 0 10px var(--sel); }
.pinfo .prio { color: var(--accent); font-weight: bold; }
.row { display: flex; align-items: center; gap: 5px; min-height: calc(var(--ch) + 4px); padding: 1px 4px; border-radius: 8px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.row::-webkit-scrollbar { height: 6px; } .row::-webkit-scrollbar-thumb { background: #3b5c48; border-radius: 3px; }
.row.field { background: rgba(0, 0, 0, .12); min-height: calc(var(--ch) + 10px); }
.row.land { min-height: calc(var(--lh) + 4px); }
.row.land .slot, .row.land .card { width: var(--lw); height: var(--lh); }
.row.land .slot.moved { width: var(--lh); }
.row.land { background: rgba(80, 60, 20, .14); }
.row.hand { min-height: calc(var(--hh) + 4px); }
.row .rlabel { writing-mode: vertical-rl; color: var(--muted); font-size: 11px; opacity: .7; flex: none; }
.slot { flex: none; width: var(--cw); height: var(--ch); position: relative; display: flex; align-items: center; justify-content: center; transition: width .15s; }
.slot.moved { width: var(--ch); }
.row.hand .slot { width: var(--hw); height: var(--hh); }

.card { width: var(--cw); height: var(--ch); border-radius: 5px; position: relative; background: #222; box-shadow: 0 1px 3px rgba(0, 0, 0, .6); transition: transform .15s, box-shadow .15s; cursor: default; overflow: visible; flex: none; }
.row.hand .card { width: var(--hw); height: var(--hh); }
.card img { width: 100%; height: 100%; border-radius: 5px; display: block; pointer-events: none; }
.slot.moved .card { transform: rotate(90deg); }
.card.night .face { display: none; }
.card .back, .card.night::after { position: absolute; inset: 0; border-radius: 5px; }
.card .back { background: repeating-linear-gradient(45deg, #2b2357, #2b2357 6px, #352b6e 6px, #352b6e 12px); border: 2px solid #8a7ad8; display: flex; align-items: center; justify-content: center; color: #c9c0ff; font-weight: bold; font-size: 11px; }
.card.night::after { content: "夜"; background: radial-gradient(circle at 30% 30%, #47457a, #15142e); border: 2px solid #8b87d6; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #ffe9a3; text-shadow: 0 0 6px #ffcf4a; }
.card.sick { filter: saturate(.75); }
.card.sick::before { content: "待機"; position: absolute; top: -6px; left: -4px; background: #555; color: #fff; font-size: 9px; padding: 0 3px; border-radius: 3px; z-index: 3; }
.card.cand { box-shadow: 0 0 0 3px var(--cand), 0 0 12px var(--cand); cursor: pointer; }
.card.playable { box-shadow: 0 0 0 2px var(--accent), 0 0 12px var(--accent); cursor: pointer; }
.row.hand .card.playable:hover { transform: translateY(-8px); }
.card.sel { box-shadow: 0 0 0 4px var(--sel), 0 0 14px var(--sel); }
.card.attacking { box-shadow: 0 0 0 3px #ff5d5d, 0 0 14px #ff5d5d; }
.card.blocking { box-shadow: 0 0 0 3px #5ab0ff, 0 0 14px #5ab0ff; }
.card .pt { position: absolute; bottom: -4px; right: -4px; background: rgba(0, 0, 0, .85); border: 1px solid #777; border-radius: 4px; padding: 0 3px; font-weight: bold; font-size: 12px; z-index: 2; }
.card .pt .up { color: #6f6; } .card .pt .down { color: #f77; }
.card .dmg { position: absolute; top: 16px; right: -6px; background: var(--danger); color: #fff; border-radius: 10px; padding: 0 5px; font-weight: bold; font-size: 12px; z-index: 2; }
.card .ctrs { position: absolute; left: -4px; bottom: 12px; display: flex; flex-direction: column; gap: 1px; z-index: 2; }
.card .ctrs span { background: #6b4fd8; color: #fff; font-size: 9px; padding: 0 3px; border-radius: 3px; white-space: nowrap; }
.card .eqb { position: absolute; top: -6px; right: -4px; background: #b88a1e; color: #111; font-size: 9px; padding: 0 3px; border-radius: 3px; z-index: 3; }
.card .kwb { position: absolute; top: 2px; left: 2px; right: 2px; display: flex; flex-wrap: wrap; gap: 1px; z-index: 2; }
.card .kwb span { background: rgba(20, 60, 40, .9); color: #bfffd8; font-size: 9px; padding: 0 2px; border-radius: 2px; }
.token-face { width: 100%; height: 100%; border-radius: 5px; background: linear-gradient(#3e5b49, #22382b); border: 2px dashed #9bd3ae; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-size: 10px; padding: 3px; }
.token-face b { font-size: 11px; }

#midbar { display: flex; align-items: center; gap: 10px; padding: 3px 10px; background: rgba(0, 0, 0, .45); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); flex-wrap: nowrap; white-space: nowrap; overflow: hidden; min-height: 30px; }
#midbar .combat { overflow: hidden; text-overflow: ellipsis; }
#midbar .turn { font-weight: bold; color: var(--accent); }
#midbar .ph { color: var(--muted); padding: 1px 6px; border-radius: 4px; }
#midbar .ph.on { color: #111; background: var(--accent); font-weight: bold; }
#midbar .combat { color: #ff9b8e; font-weight: bold; }

/* ===== 右パネル ===== */
#panel { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#topbar { display: flex; gap: 8px; align-items: center; padding: 6px; border-bottom: 1px solid var(--line); flex-wrap: wrap; font-size: 12px; }
#prompt { padding: 8px; border-bottom: 1px solid var(--line); background: #1a2a20; min-height: 70px; }
#prompt .who { font-weight: bold; margin-bottom: 4px; }
#prompt .who.p0 { color: var(--p0); } #prompt .who.p1 { color: var(--p1); }
#prompt .ptitle { white-space: pre-wrap; margin-bottom: 6px; line-height: 1.45; }
#prompt .hint { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
#prompt .btns { display: flex; gap: 6px; flex-wrap: wrap; }
#prompt .effect-text { background: #0d1611; border: 1px solid #3d5c4a; border-radius: 6px; padding: 6px; white-space: pre-wrap; margin-bottom: 6px; max-height: 160px; overflow: auto; font-size: 12px; }
#prompt.waiting { color: var(--muted); }
#preview { padding: 8px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; min-height: 120px; max-height: 300px; overflow: auto; }
#preview img { width: 120px; border-radius: 6px; flex: none; align-self: flex-start; }
#preview .ptext { font-size: 12px; white-space: pre-wrap; line-height: 1.45; }
#preview .ptext .nm { font-weight: bold; font-size: 14px; color: var(--accent); }
#preview .ptext .meta { color: var(--muted); }
#pile { padding: 6px 8px; border-bottom: 1px solid var(--line); max-height: 150px; overflow: auto; }
#pile .ph { color: var(--muted); font-size: 12px; }
#pile .item { padding: 3px 6px; margin: 3px 0; border-radius: 5px; background: #24362b; border-left: 4px solid #888; cursor: default; }
#pile .item.c0 { border-left-color: var(--p0); } #pile .item.c1 { border-left-color: var(--p1); }
#pile .item.cand { outline: 2px solid var(--cand); cursor: pointer; }
#pile .item.sel { outline: 2px solid var(--sel); }
#log { flex: 1; overflow: auto; padding: 6px 8px; font-size: 12px; line-height: 1.5; min-height: 80px; }
#log .l { border-bottom: 1px dotted #22342a; }
#log .turn { color: var(--accent); font-weight: bold; margin-top: 6px; }
#log .phase { color: #7f9a8a; }
#log .dmg { color: #ff9b8e; } #log .destroy { color: #ff7a7a; } #log .heal { color: #8f8; }
#log .play { color: #cfe6ff; } #log .combat { color: #ffc2a8; } #log .warn { color: #ffd36b; }
#log .win { color: var(--accent); font-weight: bold; font-size: 15px; } #log .manual { color: #c9b6ff; } #log .counter { color: #9be7ff; }

/* ===== モーダル ===== */
#modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.mbox { background: #14211a; border: 1px solid #456b55; border-radius: 12px; padding: 14px; width: min(980px, 96vw); max-height: 92vh; display: flex; flex-direction: column; gap: 8px; }
.mbox h3 { margin: 0; color: var(--accent); white-space: pre-wrap; }
.mgrid { display: flex; flex-wrap: wrap; gap: 8px; overflow: auto; padding: 6px; min-height: 120px; }
.mgrid .mc { width: 108px; position: relative; cursor: pointer; border-radius: 6px; }
.mgrid .mc img { width: 108px; border-radius: 6px; display: block; }
.mgrid .mc .cap { font-size: 11px; text-align: center; color: var(--muted); }
.mgrid .mc.sel { box-shadow: 0 0 0 4px var(--sel), 0 0 14px var(--sel); }
.mgrid .mc .ord { position: absolute; top: 4px; left: 4px; background: var(--accent); color: #111; font-weight: bold; border-radius: 50%; width: 22px; height: 22px; text-align: center; line-height: 22px; }
.mbtns { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.mbtns .info { margin-right: auto; color: var(--muted); }
.mform { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; }
textarea { width: 100%; min-height: 300px; font-family: monospace; }

#ctxmenu { position: fixed; z-index: 60; background: #16241c; border: 1px solid #4b7560; border-radius: 8px; padding: 4px; min-width: 190px; box-shadow: 0 6px 18px rgba(0, 0, 0, .6); max-height: 80vh; overflow: auto; }
#ctxmenu .mh { color: var(--accent); font-weight: bold; padding: 4px 8px; border-bottom: 1px solid #2e4a3a; margin-bottom: 3px; }
#ctxmenu .mi { padding: 4px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
#ctxmenu .mi:hover { background: #2c4a39; }
#ctxmenu .sep { border-top: 1px solid #2e4a3a; margin: 3px 0; }
#ctxmenu .mi.rule { color: var(--accent); font-weight: bold; }

#toast { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); background: rgba(0, 0, 0, .88); color: #fff; padding: 14px 26px; border-radius: 10px; font-size: 18px; z-index: 70; border: 1px solid var(--accent); pointer-events: none; }

/* ===== デッキ構築 ===== */
#builder { display: grid; grid-template-columns: 1fr 380px; }
.b-left { display: flex; flex-direction: column; min-height: 0; }
.b-filter { display: flex; gap: 8px; padding: 8px; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); background: var(--panel); }
.b-filter #f-text { width: 220px; }
.f-colors label { margin-right: 4px; }
#f-count { color: var(--muted); }
#b-grid { flex: 1; overflow: auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; align-content: flex-start; background: var(--felt2); }
#b-grid .bc { width: 100px; position: relative; cursor: pointer; }
#b-grid .bc img { width: 100px; border-radius: 6px; display: block; }
#b-grid .bc .n { position: absolute; top: 4px; right: 4px; background: var(--accent); color: #111; font-weight: bold; border-radius: 10px; padding: 0 6px; }
#b-grid .bc .auto { position: absolute; bottom: 4px; left: 4px; background: #2d8a55; color: #fff; font-size: 10px; border-radius: 3px; padding: 0 3px; }
.b-right { background: var(--panel); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: 8px; min-height: 0; }
.b-head { display: flex; gap: 6px; }
.b-head select { flex: 1; }
.b-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.b-actions button { padding: 4px 7px; font-size: 12px; }
#b-errors { color: #ffb36b; font-size: 12px; }
#b-list { flex: 1; overflow: auto; font-size: 12px; }
#b-list h4 { margin: 8px 0 3px; color: var(--accent); }
#b-list .dl { display: flex; align-items: center; gap: 4px; padding: 1px 2px; border-radius: 3px; }
#b-list .dl:hover { background: #233629; }
#b-list .dl .cnt { width: 22px; text-align: right; font-weight: bold; }
#b-list .dl .nm { flex: 1; cursor: default; }
#b-list .dl .cs { color: var(--muted); font-size: 11px; }
#b-list .dl button { padding: 0 6px; font-size: 11px; }
#b-preview { display: flex; gap: 6px; max-height: 220px; overflow: auto; border-top: 1px solid var(--line); padding-top: 6px; }
#b-preview img { width: 110px; border-radius: 6px; flex: none; align-self: flex-start; }
#b-preview .ptext { font-size: 11px; white-space: pre-wrap; }

@media (max-width: 1100px) {
  #game { grid-template-columns: 220px 1fr 270px; }
  .pinfo { gap: 6px; font-size: 12px; }
}

/* ===== 演出 ===== */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
#fx-arrows { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 35; }
.fx-arrow { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 8; animation: fx-dash .6s linear infinite; filter: drop-shadow(0 0 4px rgba(0,0,0,.8)); }
.fx-arrow.red { stroke: #ff5d5d; } .fx-arrow.blue { stroke: #5ab0ff; } .fx-arrow.gold { stroke: #f2c14e; }
@keyframes fx-dash { to { stroke-dashoffset: -18; } }
.fx-ghost { position: fixed; border-radius: 6px; will-change: transform, opacity; box-shadow: 0 8px 22px rgba(0,0,0,.6); }
.fx-ghost img, .fx-ghost .back, .fx-ghost .token-face { width: 100%; height: 100%; border-radius: 6px; display: block; }
.fx-ghost .back { position: static; background: repeating-linear-gradient(45deg, #2b2357, #2b2357 6px, #352b6e 6px, #352b6e 12px); border: 2px solid #8a7ad8; display: flex; align-items: center; justify-content: center; color: #c9c0ff; font-weight: bold; font-size: 11px; }
.fx-ghost.cast { box-shadow: 0 0 0 3px #f2c14e, 0 0 40px rgba(242,193,78,.8), 0 20px 50px rgba(0,0,0,.8); border-radius: 10px; z-index: 2; }
.fx-ghost.cast img { border-radius: 10px; }
.fx-ghost.slam { box-shadow: 0 0 24px rgba(255,255,255,.7); }
.fx-castlabel { position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%); white-space: nowrap; background: rgba(0,0,0,.85); padding: 3px 12px; border-radius: 12px; font-weight: bold; font-size: 14px; border: 1px solid #f2c14e; }
.fx-castlabel.p0 { color: var(--p0); } .fx-castlabel.p1 { color: var(--p1); }
.fx-float { position: fixed; font-weight: 900; font-size: 26px; pointer-events: none; text-shadow: 0 0 6px #000, 0 2px 0 #000; white-space: nowrap; }
.fx-float.dmg { color: #ff4d4d; } .fx-float.heal { color: #6dff95; } .fx-float.big { font-size: 34px; }
.fx-float.buff { color: #7dffa8; font-size: 18px; } .fx-float.debuff { color: #ff9b8e; font-size: 18px; }
.fx-ring { position: fixed; width: 90px; height: 90px; border-radius: 50%; border: 4px solid #fff; pointer-events: none; }
.fx-ring.gold { border-color: #f2c14e; box-shadow: 0 0 20px #f2c14e; } .fx-ring.red { border-color: #ff5d3b; box-shadow: 0 0 20px #ff5d3b; }
.fx-ring.blue { border-color: #5ab0ff; box-shadow: 0 0 20px #5ab0ff; } .fx-ring.purple { border-color: #a98bff; width: 60px; height: 60px; }
.fx-ring.white { border-color: #fff; box-shadow: 0 0 16px #fff; }
.fx-spark { position: fixed; width: 7px; height: 7px; border-radius: 50%; pointer-events: none; box-shadow: 0 0 8px currentColor; }
.fx-beam { position: fixed; height: 6px; margin-top: -3px; transform-origin: 0 50%; border-radius: 3px; background: linear-gradient(90deg, rgba(255,240,170,0), #ffe27a 40%, #fff 60%, rgba(255,240,170,0)); box-shadow: 0 0 14px #ffd34a; }
.fx-banner { position: fixed; min-width: 420px; padding: 14px 60px; text-align: center; background: linear-gradient(90deg, transparent, rgba(0,0,0,.85) 15%, rgba(0,0,0,.85) 85%, transparent); border-top: 2px solid; border-bottom: 2px solid; }
.fx-banner.p0 { border-color: var(--p0); } .fx-banner.p1 { border-color: var(--p1); }
.fx-banner .bm { font-size: 34px; font-weight: 900; letter-spacing: 6px; }
.fx-banner.p0 .bm { color: var(--p0); text-shadow: 0 0 18px var(--p0); } .fx-banner.p1 .bm { color: var(--p1); text-shadow: 0 0 18px var(--p1); }
.fx-banner .bs { color: #f2c14e; letter-spacing: 4px; font-weight: bold; }
.fx-phase { position: fixed; padding: 4px 28px; background: rgba(242,193,78,.95); color: #111; font-weight: 900; font-size: 16px; border-radius: 4px; letter-spacing: 3px; box-shadow: 0 0 18px rgba(242,193,78,.7); }
.fx-stamp { position: fixed; font-size: 40px; font-weight: 900; color: #9be7ff; border: 4px solid #9be7ff; padding: 2px 16px; border-radius: 8px; text-shadow: 0 0 10px #4cc3ff; background: rgba(0,0,0,.6); }
.fx-end { position: fixed; font-size: 84px; font-weight: 900; letter-spacing: 8px; white-space: nowrap; }
.fx-end.win { color: #f2c14e; text-shadow: 0 0 30px #f2c14e, 0 4px 0 #6b4a00; }
.fx-end.lose { color: #9aa7b8; text-shadow: 0 0 30px #3a4a66, 0 4px 0 #111; }
.fx-end.draw { color: #ddd; text-shadow: 0 0 20px #888; }

.row.hand .card { transition: transform .15s; }
.row.hand .slot:hover { z-index: 6; }
.row.hand .card:hover { transform: translateY(-10px) scale(1.18); z-index: 6; }
#midbar .ph.on { animation: fx-pulse 1.4s ease-in-out infinite; }
@keyframes fx-pulse { 50% { box-shadow: 0 0 12px var(--accent); } }
.pinfo.active-turn { box-shadow: 0 0 14px rgba(242,193,78,.45); }

/* ===== 能力の自動/手動表示・選択肢 ===== */
#preview .ab { margin-top: 6px; padding: 4px 6px; border-radius: 5px; background: rgba(255,255,255,.04); border-left: 3px solid #666; white-space: pre-wrap; }
#preview .ab.auto { border-left-color: #3ccf7a; }
#preview .ab.man { border-left-color: #f0b43c; }
#preview .abtag { display: inline-block; font-size: 10px; font-weight: bold; padding: 0 4px; border-radius: 3px; margin-right: 5px; color: #111; }
#preview .ab.auto .abtag { background: #3ccf7a; } #preview .ab.man .abtag { background: #f0b43c; }
#preview .kwline { margin-top: 6px; color: #bfffd8; }
#prompt .modes { flex-direction: column; align-items: stretch; }
#prompt .mode-btn { text-align: left; white-space: normal; line-height: 1.4; }
#b-grid .bc .auto.part { background: #a07a1e; }
@media (max-width: 1250px) { #game { grid-template-columns: 200px 1fr 260px; } }
@media (max-width: 950px) { #game { grid-template-columns: 150px 1fr 220px; } #detail #preview .ptext { font-size: 11px; } #topbar { font-size: 11px; } }
