/* 紙と墨と朱。配信者の机の上のノートと、その中に映るゲーム画面。 */
:root {
  --paper: #efe8d8; --paper2: #e3d9c3; --card: #f8f3e6; --ink: #1f1c17; --ink2: #5e574c; --rule: #cfc3a8;
  --shu: #c8402b; --ai: #2d4a78; --kin: #b8861f; --koke: #4c7044; --nezumi: #77716a;
  --screen: #262421; --screen2: #34302b;
  --cw: 104px;
  --f-head: 'Dela Gothic One', 'Klee One', serif;
  --f-body: 'Klee One', 'Hiragino Maru Gothic ProN', sans-serif;
  --f-num: 'DotGothic16', monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--f-body); font-weight: 600; overflow: hidden; font-synthesis: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
small { color: var(--ink2); font-weight: 400; }
i { font-style: normal; }

#app { display: flex; flex-direction: column; height: 100dvh; max-width: 1240px; margin: 0 auto; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); background: var(--paper); }

/* ---- 上の帯 ---- */
#top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 10px; background: var(--ink); color: var(--paper); }
.live { font-family: var(--f-num); background: var(--shu); color: #fff; font-size: 13px; padding: 1px 7px 0; letter-spacing: .1em; }
.live { animation: rec 2s steps(1) infinite; }
.live.off { background: var(--nezumi); animation: none; }
@keyframes rec { 85% { background: #8f2a1c; } }
.ttl { font-size: 14px; flex: 1; min-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { display: flex; gap: 12px; align-items: center; font-family: var(--f-num); font-size: 15px; }
.stats i { font-family: var(--f-body); font-size: 11px; color: #b9b0a0; margin-right: 3px; }
.stats button { background: transparent; border: 1px solid #8a8274; color: var(--paper); padding: 1px 8px; font-family: var(--f-body); font-size: 12px; }
.belong { display: flex; gap: 8px; width: 100%; align-items: center; }
.relics { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.relic, .potion { width: 28px; height: 28px; padding: 0; font-family: var(--f-head); font-size: 14px; line-height: 1; }
.relic { background: var(--paper); color: var(--ink); border: 0; }
.potion { background: transparent; border: 1px dashed #8a8274; color: var(--paper); border-radius: 50%; }
.potion:not(.empty) { background: var(--kin); border: 0; color: var(--ink); }
.potions { display: flex; gap: 4px; }

/* ---- 本体 ---- */
#main { flex: 1; display: flex; min-height: 0; position: relative; }
#stage { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; position: relative; }
#chat { width: 230px; border-left: 2px solid var(--ink); display: flex; flex-direction: column;
  background: var(--card) repeating-linear-gradient(180deg, transparent 0 23px, var(--rule) 23px 24px); }
.chathead { padding: 4px 10px; font-size: 12px; border-bottom: 2px solid var(--ink); background: var(--paper2); }
#chatlist { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 8px; font-size: 13px; line-height: 24px; }
.cm { word-break: break-all; }
.cn { color: var(--shu); margin-right: 6px; font-size: 11px; }
.c-kami { font-weight: 700; text-decoration: underline wavy var(--shu); }
.c-hurt, .c-lowhp, .c-dead { color: #7a3326; }

/* ---- 共通の画面 ---- */
.screen { padding: 18px 20px 28px; max-width: 880px; }
.screen h2 { font-family: var(--f-head); font-weight: 400; font-size: 24px; margin: 4px 0 12px; line-height: 1.35; }
.screen h3 { font-size: 16px; margin: 20px 0 8px; border-bottom: 2px solid var(--ink); display: inline-block; padding-right: 12px; }
.lead { color: var(--ink2); font-size: 14px; line-height: 1.7; font-weight: 400; }
.story { background: var(--card); border: 2px solid var(--ink); padding: 12px 14px; line-height: 1.8; font-weight: 400; }
.result { background: #fffbe9; border-left: 6px solid var(--koke); padding: 12px 14px; margin: 12px 0; line-height: 1.7; }
.tip { border-left: 6px solid var(--kin); background: #f6ecd0; padding: 8px 12px; font-size: 13px; margin: 14px 0; line-height: 1.7; font-weight: 400; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 12px 0; }
.choices.col { grid-template-columns: 1fr; max-width: 520px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.node { background: var(--card); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 3px; transition: transform .06s, box-shadow .06s; }
.node:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.node:not(:disabled):active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.node b { font-size: 16px; }
.node small { line-height: 1.55; }
.node .ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--shu); color: #fff; font-family: var(--f-head); font-size: 22px; transform: rotate(-4deg); border-radius: 3px; }
.node:has(.ic) { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 2px 12px; }
.node:has(.ic) .ic { grid-row: span 2; }
.node:has(.ic) b:last-child { grid-row: span 2; }
.node.hot { background: #f6dcd2; }
.n-battle .ic { background: var(--ink); } .n-rest .ic { background: var(--koke); } .n-shop .ic { background: var(--kin); } .n-event .ic { background: var(--nezumi); } .n-collab .ic { background: var(--ai); } .n-boss { background: #f3e1b8; }
button.main { display: block; width: 100%; max-width: 380px; margin: 22px 0 8px; padding: 13px; font-family: var(--f-head); font-size: 18px; background: var(--shu); color: #fff; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
button.main:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
button.sub { display: inline-block; margin: 10px 0; padding: 7px 16px; background: transparent; border: 0; border-bottom: 2px solid var(--ink2); color: var(--ink2); }
.danger { background: #7a2418 !important; color: #fff !important; }

/* タイトル */
.title { position: relative; }
.title .logo { margin: 14px 0 8px; position: relative; display: inline-block; padding-right: 86px; }
.logo .l1 { font-family: var(--f-head); font-size: 64px; line-height: 1; letter-spacing: -.02em; color: var(--ink); text-shadow: 4px 4px 0 var(--shu); }
.logo .l2 { font-family: var(--f-head); font-size: 26px; margin-top: 10px; }
.logo .l3 { color: var(--ink2); font-size: 15px; }
.hanko { position: absolute; top: -6px; right: 0; width: 74px; height: 74px; border: 3px solid var(--shu); border-radius: 50%; color: var(--shu); font-family: var(--f-head); font-size: 22px; line-height: 1.05; display: flex; align-items: center; justify-content: center; text-align: center; transform: rotate(12deg); opacity: .85; }
.metabox { border-top: 2px solid var(--ink); padding: 12px 0 0; font-size: 13px; line-height: 1.9; margin-top: 18px; max-width: 520px; font-weight: 400; }
.metabox b { font-family: var(--f-num); font-size: 16px; }
.next { color: var(--shu); font-size: 13px; font-weight: 600; }

/* スタイル選択 */
.styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.style { background: var(--card); border: 2px solid var(--ink); padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.style.on { box-shadow: 4px 4px 0 var(--shu); outline: 2px solid var(--shu); outline-offset: -6px; }
.style .ic { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); font-family: var(--f-head); font-size: 20px; }
.style.on .ic { background: var(--shu); }
.style small { line-height: 1.6; }
.opts { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.easy, .asc { border: 2px dashed var(--ink2); padding: 10px 12px; line-height: 1.7; }
.easy input { transform: scale(1.3); margin-right: 6px; accent-color: var(--shu); }
.asc button { background: var(--card); border: 2px solid var(--ink); padding: 0 10px; }
.asc b { font-family: var(--f-num); font-size: 18px; }

/* スケジュール表 */
.strip { display: grid; grid-template-columns: repeat(14, 1fr); border: 2px solid var(--ink); margin: 6px 0 14px; background: var(--card); }
.day { text-align: center; font-family: var(--f-head); font-size: 15px; padding: 2px 0 4px; border-right: 1px solid var(--rule); }
.day:last-child { border-right: 0; }
.day small { display: block; font-family: var(--f-num); font-size: 10px; color: var(--ink2); }
.day.done { color: var(--nezumi); background: repeating-linear-gradient(135deg, transparent 0 5px, #e2d8c2 5px 6px); }
.day.now { background: var(--shu); color: #fff; }
.day.now small { color: #fff; }
.loop { font-size: 13px; background: var(--ink); color: var(--paper); padding: 2px 8px; vertical-align: middle; font-family: var(--f-body); }

/* 報酬・ショップ */
.gain { border-left: 6px solid var(--shu); padding: 6px 12px; line-height: 1.9; font-size: 16px; }
.cardrow { display: flex; flex-wrap: wrap; gap: 12px; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cw), 1fr)); gap: 10px; justify-items: center; max-height: 62vh; overflow-y: auto; padding: 4px 6px 8px 4px; }
.item { display: flex; gap: 10px; align-items: center; background: var(--card); border: 2px solid var(--ink); padding: 8px 10px; margin: 10px 0; font-size: 14px; line-height: 1.5; font-weight: 400; }
.item span:nth-child(2) { flex: 1; }
.item button { background: var(--ink); color: var(--paper); border: 0; padding: 6px 12px; white-space: nowrap; }
.gl { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; background: var(--ink); color: var(--paper); font-family: var(--f-head); }
.bossrelics, .shoplist { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.brelic, .sitem { background: var(--card); border: 2px solid var(--ink); padding: 10px; text-align: left; display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; }
.brelic span, .sitem span { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); font-family: var(--f-head); font-size: 17px; grid-row: span 3; align-self: start; }
.brelic small, .sitem small { grid-column: 2; line-height: 1.5; }
.sitem em { grid-column: 2; font-style: normal; font-family: var(--f-num); color: var(--ink); }
.brelic:hover, .sitem:hover { box-shadow: 3px 3px 0 var(--ink); }
em.no, .price.no { color: var(--shu) !important; text-decoration: line-through; }
.sumgrid { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--ink); background: var(--card); }
.sumgrid div { padding: 8px 10px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sumgrid small { display: block; font-size: 11px; } .sumgrid b { font-family: var(--f-num); font-size: 18px; font-weight: 400; }
.subs { margin: 14px 0; font-size: 17px; line-height: 1.8; border-left: 6px solid var(--shu); padding-left: 12px; }
.unlock { border: 2px solid var(--koke); background: #e6ecd8; padding: 8px 12px; margin: 10px 0; }

/* エンディング */
.credits { height: 220px; overflow: hidden; position: relative; background: var(--screen); color: var(--paper); border: 2px solid var(--ink); }
.roll { position: absolute; width: 100%; text-align: center; animation: roll 14s linear forwards; font-family: var(--f-num); }
@keyframes roll { from { top: 220px; } to { top: -300px; } }

/* ---- カード（印刷物っぽく） ---- */
.card { position: relative; width: var(--cw); min-height: calc(var(--cw) * 1.42); background: var(--card); border: 2px solid var(--ink); border-radius: 4px; padding: 0 0 6px; font-size: 11px; line-height: 1.5; flex-shrink: 0; transition: transform .1s; cursor: pointer; user-select: none; box-shadow: 2px 2px 0 var(--ink); color: var(--ink); font-weight: 400; }
.card .cost { position: absolute; top: -9px; left: -9px; width: 25px; height: 25px; border-radius: 50%; background: var(--ink); border: 2px solid var(--card); color: var(--card); font-family: var(--f-num); font-size: 15px; display: flex; align-items: center; justify-content: center; z-index: 1; }
.card .cost.no { background: var(--nezumi); }
.cname { font-family: var(--f-head); font-size: 12px; text-align: center; line-height: 1.25; padding: 7px 4px 5px; color: #fff; background: var(--ink); border-radius: 2px 2px 0 0; }
.ctype { text-align: right; font-size: 9px; color: var(--ink2); padding: 2px 5px 3px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.ctext { padding: 0 6px; }
.ctext i { color: var(--ink2); font-size: 10px; }
.kw { font-weight: 700; background: linear-gradient(transparent 60%, #f0d48a 60%); }
.shoken { color: var(--shu); font-weight: 700; }
.plus { color: var(--koke); font-weight: 700; } .minus { color: var(--shu); font-weight: 700; }
.t-atk .cname { background: var(--shu); }
.t-skl .cname { background: var(--ai); }
.t-pow .cname { background: var(--kin); color: var(--ink); }
.t-cmt .cname { background: var(--koke); }
.t-curse { background: #ddd6c8; } .t-curse .cname { background: var(--nezumi); }
.r-rare { border-width: 3px; outline: 1px solid var(--kin); outline-offset: 1px; }
.r-rare .ctype { color: var(--kin); font-weight: 700; }
.r-collab .ctype { color: var(--ai); font-weight: 700; }
.card.pickable:hover { transform: translate(-2px, -3px); box-shadow: 4px 5px 0 var(--ink); }
.card.sold, .card.unknown { opacity: .45; display: flex; align-items: center; justify-content: center; flex-direction: column; cursor: default; box-shadow: none; border-style: dashed; }
.card.unknown .cname { background: none; color: var(--ink); }
.price { text-align: center; font-family: var(--f-num); margin-top: 6px; font-size: 14px; }

/* ---- 戦闘（ゲーム画面＝モニターの中） ---- */
.battle { min-height: 100%; display: flex; flex-direction: column; position: relative; background: var(--screen); color: var(--paper); }
.battle.bg-2 { background: #2b2421; }
.battle.bg-3 { background: #1f2426; }
.battle::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #00000022 0 1px, transparent 1px 3px); }
.field { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px; min-height: 240px; }
.player { width: 130px; flex-shrink: 0; text-align: center; cursor: pointer; }
.wipe { position: relative; width: 104px; height: 88px; margin: 0 auto 4px; background: var(--card); border: 3px solid var(--paper); outline: 2px solid var(--ink); }
.facesvg { width: 100%; height: 100%; display: block; }
.rec { position: absolute; top: 2px; left: 4px; font-size: 9px; color: var(--shu); font-family: var(--f-num); }
.pname { font-family: var(--f-head); font-size: 14px; }
.enemies { flex: 1; display: flex; justify-content: space-around; align-items: flex-end; gap: 6px; min-width: 0; }
.enemy { flex: 1; max-width: 170px; text-align: center; padding: 6px 4px; border: 2px dashed transparent; cursor: pointer; transition: transform .12s; }
.enemy.dead { visibility: hidden; }
.enemy.tgt { border-color: #efe8d888; }
.enemy.tgt:hover { border-color: var(--paper); border-style: solid; }
.enemy.acting { transform: translateY(-8px); }
.enemy.shake .eicon span { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px) rotate(-6deg); } 75% { transform: translateX(6px) rotate(3deg); } }
.eicon span { display: inline-flex; align-items: center; justify-content: center; width: 70px; height: 70px; font-family: var(--f-head); font-size: 44px; color: var(--shu); background: var(--card); border: 4px double var(--shu); transform: rotate(-3deg); }
.enemy:nth-child(2n) .eicon span { transform: rotate(4deg); }
.enemy.boss .eicon span { width: 96px; height: 96px; font-size: 64px; background: var(--shu); color: var(--card); border-color: var(--card); }
.ename { font-size: 12px; margin: 6px 0 2px; }
.intent { min-height: 40px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 3px; margin-bottom: 6px; }
.intent span { font-family: var(--f-head); font-size: 13px; padding: 1px 6px; background: var(--paper); color: var(--ink); }
.intent small { width: 100%; font-size: 10px; color: #b9b0a0; }
.i-atk { background: var(--shu) !important; color: #fff !important; font-size: 15px !important; }
.i-def { background: #c9d4e6 !important; } .i-deb { background: #d8c9e0 !important; }
.hpbar { position: relative; height: 15px; background: #4a1f18; border: 2px solid var(--paper); margin: 3px 0; }
.hpfill { height: 100%; background: var(--shu); transition: width .3s; }
.hpbar span { position: absolute; inset: 0; font-family: var(--f-num); font-size: 11px; line-height: 12px; color: #fff; }
.blk { position: absolute; left: -12px; top: -8px; background: var(--ai); color: #fff; border: 2px solid var(--paper); font-family: var(--f-num); font-size: 12px; padding: 0 4px; }
.blk::before { content: '守'; font-family: var(--f-head); font-size: 10px; margin-right: 2px; }
.sts { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 20px; margin-top: 3px; }
.st { font-size: 11px; padding: 0 4px; border: 1px solid var(--paper); color: var(--paper); }
.st.b { background: #6b2a20; border-color: #e0a090; }
.detail { position: relative; margin: 0 12px 10px; background: var(--card); color: var(--ink); border: 2px solid var(--ink); padding: 8px 12px; font-size: 13px; line-height: 1.65; z-index: 2; font-weight: 400; }
.detail b { font-weight: 700; }
.detail.tut { background: #f3dc8e; transform: rotate(-.4deg); box-shadow: 3px 3px 0 #0006; }
.kwdesc { font-size: 12px; color: var(--ink2); }
.hint { color: var(--shu); font-weight: 700; margin-top: 2px; }

/* ---- 手札 ---- */
#bottom { background: var(--paper2); border-top: 2px solid var(--ink); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); }
.hype { position: relative; height: 22px; background: var(--card); border: 2px solid var(--ink); }
.hfill { height: 100%; background: #e07a2e; transition: width .25s; }
.hype::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--ink) calc(10% - 2px) 10%); pointer-events: none; }
.hype span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 18px; font-weight: 700; z-index: 1; }
.hype.hot .hfill { background: var(--shu); }
.hype.hot span { color: #fff; text-shadow: 1px 1px 0 var(--ink); }
.hand { display: flex; justify-content: center; padding: 18px 12px 6px; min-height: calc(var(--cw) * 1.42 + 26px); }
.hand .card + .card { margin-left: min(6px, calc((100% - var(--n) * var(--cw)) / (var(--n) - 1))); }
.hand .card:hover { transform: translateY(-8px); z-index: 4; }
.hand .card.sel { transform: translateY(-16px) rotate(-2deg); z-index: 5; box-shadow: 4px 6px 0 var(--ink); outline: 3px solid var(--shu); outline-offset: 1px; }
.empty-hand { color: var(--ink2); align-self: center; }
.ctrl { display: flex; gap: 8px; align-items: center; }
.energy { display: flex; align-items: baseline; gap: 6px; background: var(--ink); color: var(--paper); padding: 2px 12px; }
.energy i { font-size: 12px; }
.energy b { font-family: var(--f-num); font-size: 24px; font-weight: 400; }
.pile { background: var(--card); border: 2px solid var(--ink); padding: 5px 10px; font-size: 13px; }
.endturn { margin-left: auto; background: var(--ai); color: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 8px 16px; font-family: var(--f-head); font-size: 15px; }
.endturn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.endturn.glow { background: var(--shu); animation: nudge 1.4s infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: rotate(-2deg); } 90% { transform: rotate(2deg); } }

/* ---- 演出 ---- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.pop { position: absolute; transform: translate(-50%, 0); font-family: var(--f-head); font-size: 26px; color: #fff; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; animation: pop .9s ease-out forwards; white-space: nowrap; }
.pop.big { font-size: 40px; color: #ffd35c; }
.pop.blk { color: #b8cdf0; font-size: 18px; }
.pop.heal { color: #b7e0a0; }
.pop.shoken { color: #ffb4a6; font-size: 17px; }
.pop.minus { color: #e8c8f0; font-size: 15px; }
@keyframes pop { 0% { opacity: 0; margin-top: 10px; } 15% { opacity: 1; margin-top: 0; } 100% { opacity: 0; margin-top: -50px; } }
.banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; font-family: var(--f-head); font-size: 36px; line-height: 1.3; color: var(--paper); background: var(--ink); padding: 12px 34px; border: 2px solid var(--paper); outline: 2px solid var(--ink); animation: banner 1.6s forwards; white-space: nowrap; }
.banner small { font-family: var(--f-body); font-size: 15px; color: #c9c0ad; }
.banner.kami { font-size: 72px; color: #fff; background: var(--shu); padding: 6px 40px 12px; --r: -5deg; box-shadow: 8px 8px 0 var(--ink); }
.banner.red { background: var(--shu); }
.banner.gold { background: var(--kin); color: var(--ink); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(var(--r, 0deg)); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(var(--r, 0deg)); } 82% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); } }
#stage.quake { animation: quake .22s; }
@keyframes quake { 25% { transform: translate(-5px, 2px); } 50% { transform: translate(5px, -2px); } 75% { transform: translate(-2px, 1px); } }
#toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 30px); background: var(--ink); color: var(--paper); padding: 9px 16px; font-size: 14px; opacity: 0; transition: .2s; z-index: 70; max-width: 92vw; pointer-events: none; line-height: 1.6; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- モーダル ---- */
#modal { position: fixed; inset: 0; background: #1f1c17a8; z-index: 60; display: none; align-items: center; justify-content: center; padding: 12px; }
#modal.show { display: flex; }
.mbox { position: relative; background: var(--paper); border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); padding: 16px 18px; width: 100%; max-width: 760px; max-height: 92dvh; overflow-y: auto; }
.mbox h3 { margin: 0 70px 12px 0; font-family: var(--f-head); font-weight: 400; }
.mclose { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--paper); border: 0; padding: 4px 10px; font-size: 12px; }
.menu { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.menu button { background: var(--card); border: 2px solid var(--ink); padding: 10px 12px; text-align: left; }
.help { line-height: 1.8; font-size: 14px; font-weight: 400; }
.help b { font-weight: 700; }
.help ol { padding-left: 1.4em; }
.relicgrid, .achlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ritem, .ach { background: var(--card); border: 2px solid var(--ink); padding: 8px 10px; display: flex; flex-direction: column; font-size: 13px; }
.ritem span { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--paper); font-family: var(--f-head); margin-bottom: 4px; }
.ritem.unknown, .ach:not(.got) { opacity: .5; border-style: dashed; }

/* 極太書体は大きい文字だけ。小さい文字は教科書体の太字で */
.cname, .pname, .endturn, .intent span, .relic, .potion, .gl, .day, .blk::before, .style .ic, .ritem span, .brelic span, .sitem span, .mbox h3 { font-family: var(--f-body); font-weight: 600; }
.cname { font-size: 12.5px; letter-spacing: .02em; }
.endturn { font-size: 16px; }
.intent span { font-size: 13px; }

/* ---- スマホ ---- */
@media (max-width: 760px) {
  :root { --cw: 84px; }
  #app { border: 0; }
  #top { padding: 4px 8px; gap: 3px 8px; }
  .ttl { font-size: 12px; order: 5; flex-basis: 100%; }
  .stats { font-size: 14px; gap: 8px; margin-left: auto; }
  .relic, .potion { width: 24px; height: 24px; font-size: 12px; }
  #chat { position: absolute; top: 6px; right: 6px; width: 48%; max-width: 230px; height: 98px; z-index: 3; pointer-events: none; border: 2px solid var(--ink); opacity: .93; }
  body:not([data-screen="battle"]) #chat { display: none; }
  .chathead { display: none; }
  #chatlist { font-size: 11px; line-height: 19px; padding: 0 6px; overflow: hidden; background: repeating-linear-gradient(180deg, transparent 0 18px, var(--rule) 18px 19px); }
  .cn { font-size: 9px; }
  .screen { padding: 14px 14px 24px; }
  .screen h2 { font-size: 19px; }
  .logo .l1 { font-size: 46px; }
  .hanko { left: auto; right: 4px; top: -4px; width: 62px; height: 62px; font-size: 18px; }
  .field { padding: 110px 6px 8px; gap: 4px; min-height: 0; align-items: flex-end; }
  .player { width: 84px; }
  .wipe { width: 80px; height: 68px; }
  .eicon span { width: 50px; height: 50px; font-size: 30px; border-width: 3px; }
  .enemy.boss .eicon span { width: 70px; height: 70px; font-size: 46px; }
  .ename { font-size: 10px; }
  .intent span { font-size: 11px; padding: 0 4px; }
  .i-atk { font-size: 13px !important; }
  .intent small { font-size: 9px; }
  .card { font-size: 10px; }
  .cname { font-size: 11px; padding: 6px 2px 4px; }
  .hand { padding: 16px 8px 4px; }
  .detail { font-size: 12px; margin: 0 6px 8px; }
  .sumgrid { grid-template-columns: repeat(2, 1fr); }
  .banner { font-size: 26px; padding: 10px 20px; }
  .banner.kami { font-size: 52px; }
  .pile { padding: 5px 7px; font-size: 12px; }
  .endturn { padding: 8px 12px; font-size: 14px; }
  .day { font-size: 11px; }
}
