/* めざせ！モンマス！！！ 見た目（パステルでかわいく） */
:root {
  --bg1: #fff4e6; --bg2: #e8f4ff; --ink: #3b2a3a; --sub: #8a7a8a; --pink: #ff6a9a; --pink2: #ffd0e0;
  --panel: #fffdf9; --line: #f0dccc; --gold: #ffcf3f; --green: #5cc85a; --red: #ff5a5a; --blue: #4aa8ff;
  --fire: #ff7a4a; --water: #4aa8ff; --grass: #5cc85a; --light: #e8b820; --dark: #8a5ac8; --none: #9a9aa4;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--ink); background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed; font-size: 15px;
}
button { font: inherit; color: inherit; cursor: pointer; border: 2px solid #e6c9b8; background: #fff; border-radius: 12px; padding: 6px 12px; transition: transform .08s, box-shadow .1s; }
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 0 #f0d5c5; }
button:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
button:disabled { opacity: .45; cursor: default; }
button.big { font-size: 18px; font-weight: bold; padding: 12px 28px; background: linear-gradient(#ff8ab0, #ff5a8a); color: #fff; border: none; box-shadow: 0 4px 0 #d03a6a; }
button.big.on { background: linear-gradient(#7adf7a, #3ab84a); box-shadow: 0 4px 0 #2a8a3a; }
button.ghost { background: transparent; border-style: dashed; }
button.link { border: none; background: none; color: var(--pink); text-decoration: underline; }
button.icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; }
input { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid #e6c9b8; background: #fff; }
h2 { margin: 4px 0 10px; font-size: 21px; } h2 small, h3 small { font-weight: normal; color: var(--sub); font-size: 13px; margin-left: 8px; }
h3 { margin: 14px 0 8px; font-size: 16px; }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 14px 16px; box-shadow: 0 4px 0 rgba(200,160,140,.18); margin-bottom: 12px; }
.center { text-align: center; }
.note { color: var(--sub); font-size: 13.5px; line-height: 1.6; }
.warn { color: #d04a3a; font-weight: bold; }
.good { color: #2a9a3a; font-weight: bold; }
.msg { color: #d04a3a; min-height: 1.2em; }
.big-text { font-size: 20px; font-weight: bold; }
.screen { display: none; min-height: 100vh; }
.screen.show { display: block; }

/* ---- タイトル */
#title.show { display: flex; align-items: center; justify-content: center; padding: 16px; }
.title-box { text-align: center; background: var(--panel); border-radius: 28px; padding: 26px 28px; border: 3px solid var(--line); box-shadow: 0 8px 0 rgba(200,160,140,.25); max-width: 520px; width: 100%; }
.logo { margin: 0; font-size: 46px; letter-spacing: 2px; line-height: 1.1; }
.logo span { color: #ff8a3a; font-size: .62em; } .logo b { color: var(--pink); text-shadow: 3px 3px 0 #ffe066, 5px 5px 0 #ffb0c8; }
.sub { color: var(--sub); }
.title-mons { display: flex; justify-content: center; gap: 2px; margin: 6px 0 10px; }
.field { display: block; margin: 8px 0; }
.field input { display: block; margin: 6px auto 0; width: 220px; text-align: center; }
.join-row { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.join-row input { width: 140px; text-align: center; text-transform: uppercase; }

/* ---- ロビー */
#lobby.show { display: flex; gap: 14px; justify-content: center; align-items: flex-start; padding: 24px 16px; flex-wrap: wrap; }
.lobby-box { width: 460px; max-width: 100%; text-align: center; }
.lobby-top { margin: 6px 0 8px; padding-bottom: 8px; border-bottom: 2px dashed #f0dcc8; }
.lobby-top .msg:empty { display: none; }
.ban-btn { display: block; width: 100%; margin: 8px 0 6px; padding: 10px 14px; font-size: 16px; font-weight: 900; border-radius: 14px; }
.lobby-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 6px; margin-top: 4px; }
.starter-pick { margin-top: 8px; padding-top: 6px; border-top: 2px dashed #f0dcc8; }
.room-code b { font-size: 34px; letter-spacing: 6px; color: var(--pink); margin-left: 6px; }
.invite { display: flex; gap: 6px; margin: 10px 0; } .invite input { flex: 1; min-width: 0; font-size: 12px; }
.lobby-players { list-style: none; padding: 0; margin: 12px 0; text-align: left; }
.lobby-players li { padding: 8px 12px; border-radius: 12px; background: #fff6ee; margin: 5px 0; font-weight: bold; display: flex; align-items: center; gap: 8px; }
.lobby-players li i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; background: #ccc; }
.lobby-players li.cpu { color: var(--sub); font-weight: normal; background: #f6f6f6; }
.chat-box { width: 300px; max-width: 100%; }
.chat-log { height: 260px; overflow-y: auto; font-size: 13px; }
.chat-form { display: flex; gap: 4px; margin-top: 6px; } .chat-form input { flex: 1; min-width: 0; padding: 5px 8px; } .chat-form button { padding: 4px 10px; }

/* ---- ゲーム */
header.top { display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: #fff; border-bottom: 3px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.week { font-weight: bold; font-size: 18px; color: var(--pink); }
.acts { letter-spacing: 2px; color: #ff8a3a; font-weight: bold; }
.money b, .wins b { font-size: 17px; }
.spacer { flex: 1; }
#volume { width: 90px; padding: 0; }
.master-vol { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; cursor: pointer; }
.layout { display: flex; gap: 14px; padding: 14px; align-items: flex-start; max-width: 1400px; margin: 0 auto; }
main { flex: 1; min-width: 0; }
.side { width: 290px; flex-shrink: 0; position: sticky; top: 64px; }
.roster { list-style: none; padding: 0; margin: 0; }
.roster li { padding: 6px 8px; border-radius: 12px; margin-bottom: 6px; background: #fff7f0; }
.roster li.me { background: #fff0f6; outline: 2px solid var(--pink2); }
.r-top { display: flex; align-items: center; gap: 6px; } .r-top i { width: 12px; height: 12px; border-radius: 50%; }
.r-wins { margin-left: auto; font-weight: bold; } .cpu { font-size: 11px; background: #ddd; border-radius: 6px; padding: 0 5px; margin-left: 4px; }
.r-st { font-size: 12px; color: var(--sub); } .r-mons { display: flex; gap: 2px; }
.feed { height: 230px; overflow-y: auto; font-size: 12.5px; line-height: 1.5; }
.feed .line { padding: 2px 0; border-bottom: 1px dashed #f3e4da; } .feed .big { font-weight: bold; color: var(--pink); } .feed .good { color: #2a9a3a; font-weight: normal; } .feed .warn { color: #c04a3a; font-weight: normal; }

/* ---- モンスターのカード */
canvas.mon { display: block; }
.bob { animation: bob 1.6s ease-in-out infinite; } .d1 { animation-delay: .3s; } .d2 { animation-delay: .6s; } .d3 { animation-delay: .9s; }
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-5px) scale(1.02, .98); } }
.mons { display: flex; gap: 12px; flex-wrap: wrap; }
.mcard { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px; width: 300px; max-width: 100%; }
.mcard.small { width: 250px; }
.mcard.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--sub); border-style: dashed; min-height: 200px; width: 200px; }
.mc-top { display: flex; align-items: center; gap: 6px; }
.mc-top canvas { background: radial-gradient(circle at 50% 60%, #fff6e8, #ffe8f0 70%); border-radius: 50%; flex-shrink: 0; }
.mc-name b { font-size: 17px; }
.tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: #f2ece8; }
.br-atk { background: #ffe0dc; color: #c03a2a; } .br-mag { background: #ece0ff; color: #6a3ac0; } .br-bal { background: #dcf4dc; color: #2a8a3a; }
.el { font-size: 11px; padding: 1px 6px; border-radius: 8px; color: #fff; font-weight: bold; white-space: nowrap; }
.el-fire { background: var(--fire); } .el-water { background: var(--water); } .el-grass { background: var(--grass); } .el-light { background: var(--light); } .el-dark { background: var(--dark); } .el-none { background: var(--none); }
.stats { margin: 6px 0; }
.st { display: grid; grid-template-columns: 62px 1fr 34px 34px; align-items: center; gap: 4px; font-size: 12px; }
.sbar { height: 8px; background: #f2ece8; border-radius: 5px; overflow: hidden; } .sbar i { display: block; height: 100%; border-radius: 5px; }
.st b { text-align: right; } .st em { font-style: normal; font-weight: bold; font-size: 12px; } em.up, .up { color: #2a9a3a; } em.down, .down { color: #d04a3a; }
.moves { display: flex; flex-wrap: wrap; gap: 4px; }
.move { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 2px solid; background: #fff; white-space: nowrap; cursor: help; }
.el-b-fire { border-color: var(--fire) !important; } .el-b-water { border-color: var(--water) !important; } .el-b-grass { border-color: var(--grass) !important; } .el-b-light { border-color: var(--light) !important; } .el-b-dark { border-color: var(--dark) !important; } .el-b-none { border-color: var(--none) !important; }
.el-t-fire { color: var(--fire); } .el-t-water { color: var(--water); } .el-t-grass { color: #2a9a3a; } .el-t-light { color: #c09000; } .el-t-dark { color: var(--dark); }
.evo { margin-top: 8px; font-size: 12px; }
.ebar { height: 10px; border-radius: 6px; background: #f2ece8; overflow: hidden; margin-bottom: 3px; } .ebar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd860, #ff8ab0); }
.evo.ready .ebar i { background: linear-gradient(90deg, #ffe066, #ff5a8a, #8a6aff); animation: shine 1s linear infinite; background-size: 200% 100%; }
@keyframes shine { to { background-position: 200% 0; } }
.evo .next { display: block; color: var(--sub); } .evo.done { color: #c09000; font-weight: bold; }

/* ---- 行動ボタン */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.act { display: flex; flex-direction: column; align-items: center; padding: 16px 8px; border-radius: 20px; border: 3px solid; font-size: 14px; }
.act span { font-size: 38px; } .act b { font-size: 20px; } .act small { color: var(--sub); text-align: center; }
.a-train { border-color: #ff9a7a; background: #fff3ee; } .a-adv { border-color: #7ac87a; background: #f0fbef; } .a-mock { border-color: #8aa8ff; background: #f0f4ff; }
.back { float: right; font-size: 13px; padding: 3px 10px; }
.testbar { font-size: 12px; } .testbar button { font-size: 12px; padding: 2px 8px; margin: 2px; }

/* ---- 鍛える */
.trow { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap; }
.menus { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; min-width: 260px; }
.menu { display: flex; flex-direction: column; align-items: center; padding: 6px 4px; font-size: 13px; border-radius: 12px; }
.menu span { font-size: 22px; } .menu small { font-size: 11px; color: var(--sub); }
.menu.hard { border-color: #ffb0a0; background: #fff4f2; } .menu.rest { border-color: #b0c8ff; background: #f4f7ff; }
.menu.on { border-color: var(--pink); background: #ffe8f0; box-shadow: 0 0 0 3px var(--pink2); }
.hard-note { color: #e05a4a; font-weight: bold; }
.dungeons, .ranks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dg, .rank { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px; border-radius: 16px; font-size: 13px; }
.dg b, .rank b { font-size: 17px; } .dg small, .rank small { color: #5a4a5a; } .dg em { color: #d04a3a; font-style: normal; font-weight: bold; }
.stars { color: #f0a020; letter-spacing: 1px; }
.el-bg-fire { background: #fff0ea; border-color: #ffb08a; } .el-bg-water { background: #eef6ff; border-color: #9acaff; } .el-bg-grass { background: #effaee; border-color: #9ad89a; } .el-bg-light { background: #fffbe6; border-color: #f0d870; } .el-bg-dark { background: #f5eefc; border-color: #c0a0e8; }
.rank { background: #f4f6ff; border-color: #a8b8ff; }

/* ---- 待機部屋 */
.ready-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff6ee; border-radius: 14px; padding: 10px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.item { display: flex; align-items: center; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 8px; }
.item .ic { font-size: 28px; } .item div { flex: 1; min-width: 0; } .item small { display: block; color: var(--sub); font-size: 11.5px; }
.item button { white-space: nowrap; font-weight: bold; }

/* ---- 週末 */
.pairs { display: flex; flex-direction: column; gap: 10px; }
.pair { display: flex; align-items: center; justify-content: center; gap: 14px; background: #fff7f0; border-radius: 16px; padding: 10px; }
.pair.final { background: linear-gradient(90deg, #fff4c0, #ffe0ec); border: 2px solid var(--gold); }
.pp { text-align: center; border-bottom: 4px solid var(--c); padding: 4px 10px; min-width: 150px; } .pp div { display: flex; justify-content: center; }
.vs { font-size: 26px; font-weight: bold; color: var(--pink); }
.stand { padding-left: 24px; } .stand li { margin: 4px 0; } .stand li i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.watch button { display: block; margin: 4px 0; }

/* ---- 優勝発表 */
.result { text-align: center; position: relative; overflow: hidden; }
.champ-title { font-size: 34px; color: #e0a000; text-shadow: 2px 2px 0 #fff3b0; }
.champ b { font-size: 30px; } .champ-mons { display: flex; justify-content: center; gap: 6px; }
.ranking { list-style: none; padding: 0; max-width: 640px; margin: 14px auto; text-align: left; }
.ranking li { display: flex; align-items: center; gap: 10px; background: #fff7f0; border-radius: 14px; padding: 6px 10px; margin: 6px 0; flex-wrap: wrap; }
.ranking .md { font-size: 24px; width: 40px; text-align: center; } .ranking .rm { display: flex; } .ranking small { color: var(--sub); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 3px; animation: fall 3.4s linear infinite; }
@keyframes fall { to { transform: translateY(900px) rotate(720deg); } }

/* ---- ダイアログ */
.modal { position: fixed; inset: 0; background: rgba(60,40,60,.45); display: none; align-items: center; justify-content: center; z-index: 20; padding: 12px; }
.modal.show { display: flex; }
.modal-box { background: var(--panel); border-radius: 22px; border: 3px solid var(--line); padding: 18px 20px; max-width: 560px; width: 100%; max-height: 92vh; max-height: 92dvh; overflow-y: auto; animation: pop .2s ease-out; }
.modal-box.wide { max-width: 900px; }
.modal-box { position: relative; }
/* ストーリーの 場面の 背景（画像なし: グラデーション＋うかぶ 絵文字） */
.story.place { position: relative; overflow: hidden; isolation: isolate; transition: background .8s; min-height: min(440px, 62vh); }
.story.place > *:not(.st-bg) { position: relative; z-index: 1; }
.st-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.st-bg i { position: absolute; font-style: normal; font-size: 46px; opacity: .22; top: calc(12% + var(--i) * 26%); left: calc(6% + var(--i) * 34%); animation: stFloat calc(9s + var(--i) * 2s) ease-in-out infinite alternate; }
@keyframes stFloat { from { transform: translateY(-6px) rotate(-4deg); } to { transform: translateY(10px) rotate(5deg); } }
.story.place .st-scene { background: rgba(255,255,255,.88); backdrop-filter: blur(2px); }
.place-town { background: linear-gradient(180deg, #d8f0ff 0%, #eafbe0 60%, #c9eab0 100%); }
.place-mountain { background: linear-gradient(180deg, #dfe8f2 0%, #e9e2d6 55%, #cbbba3 100%); }
.place-factory { background: linear-gradient(180deg, #d9dde3 0%, #c6ccd4 60%, #a9b1bb 100%); }
.place-tower { background: linear-gradient(180deg, #3a2f52 0%, #5a4a78 55%, #2e2640 100%); color: #f4effa; }
.place-village { background: linear-gradient(180deg, #ffd9b8 0%, #ffc59a 50%, #e8946a 100%); }
.place-spirit { background: linear-gradient(180deg, #2e2b45 0%, #4b4470 60%, #6a5e8f 100%); color: #f4effa; }
.place-ice { background: linear-gradient(180deg, #e9f7ff 0%, #cfeeff 55%, #b5dcf5 100%); }
.place-beastwood { background: linear-gradient(180deg, #cfe8c4 0%, #a9d39a 55%, #7fb06e 100%); }
.place-stadium { background: radial-gradient(ellipse at 50% 0%, #fff6c8 0%, #ffe08a 45%, #f3b860 100%); }
.place-festival { background: linear-gradient(180deg, #1f2550 0%, #3b2f66 55%, #7a3b55 100%); color: #fff6ea; }
.place-otherworld { background: linear-gradient(180deg, #2b1f4a 0%, #4a2f6e 50%, #7b4a8e 100%); color: #fbf1ff; }
.place-chapel { background: linear-gradient(180deg, #fff8e6 0%, #f4e7c4 60%, #e2cf9e 100%); }
.place-abyss { background: radial-gradient(ellipse at 50% 60%, #6a3f9e 0%, #2a1a48 60%, #120b22 100%); color: #f4ecff; }
.place-beach { background: linear-gradient(180deg, #bfeaff 0%, #e6f8ff 45%, #9fe0e6 62%, #ffe7b3 100%); }
.place-jungle { background: linear-gradient(180deg, #2f5a35 0%, #46804a 50%, #6aa35c 100%); color: #f3fff0; }
.place-lobby { background: linear-gradient(180deg, #6b1f2e 0%, #9a2f3e 55%, #c7a35a 100%); color: #fff6ea; }
.place-backstage { background: linear-gradient(180deg, #23222a 0%, #3a3842 60%, #55525e 100%); color: #f0eef5; }
.place-stage { background: radial-gradient(ellipse at 50% 100%, #ff9a3c 0%, #c2412e 45%, #3a1418 100%); color: #fff3e6; }
.place-mtvillage { background: linear-gradient(180deg, #bfe3ff 0%, #e8f4d8 55%, #b8d890 100%); }
.place-mtroad { background: linear-gradient(180deg, #d0dce8 0%, #b8c8a8 55%, #7f9a6a 100%); }
.place-mtshrine { background: radial-gradient(ellipse at 50% 70%, #6a4a7a 0%, #33263f 60%, #1a1422 100%); color: #f4ecff; }
.story.place .st-scene, .story.place .st-scene * { color: var(--ink, #4a3a4a); }
.story.place h2 small, .story.place .note { color: inherit; opacity: .85; }
/* 暗い 場所でも 白い ボタン・カードの 中は いつもの 文字色（白地に 白文字で 見えなく ならないように） */
.story.place button:not(.big):not(.ghost):not(.mz-fire), .story.place .st-mon, .story.place .st-got, .story.place .mz-partner { color: var(--ink); }
.tr-rank { display: block; font-style: normal; font-size: 10px; line-height: 1; letter-spacing: -1px; margin-top: 1px; } .tr-rank.r3 { color: #e0503a; } .tr-rank.r2 { color: #e09a2a; } .tr-rank.r1 { color: #9a9aa8; }
.order-btn { font-size: 11px; padding: 1px 8px; margin-left: 4px; }
.order-list { display: flex; flex-direction: column; gap: 6px; margin: 8px auto; max-width: 360px; }
.order-row { display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 4px 8px; } .order-row .move { flex: 1; } .order-row button { padding: 4px 12px; font-size: 16px; }
.kw { color: #6a3fc0; text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
#kwPop { position: fixed; z-index: 60; display: none; background: #fff; border: 2px solid #b9a2e6; border-radius: 12px; padding: 8px 10px; box-shadow: 0 6px 18px rgba(60,40,90,.25); font-size: 13px; line-height: 1.5; max-height: 60vh; overflow-y: auto; box-sizing: border-box; }
.m-bdg { display: inline-flex; align-items: center; gap: 1px; margin-left: 4px; padding: 0 5px; border-radius: 10px; background: #fff3c4; border: 1.5px solid #e0b030; font-size: .78em; line-height: 1.5; font-weight: bold; vertical-align: middle; cursor: pointer; color: #6a4a00; } .m-bdg small { font-size: .9em; }
.m-bdg:hover { background: #ffe58a; }
.bdg-list { list-style: none; padding: 0; margin: 6px 0 0; } .bdg-list li { display: grid; grid-template-columns: auto 1fr; column-gap: 6px; align-items: center; padding: 3px 0; border-top: 1px dashed #e6dcf0; } .bdg-list li:first-child { border-top: none; } .bdg-list small { grid-column: 2; color: var(--sub); font-size: 11.5px; }
#kwPop.show { display: block; } #kwPop p { margin: 4px 0; } #kwPop .kw-x { float: right; padding: 0 6px; margin: -2px -4px 0 6px; } #kwPop .kw-go { display: block; margin: 6px 0 0 auto; font-size: 12px; padding: 3px 10px; }
.spec-item.flash { animation: kwFlash 1.6s ease-out; } @keyframes kwFlash { 0%, 40% { background: #fff3a8; } 100% { background: transparent; } }
.settings .set-h { margin: 10px 0 2px; font-size: 14px; border-bottom: 2px dashed var(--line); }
.modal-x { position: sticky; top: -6px; float: right; z-index: 3; width: 38px; height: 38px; margin: -8px -8px 0 6px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.modal-box .center canvas { margin: 0 auto; }
.choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin: 8px 0; }
.choice button { text-align: left; } .choice button small { display: block; font-size: 11px; color: var(--sub); margin-top: 3px; }
.choice button.on, .cand.on { border-color: var(--pink); background: #ffe8f0; }
.mons-choice button { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cands { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
/* ランダムイベント */
.ev-story { display: flex; gap: 12px; align-items: center; background: #fff8ee; border: 2px dashed #f0d4b0; border-radius: 16px; padding: 10px 14px; margin: 6px 0 10px; }
.ev-story canvas { flex: none; }
.ev-story p { margin: 0; line-height: 1.8; }
.ev-choices button b { font-size: 15px; }
.ev-result { list-style: none; padding: 0; margin: 10px auto; max-width: 420px; }
.ev-result li { background: #fff8ee; border-radius: 10px; padding: 6px 12px; margin: 4px 0; }
@media (max-width: 600px) { .ev-story { flex-direction: column; text-align: left; } }
.cand { padding: 4px; border-radius: 18px; text-align: left; } .cand .mcard { border: none; } .cand .pw { display: block; text-align: center; font-weight: bold; }
.res-mons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.menu-name { margin: 4px 0 0; font-weight: bold; } .learned { margin: 4px 0 0; color: #c07a00; font-weight: bold; }
.help ul { padding-left: 18px; line-height: 1.7; } .help li { margin-bottom: 4px; }
.toast { position: fixed; left: 50%; top: 80px; transform: translate(-50%, -20px); background: #fff; border: 3px solid var(--pink2); border-radius: 16px; padding: 10px 22px; font-weight: bold; opacity: 0; pointer-events: none; transition: .25s; z-index: 30; }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.big { font-size: 22px; color: var(--pink); }

/* ミニゲーム */
.mg-bar { position: relative; height: 38px; background: #f2ece8; border-radius: 19px; margin: 18px 0; overflow: hidden; border: 3px solid #e6c9b8; }
.mg-bar .zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(#9af09a, #5cc85a); }
.mg-bar .needle { position: absolute; top: -2px; bottom: -2px; width: 6px; margin-left: -3px; background: var(--pink); border-radius: 3px; box-shadow: 0 0 6px #ff6a9a; }
.mg-res { text-align: center; min-height: 26px; } .mg-res span { margin: 0 6px; font-weight: bold; } .mg-res .good { color: #2a9a3a; } .mg-res .bad { color: #d04a3a; }
.mg-mash { text-align: center; } .mg-mash .gauge { height: 26px; background: #f2ece8; border-radius: 13px; overflow: hidden; margin: 12px 0; }
.mg-mash .gauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd860, #ff8a3a, #ff5a8a); transition: width .08s; }
.mg-mash .cnt { font-size: 44px; color: var(--pink); display: block; } .mg-mash .time { font-size: 18px; color: var(--sub); }
.evo-stage { display: flex; justify-content: center; background: radial-gradient(circle, #fffbe0, #ffe0f0 60%, #e0d8ff); border-radius: 50%; width: 240px; height: 240px; margin: 0 auto; align-items: center; }
.evo-stage canvas.flash { animation: flash .9s ease-out; }
@keyframes flash { 0% { filter: brightness(3); transform: scale(1.3); } 100% { filter: none; transform: scale(1); } }

/* ---- バトル */
.battle { background: linear-gradient(#cfe8ff 0%, #eaf6ff 45%, #e8f8e0 55%, #c8ecb8 100%); border-radius: 20px; border: 3px solid #b8d0e8; padding: 10px; position: relative; }
.battle.k-final { background: linear-gradient(#ffe8a8 0%, #fff4d8 45%, #f8e8d0 55%, #e8c890 100%); border-color: var(--gold); }
.battle.k-adv { background: linear-gradient(#d8cce8 0%, #ece6f4 45%, #e4dccc 55%, #c8b898 100%); }
.bt-head { display: flex; align-items: center; gap: 10px; } .bt-head b { font-size: 17px; } .bt-head span { color: var(--sub); } .bt-head button { margin-left: auto; padding: 3px 10px; font-size: 13px; }
.bt-team { margin: 6px 0; } .team-name { font-weight: bold; border-left: 6px solid var(--c); padding-left: 8px; margin-bottom: 4px; }
.units { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.unit { background: rgba(255,255,255,.8); border-radius: 16px; padding: 6px 8px; width: 170px; border: 3px solid transparent; position: relative; transition: transform .15s; }
.unit .u-art { position: relative; display: flex; justify-content: center; }
.foe .unit canvas { transform: scaleX(-1); }
.unit .u-tags { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 1px; padding: 0 4px; border-radius: 9px; background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-size: 12px; line-height: 1.45; white-space: nowrap; pointer-events: auto; }
.unit.ko .u-tags { opacity: .4; }
.unit .u-name { font-size: 13px;white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; background: #e0d8d8; border-radius: 5px; overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; transition: width .35s; }
.bar.hp i { background: linear-gradient(#7aea7a, #3ab84a); } .bar.hp.low i { background: linear-gradient(#ff9a7a, #ff5a4a); }
.bar.mp { height: 5px; } .bar.mp i { background: linear-gradient(#8ad0ff, #4a90ff); }
.u-num { font-size: 11px; text-align: right; color: #5a4a5a; }
.u-stg { min-height: 16px; font-size: 11px; } .u-stg span { margin-right: 4px; font-weight: bold; }
.unit.ko { opacity: .45; filter: grayscale(1); }
.unit.acting { transform: translateY(-8px) scale(1.04); }
.unit.hit { animation: hit .4s; } @keyframes hit { 20%, 60% { transform: translateX(-7px); background: #ffd0d0; } 40%, 80% { transform: translateX(7px); } }
.unit.healed { box-shadow: 0 0 14px #7aea7a; } .unit.guarding { box-shadow: 0 0 0 3px #8ab0ff; }
.unit.leeched { box-shadow: inset 0 0 0 3px #5cc85a; }
.unit.walled { outline: 3px dashed #6ad0f0; outline-offset: -3px; }   /* いのちの結界 */
.unit.diving .u-art { opacity: 0.25; transform: translateY(10px); transition: opacity .25s, transform .25s; }   /* もぐる技 */
/* 育成画面の 行動ボタン: いちばん上に 小さく。スクロールしても ヘッダーの 下に のこる */
.actions.home-acts { position: sticky; top: var(--hdr, 56px); z-index: 4; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -6px 0 8px; padding: 6px 0; backdrop-filter: blur(6px); }
.home-acts .act { flex-direction: row; justify-content: center; gap: 10px; padding: 8px 10px; border-radius: 16px; }
.home-acts .act span { font-size: 30px; line-height: 1; } .home-acts .act b { display: block; font-size: 17px; white-space: nowrap; } .home-acts .act small { display: block; font-size: 11px; line-height: 1.25; text-align: left; }
@media (max-width: 900px) { .actions.home-acts { grid-template-columns: repeat(3, 1fr); } .home-acts .act { flex-direction: column; gap: 2px; padding: 6px 4px; } .home-acts .act span { font-size: 22px; } .home-acts .act b { font-size: 14px; text-align: center; } .home-acts .act small { display: none; } }
.reset-btn { font-size: 12px; padding: 4px 10px; white-space: nowrap; } .reset-btn.armed { background: #e0503a; border-color: #b03020; color: #fff; font-weight: bold; }
.u-curse:empty { display: none; } .st-doom { background: #7a2a6a; } .st-curse { background: #4a2a7a; } .st-bomb { background: #333; } .st-doll { background: #a07a3a; } .st-pal { background: #3a9a5a; } .st-boost { background: #d0503a; }
.u-pal { position: absolute; right: 0; bottom: 0; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.u-pal.hop { animation: palHop .4s ease-out; } @keyframes palHop { 40% { transform: translate(-14px, -18px) scale(1.15); } }
.u-pal .pal-hp { position: absolute; left: 10%; right: 10%; bottom: -3px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.45); overflow: hidden; }
.u-pal .pal-hp b { display: block; height: 100%; width: 100%; background: #6fd36f; transition: width .3s; }
.u-pal.pal-hurt { animation: palHurt .35s ease-out; } @keyframes palHurt { 25% { transform: translateX(-4px); filter: brightness(2) drop-shadow(0 0 4px #f44); } 60% { transform: translateX(3px); } }
.u-pal.targetable { pointer-events: auto; cursor: pointer; border-radius: 50%; animation: tgPal .7s infinite alternate; } @keyframes tgPal { to { filter: drop-shadow(0 0 6px #ffb060) drop-shadow(0 0 2px #ff9a3a); } }
.cmd-pray { margin-top: 6px; } .cmd-pray .pray { width: 100%; background: #fff4d0; border: 2px solid #e0b020; color: #5a4300; }
.cmd-pray .pray small { display: block; font-size: 11.5px; }
.item.on-sale { box-shadow: inset 0 0 0 2px #ff6a4a; } .sale-tag { font-style: normal; font-size: 11px; font-weight: bold; color: #fff; background: #ff5a3a; border-radius: 8px; padding: 0 6px; margin-left: 6px; white-space: nowrap; display: inline-block; }
.item button s { opacity: .6; font-weight: normal; font-size: 11px; display: block; }
.ban-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 52vh; overflow-y: auto; margin: 8px 0; }
.ban-list button { text-align: left; padding: 6px 8px; } .ban-list button span { margin-right: 4px; } .ban-list button small { display: block; font-size: 11px; font-weight: normal; }
.ban-list button.on { background: #ffe0dc; border-color: #e0503a; box-shadow: inset 0 0 0 2px #e0503a; }
.unit.choosing { border-color: var(--pink); box-shadow: 0 0 12px var(--pink2); }
.unit.targetable { border-color: #ff9a3a; cursor: pointer; animation: tg .7s infinite alternate; } @keyframes tg { to { box-shadow: 0 0 16px #ffb060; } }
.floats { position: absolute; inset: 0; pointer-events: none; }
/* 連続こうげきの HIT数（client.js showCombo） */
.combo { position: absolute; right: -6px; top: 4%; z-index: 6; font-weight: 900; font-style: italic; font-size: 15px; color: #ff8a00; white-space: nowrap; paint-order: stroke fill; -webkit-text-stroke: 4px #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); letter-spacing: .5px; }
.combo b { font-size: 28px; margin-right: 2px; color: #ff5a1f; }
.combo.big b { color: #e0127a; font-size: 32px; }
.combo.pop { animation: comboPop .28s cubic-bezier(.2,1.6,.4,1); }
@keyframes comboPop { from { transform: scale(1.6) rotate(-8deg); } to { transform: scale(1) rotate(0); } }
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 14; }
.float { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-weight: 900; font-size: 22px; animation: up 1.05s ease-out forwards; text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff; white-space: nowrap; }
.float.dmgn { color: var(--dc, #e04a3a); display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: 32px; top: 22%; animation: dmgPop 1.85s cubic-bezier(.2,.8,.3,1) forwards; text-shadow: none; -webkit-text-stroke: 0; }
.float.dmgn b { font-weight: 900; paint-order: stroke fill; -webkit-text-stroke: 6px #fff; filter: drop-shadow(0 0 1px rgba(30,30,50,.75)) drop-shadow(0 2px 2px rgba(0,0,0,.35)); letter-spacing: -.5px; }   /* 黄色など うすい 色でも 読めるように 白ふちの 外に うすい 黒線 */
.float.dmgn small { font-size: 13px; font-weight: 900; padding: 2px 8px; margin-bottom: 3px; border-radius: 9px; background: var(--dc, #e04a3a); color: #fff; text-shadow: none; letter-spacing: .5px; border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.float.dmgn.crit, .float.dmgn.good { color: var(--dc, #ff3a00); font-size: 40px; }
.float.dmgn.crit b { -webkit-text-stroke: 7px #fff4a0; }
.float.dmg { color: #e04a3a; } .float.good { color: #ff3a00; font-size: 28px; } .float.crit { color: #ff00a0; font-size: 30px; } .float.heal { color: #2aaa3a; } .float.miss { color: #888; }
@keyframes up { from { opacity: 1; top: 35%; } to { opacity: 0; top: -10%; } }
@keyframes dmgPop {
  0% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)) scale(.3); }
  12% { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), calc(var(--dy, 0px) - 10px)) scale(1.3); }
  22% { transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)) scale(1); }
  70% { opacity: 1; transform: translate(calc(-50% + var(--dx, 0px)), calc(var(--dy, 0px) - 14px)) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(var(--dy, 0px) - 40px)) scale(.9); }
}
/* トータルダメージ（ログの 下・ふちどり文字。合計が 大きいほど 銅 → 銀 → 金 → 虹） */
.bt-total { display: flex; justify-content: flex-end; align-items: flex-end; gap: 6px 26px; flex-wrap: wrap; max-width: 640px; margin: 2px auto 6px; padding: 0 8px; font-weight: 900; }
.bt-total-h { width: 100%; text-align: right; padding-right: 4px; font-size: 11px; letter-spacing: 3px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 3px #5a6a8a; margin-bottom: -2px; }
.bt-total-row { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.bt-total-name { font-size: 12px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 3px var(--c, #5a6a8a); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-total-sum { font-size: 30px; font-variant-numeric: tabular-nums; paint-order: stroke fill; -webkit-text-stroke: 6px #3a4058; color: #fff; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.bt-total-row:not(.me) .bt-total-sum { font-size: 22px; }
.bt-total-row small { font-size: 10.5px; color: #fff; paint-order: stroke fill; -webkit-text-stroke: 2.5px #6a7690; margin-top: 1px; }
.bt-total-sum.t-plain { color: #fff; }
.bt-total-sum.t-bronze { color: transparent; background: linear-gradient(180deg, #ffe0c0 0%, #e0915a 45%, #a85a2a 55%, #e8a070 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 0; filter: drop-shadow(0 0 0 #4a2a14) drop-shadow(2px 0 0 #4a2a14) drop-shadow(-2px 0 0 #4a2a14) drop-shadow(0 2px 0 #4a2a14) drop-shadow(0 -2px 0 #4a2a14); }
.bt-total-sum.t-silver { color: transparent; background: linear-gradient(180deg, #ffffff 0%, #d8dee8 40%, #8a94a8 52%, #e8edf5 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 0; filter: drop-shadow(2px 0 0 #3a4258) drop-shadow(-2px 0 0 #3a4258) drop-shadow(0 2px 0 #3a4258) drop-shadow(0 -2px 0 #3a4258) drop-shadow(0 0 6px rgba(200,220,255,.9)); }
.bt-total-sum.t-gold { color: transparent; background: linear-gradient(180deg, #fffbe0 0%, #ffd84a 40%, #c88a00 54%, #ffe680 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 0; filter: drop-shadow(2px 0 0 #6a3a00) drop-shadow(-2px 0 0 #6a3a00) drop-shadow(0 2px 0 #6a3a00) drop-shadow(0 -2px 0 #6a3a00) drop-shadow(0 0 8px rgba(255,210,60,.95)); }
.bt-total-sum.t-rainbow { color: transparent; background: linear-gradient(90deg, #ff5a7a, #ffb84a, #fff06a, #5ae08a, #4ac8ff, #a07aff, #ff5a7a); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-stroke: 0; animation: totRain 2.4s linear infinite; filter: drop-shadow(2px 0 0 #2a2050) drop-shadow(-2px 0 0 #2a2050) drop-shadow(0 2px 0 #2a2050) drop-shadow(0 -2px 0 #2a2050) drop-shadow(0 0 10px rgba(255,255,255,.95)); }
.bt-total-sum.bump { animation: totBump .35s ease-out; }
.bt-total-sum.t-rainbow.bump { animation: totBump .35s ease-out, totRain 2.4s linear infinite; }
@keyframes totBump { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes totRain { to { background-position: 200% 0; } }
@media (max-width: 600px) { .bt-total { gap: 2px 16px; margin: 0 auto 4px; } .bt-total-sum { font-size: 24px; } .bt-total-row:not(.me) .bt-total-sum { font-size: 18px; } .bt-total-row small { display: none; } .bt-total-h { font-size: 10px; } }
/* 戦いの はじまりの 演出 */
.bt-intro { position: absolute; inset: 0; z-index: 30; overflow: hidden; border-radius: inherit; background: radial-gradient(ellipse at center, rgba(20,24,48,.55), rgba(10,12,30,.85)); animation: biFade 1.9s ease forwards; cursor: pointer; }
.bi-band { position: absolute; left: -10%; width: 120%; height: 22%; display: flex; align-items: center; justify-content: center; background: linear-gradient(90deg, transparent, var(--c) 25%, var(--c) 75%, transparent); transform: skewY(-6deg); box-shadow: 0 0 30px var(--c); }
.bi-band b { color: #fff; font-size: clamp(18px, 4vw, 34px); letter-spacing: 3px; text-shadow: 0 2px 6px rgba(0,0,0,.5); transform: skewY(6deg); }
.bi-a { top: 22%; animation: biInL .45s cubic-bezier(.2,.9,.3,1.2) both; }
.bi-b { top: 56%; animation: biInR .45s .12s cubic-bezier(.2,.9,.3,1.2) both; }
.bi-vs { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); font-size: clamp(40px, 9vw, 84px); font-weight: 900; font-style: italic; color: #ffe066; text-shadow: 0 0 18px #ff8a00, 3px 3px 0 #a03000; animation: biVs .5s .35s cubic-bezier(.2,1.6,.4,1) both; }
.bi-go { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; color: #fff; font-weight: 900; letter-spacing: 8px; font-size: clamp(14px, 2.6vw, 22px); text-shadow: 0 0 10px #6ac8ff; animation: biGo .4s .8s ease both; }
@keyframes biInL { from { transform: translateX(-110%) skewY(-6deg); } to { transform: translateX(0) skewY(-6deg); } }
@keyframes biInR { from { transform: translateX(110%) skewY(-6deg); } to { transform: translateX(0) skewY(-6deg); } }
@keyframes biVs { from { transform: translate(-50%, -50%) scale(3); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes biGo { from { opacity: 0; letter-spacing: 24px; } to { opacity: 1; letter-spacing: 8px; } }
@keyframes biFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
/* 戦闘画面を すこし おしゃれに: ユニットの カードを ガラスふうに */
.battle .unit { background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(240,246,255,.85)); box-shadow: 0 3px 10px rgba(50,80,140,.12); }
.battle .team-name { letter-spacing: .5px; }
.bt-log { background: rgba(255,255,255,.88); border-radius: 12px; padding: 6px 12px; min-height: 92px; font-size: 14px; line-height: 1.5; margin: 6px auto; max-width: 640px; }
.bt-head #btLogBtn { margin-left: auto; } .bt-head #btLogBtn ~ button { margin-left: 0; }
.bt-full { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column; background: var(--panel); border: 3px solid var(--line); border-radius: 16px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(60,40,60,.3); z-index: 15; }
.bt-full[hidden] { display: none; }
.bt-full-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; } .bt-full-head button { padding: 3px 10px; font-size: 13px; }
.bt-log.bt-full-body { flex: 1; min-height: 0; max-width: none; margin: 0; overflow-y: auto; background: none; padding: 0 4px; }
.bt-full-body .log-turn { font-weight: bold; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 4px; }
.bt-full-body .log-detail { font-size: 12px; color: var(--sub); margin: 0 0 4px 1em; }
.bt-log .good { color: #e05a00; } .bt-log .crit { color: #ff00a0; font-weight: bold; } .bt-log .sub { color: var(--sub); } .bt-log .ko { color: #c03a3a; font-weight: bold; }
.bt-cmd { background: rgba(255,255,255,.92); border-radius: 14px; padding: 8px; min-height: 60px; max-width: 760px; margin: 0 auto; }
.cmd-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; } .cmd-who small { color: var(--sub); } .cmd-who button { margin-left: auto; padding: 2px 10px; font-size: 13px; }
.cmds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cmds button { display: flex; flex-direction: column; align-items: flex-start; font-weight: bold; text-align: left; }
.cmds button small { font-weight: normal; font-size: 11px; color: var(--sub); }
.c-atk { border-color: #ff9a7a; } .c-guard { border-color: #8ab0ff; }
.pick-t { grid-column: 1 / -1; margin: 2px 0; font-weight: bold; }
.cmd-note { text-align: center; color: var(--sub); padding: 14px; }
/* リザルト画面（client.js resultHtml）: 戦闘画面の 上に かぶせる */
.bt-result { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 14px 10px; border-radius: inherit; background: rgba(20, 26, 50, .55); overflow-y: auto; animation: rsFade .3s ease; }
.bt-result[hidden] { display: none; }
@keyframes rsFade { from { opacity: 0; } }
.rs-card { width: 100%; max-width: 620px; background: linear-gradient(#fffdf6, #fff4e0); border: 3px solid #f0c060; border-radius: 18px; padding: 12px 14px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: rsIn .45s cubic-bezier(.2,1.4,.4,1); }
.bt-result.lose .rs-card { background: linear-gradient(#f6f7fb, #e6e9f2); border-color: #a8b0c8; }
@keyframes rsIn { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.rs-title { text-align: center; font-size: 34px; font-weight: 900; color: #ff5a8a; paint-order: stroke fill; -webkit-text-stroke: 6px #fff; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.bt-result.lose .rs-title { color: #6a6a8a; }
.rs-sub { text-align: center; font-size: 12px; color: #8a7a6a; margin-bottom: 6px; }
.rs-rows { display: flex; flex-direction: column; gap: 6px; }
.rs-row { background: #fff; border: 2px solid color-mix(in srgb, var(--c) 45%, #fff); border-left: 7px solid var(--c); border-radius: 12px; padding: 6px 10px; }
.rs-row.foe { opacity: .8; transform: scale(.97); }
.rs-row.mvp { border-color: #f0b020; border-left-color: #f0b020; background: linear-gradient(90deg, #fff6d0, #fff); box-shadow: 0 0 0 2px #ffe58a, 0 3px 10px rgba(240,176,32,.35); }
.rs-who { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.rs-who b { color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-medal { font-size: 26px; line-height: 1; animation: rsMedal 1.6s ease-in-out infinite; display: inline-block; }
@keyframes rsMedal { 0%, 100% { transform: rotate(-10deg) scale(1); } 50% { transform: rotate(10deg) scale(1.15); } }
.rs-mvp { background: #f0a000; color: #fff; font-weight: 900; font-size: 11px; padding: 1px 7px; border-radius: 8px; letter-spacing: 1px; }
.rs-bar { height: 8px; background: #eef0f4; border-radius: 5px; overflow: hidden; display: flex; margin: 4px 0 3px; }
.rs-bar i { display: block; height: 100%; animation: rsGrow .8s ease-out; transform-origin: left; }
.rs-bar i.d { background: linear-gradient(90deg, #ff9a5a, #ff5a5a); } .rs-bar i.h { background: linear-gradient(90deg, #6ad08a, #3ab06a); }
@keyframes rsGrow { from { transform: scaleX(0); } }
.rs-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 900; font-size: 15px; }
.rs-dmg { color: #e04a3a; } .rs-heal { color: #2a9a4a; } .rs-ko { color: #7a4ad0; }
.rs-kinds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rs-chip { font-size: 11px; background: #f3f0ea; border-radius: 8px; padding: 1px 7px; color: #5a5040; }
.rs-chip b { color: #c04a2a; }
.rs-stage { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 4px 10px; margin: 12px 0 8px; padding: 10px 4px 4px; border-radius: 14px; background: linear-gradient(#ffffff00, #c8ecb8 70%); }
.rs-pal { position: relative; display: flex; flex-direction: column; align-items: center; width: 92px; }
.rs-pal canvas { width: 84px; height: 84px; }
.rs-pal b { font-size: 11px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-pal small { font-size: 10px; color: #7a6a5a; white-space: nowrap; }
.rs-pal.hop canvas { animation: rsHop .7s cubic-bezier(.3,0,.5,1) infinite; animation-delay: var(--d); }
.rs-pal.sad canvas { animation: rsSad 2.4s ease-in-out infinite; animation-delay: var(--d); filter: saturate(.6) brightness(.95); }
@keyframes rsHop { 0%, 100% { transform: translateY(0) scale(1.06, .94); } 15% { transform: translateY(0) scale(.96, 1.05); } 50% { transform: translateY(-22px) scale(1, 1); } 85% { transform: translateY(0) scale(1.04, .96); } }
@keyframes rsSad { 0%, 100% { transform: translateY(2px) rotate(-3deg); } 50% { transform: translateY(4px) rotate(3deg); } }
.rs-crown { position: absolute; top: -12px; z-index: 2; font-size: 22px; animation: rsMedal 1.6s ease-in-out infinite; }
@media (max-width: 600px) { .bt-result { position: fixed; z-index: 200; border-radius: 0; padding: 8px 6px; } .rs-card { padding: 8px 8px 10px; } .rs-title { font-size: 26px; } .rs-nums { font-size: 13px; } .rs-pal { width: 72px; } .rs-pal canvas { width: 64px; height: 64px; } .rs-pal b { max-width: 72px; } }
.bt-end { text-align: center; font-size: 30px; font-weight: 900; padding: 6px; } .bt-end.win { color: #ff5a8a; } .bt-end.lose { color: #6a6a8a; }

/* ---- スマホ */
@media (max-width: 900px) {
  .layout { flex-direction: column; padding: 8px; }
  .side { width: 100%; position: static; }
  .actions { grid-template-columns: 1fr; }
  .act { flex-direction: row; gap: 10px; justify-content: flex-start; padding: 10px 14px; } .act span { font-size: 30px; } .act small { text-align: left; }
  .unit { width: 31%; min-width: 100px; padding: 4px; } .unit canvas { width: 80px; height: 80px; }
  .mcard, .mcard.small { width: 100%; }
  .logo { font-size: 36px; }
  header.top { gap: 8px; padding: 6px 10px; } .master-vol { display: none; }
}
.pp.won { background: #fff3c0; border-radius: 12px 12px 0 0; } .pp.won b::before { content: '🏆 '; }
@media (max-width: 600px) { .cmds { grid-template-columns: 1fr 1fr; } .bt-log { min-height: 70px; font-size: 13px; } .battle { padding: 6px; } .cmds button { padding: 5px 8px; } }

/* 特性・そうび */
.traits { display: flex; flex-direction: column; gap: 3px; margin: 6px 0 2px; }
.trait { font-size: 12px; font-weight: bold; background: #f4f0ff; border-radius: 8px; padding: 3px 7px; }
.trait small { display: block; font-weight: normal; color: var(--sub); font-size: 11px; }
.trait.pas { background: #fff6d8; } .trait.none { background: #f6f6f6; color: var(--sub); font-weight: normal; } .trait.eq { background: #eef8f0; position: relative; }
.eqbtn { position: absolute; right: 4px; top: 3px; font-size: 11px; padding: 1px 8px; }
.u-eq { font-size: 13px; }
/* 技 2×2 */
.cmds.moves4 { grid-template-columns: 1fr 1fr; gap: 8px; }
.cmds.moves4 button { min-height: 64px; padding: 8px 12px; border-width: 3px; position: relative; font-size: 16px; }
.cmds.moves4 button b { font-size: 17px; } .cmds.moves4 button small { font-size: 12px; }
.cmds.moves4 .mpc { position: absolute; right: 10px; top: 8px; font-size: 12px; color: #4a90ff; font-weight: bold; } .cmds.moves4 .mpc.short { color: #d04a3a; }
.cmds.moves4 .empty { color: #ccc; }
.cmds.moves4 .struggle { grid-column: 1 / -1; border-color: #ff7a5a; background: #fff0ea; }
.lock-note { margin: 0 0 6px; font-size: 13px; color: #c05a00; font-weight: bold; }
@media (max-width: 600px) { .cmds.moves4 button { min-height: 56px; font-size: 14px; } .cmds.moves4 button b { font-size: 15px; } }

/* 最初の3体 */
.starter-pick h3 { margin: 6px 0; }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.starter { display: flex; flex-direction: column; align-items: center; padding: 6px; border-radius: 16px; font-size: 12px; }
.starter b { font-size: 15px; } .starter small { color: var(--sub); font-size: 11px; } .starter .tr { color: #7a5ac8; }
.starter.on { border-color: var(--pink); background: #ffe8f0; box-shadow: 0 0 0 3px var(--pink2); }
.lobby-players .st-ic { margin-left: auto; }
/* なつき度 */
.fr { font-size: 11px; margin-top: 3px; color: #c0507a; } .fr span { letter-spacing: -2px; } .fr small { color: var(--sub); margin-left: 4px; }
/* 天候・フィールド・状態異常 */
.bt-env { display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0; } .env { white-space: nowrap; font-size: 13px; background: rgba(255,255,255,.85); border-radius: 10px; padding: 1px 8px; font-weight: bold; color: var(--ink) !important; }
.u-st { min-height: 16px; } .stt { display: inline-block; white-space: nowrap; line-height: 1.35; margin: 1px 1px 0 0; font-size: 11px; font-weight: bold; border-radius: 8px; padding: 0 6px; color: #fff; }
.st-freeze { background: #3a9ad0; }
.st-poison { background: #9a4ac8; } .st-burn { background: #ff6a3a; } .st-para { background: #e0b020; } .st-sleep { background: #6a8ac8; } .st-conf { background: #e05aa0; }
.battle[data-weather="sun"] { background: linear-gradient(#ffe9a0 0%, #fff6d8 45%, #f0f4c8 55%, #d8ecb0 100%); }
.battle[data-weather="rain"] { background: linear-gradient(#a8bcd8 0%, #d4e0ee 45%, #d0e4dc 55%, #a8c8b8 100%); }
.battle[data-weather="sand"] { background: linear-gradient(#e8d0a0 0%, #f2e4c4 45%, #eadcb8 55%, #d8c090 100%); }
.battle[data-weather="night"] { background: linear-gradient(#3a3a6a 0%, #6a6a9a 45%, #7a7a9a 55%, #5a5a7a 100%); }
.battle[data-weather="night"] .team-name, .battle[data-weather="night"] .bt-head { color: #fff; }
.battle[data-weather="night"] .bt-head button { color: #4a3a3a; }   /* ボタンは 白地なので 字は こいめ（白に ならないように） */

/* おせっかいモモンガ「モモ」 */
#helper { position: fixed; left: 0; bottom: 16px; display: flex; align-items: flex-end; z-index: 25; cursor: pointer; transform: translateX(-110%); }
#helper.hidden { display: none; }
#helper.in { animation: helperIn .6s cubic-bezier(.2, 1.4, .4, 1) forwards; }
#helper.out { animation: helperOut .45s ease-in forwards; }
@keyframes helperIn { from { transform: translate(-110%, 30px) rotate(-10deg); } to { transform: translate(0, 0); } }
@keyframes helperOut { from { transform: translateX(0); } to { transform: translate(-110%, 30px); } }
#helper canvas { width: 104px; height: 95px; flex: none; filter: drop-shadow(0 2px 6px #0005); }
#helper .h-bubble { position: relative; margin-bottom: 40px; max-width: min(320px, 64vw); background: #fffdf4; color: #3b2a3a; border: 3px solid #e0a060; border-radius: 16px;
  padding: 8px 12px; font-size: 14px; line-height: 1.5; box-shadow: 0 3px 0 #e8c8a0; min-height: 1.5em; }
#helper .h-bubble::before { content: ''; position: absolute; left: -16px; bottom: 14px; border: 7px solid transparent; border-right: 9px solid #e0a060; }
#helper .h-bubble::after { content: 'モモ'; position: absolute; left: 10px; top: -11px; background: #e0a060; color: #fff; font-size: 11px; padding: 0 8px; border-radius: 999px; }
#helper .h-close { position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%; background: #e0a060; color: #fff; font-size: 12px; line-height: 16px; border: none; }
@media (max-width: 600px) { #helper canvas { width: 70px; height: 64px; } #helper .h-bubble { font-size: 12px; padding: 6px 9px; margin-bottom: 26px; } }
.starters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .starter { min-width: 0; } .starter canvas { width: 100%; max-width: 90px; height: auto; } .starter small { overflow-wrap: anywhere; }
@media (max-width: 600px) { .cmds.moves4 .mpc { position: static; display: block; text-align: right; } .cmds.moves4 button { padding: 6px 8px; } }

/* ---- タイトル画面の にぎやかし */
#title { position: relative; overflow: hidden; }
.title-box { position: relative; z-index: 2; }
.title-sky { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sky-mon { position: absolute; width: 96px; height: 96px; opacity: .9; animation: skyFloat 5s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(120,80,120,.25)); }
@keyframes skyFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
.sky-mon.sil { filter: brightness(0) opacity(.5); }
.sky-mon.sil.poof { animation: skyFloat 5s ease-in-out infinite; }
.sky-mon.poof { animation: poof .5s ease-out, skyFloat 5s ease-in-out infinite; }
@keyframes poof { 0% { transform: scale(1); filter: brightness(1); } 45% { transform: scale(.2); filter: brightness(3); } 100% { transform: scale(1); filter: brightness(1); } }
.title-parade { position: absolute; left: 0; right: 0; bottom: 0; height: 96px; pointer-events: none; z-index: 1;
  background: linear-gradient(transparent 60%, rgba(140,210,120,.35) 60%, rgba(120,190,100,.45)); }
.walker { position: absolute; bottom: 6px; left: 0; animation: walk 26s linear infinite; }
.walker canvas { width: 84px; height: 84px; animation: hop .55s ease-in-out infinite alternate; }
@keyframes walk { from { transform: translateX(-100px); } to { transform: translateX(calc(100vw + 20px)); } }
@keyframes hop { from { transform: translateY(0); } to { transform: translateY(-10px); } }
.title-mons canvas.flash { animation: titleFlash .7s ease-out, bob 1.6s ease-in-out infinite; }
@keyframes titleFlash { 0% { filter: brightness(3) drop-shadow(0 0 12px #fff6a0); transform: scale(1.25); } 100% { filter: none; transform: scale(1); } }
.evo-ticker { margin: 0 0 4px; font-size: 13px; font-weight: bold; color: #c07a00; min-height: 1.4em; }
@media (max-width: 600px) { .sky-mon { width: 60px; height: 60px; } .walker canvas { width: 60px; height: 60px; } .title-parade { height: 70px; } }

/* ---- スタンプ */
.stamp-fab { position: fixed; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 50%; font-size: 26px; padding: 0; z-index: 26;
  background: linear-gradient(#ffd0e4, #ff8ab8); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(200,80,130,.35); display: none; }
.stamp-fab.on { display: block; }
.stamp-palette { position: fixed; right: 16px; bottom: 82px; z-index: 26; display: none; grid-template-columns: 1fr 1fr; gap: 6px; background: #fffdf9;
  border: 3px solid var(--pink2); border-radius: 18px; padding: 8px; box-shadow: 0 6px 16px rgba(150,90,120,.3); animation: pop .15s ease-out; }
.stamp-palette.open { display: grid; }
.stamp-palette button { padding: 2px; border-radius: 14px; background: #fff; }
.stamp-palette canvas { width: 120px; height: 106px; display: block; }
.stamp-show { position: fixed; right: 16px; top: 70px; z-index: 27; display: flex; flex-direction: column; gap: 6px; pointer-events: none; align-items: flex-end; }
.stamp-pop { position: relative; animation: stampIn .45s cubic-bezier(.2, 1.6, .4, 1); }
.stamp-pop canvas { width: 170px; height: 150px; display: block; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.stamp-pop b { position: absolute; left: 6px; bottom: 2px; color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.stamp-pop.out { animation: stampOut .45s ease-in forwards; }
@keyframes stampIn { from { transform: scale(.2) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stampOut { to { transform: translateX(120%); opacity: 0; } }
@media (max-width: 600px) { .stamp-pop canvas { width: 120px; height: 106px; } .stamp-palette canvas { width: 96px; height: 85px; } .stamp-fab { width: 48px; height: 48px; font-size: 22px; } }
.stamp-pop { background: rgba(255,253,249,.92); border: 3px solid #ffd0e0; border-radius: 18px; padding: 2px 4px 14px; } .stamp-pop b { bottom: 2px; }

/* 拍手 */
.clap-box { margin: 10px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.clap-btn { background: linear-gradient(#ffe680, #ffb020) !important; color: #6a3a00 !important; box-shadow: 0 4px 0 #c07a00 !important; font-size: 22px !important; }
.clap-btn.pressed { animation: clapPress .25s; } @keyframes clapPress { 50% { transform: scale(.9) rotate(-6deg); } }
.clap-count { font-weight: bold; color: #c07a00; min-height: 1.4em; }
.clap-fly { position: fixed; bottom: 60px; z-index: 30; pointer-events: none; font-weight: 900; white-space: nowrap; text-shadow: 0 0 4px #fff, 0 0 4px #fff; animation: clapFly 2.2s ease-out forwards; }
@keyframes clapFly { from { transform: translateY(0) scale(.6); opacity: 1; } 70% { opacity: 1; } to { transform: translateY(-60vh) scale(1.2) rotate(15deg); opacity: 0; } }

/* モンスターの おしゃべり */
.mc-top, .u-art { position: relative; }
.say { position: absolute; left: 50%; top: -6px; transform: translate(-30%, -100%); z-index: 4; background: #fff; border: 2px solid #ffb0c8; border-radius: 12px;
  padding: 3px 9px; font-size: 12px; font-weight: bold; color: #5a3a4a; white-space: nowrap; box-shadow: 0 2px 0 #f0d0dc; animation: sayIn .3s cubic-bezier(.2, 1.6, .4, 1); pointer-events: none; }
.say::after { content: ''; position: absolute; left: 22%; bottom: -8px; border: 5px solid transparent; border-top: 6px solid #ffb0c8; }
.say.out { animation: sayOut .4s ease-in forwards; }
@keyframes sayIn { from { transform: translate(-30%, -60%) scale(.3); opacity: 0; } to { transform: translate(-30%, -100%) scale(1); opacity: 1; } }
@keyframes sayOut { to { transform: translate(-30%, -130%); opacity: 0; } }
.mc-top .say { left: 60px; top: 10px; transform: translate(0, -100%); }
.mc-top .say.out { animation: sayOutL .4s ease-in forwards; }
@keyframes sayOutL { to { transform: translate(0, -130%); opacity: 0; } }
.mc-top .say { animation-name: sayInL; } @keyframes sayInL { from { transform: translate(0, -60%) scale(.3); opacity: 0; } to { transform: translate(0, -100%) scale(1); opacity: 1; } }
.mcard { overflow: visible; }
.cmds.moves4 button { padding-right: 54px; } @media (max-width: 600px) { .cmds.moves4 button { padding-right: 8px; } }

/* あそびかた */
.help-box { max-width: 860px; }
.story-hdr .money, .story-hdr .wins { display: none; }
.m-badge { display: inline-block; width: 1.25em; height: 1.25em; line-height: 1.25em; margin-left: 3px; border-radius: 50%; text-align: center; font-size: .8em; font-weight: bold; font-style: normal; vertical-align: middle; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55), 0 0 0 1px rgba(0,0,0,.2); }
.md-master { background: linear-gradient(135deg, #e8a878, #a8602a); } .md-silver { background: linear-gradient(135deg, #f0f2f6, #8e96a4); } .md-gold { background: linear-gradient(135deg, #ffe680, #d09a10); } .md-platinum { background: linear-gradient(135deg, #e8fbff, #9fd8ec 45%, #d8c8ff); color: #5a6a9a; text-shadow: none; box-shadow: inset 0 0 0 1px #fff, 0 0 0 1px rgba(90,110,170,.5), 0 0 5px rgba(150,210,255,.9); }
.story { max-width: 760px; margin: 0 auto; }
.st-map { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; } .st-map span { width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: #f2ece8; font-size: 13px; filter: grayscale(1); opacity: .55; } .st-map span.done { filter: none; opacity: 1; background: #fff1b8; } .st-map span.now { filter: none; opacity: 1; box-shadow: 0 0 0 2px var(--pink); background: #fff0f6; }
.st-scene { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; min-height: 110px; cursor: pointer; margin-bottom: 10px; } .st-who { font-size: 14px; color: #c0507a; margin-bottom: 4px; } .st-text { margin: 0 0 4px; font-size: 16px; line-height: 1.7; } .st-page { color: var(--sub); }
.st-got { text-align: center; font-size: 17px; background: #fff7d0; border-radius: 12px; padding: 6px; } .st-score { text-align: center; font-size: 30px; font-weight: 900; color: var(--pink); margin: 8px 0; } .st-wait { color: var(--sub); } .st-badges { font-size: 30px; }
.st-team { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; } .st-mon { display: flex; flex-direction: column; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; min-width: 96px; } .st-mon small { color: var(--sub); }
.st-timer { height: 8px; background: #f2ece8; border-radius: 5px; overflow: hidden; margin: 4px 0 8px; } .st-timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ffd860, #ff8ab0); transition: width .2s linear; }
.st-q { font-size: 16px; font-weight: bold; text-align: center; line-height: 1.6; margin: 6px 0; } .st-sil canvas { margin: 0 auto; }
.st-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 8px 0; } .st-choices button { padding: 10px 8px; font-weight: bold; } .st-choices.wide { grid-template-columns: minmax(0, 1fr); } .st-choices.wide button { padding: 7px 8px; } .st-choices button.on { border-color: var(--pink); background: #ffe8f0; } .st-choices button.right { background: #d8f5d8; border-color: #3ab84a; opacity: 1; } .st-choices button.wrong { background: #ffd8d4; border-color: #e0503a; opacity: 1; }
.spec-q { width: 100%; box-sizing: border-box; margin-bottom: 6px; }
.spec-group { background: #fff7f0; border-radius: 12px; padding: 6px 10px; margin-bottom: 6px; } .spec-group > summary { font-weight: bold; cursor: pointer; color: #c0507a; } .spec-group > summary small { color: var(--sub); font-weight: normal; }
.spec-item { background: #fff; border-radius: 10px; padding: 6px 10px; margin: 6px 0; } .spec-item[hidden], .spec-group[hidden] { display: none; }
.spec-item h4 { margin: 0 0 2px; font-size: 14px; } .spec-item p { margin: 2px 0; font-size: 13px; line-height: 1.6; }
.spec-note { color: #b0603a; } .spec-item p.spec-moves { color: var(--sub); font-size: 11.5px; line-height: 1.4; }
.htabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.htabs button { font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.htabs button.on { background: var(--pink); color: #fff; border-color: var(--pink); }
.help { font-size: 14px; line-height: 1.7; }
/* あそびかた: もどる・見出しの 折りたたみ・文の 中の リンク */
.hback { position: sticky; top: 0; z-index: 3; display: block; margin: 0 0 6px; font-size: 13px; padding: 4px 12px; border-radius: 999px; background: #efe8ff; border-color: #b9a2e6; color: #5a35b0; box-shadow: 0 2px 6px rgba(60,40,90,.18); } .hback[hidden] { display: none; }
.hsec { background: #fff7f0; border-radius: 12px; padding: 6px 10px; margin: 6px 0; } .hsec > summary { font-weight: bold; cursor: pointer; color: #c0507a; } .hsec > summary small { color: var(--sub); font-weight: normal; } .hsec[open] > summary { margin-bottom: 4px; }
.hall { display: block; margin: 0 0 4px auto; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.help a.hl { color: #6a3fc0; text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; } .help a.mv { color: var(--sub); text-decoration: underline dotted; text-underline-offset: 2px; cursor: pointer; } .help a.hl:hover, .help a.mv:hover { color: var(--pink); }
#kwPop .mv-rel { font-size: 12px; } #kwPop .mv-go { font-size: 12px; padding: 2px 8px; margin: 2px 4px 0 0; }
.help h3 { margin: 12px 0 4px; color: #c0507a; }
.hflow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; font-weight: bold; color: var(--sub); }
.hflow span { background: #fff0f6; border: 2px solid var(--pink2); border-radius: 10px; padding: 2px 8px; color: var(--ink); }
.htable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0; }
.htable th { background: #fff0f6; text-align: left; padding: 4px 6px; }
.htable td { border-top: 1px solid #f3e4da; padding: 4px 6px; vertical-align: middle; }
.htable td canvas { display: inline-block; vertical-align: middle; }
.htable small { color: var(--sub); }
.htable td:first-child { white-space: nowrap; }

/* モモの声の クレジット（VOICEVOX の利用規約で 必要） */
#helper .h-credit { position: absolute; left: 6px; bottom: -14px; font-size: 10px; color: #8a6a4a; background: rgba(255,253,244,.9); border-radius: 6px; padding: 0 5px; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
#helper .h-credit.on { opacity: 1; }

/* 出場・控え・配合・得意の型 */
.party-btn { width: 100%; margin: 6px 0 2px; font-size: 12px; font-weight: bold; border-radius: 10px; background: #f4f4f8; }
.party-btn.on { background: #ffe8f0; border-color: var(--pink); color: #c0306a; }
.tag.apt { font-weight: bold; } .apt-phy { background: #ffe0dc; color: #c03a2a; } .apt-mag { background: #ece0ff; color: #6a3ac0; } .apt-both { background: #fff2c0; color: #a07000; }
.tag.gen { background: #e0f4ff; color: #2a6aa0; }
.trait.inh { background: #e8f6ff; }
.r-mons .bench { opacity: .4; filter: grayscale(.6); }
.lineup .cand { position: relative; } .lu-mark { position: absolute; top: 4px; right: 6px; background: var(--pink); color: #fff; font-size: 11px; font-weight: bold; border-radius: 8px; padding: 0 6px; z-index: 1; }
.good-at { color: #ff9a00; margin-left: 4px; }
.choice button canvas { display: inline-block; vertical-align: middle; }

/* 技の強さ（小・中・大）・役割 */
.rk { font-style: normal; font-size: 10px; font-weight: bold; border-radius: 6px; padding: 0 4px; margin-right: 3px; color: #fff; vertical-align: 1px; }
.rk1 { background: #9ac0a0; } .rk2 { background: #e0a040; } .rk3 { background: #e05a6a; }
.tag.role { background: #e4f6ec; color: #2a7a4a; font-weight: bold; }

/* ---- 対戦モード（保管庫・ロビーの ルール・乱戦） */
.mode-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.mode-tabs button { display: flex; flex-direction: column; gap: 2px; padding: 8px; } .mode-tabs button small { color: var(--sub); font-size: 11.5px; }
.mode-tabs button.on { border-color: var(--pink); background: #fff0f5; box-shadow: 0 0 0 2px var(--pink2); }
.mode-tabs button:disabled { opacity: 1; } .mode-tabs button:disabled:not(.on) { opacity: .5; }
.arena-rules { background: #f6f2ff; border-radius: 14px; padding: 8px 10px; text-align: left; }
.arena-rules .row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; } .arena-rules .row > span { font-weight: bold; min-width: 3.5em; white-space: nowrap; }
.arena-rules .row button { padding: 4px 10px; font-size: 14px; } .arena-rules .row button.on { border-color: #8a5ac8; background: #ece2ff; font-weight: bold; }
.arena-rules .row button:disabled.on { opacity: 1; } .arena-rules .row small { color: var(--sub); font-size: 11px; }
.arena-rules .note { margin: 2px 0 4px; }
.units .u-eq.u-inh { display: inline !important; margin-left: 2px; } .units:has(.unit:nth-child(4)) .u-name { position: relative; } .units:has(.unit:nth-child(4)) .u-eq.u-inh { position: absolute; top: 0; right: 0; margin: 0; }
.cmd-pray .rest small { margin-left: 8px; }
.st-stock { background: #fff5c8; color: #7a5a00; border: 1px solid #e8c84a; } .st-stock.full { background: #ffe066; font-weight: bold; }
.st-shadow { background: #e4def0; color: #3a2a5a; border: 1px solid #9a8ac0; } .st-shadow.full { background: #5a4a8a; color: #fff; font-weight: bold; } .st-shadow small { letter-spacing: -1px; margin-left: 1px; }
.chart-wrap { overflow-x: auto; }
.unit-tip { position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 30; max-height: 45vh; overflow: auto; padding: 8px 12px; border-radius: 12px; background: rgba(50,35,50,.94); color: #fff; font-size: 13px; line-height: 1.45; white-space: pre-line; pointer-events: none; }
.bgm-row select { flex: 1 1 150px; min-width: 0; max-width: 100%; font: inherit; padding: 4px 6px; border-radius: 8px; }
.settings .arena-bgm { flex: 1; min-width: 0; font: inherit; padding: 3px 6px; border-radius: 8px; }
.bgm-room h2 { margin-top: 0; } .bgm-room h3 { margin: 10px 0 4px; font-size: 14px; }
.bgm-now { position: sticky; top: -4px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #fff0f5; } .bgm-now b { min-width: 0; overflow-wrap: anywhere; } .bgm-now button { flex: none; padding: 3px 10px; }
.bgm-vol { margin: 6px 0; } .bgm-vol span { width: auto; flex: none; }
.bgm-warn:empty { display: none; } .bgm-warn { margin: 6px 0; font-size: 13px; color: #c0504a; } .bgm-warn button { padding: 2px 10px; }
.bgm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; } .bgm-list button { padding: 6px 8px; text-align: left; overflow-wrap: anywhere; } .bgm-list button.on { border-color: var(--pink); background: #fff0f5; font-weight: bold; } .bgm-list button.on::before { content: '♪ '; }
.bgm-close { margin-top: 10px; }
/* 難易度は 4つ 同じ 幅で 1列に ならべる（画面の 幅で 1つだけ 折り返さないように） */
.lv-btns { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.arena-rules .row .lv-btns button { padding: 4px 2px; white-space: nowrap; }
.my-team { margin: 10px 0; } .team-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.btile { display: flex; flex-direction: column; align-items: center; width: 108px; padding: 4px; font-size: 12px; gap: 1px; background: #fff; }
.btile b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .btile small { color: var(--sub); }
.btile.on { border-color: var(--pink); background: #fff0f5; box-shadow: 0 0 0 3px var(--pink2); }
.btile.on::after { content: '✔ 出す'; color: var(--pink); font-weight: bold; }
.box-list { max-height: 58vh; overflow-y: auto; }
.btile-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; } .bt-acts { display: flex; gap: 4px; } .bt-acts button { padding: 1px 8px; font-size: 13px; } .bt-acts button.on { background: #fff1b8; }
.rename-btn { padding: 0 6px; margin-left: 4px; font-size: 12px; } .form-name { color: var(--sub); font-size: 11px; margin-left: 4px; } .name-input { width: min(260px, 100%); font-size: 16px; padding: 6px 10px; margin: 6px 0 10px; text-align: center; }
.starter { position: relative; } .starter .rare-badge { position: absolute; top: 4px; left: 4px; } .starter.rare { box-shadow: 0 0 0 2px #f2c230; }
.box-rec { background: #fff7f0; border-radius: 14px; padding: 6px 10px; margin: 8px 0; }
.br-head { display: flex; align-items: center; gap: 8px; } .br-head span { color: var(--sub); font-size: 12px; } .br-head button { margin-left: auto; padding: 2px 8px; }
.br-mons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
header.top.arena .money { display: none; }
.lobby-players .st-ic { display: flex; align-items: center; gap: 2px; }
.melee-sides { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; } .melee-sides .pp { background: #fff7f0; border-radius: 14px; padding: 6px 12px; }
.bt-foes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.battle:not(.many) .bt-foes > .bt-team { flex: 1 1 100%; min-width: 0; }   /* 相手1チームは 横いっぱい（スマホで カードが つぶれない） */
.battle.many .bt-team.foe { background: rgba(255,255,255,.35); border-radius: 14px; padding: 4px 6px; }
/* 乱戦: 相手チームは よこに ならべ、1体を 小さな 1行に */
.battle.many .bt-foes { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.battle.many .foe .units { flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.battle.many .foe .unit { width: auto; display: grid; grid-template-columns: 50px 1fr; column-gap: 4px; padding: 3px 6px; }
.battle.many .foe .unit > .u-art { grid-row: 1 / span 6; align-self: center; }
.battle.many .foe .unit canvas { width: 50px; height: 50px; }
.battle.many .foe .u-stg { min-height: 0; }
.battle.many .mine .unit { width: 140px; } .battle.many .mine .unit canvas { width: 84px; height: 84px; }
.bt-team.out { opacity: .55; } .bt-team.out .team-name::after { content: ' 💥全滅'; color: #c03a3a; }
.bt-place { list-style: none; padding: 0; margin: 4px auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; } .bt-place li.me { background: #fff3c0; border-radius: 8px; padding: 0 6px; }
@media (max-width: 900px) { .battle.many .mine .unit { width: 30%; min-width: 92px; } .battle.many .mine .unit canvas { width: 60px; height: 60px; } .battle.many .bt-foes { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); } }
/* 音の設定 */
.settings { max-width: 460px; margin: 0 auto; }
.set-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; } .set-row span { width: 9em; font-weight: bold; } .set-row input[type=range] { flex: 1; } .set-row b { width: 2.5em; text-align: right; }
/* 途中で 落ちたときの 再接続 */
.reconnect { position: fixed; inset: 0; z-index: 9999; background: rgba(40, 30, 20, .45); display: flex; align-items: center; justify-content: center; }
.reconnect > div { background: #fff; border-radius: 16px; padding: 18px 24px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px); }
.reconnect b { display: block; font-size: 1.1em; margin-bottom: 6px; }
.reconnect small { color: var(--sub); }
.lobby-players .away { color: #c07020; font-weight: normal; }
.title-box .resume { display: block; margin: 8px auto; background: #3a9a5a; }

/* 図鑑・技の秘伝書 */
canvas.sil { filter: brightness(0) opacity(.5); }
.note-sp { margin: 10px 0; }
.note-sp h4 { margin: 0 0 4px; }
.note-row { padding: 6px 8px; margin: 4px 0; border-radius: 8px; background: rgba(0,0,0,.04); }
.note-row.hidden { opacity: .7; }
.note-row p { margin: 4px 0 0; font-size: 13px; }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
/* 図鑑: タイプ相性表（格子） */
.tc-wrap { overflow-x: auto; margin: 6px 0; }
.tc-grid { border-collapse: separate; border-spacing: 3px; margin: 0 auto; table-layout: fixed; }
.tc-grid th, .tc-grid td { width: 46px; height: 40px; text-align: center; border-radius: 8px; padding: 0; }
.tc-grid td { font-size: 20px; font-weight: 900; cursor: pointer; background: #f4f1ec; color: #c8c0b4; transition: transform .1s; }
.tc-grid td:hover { transform: scale(1.12); }
.tc-grid td.tc-g, .tc-legend .tc-g { background: #ffd9d0; color: #e0402a; }
.tc-grid td.tc-b, .tc-legend .tc-b { background: #d6e8ff; color: #2a6ad0; }
.tc-grid td.tc-x, .tc-legend .tc-x { background: #4a4a58; color: #fff; }
.tc-legend .tc-n { background: #f4f1ec; }
.tc-grid th { background: none; }
.tc-corner small { font-size: 10px; color: var(--sub); }
.tc-el { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; height: 100%; border-radius: 8px; background: color-mix(in srgb, var(--c) 22%, #fff); border: 2px solid var(--c); cursor: pointer; }
.tc-el i { font-style: normal; font-size: 15px; } .tc-el b { font-size: 11px; color: #4a4038; }
.tc-grid .hl { outline: 3px solid #ffb020; outline-offset: -1px; }
.tc-grid th.hl .tc-el { background: color-mix(in srgb, var(--c) 55%, #fff); }
.tc-say { min-height: 1.6em; font-size: 15px; margin: 6px 0 2px; }
.tc-vg { color: #e0402a; } .tc-vb { color: #2a6ad0; } .tc-vx { color: #4a4a58; } .tc-vn { color: var(--sub); }
.tc-legend { font-size: 12px; color: var(--sub); }
.tc-legend span { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; border-radius: 5px; font-weight: 900; text-align: center; vertical-align: middle; }
@media (max-width: 600px) { .tc-grid { border-spacing: 2px; } .tc-grid th, .tc-grid td { width: 25px; height: 28px; border-radius: 5px; } .tc-grid td { font-size: 14px; } .tc-el { border-width: 1px; border-radius: 5px; } .tc-el i { font-size: 12px; } .tc-el b { font-size: 8px; } .tc-corner small { font-size: 7px; } .tc-say { font-size: 13px; } }
/* 特性研究ノート: 種族の 固有技 */
.note-sig { margin: 6px 0 2px; padding: 4px 8px; border-radius: 8px; background: #fff6e0; border: 1px solid #f0d8a8; }
.note-sig summary { cursor: pointer; font-weight: 900; font-size: 13px; color: #8a5a10; }
.note-sig ul { list-style: none; margin: 4px 0 0; padding: 0; }
.note-sig li { padding: 4px 0; border-top: 1px dashed #f0d8a8; }
.note-sig li p { margin: 2px 0 0; font-size: 12px; color: var(--sub); }
.note-syn { margin: 6px 0 2px; padding: 5px 8px; border-radius: 8px; background: #eef8ec; border: 1px solid #c8e4c0; font-size: 13px; }
.note-syn > span { font-weight: 900; color: #3a7a3a; } .note-syn > span small { font-weight: 400; color: var(--sub); }
.note-syn > p { margin: 2px 0 0; font-size: 12px; }
.note-syn.tmp { background: #f4f6f2; border-style: dashed; } .note-syn.tmp > span small { font-weight: 400; color: var(--sub); }
.note-syn ul { list-style: none; margin: 3px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.note-syn li { background: #fff; border-radius: 10px; padding: 2px 9px; border: 1px solid #c8e4c0; }
.note-syn li small { display: block; font-size: 11px; color: var(--sub); }
.dex-box { max-width: 980px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.dex-sp { background: #fff6ee; border-radius: 12px; padding: 8px 10px; }
.dex-sp h4 { margin: 0 0 6px; } .sp-reveal { display: block; padding: 2px 10px; font-size: 12px; margin: 0 0 6px; }
.dex-sp h4 small { display: block; font-weight: normal; color: var(--sub); font-size: .8em; }
.dex-tree { display: flex; align-items: center; gap: 6px; }
.dex-br { display: flex; flex-direction: column; gap: 4px; }
.dex-row { display: flex; align-items: center; gap: 4px; }
.dex-row .arrow { font-size: .75em; color: var(--sub); white-space: nowrap; }
.dex-cell { display: flex; flex-direction: column; align-items: center; padding: 3px; border-radius: 10px; background: #fff; border: 2px solid transparent; width: 76px; cursor: pointer; }
.dex-cell canvas { width: 52px; height: 52px; }
.dex-cell small { font-size: .7em; line-height: 1.1; text-align: center; min-height: 2.2em; }
.dex-cell.hidden small { color: var(--sub); }
.dex-cell.on { border-color: #ff9a3a; background: #fff1dd; }
.dex-detail { margin-top: 12px; background: #fffaf4; border-radius: 12px; padding: 10px 14px; text-align: left; }
.dd-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dd-top h3 { margin: 0 0 4px; }
.dex-how { margin: 4px 0; padding-left: 1.2em; }
.dex-how li { margin: 3px 0; }
.mv-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.mv-tools select { font: inherit; padding: 3px 6px; border-radius: 8px; }
.mv-scroll { max-height: 60vh; overflow: auto; }
.mv-table { width: 100%; border-collapse: collapse; font-size: .9em; text-align: left; }
.mv-table th { position: sticky; top: 0; background: #ffe7cc; padding: 5px; white-space: nowrap; }
.mv-table td { padding: 5px; border-bottom: 1px solid #f0e2d2; vertical-align: top; }
.mv-table td.num { text-align: right; white-space: nowrap; }
.mv-table td.nw { white-space: nowrap; }
.mv-desc { font-size: .85em; color: var(--sub); }
.mv-who { font-size: .8em; color: #7a6040; }
@media (max-width: 600px) { .mv-table th:nth-child(4), .mv-table td:nth-child(4) { display: none; } .dex-grid { grid-template-columns: 1fr; } }

/* 保管庫の 書き出し・読み込み */
.box-io { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: 6px 0 10px; }
.box-io small { color: var(--sub); }
.box-code { width: 100%; box-sizing: border-box; height: 120px; font-family: monospace; font-size: .75em; word-break: break-all; border-radius: 10px; padding: 8px; }
.file-btn { display: inline-block; padding: 6px 14px; border-radius: 10px; background: #fff1dd; cursor: pointer; margin: 6px 0; }

/* スタンプ 8種（4列）・ショートカットの 番号 */
.stamp-palette { grid-template-columns: repeat(4, 1fr); }
.stamp-palette canvas { width: 104px; height: 92px; }
.stamp-palette button { position: relative; }
.stamp-palette kbd { position: absolute; left: 4px; top: 3px; font-size: 11px; background: #fff3e0; border: 1px solid #e6c9b8; border-radius: 5px; padding: 0 4px; color: #7a6040; }
@media (max-width: 600px) { .stamp-palette { grid-template-columns: repeat(2, 1fr); } .stamp-palette canvas { width: 92px; height: 81px; } .stamp-palette kbd { display: none; } }

/* レアモン（氷・蒸気・祟の 属性・バッジ） */
.el-warp { background: #7a3ac8; } .el-b-warp { border-color: #7a3ac8 !important; } .el-t-warp { color: #6a2ab8; } .el-bg-warp { background: #f3ecff; border-color: #b08ae0; }
.el-thunder { background: #e0b000; } .el-earth { background: #a8824f; } .el-b-thunder { border-color: #e0b000 !important; } .el-b-earth { border-color: #a8824f !important; } .el-t-thunder { color: #b08a00; } .el-t-earth { color: #8a6a3a; }
.el-bg-thunder { background: #fff9dc; border-color: #ecd25a; } .el-bg-earth { background: #f7f0e6; border-color: #cdb48a; }
.el-ice { background: #6ad0f0; } .el-steam { background: #d09ab0; } .el-tatari { background: #7a6a3a; }
.el-b-ice { border-color: #6ad0f0 !important; } .el-b-steam { border-color: #d09ab0 !important; } .el-b-tatari { border-color: #7a6a3a !important; }
.el-t-ice { color: #2a9ac0; } .el-t-steam { color: #b06a8a; } .el-t-tatari { color: #6a5a2a; }
.rare-badge { display: inline-block; font-style: normal; font-size: 11px; font-weight: bold; color: #8a5a00; background: linear-gradient(90deg, #fff1b0, #ffd860, #fff1b0); border: 1px solid #e0b030; border-radius: 8px; padding: 0 6px; margin-bottom: 2px; }
.mcard.rare { box-shadow: 0 0 0 2px #f2c230, 0 0 14px rgba(242, 194, 48, .55); }
.btile.rare { box-shadow: 0 0 0 2px #f2c230; }
.btile .rare-badge { position: absolute; top: 2px; left: 2px; }
.btile { position: relative; }
.cand.rare { box-shadow: 0 0 0 3px #f2c230, 0 0 18px rgba(242, 194, 48, .7); animation: rareGlow 1.4s ease-in-out infinite alternate; }
@keyframes rareGlow { from { box-shadow: 0 0 0 3px #f2c230, 0 0 8px rgba(242, 194, 48, .5); } to { box-shadow: 0 0 0 3px #ffe680, 0 0 22px rgba(242, 194, 48, .9); } }
.rare-rule { margin-top: 8px; }
.dex-sp.rare { background: linear-gradient(135deg, #fff8dc, #fff0f6); box-shadow: 0 0 0 2px #f2c230; }

/* ---- 検証バトル */
body.lab-open #helper, body.lab-open #stampFab { display: none; }
#labRoot { position: fixed; inset: 0; z-index: 18; background: var(--bg1); overflow-y: auto; color: var(--ink); }
.lab-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 2px solid var(--line); }
.lab-top .spacer { flex: 1; } #labBanner { color: var(--red); font-weight: bold; font-size: 13px; }
.lab-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 12px; padding: 12px; max-width: 1300px; margin: 0 auto; }
.lab-big { background: #2b2233; color: #fff; border-radius: 16px; padding: 12px 18px; margin-bottom: 10px; min-height: 150px; cursor: pointer; }
.lab-big.pop .lab-big-n { animation: labPop .28s ease-out; }
@keyframes labPop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.lab-big-t { font-size: 14px; opacity: .85; }
.lab-big-n { font-size: clamp(44px, 8vw, 84px); font-weight: 900; line-height: 1.15; transform-origin: left center; overflow-wrap: anywhere; }
.lab-big-n small { font-size: .28em; font-weight: bold; color: #fff; }
.lab-big-empty { opacity: .45; }
.lab-big-d { font-size: 18px; } .lab-big-d b { font-size: 24px; } .lab-big-d small { font-size: 13px; opacity: .85; }
.lab-big-d .up { color: #ffcf3f; font-size: 18px; } .lab-big-d .down { color: #9ac8ff; font-size: 18px; }
.lab-big-p { font-size: 12.5px; opacity: .8; margin-top: 4px; overflow-wrap: anywhere; }
.lab-row h4 { margin: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lab-row h4 input { width: 56px; }
.lab-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.lab-card { width: 124px; padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--panel); border: 2px solid var(--line); border-radius: 12px; color: var(--ink); font-size: 13px; font-weight: normal; }
.lab-card.mine { border-color: var(--pink2); } .lab-card.on { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink2); }
.lab-card.ko { opacity: .4; filter: grayscale(1); }
.lab-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lab-card .bar { width: 100%; }
.lab-card small { font-size: 11px; color: var(--sub); }
.lab-dummy { font-size: 46px; height: 72px; line-height: 72px; }
.lab-stg { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 14px; }
.lab-stg i { font-style: normal; font-size: 10px; padding: 0 4px; border-radius: 6px; background: #eee; } .lab-stg .up { background: #ffe0d0; } .lab-stg .down { background: #d8e4ff; }
.lab-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.lab-cmd b { min-width: 90px; font-size: 13px; } .lab-cmd select { flex: 1 1 150px; min-width: 0; max-width: 100%; }
.lab-go { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.lab-form { display: flex; flex-direction: column; gap: 6px; } .lab-form > label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.lab-form > label select { flex: 1; min-width: 0; } .lab-form small.note { font-size: 11.5px; line-height: 1.4; }
.lab-form h4 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lab-chk { font-size: 13px; }
.lab-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px 8px; } .lab-stats label { font-size: 12px; display: flex; flex-direction: column; } .lab-stats input, .lab-stats select { width: 100%; }
.lab-scale { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .lab-scale input { width: 80px; }
.lab-log { max-height: 340px; overflow-y: auto; font-size: 12px; line-height: 1.5; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.lab-l { overflow-wrap: anywhere; white-space: pre-wrap; } .lab-l.turn { font-weight: bold; margin-top: 4px; } .lab-l.act { font-weight: bold; } .lab-l.hit { color: #c0402a; } .lab-l.sub { color: var(--sub); } .lab-l.sum { font-weight: bold; color: #2a8a4a; } .lab-l.sep { color: var(--pink); font-weight: bold; }
@media (max-width: 800px) { .lab-grid { grid-template-columns: minmax(0, 1fr); padding: 8px; } .lab-card { width: 104px; } }

/* ---- スマホ: あまり スクロールしない 配置（PC の 見た目は かえない） */
.hdr-tools { display: contents; }
#menuBtn, .lt-tabs, .t-sel { display: none; }
@media (max-width: 600px) {
  /* ヘッダー: 1行。ボタンは ☰ に まとめる */
  header.top { gap: 6px; padding: 4px 8px; flex-wrap: nowrap; font-size: 13px; }
  .week { font-size: 14px; white-space: nowrap; } .acts { letter-spacing: 0; font-size: 11px; white-space: nowrap; } .money, .wins { white-space: nowrap; } .money b, .wins b { font-size: 14px; } .w-lab { display: none; }
  #menuBtn { display: block; width: 30px; height: 30px; flex-shrink: 0; }
  .hdr-tools { display: none; position: absolute; top: 100%; right: 6px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 8px; gap: 6px; flex-wrap: wrap; justify-content: flex-end; width: min(250px, calc(100vw - 12px)); box-shadow: 0 6px 16px rgba(60,40,60,.25); z-index: 6; }
  .hdr-tools.open { display: flex; }
  /* 全体の すきま */
  .layout { padding: 4px; gap: 6px; } .panel { padding: 8px; border-radius: 12px; margin-bottom: 6px; box-shadow: none; }
  h2 { font-size: 16px; margin: 0 0 4px; } h2 small, h3 small { font-size: 11px; margin-left: 4px; } h3 { font-size: 14px; margin: 8px 0 4px; }
  /* iPhone: 100vh は アドレスバーの ぶん 画面より 大きい → dvh（いま 見えている 高さ）で はみ出さない。下は ホームバーの ぶん あける */
  .modal { padding: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); } .modal-box { padding: 10px; border-radius: 14px; max-height: 96vh; max-height: calc(100dvh - 12px - env(safe-area-inset-bottom, 0px)); }
  button.big { font-size: 16px; padding: 8px 18px; }
  /* 行動ボタン */
  .actions.home-acts { gap: 4px; margin: 0 0 4px; padding: 2px 0; } .home-acts .act { flex-direction: row; gap: 4px; padding: 4px; border-radius: 12px; border-width: 2px; } .home-acts .act span { font-size: 18px; } .home-acts .act b { font-size: 13px; }
  /* モンスターの カード: たたんで 1行。おすと ひらく */
  .mons { gap: 4px; } .mcard { padding: 6px; border-radius: 12px; } .mcard.empty { display: none; }
  .mcard.fold { position: relative; }
  .mcard.fold .mc-top { cursor: pointer; padding-right: 58px; } .mcard.fold .mc-top canvas { width: 52px; height: 52px; }
  .mc-name b { font-size: 14px; } .mc-name .tags { margin-top: 1px; } .mc-name .fr { font-size: 10px; }
  .mcard.fold:not(.open) .stats, .mcard.fold:not(.open) .moves, .mcard.fold:not(.open) .traits, .mcard.fold:not(.open) .evo .next, .mcard.fold:not(.open) .mc-name .fr, .mcard.fold:not(.open) .tag.apt, .mcard.fold:not(.open) .tag.role { display: none; }
  .mc-name { min-width: 0; overflow-wrap: anywhere; } .mcard.fold:not(.open) .form-name { display: none; }
  .mcard.fold:not(.open) .evo { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; font-size: 10px; line-height: 1.2; } .mcard.fold:not(.open) .ebar { flex: 1; min-width: 40px; height: 6px; margin: 0; } .mcard.fold:not(.open) .evo span { white-space: nowrap; }
  .mcard.fold .mc-top::after { content: '▼'; position: absolute; top: 34px; right: 12px; font-size: 11px; color: var(--sub); } .mcard.fold.open .mc-top::after { content: '▲'; }
  .mcard.fold .party-btn { position: absolute; top: 6px; right: 6px; width: auto; margin: 0; padding: 2px 6px; font-size: 11px; z-index: 1; }
  .pb-more { display: none; } .rename-btn { padding: 0 4px; margin-left: 2px; font-size: 10px; } .form-name { font-size: 10px; margin-left: 2px; }
  .bt-head { flex-wrap: wrap; } .bt-head b { min-width: 0; overflow-wrap: anywhere; } .battle, .bt-team, .units, .bt-log, .bt-cmd { max-width: 100%; box-sizing: border-box; } .team-name { overflow-wrap: anywhere; }
  .modal-box .center:has(#boxOk) { position: sticky; bottom: -10px; background: var(--panel); padding: 4px 0; z-index: 1; }
  /* 4体の チームは 1列に おさめる */
  .units:has(.unit:nth-child(4)) { gap: 3px; flex-wrap: nowrap; } .units:has(.unit:nth-child(4)) .unit { width: 24%; min-width: 0; padding: 2px; } .units:has(.unit:nth-child(4)) .unit canvas { width: 50px; height: 50px; }
  main { width: 100%; }   /* 中身の 幅で 画面が 広がらないように */
  .battle:not(.many) .units { flex-wrap: nowrap; gap: 4px; } .battle:not(.many) .unit { flex: 1 1 0; min-width: 0; max-width: 34%; }
  .battle:not(.many) .units:not(:has(.unit:nth-child(3))) .unit { max-width: 46%; }   /* 1〜2体なら 名前が 見える 幅に */
  .units:has(.unit:nth-child(4)) .u-name { line-height: 1.2; } .units:has(.unit:nth-child(4)) .u-name .el { display: table; margin-bottom: 1px; } .units:has(.unit:nth-child(4)) .u-name b { display: block; overflow: hidden; text-overflow: ellipsis; } .units:has(.unit:nth-child(4)) .u-eq { display: none; }
  .u-pal { right: -2px; bottom: -2px; } .u-pal canvas { width: 26px !important; height: 26px !important; }   /* おとも: 本体に かぶらない 大きさ */
  /* 画面の いちばん下は ブラウザの バーや ホームバーに 近くて おしにくい → 下に 余白を とって、上へ スクロールして おせる ように */
  .layout { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  #title.show, #labRoot { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .toast { max-width: calc(100vw - 24px); box-sizing: border-box; }
  .st-sil canvas { width: 96px; height: 96px; } .st-q { font-size: 14px; } .st-choices button { padding: 8px 6px; font-size: 13px; } .st-scene { min-height: 90px; padding: 8px 10px; } .st-text { font-size: 15px; } .st-map span { width: 22px; height: 22px; line-height: 22px; font-size: 11px; } .st-map { gap: 2px; margin-bottom: 4px; } .st-mon { min-width: 80px; padding: 4px 6px; } .st-mon canvas { width: 50px; height: 50px; } .story .note { font-size: 11px; margin: 2px 0; }
  /* 鍛える */
  .t-intro { display: none; } .trow { display: block; margin-bottom: 6px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 4px; } .trow .mcard { border: none; padding: 0; width: 100%; } .trow .mc-top canvas { width: 40px; height: 40px; } .trow .mc-name .tags, .trow .mc-name .fr { display: none; }
  .trow .stats { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 1px 0 3px; } .trow .st { display: flex; gap: 2px; font-size: 10.5px; } .trow .sbar { display: none; }
  .menus { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; min-width: 0; } .menu { padding: 2px 1px; border-radius: 8px; border-width: 2px; } .menu span { font-size: 16px; line-height: 1.1; } .menu b { font-size: 9.5px; font-weight: bold; line-height: 1.1; } .menu small { display: none; }
  .t-sel { display: block; margin: 2px 0 0; font-size: 11px; color: var(--sub); }
  #trainGo { position: sticky; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 3; width: 100%; min-height: 44px; }
  .dungeons, .ranks { gap: 4px; grid-template-columns: minmax(0, 1fr); } .dg, .rank { padding: 6px 8px; border-radius: 10px; font-size: 11px; gap: 1px; } .dg b, .rank b { font-size: 14px; }
  /* サイド */
  .feed { height: 84px; } .side .panel h3 { margin: 0 0 2px; font-size: 12px; } .roster li { padding: 2px 6px; margin-bottom: 2px; } .r-st { display: none; } .r-mons canvas { width: 24px; height: 24px; }
  main[data-v="battle"] ~ .side { display: none; }
  /* バトル: 1画面に おさめる */
  .battle { padding: 4px; border-radius: 12px; } .bt-head b { font-size: 13px; } .bt-head { font-size: 12px; gap: 6px; } .bt-head button { padding: 2px 8px; font-size: 12px; } .bt-team { margin: 2px 0; } .team-name { font-size: 12px; margin-bottom: 1px; padding-left: 5px; border-left-width: 4px; }
  .unit { padding: 2px 4px; border-radius: 10px; width: 31%; min-width: 96px; } .unit canvas { width: 62px; height: 62px; } .unit .u-name { font-size: 11px; } .bar { margin-top: 1px; } .u-num { font-size: 10px; line-height: 1.1; } .u-stg { min-height: 0; font-size: 10px; }
  .bt-log { display: flex; flex-direction: column; justify-content: flex-end; height: 58px; min-height: 0; overflow: hidden; font-size: 12px; line-height: 1.35; padding: 3px 8px; margin: 2px auto; }
  .bt-log.bt-full-body { display: block; height: auto; font-size: 13px; line-height: 1.5; overflow-y: auto; }
  .bt-cmd { padding: 4px; min-height: 40px; } .cmd-who { margin-bottom: 3px; font-size: 13px; } .cmds { gap: 4px; }
  .cmds.moves4 button { min-height: 0; padding: 3px 6px; font-size: 12px; position: relative; } .cmds.moves4 button b { font-size: 13px; line-height: 1.2; padding-right: 30px; } .cmds.moves4 button small { font-size: 10px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .cmds.moves4 .mpc { position: absolute; top: 2px; right: 5px; font-size: 10px; } .cmds.moves4 button { padding-right: 6px; }
  .bt-full { top: 40px; max-height: 80vh; max-height: 80dvh; padding: 6px 8px; }
  body:has(#game.show main[data-v="battle"]) #helper { display: none; }
  .stamp-fab { width: 44px; height: 44px; font-size: 20px; right: 8px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .stamp-palette { right: 8px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  #helper { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .unit-tip { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  input:not([type=range]):not([type=checkbox]) { font-size: 16px; }   /* iPhone で 入力時に 拡大されない */
  .title-box a.link { display: none; }   /* 工房は この PC からだけ */
  /* タイトル */
  .title-parade, .evo-ticker, .sub { display: none; } .title-box { padding: 10px; border-radius: 16px; } .logo { font-size: 30px; }
  .title-mons { margin: 2px 0; } .title-mons canvas { width: 70px; height: 70px; } .field { margin: 2px 0; font-size: 12px; } .field input { margin-top: 2px; }
  .join-row { margin-top: 6px; } .title-box .msg { margin: 2px 0; }
  .title-box button.resume { display: block; width: 100%; margin: 4px 0; font-size: 14px; padding: 6px; }
  .title-box button.link { display: inline-block; font-size: 12px; padding: 3px 5px; }
  /* ロビー */
  #lobby.show { padding: 4px 4px calc(72px + env(safe-area-inset-bottom, 0px)); gap: 4px; } .lobby-box { padding: 8px; margin-bottom: 0; } .lobby-box h2 { display: none; }
  .room-code { font-size: 12px; } .room-code b { font-size: 20px; letter-spacing: 3px; } .invite { margin: 2px 0; } .invite input { font-size: 10px; padding: 3px 6px; } .invite button { font-size: 11px; padding: 3px 6px; }
  .mode-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-bottom: 3px; } .mode-tabs button { padding: 3px 1px; font-size: 11px; min-width: 0; } .mode-tabs button b { font-size: 11px; white-space: nowrap; } .mode-tabs small { display: none; }
  .arena-rules { padding: 3px 6px; margin: 2px 0; border-radius: 8px; font-size: 11px; } .arena-rules .note { display: none; } .arena-rules .row > span { width: auto; } .arena-rules .row { flex-wrap: wrap; gap: 3px; margin: 1px 0; } .arena-rules .row button, .arena-rules .row > span { white-space: nowrap; } .arena-rules .row small { flex-basis: 100%; font-size: 10px; } .arena-rules .row button { padding: 1px 6px; font-size: 11px; } .invite input { display: none; } .invite { justify-content: center; } .room-code { display: inline-block; margin-right: 6px; } .invite { display: inline-flex; }
  .cmds.moves4 button.empty { display: none; }
  .starter-pick h3 { font-size: 13px; margin: 3px 0; } .starters { gap: 3px; } .starter { padding: 3px; border-radius: 10px; } .starter canvas { max-width: 54px; } .starter b { font-size: 12px; line-height: 1.1; } .starter span { font-size: 10px; } .starter small { display: none; }
  .lobby-players { margin: 4px 0; } .lobby-players li { padding: 2px 8px; margin: 2px 0; font-size: 12px; } #lobbyNote { font-size: 10.5px; margin: 2px 0; }
  #startBtn { width: 100%; } .lobby-box .msg { margin: 2px 0; font-size: 12px; }
  .lobby-box button.link { font-size: 12px; padding: 2px 5px; }
  .chat-box { width: 100%; padding: 6px; } .chat-log { height: 56px; font-size: 12px; }
  /* 待機部屋: タブで わける */
  .lt-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin: 4px 0; position: sticky; top: var(--hdr, 40px); z-index: 3; background: var(--panel); padding: 2px 0; }
  .lt-tabs button { padding: 4px 1px; font-size: 11px; border-radius: 8px; white-space: nowrap; } .lt-tabs button.on { background: var(--pink); color: #fff; border-color: var(--pink); }
  .lounge[data-tab="item"] .lt-sec:not([data-sec="item"]), .lounge[data-tab="gear"] .lt-sec:not([data-sec="gear"]), .lounge[data-tab="scroll"] .lt-sec:not([data-sec="scroll"]), .lounge[data-tab="breed"] .lt-sec:not([data-sec="breed"]), .lounge[data-tab="mon"] .lt-sec:not([data-sec="mon"]) { display: none; }
  .lt-sec h3 { display: none; } .lt-sec[data-sec="mon"] h3 { display: block; } .lounge > h2 small { display: none; }
  .ready-box { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 11px; } .ready-box button[data-lab] { font-size: 11px; padding: 2px 6px; }
  .shop { gap: 4px; grid-template-columns: minmax(0, 1fr); } .item { padding: 4px 6px; gap: 6px; border-radius: 10px; } .item .ic { font-size: 20px; } .item small { font-size: 10.5px; line-height: 1.25; } .item button { padding: 4px 8px; font-size: 12px; }
}

/* 祭りの章: 瀕死無効・HP増減反転・概念変更 */
.st-deathless { background: #c09a2a; } .st-invert { background: #3a9a9a; }
.unit.hp-zero { box-shadow: 0 0 0 2px #e0b040, 0 0 12px rgba(224,176,64,.8); } .unit.hp-zero .u-num { color: #c03030; font-weight: bold; }
.unit { position: relative; } .tgt-real { position: absolute; left: 2px; right: 2px; top: 2px; z-index: 3; background: #4a2a8a; color: #fff; font-size: 11px; font-weight: bold; border-radius: 6px; padding: 1px 3px; text-align: center; pointer-events: none; overflow-wrap: anywhere; }
.real-t { display: block; color: #6a2ab8; font-weight: bold; }
.st-ally { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 6px 0; font-weight: bold; } .st-ally span { display: inline-flex; align-items: center; gap: 4px; } .st-ally small { color: var(--sub); font-weight: normal; }
.m-badge.md-lantern { color: #ff7a2a; text-shadow: 0 0 6px rgba(255,160,60,.9); }
.m-badge.md-sunshell { color: #19b8c8; text-shadow: 0 0 6px rgba(80,220,230,.9); }
.m-badge.md-yamamatsuri { color: #4a9a5a; text-shadow: 0 0 6px rgba(120,220,140,.9); }
.stt.st-buff { background: linear-gradient(135deg, #fff6c8, #ffe08a); color: #6a4a00; border-radius: 8px; padding: 0 4px; font-size: 11px; font-weight: bold; box-shadow: 0 0 0 1px #e8c050 inset; } .stt.st-buff small { font-size: 9px; margin-left: 1px; opacity: .8; }
.stt.st-union { background: #fff0c8; color: #8a5a00; border-radius: 8px; padding: 0 4px; font-size: 11px; font-weight: bold; }
.m-badge.md-curtain { color: #e0304a; text-shadow: 0 0 6px rgba(255,90,130,.9); }

/* 異常値（状態異常の ゲージ） */
.stt.st-gauge { position: relative; overflow: hidden; padding-bottom: 3px; }
.stt.st-gauge i { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--g); background: currentColor; opacity: .55; }
.bt-from { display: block; font-size: 10px; color: #8a7a8a; text-align: center; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 千灯祭の 夜店 */
.mz-partner { display: flex; align-items: center; gap: 10px; justify-content: center; background: #fff8ee; border: 2px solid #e8b878; border-radius: 14px; padding: 6px 12px; margin: 6px auto; max-width: 360px; } .mz-partner div { display: flex; flex-direction: column; } .mz-partner small { color: var(--sub); }
.mz-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 520px; margin: 8px auto; } .mz-menu button, .mz-prizes button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 10px 12px; border-radius: 12px; } .mz-menu button b, .mz-prizes button b { font-size: 16px; } .mz-menu small, .mz-prizes small { font-size: 12px; opacity: .85; line-height: 1.4; }
.mz-menu .mz-fire { background: #3a2a5a; color: #ffe9a8; border-color: #3a2a5a; }
.mz-prizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; max-width: 620px; margin: 8px auto; }
.mz-btns button { margin: 2px 4px; }
@media (max-width: 520px) { .mz-menu { grid-template-columns: 1fr; } .mz-menu button, .mz-prizes button { padding: 8px 10px; } .mz-menu button b, .mz-prizes button b { font-size: 15px; } .mz-partner canvas { width: 56px; height: 56px; } }
