/* ETERNAL DUNGEON - スマホ縦画面を最優先 */
:root {
  --bg: #0b0d17; --panel: #151829; --panel2: #1d2136; --line: #2c3152; --text: #ece6d8; --sub: #9aa0bb;
  --gold: #d9b66a; --gold2: #f3d894; --bad: #e2574c; --good: #5fd47a; --hp: #58c26a; --ally: #6fb2ff; --enemy: #ff8a7a;
  --r0: #a9b0c0; --r1: #5fd47a; --r2: #4aa8ff; --r3: #c56bff; --r4: #ffb02e; --set: #3fd6c0;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "MS PMincho", serif;
  --sans: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  --nav: 58px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #05060c; }
body {
  margin: 0; color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.55;
  background: radial-gradient(120% 60% at 50% 0%, #1b1f38 0%, var(--bg) 55%, #05060c 100%) fixed;
  min-height: 100vh; min-height: 100dvh; touch-action: manipulation; overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%; user-select: none; -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
h1, h2, h3, p { margin: 0; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 14px); }
#app.nonav { padding-bottom: 0; }
.scr { padding: 0 12px 8px; }
.scr-run, .scr-result { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.scr-battle { padding-bottom: 0; }
.sub { color: var(--sub); font-size: 12.5px; }
.pad { padding: 8px 2px; } .center { text-align: center; }
.lead { color: #cfc9ba; font-size: 13.5px; padding: 10px 4px; } .lead b { color: var(--gold2); }

/* ヘッダーとナビ */
.top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 2px 10px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(#0b0d17 70%, transparent); }
.top h1 { font-family: var(--serif); font-size: 19px; letter-spacing: .08em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .back { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); font-size: 22px; line-height: 1; padding: 0 0 3px; }
.res { display: flex; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res .gold { color: var(--gold2); } .res .stone { color: #9fd8ff; }
.logo { font-family: var(--serif); font-size: 21px; letter-spacing: .16em; color: var(--gold2); flex: 1; line-height: 1.05; text-shadow: 0 0 18px #d9b66a55; }
.logo small { display: block; font-size: 10px; letter-spacing: .5em; color: var(--gold); }
.logo.big { font-size: 34px; text-align: center; margin: 8px 0 18px; } .logo.big small { font-size: 13px; }
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; display: flex; z-index: 20;
  background: #0d1020f2; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px); }
.nav button { flex: 1; height: var(--nav); border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--sub); }
.nav button i { font-style: normal; font-family: var(--serif); font-size: 19px; width: 30px; height: 30px; line-height: 28px; border: 1px solid transparent; border-radius: 9px; }
.nav button span { font-size: 10px; }
.nav button.on { color: var(--gold2); } .nav button.on i { border-color: var(--gold); background: #d9b66a1a; }

/* ボタン類 */
.btn { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 10px 12px; min-height: 44px; font-size: 14px; }
.btn:active:not(:disabled), .big-btn:active, .tile-btn:active, .room:active, .sk-btn:active:not(:disabled) { transform: translateY(1px); filter: brightness(1.15); }
.btn small { color: var(--sub); font-size: 11.5px; }
.btn.gold { border-color: #a5894a; background: linear-gradient(#5b4a22, #3d3117); color: var(--gold2); }
.btn.gold small { color: #e0cf9d; }
.btn.danger { border-color: #7a3530; background: #3a1c1b; color: #ffb3aa; }
.btn.ghost { background: transparent; color: var(--sub); }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 12.5px; }
.btn.on { border-color: var(--gold); color: var(--gold2); background: #d9b66a1c; }
.btn.wide { display: block; width: 100%; margin: 10px 0; }
.btn-row { display: flex; gap: 8px; margin: 10px 0; } .btn-row .btn { flex: 1; }
.btn-row.sticky { position: sticky; bottom: -14px; background: linear-gradient(transparent, var(--panel) 30%); padding: 14px 0 6px; margin-bottom: 0; }
.btn-col { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.big-btn { display: block; width: 100%; margin: 12px 0; padding: 15px; border-radius: 14px; border: 1px solid #b89a57; font-family: var(--serif); font-size: 19px; letter-spacing: .2em;
  color: #1a1408; background: linear-gradient(#f3d894, #c89c45); box-shadow: 0 6px 22px #d9b66a33, inset 0 1px 0 #fff6; font-weight: 700; }
.big-btn small { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .04em; font-weight: 400; margin-top: 2px; }
.big-btn.warn { background: linear-gradient(#ffb08a, #d9603b); border-color: #ffb08a; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile-btn { text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 11px 12px; }
.tile-btn b { display: block; font-family: var(--serif); font-size: 16px; letter-spacing: .08em; }
.tile-btn small { color: var(--sub); font-size: 11.5px; }
.chip { display: inline-block; border: 1px solid var(--line); background: var(--panel2); border-radius: 99px; padding: 2px 9px; font-size: 11.5px; margin: 2px 3px 2px 0; color: #cfd3e6; line-height: 1.5; }
button.chip { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
.chip.good { border-color: #2f6b45; color: #9fe6b3; background: #17301f; }
.chip.bad { border-color: #7a3530; color: #ffb3aa; background: #331a19; }
.chip.on { border-color: var(--gold); color: var(--gold2); background: #d9b66a22; }
.chip.act { border-color: #4a6a9a; color: #b9d6ff; }
.chip.trait { border-radius: 8px; font-size: 11px; } .chip.trait b { color: var(--gold2); }
.filters { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.tabs { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 3px; margin: 2px 0 10px; }
.tabs button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 9px 0; color: var(--sub); font-family: var(--serif); letter-spacing: .15em; }
.tabs button.on { background: var(--panel2); color: var(--gold2); box-shadow: inset 0 0 0 1px #a5894a; }
.el { --c: #ccc; display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 700;
  color: #0b0d17; background: var(--c); margin: 0 1.5px; vertical-align: middle; box-shadow: 0 0 6px color-mix(in srgb, var(--c) 60%, transparent); }
.el.unk { background: #333955; color: #9aa0bb; box-shadow: none; } .el.wpn { background: #8b93b5; }
.bar { height: 7px; border-radius: 4px; background: #0a0c16; overflow: hidden; border: 1px solid #00000080; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--hp); transition: width .25s ease-out; }
.bar.hp i { background: linear-gradient(90deg, #3fae5a, #8be07a); } .bar.exp i { background: linear-gradient(90deg, #4a79d9, #7fc4ff); }
.stars { color: var(--gold2); font-size: 12px; letter-spacing: 1px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; }
.panel h2, .scr h3, .modal-box h3 { font-family: var(--serif); font-size: 15px; letter-spacing: .1em; color: var(--gold2); margin: 2px 0 8px; }
.panel h2 small { font-family: var(--sans); font-size: 11px; color: var(--sub); letter-spacing: 0; margin-left: 6px; font-weight: 400; }
.modal-box h3, .scr h3 { margin-top: 14px; }
.art { display: block; flex: none; border-radius: 10px; } .art.mon { filter: drop-shadow(0 4px 6px #0009); }
.art.shadow { filter: brightness(0) drop-shadow(0 0 2px #6a70a0); opacity: .75; }

/* 拠点 */
.season-card { --c: #d9b66a; border: 1px solid color-mix(in srgb, var(--c) 55%, #000); border-radius: 16px; padding: 13px 14px; margin: 4px 0 10px; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 60%), var(--panel); }
.sc-tag { font-size: 11px; color: var(--sub); letter-spacing: .08em; }
.sc-name { font-family: var(--serif); font-size: 25px; letter-spacing: .14em; color: color-mix(in srgb, var(--c) 70%, #fff); text-shadow: 0 0 20px color-mix(in srgb, var(--c) 50%, transparent); margin: 2px 0 4px; }
.sc-foot { font-size: 11px; color: var(--sub); margin-top: 5px; }
.goal { display: flex; align-items: center; gap: 10px; border: 1px dashed #4a5078; border-radius: 12px; padding: 9px 12px; margin: 10px 0; background: #12152440; }
.goal.done { border: 1px solid var(--gold); background: #d9b66a14; animation: pulse 1.6s infinite; }
.goal-t { flex: 1; font-size: 13.5px; } .goal-t small { display: block; color: var(--gold); font-size: 10.5px; letter-spacing: .15em; }
.goal-r { font-size: 12px; color: var(--gold2); white-space: nowrap; }
.party-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.ps { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 7px 2px 5px; min-width: 0; }
.ps .art { margin: 0 auto 3px; width: 100%; max-width: 68px; height: auto; }
.ps b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ps small { font-size: 10px; color: var(--sub); display: block; white-space: nowrap; }
.ps.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; color: #4a5078; border-style: dashed; min-height: 104px; } .ps.empty span { font-size: 26px; }
.power { text-align: right; font-size: 12px; color: var(--sub); } .power b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }

/* 行アイテム */
.crow { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; margin: 6px 0; }
.crow.in { border-color: #6a5a34; background: linear-gradient(90deg, #d9b66a12, transparent 60%), var(--panel); }
.crow.sm { padding: 6px 8px; } .cr-main { flex: 1; min-width: 0; } .cr-main b { font-size: 15px; }
.item { display: flex; align-items: center; gap: 9px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--r0); border-radius: 10px; padding: 7px 9px; margin: 5px 0; min-height: 54px; }
.item.r1 { border-left-color: var(--r1); } .item.r2 { border-left-color: var(--r2); } .item.r3 { border-left-color: var(--r3); }
.item.r4 { border-left-color: var(--r4); background: linear-gradient(90deg, #ffb02e14, transparent 55%), var(--panel); } .item.set { border-left-color: var(--set); }
.item.empty { border-style: dashed; border-left-style: dashed; color: var(--sub); }
.it-main { flex: 1; min-width: 0; } .it-name { font-size: 13.5px; font-weight: 600; }
.item.r1 .it-name, .rt1 { color: var(--r1); } .item.r2 .it-name, .rt2 { color: var(--r2); } .item.r3 .it-name, .rt3 { color: var(--r3); }
.item.r4 .it-name, .rt4 { color: var(--r4); } .item.set .it-name, .rts { color: var(--set); } .rt0 { color: var(--r0); }
.slotl { color: var(--sub); font-weight: 400; margin-right: 6px; font-size: 10.5px; }
.it-sub { font-size: 11.5px; color: #c9cde0; font-variant-numeric: tabular-nums; } .it-aff { font-size: 11px; color: var(--sub); line-height: 1.4; }
.it-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.who { font-size: 10px; color: var(--gold2); border: 1px solid #6a5a34; border-radius: 6px; padding: 0 5px; }
.new { font-style: normal; font-size: 9px; background: var(--bad); color: #fff; border-radius: 4px; padding: 0 4px; margin-left: 5px; vertical-align: 1px; }
.lockt { font-style: normal; font-size: 9px; border: 1px solid var(--sub); color: var(--sub); border-radius: 4px; padding: 0 3px; margin-left: 5px; }
.diff { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; } .diff.up { color: var(--good); } .diff.down { color: var(--bad); }
.tile { position: relative; flex: none; width: 40px; height: 40px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 19px; font-weight: 700;
  color: var(--r0); border: 1.5px solid currentColor; background: #0b0d17; }
.tile.r1 { color: var(--r1); } .tile.r2 { color: var(--r2); } .tile.r3 { color: var(--r3); box-shadow: 0 0 8px #c56bff55; }
.tile.r4 { color: var(--r4); box-shadow: 0 0 12px #ffb02e77; background: radial-gradient(#3a2a08, #0b0d17); } .tile.set { color: var(--set); box-shadow: 0 0 8px #3fd6c055; }
.tile .dot { position: absolute; right: -3px; top: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #0b0d17; }
.itd-head { display: flex; gap: 10px; align-items: center; } .itd-head .it-name { font-size: 16px; }
.itd-base { font-size: 15px; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.itd-aff { margin: 4px 0; padding-left: 18px; font-size: 13px; color: #cfd3e6; } .itd-aff li { margin: 2px 0; }
.itd-uq { border: 1px solid #7a5a1c; background: #ffb02e12; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; } .itd-uq b { display: block; color: var(--r4); }
.itd-set { border: 1px solid #2a7a70; background: #3fd6c010; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; margin: 8px 0; color: var(--sub); }
.itd-set b { display: block; color: var(--set); } .itd-set .on { color: var(--text); }
.warnline { font-size: 12px; color: #ffcf9a; background: #4a2f1466; border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
details.cmp { margin: 8px 0; border-top: 1px dashed var(--line); padding-top: 6px; } details.cmp summary { color: var(--sub); font-size: 12.5px; padding: 4px 0; }

/* キャラ */
.ch-hero { display: flex; gap: 12px; align-items: center; margin: 4px 0 6px; } .ch-info { flex: 1; min-width: 0; }
.ch-name { font-family: var(--serif); font-size: 21px; letter-spacing: .08em; } .ch-cls { font-size: 14px; font-weight: 600; } .ch-cls small { color: var(--sub); font-weight: 400; }
.ch-lv { font-size: 17px; font-weight: 700; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stats div { background: var(--panel2); border-radius: 8px; padding: 5px 4px; text-align: center; }
.stats small { display: block; font-size: 10px; color: var(--sub); } .stats b { font-size: 15px; font-variant-numeric: tabular-nums; }
.traits { margin-top: 8px; }
.skill { border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 7px 10px; margin: 5px 0; }
.skill.off { opacity: .5; } .skill.pas { border-style: dashed; }
.skill.empty { border-style: dashed; color: var(--sub); text-align: center; padding: 13px; font-size: 13px; }
.sk-h { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .sk-h b { font-size: 14px; margin-right: 2px; }
.tag { font-style: normal; font-size: 10px; border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; color: var(--sub); margin-left: 2px; }
.tag.need { border-color: #7a5a1c; color: var(--gold); }
.sk-d { font-size: 12px; color: #c1c5d8; }
.inh.used { opacity: .45; }
.cls { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; background: var(--panel2); }
.cls.cur { border-color: var(--gold); }
.cglyph { --c: #999; flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 19px; font-weight: 700;
  color: var(--c); border: 2px solid var(--c); background: #0b0d17; }
.cand { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 11px; margin: 8px 0; }
.cand.gone { justify-content: center; color: var(--sub); border-style: dashed; padding: 22px; }
.cd-main { flex: 1; min-width: 0; } .cd-main b { font-size: 16px; } .cd-main .btn { width: 100%; margin-top: 8px; }
table.rec { width: 100%; border-collapse: collapse; font-size: 13.5px; } table.rec td { padding: 6px 2px; border-bottom: 1px solid #23274199; } table.rec td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--gold2); }
.help h2 { margin-top: 14px; } .help h2:first-child { margin-top: 0; } .help p { font-size: 13.5px; color: #d6d2c6; } .help b { color: var(--gold2); }
.ta { width: 100%; height: 76px; margin: 8px 0; background: #0a0c16; color: var(--sub); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; padding: 6px; user-select: text; -webkit-user-select: text; }
.file { width: 100%; margin: 8px 0; font-size: 13px; color: var(--sub); }

/* ダンジョン選択 */
.card.dg { --c: #d9b66a; border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 10px 12px; margin: 7px 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 12%, transparent), transparent 50%), var(--panel); }
.card.dg.locked { opacity: .45; border-left-color: #444; }
.card.dg.big { padding: 16px 14px; } .card.dg.big .dg-h b { font-size: 22px; }
.dg-h { display: flex; align-items: baseline; gap: 8px; } .dg-h b { flex: 1; font-family: var(--serif); font-size: 17px; letter-spacing: .1em; }
.lv { font-size: 11.5px; color: var(--gold2); white-space: nowrap; } .dg-d { font-size: 12.5px; color: #c1c5d8; margin: 2px 0; } .dg-f { font-size: 11px; color: var(--sub); }
.m-title { --c: #f3d894; font-family: var(--serif); font-size: 22px; letter-spacing: .12em; text-align: center; color: color-mix(in srgb, var(--c) 75%, #fff); margin-bottom: 4px; }
.m-title small { font-size: 12px; color: var(--sub); letter-spacing: 0; font-family: var(--sans); } .m-title.good { color: var(--gold2); } .m-title.bad { color: #ff8a7a; }
.depth { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 10px 0 4px; }
.depth button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold); background: var(--panel2); font-size: 22px; color: var(--gold2); }
.depth div { text-align: center; min-width: 110px; } .depth b { display: block; font-family: var(--serif); font-size: 22px; } .depth small { color: var(--sub); }
.lvcmp { text-align: center; font-size: 12.5px; margin: 8px 0; color: var(--sub); } .lvcmp.bad { color: #ff9a8a; } .lvcmp.good { color: #9fe6b3; }
.rule { border-left: 3px solid var(--good); background: #17301f88; border-radius: 0 8px 8px 0; padding: 6px 10px; margin: 5px 0; font-size: 12.5px; }
.rule.bad { border-left-color: var(--bad); background: #331a1988; } .rule b { display: block; font-size: 13.5px; }
.rw { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; } .rw small { color: var(--sub); font-size: 11px; } .chal { font-size: 12px; color: var(--gold2); margin-top: 2px; }
.mons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .mons.boss { grid-template-columns: 1fr; }
.mon { text-align: center; background: var(--panel2); border-radius: 10px; padding: 6px 2px; min-width: 0; } .mon .art { margin: 0 auto; }
.mon b { display: block; font-size: 11px; font-weight: 500; line-height: 1.3; min-height: 2.6em; } .mons.boss .mon b { font-size: 14px; min-height: 0; }

/* モーダル・トースト */
#modal { display: none; } #modal.show { display: block; position: fixed; inset: 0; z-index: 50; }
.modal-bg { position: absolute; inset: 0; background: #04050acc; backdrop-filter: blur(3px); }
.modal-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(100% - 24px); max-width: 456px; max-height: calc(100dvh - 40px); overflow-y: auto;
  background: var(--panel); border: 1px solid #454b78; border-radius: 16px; padding: 16px 14px; box-shadow: 0 20px 60px #000c; animation: pop .18s ease-out; overscroll-behavior: contain; }
.modal-box p { margin: 8px 0; font-size: 13.5px; }
.intro { text-align: center; } .intro p { font-size: 14.5px; line-height: 1.8; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 14px); z-index: 80; width: calc(100% - 32px); max-width: 440px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.toast { background: #23284af2; border: 1px solid #4a5078; border-radius: 10px; padding: 9px 13px; font-size: 13px; text-align: center; animation: pop .2s ease-out; transition: opacity .4s; }
.toast.good { border-color: #2f6b45; background: #183523f2; } .toast.bad { border-color: #7a3530; background: #3a1c1bf2; } .toast.out { opacity: 0; }

/* 探索 */
.top.run { flex-direction: column; align-items: flex-start; gap: 0; } .top.run h1 { font-size: 21px; }
.floors { display: flex; gap: 5px; margin: 2px 0 8px; }
.floors i { flex: 1; height: 6px; border-radius: 3px; background: #23274a; } .floors i.done { background: var(--gold); } .floors i.cur { background: var(--gold2); box-shadow: 0 0 8px var(--gold2); animation: pulse 1.4s infinite; }
.floors i.boss { background: #5a2420; } .floors i.boss.cur { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.b-rules { margin: 2px 0 6px; }
.run-party { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 10px; }
.rp { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.rp > div { flex: 1; min-width: 0; } .rp b { font-size: 12.5px; } .rp small { color: var(--sub); font-size: 10.5px; margin-left: 5px; } .rp .bar { margin-top: 3px; }
.choose { font-family: var(--serif); font-size: 16px; letter-spacing: .15em; text-align: center; color: var(--gold2); margin: 14px 0 8px; }
.room { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px; margin: 8px 0; min-height: 76px; }
.rglyph { flex: none; width: 50px; height: 50px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 25px; font-weight: 700; border: 2px solid currentColor; color: #c9cde0; background: #0b0d17; }
.rglyph.big { width: 72px; height: 72px; font-size: 36px; margin: 4px auto 10px; display: flex; color: var(--gold2); } .rglyph.spring { color: #7fd6ff; } .rglyph.bad { color: #ff8a7a; }
.room.battle .rglyph { color: #ffb08a; } .room.elite .rglyph { color: #ff6a8a; box-shadow: 0 0 12px #ff6a8a55; } .room.chest .rglyph { color: var(--gold2); box-shadow: 0 0 12px #f3d89455; }
.room.spring .rglyph { color: #7fd6ff; } .room.event .rglyph { color: #c9a6ff; } .room.boss .rglyph { color: #ff5a4a; box-shadow: 0 0 16px #ff5a4a88; }
.room.boss { border-color: #7a3530; background: radial-gradient(120% 140% at 100% 0, #e2574c33, transparent 60%), var(--panel); min-height: 96px; }
.r-main { flex: 1; min-width: 0; } .r-main b { display: block; font-family: var(--serif); font-size: 17px; letter-spacing: .1em; } .r-main small { color: var(--sub); font-size: 12px; display: block; }
.r-en { display: flex; flex: none; } .r-en .art { margin-left: -8px; }

/* 宝箱 */
.chest-wrap { text-align: center; }
.chest { --c: #a9b0c0; position: relative; width: 130px; height: 120px; margin: 18px auto 8px; cursor: pointer; }
.c-box { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; border-radius: 6px 6px 10px 10px; background: linear-gradient(#7a5226, #4a2f14); border: 3px solid #d9b66a; box-shadow: inset 0 -8px 0 #0004; }
.c-box i { position: absolute; left: 50%; top: -6px; width: 22px; height: 26px; transform: translateX(-50%); border-radius: 4px; background: #f3d894; border: 2px solid #8a6a2a; }
.c-lid { position: absolute; left: -3px; right: -3px; bottom: 58px; height: 46px; border-radius: 60px 60px 4px 4px / 46px 46px 4px 4px; background: linear-gradient(#93652f, #6a4520); border: 3px solid #d9b66a;
  transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); z-index: 2; }
.c-glow { position: absolute; left: 50%; bottom: 40px; width: 20px; height: 20px; border-radius: 50%; transform: translate(-50%, 0) scale(0); background: var(--c); filter: blur(14px); opacity: 0; transition: transform .5s, opacity .5s; }
.chest.shake { animation: shake .12s 5; }
.chest.open .c-lid { transform: translateY(-34px) rotate(-18deg); }
.chest.open .c-glow { transform: translate(-50%, 0) scale(9); opacity: .85; }
.chest.legend .c-glow { animation: legend 1.2s ease-in-out infinite alternate; }
.chest-hint { color: var(--gold2); font-size: 13px; min-height: 26px; animation: pulse 1.2s infinite; }
.leg-text { font-family: var(--serif); font-size: 24px; letter-spacing: .25em; color: var(--r4); text-shadow: 0 0 18px #ffb02e; }
.loot { text-align: left; margin: 6px 0; } .lc { position: relative; } .lc.pop { animation: lootin .32s cubic-bezier(.2, 1.4, .4, 1) both; }
.lc.leg .item { box-shadow: 0 0 18px #ffb02e66; }
.lc .gone { position: absolute; right: 8px; top: 8px; font-style: normal; font-size: 10px; color: var(--sub); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; background: #0b0d17; }

/* 結果 */
.result { padding-top: calc(28px + env(safe-area-inset-top)); text-align: center; } .result .item, .result .rule, .result .rw { text-align: left; }
.res-sub { color: var(--sub); font-size: 13px; }
.res-title { font-family: var(--serif); font-size: 44px; letter-spacing: .3em; margin: 4px 0 12px; padding-left: .3em; } .res-title.good { color: var(--gold2); text-shadow: 0 0 30px #d9b66a88; } .res-title.bad { color: #ff8a7a; }
.v-row { display: flex; justify-content: center; gap: 14px; font-size: 13.5px; color: var(--gold2); margin: 8px 0; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.v-up { background: #4a79d922; border: 1px solid #4a79d9; border-radius: 8px; padding: 5px 10px; margin: 5px 0; font-size: 13.5px; text-align: center; } .v-up b { color: #9fd0ff; }
.v-skill { background: #d9b66a1c; border: 1px solid var(--gold); border-radius: 8px; padding: 6px 10px; margin: 5px 0; font-size: 13.5px; text-align: center; animation: pulse 1.6s 2; }
.v-skill b { color: var(--gold2); } .v-skill small { display: block; color: var(--sub); font-size: 11.5px; }

/* 戦闘 */
.battle { position: relative; padding-top: env(safe-area-inset-top); min-height: 100dvh; display: flex; flex-direction: column; }
.b-top { display: flex; align-items: center; gap: 6px; padding: 8px 0 4px; }
.b-title { flex: 1; font-family: var(--serif); font-size: 15px; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .b-title small { color: var(--sub); margin-left: 8px; font-family: var(--sans); font-size: 11.5px; }
.b-enemies { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 6px; padding: 4px 0; min-height: 150px; }
.ucard { position: relative; border-radius: 12px; border: 1.5px solid transparent; transition: opacity .3s, border-color .15s, transform .15s; }
.ucard.enemy { width: calc(33.3% - 4px); text-align: center; padding: 4px 3px 5px; background: #15182966; } .ucard.enemy.elite { width: calc(36% - 4px); } .ucard.enemy.boss { width: 54%; background: radial-gradient(#e2574c1f, #15182966 70%); }
.ucard.enemy .art { margin: 0 auto; }
.b-enemies.n4 .ucard.enemy, .b-enemies.n5 .ucard.enemy { width: calc(25% - 5px); padding: 3px 1px 4px; }
.b-enemies.n4 .ucard.enemy.boss, .b-enemies.n5 .ucard.enemy.boss { width: 44%; }
.b-enemies.n4 .ucard.enemy:not(.boss) .art, .b-enemies.n5 .ucard.enemy:not(.boss) .art { width: 54px; height: 54px; }
.b-enemies.n4 .ucard.enemy:not(.boss) .uname, .b-enemies.n5 .ucard.enemy:not(.boss) .uname { font-size: 9.5px; } .ucard .uname { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ucard.boss .uname { font-family: var(--serif); font-size: 13.5px; color: #ffb3aa; }
.unum { position: absolute; left: 4px; top: 3px; font-style: normal; font-size: 10px; width: 16px; height: 16px; line-height: 16px; border-radius: 50%; background: #5a2420; color: #ffc9c2; }
.umeta { margin-top: 3px; min-height: 20px; } .sh { font-size: 11.5px; color: #9fd8ff; margin-right: 3px; font-variant-numeric: tabular-nums; }
.brk { font-size: 11px; color: #1a1408; background: var(--gold2); border-radius: 4px; padding: 0 5px; margin-right: 3px; letter-spacing: .08em; animation: pulse .8s infinite; }
.ufx { min-height: 16px; line-height: 1.2; } .fx { font-style: normal; display: inline-block; font-size: 9.5px; border-radius: 4px; padding: 0 3px; margin: 1px; }
.fx.good { background: #1c4a2c; color: #a8f0bd; } .fx.bad { background: #4a1f1c; color: #ffb9b0; } .fx.warn { background: #ffb02e; color: #1a1408; font-weight: 700; animation: pulse .7s infinite; } .fx sub { font-size: 8px; opacity: .8; margin-left: 1px; }
.ucard.dead { opacity: .22; filter: grayscale(1); } .ucard.broken { border-color: var(--gold2); } .ucard.broken .art { transform: rotate(-7deg) translateY(4px); filter: saturate(.4) drop-shadow(0 4px 6px #0009); }
.ucard.acting { border-color: #fff; transform: translateY(-3px); box-shadow: 0 0 14px #ffffff55; } .ucard.ally.acting { border-color: var(--ally); box-shadow: 0 0 14px #6fb2ff77; }
.ucard.hit { animation: hit .22s; }
.b-order { display: flex; align-items: center; gap: 4px; padding: 5px 0; overflow: hidden; } .b-order small { font-size: 10px; color: var(--sub); margin-right: 2px; flex: none; }
.b-order i { flex: none; font-style: normal; width: 24px; height: 24px; line-height: 22px; text-align: center; border-radius: 7px; font-size: 11.5px; border: 1px solid; }
.b-order i.a { color: var(--ally); background: #6fb2ff1a; } .b-order i.e { color: var(--enemy); background: #ff8a7a1a; } .b-order i.boss { background: #e2574c55; color: #fff; }
.b-order i.first { transform: scale(1.18); box-shadow: 0 0 8px currentColor; margin-right: 3px; }
.b-log { height: 52px; overflow: hidden; font-size: 11.5px; color: var(--sub); display: flex; flex-direction: column; justify-content: flex-end; padding: 0 2px; }
.b-log .cur { color: var(--text); font-size: 12.5px; } .la { color: var(--ally); } .le { color: var(--enemy); } .lb { color: var(--gold2); }
.b-allies { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 0; }
.ucard.ally { display: flex; gap: 7px; align-items: center; background: var(--panel); border-color: var(--line); padding: 5px 7px; min-width: 0; }
.ubody { flex: 1; min-width: 0; } .ucard.ally .uname { font-size: 12.5px; font-weight: 600; } .uhp { font-size: 12px; font-variant-numeric: tabular-nums; } .uhp small { color: var(--sub); font-size: 10px; }
.pick-E .ucard.enemy:not(.dead), .pick-A .ucard.ally:not(.dead), .pick-D .ucard.ally.dead { border-color: var(--gold2); animation: pulse .8s infinite; cursor: pointer; opacity: 1; }
.b-cmd { margin-top: auto; position: sticky; bottom: 0; background: linear-gradient(transparent, #0b0d17 14px); padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); min-height: 150px; z-index: 4; }
.cmd-wait { text-align: center; color: var(--sub); font-size: 12px; padding: 22px 0; }
.cmd-tip { font-size: 11.5px; color: #ffe2a8; background: #d9b66a1c; border: 1px solid #6a5a34; border-radius: 8px; padding: 5px 9px; margin-bottom: 6px; line-height: 1.45; }
.cmd-head { font-size: 13px; margin-bottom: 5px; } .cmd-head b { color: var(--gold2); }
.cmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cmd-grid.many { grid-template-columns: repeat(3, 1fr); gap: 5px; } .cmd-grid.many .sk-btn { padding: 5px 6px; } .cmd-grid.many .sk-btn b { font-size: 12.5px; white-space: normal; line-height: 1.25; } .cmd-grid.many .sk-btn .el { width: 16px; height: 16px; font-size: 9.5px; margin: 0 1px; }
.sk-btn { text-align: left; border: 1px solid #454b78; background: linear-gradient(#262b48, #1a1e33); border-radius: 10px; padding: 6px 9px; min-height: 52px; min-width: 0; }
.sk-btn b { display: block; font-size: 14px; white-space: nowrap; } .sk-btn.basic { border-color: var(--line); background: var(--panel); }
.sk-btn small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 10.5px; color: var(--sub); line-height: 1.3; }
#bFloat { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.flt { position: absolute; transform: translate(-50%, -50%); font-weight: 800; font-size: 19px; color: #fff; text-shadow: 0 0 4px #000, 0 2px 0 #000, 0 0 10px #000; white-space: nowrap; animation: flt .95s ease-out forwards; font-variant-numeric: tabular-nums; }
.flt.ally { color: #ff9a8a; } .flt.crit { font-size: 25px; color: #ffe07a; } .flt.weak { color: #ffb86a; } .flt.crit.weak { color: #ffd04a; } .flt.res { color: #8a90a8; font-size: 15px; } .flt.dot { color: #c9a6ff; font-size: 15px; }
.flt.heal { color: #8ff0a8; font-size: 17px; } .flt.skill { font-size: 13px; color: var(--gold2); font-family: var(--serif); letter-spacing: .1em; animation-name: flt2; }
.flt.tag { font-size: 12px; animation-name: flt2; } .flt.tag.good { color: #a8f0bd; } .flt.tag.bad { color: #ffb9b0; } .flt.tag.weak { color: #ffb02e; font-size: 13px; letter-spacing: .15em; margin-top: -22px; }
.flt.brk { font-family: var(--serif); font-size: 30px; color: var(--gold2); letter-spacing: .12em; text-shadow: 0 0 16px #ffb02e, 0 2px 0 #000; animation-name: brk; }
.victory .m-title { font-size: 28px; letter-spacing: .3em; }

@keyframes pop { from { transform: translate(-50%, -48%) scale(.96); opacity: 0; } }
.toast { animation-name: tin; } @keyframes tin { from { transform: translateY(8px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .6; } }
@keyframes shake { 25% { transform: translateX(-5px) rotate(-3deg); } 75% { transform: translateX(5px) rotate(3deg); } }
@keyframes legend { from { transform: translate(-50%, 0) scale(8); } to { transform: translate(-50%, 0) scale(12); } }
@keyframes lootin { from { transform: translateY(14px) scale(.92); opacity: 0; } }
@keyframes hit { 30% { transform: translateX(-5px); filter: brightness(2.2); } 70% { transform: translateX(4px); } }
@keyframes flt { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.25); } 30% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -170%); } }
@keyframes flt2 { 0% { opacity: 0; transform: translate(-50%, 40%); } 20% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -90%); } }
@keyframes brk { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1.1); } }
@media (max-height: 740px) {
  .b-log { height: 36px; } .b-enemies { min-height: 118px; padding: 2px 0; } .b-top { padding: 6px 0 2px; }
  .ucard.ally { padding: 3px 6px; } .ucard.ally .art { width: 36px; height: 36px; } .ufx { min-height: 0; } .umeta { margin-top: 1px; }
  .sk-btn { min-height: 42px; padding: 4px 8px; } .sk-btn small { -webkit-line-clamp: 1; }
  .b-cmd { min-height: 116px; padding-top: 8px; } .cmd-tip { font-size: 10.5px; padding: 3px 7px; }
  .ucard.enemy:not(.boss):not(.elite) .art { width: 56px; height: 56px; } .ucard.enemy.boss .art { width: 88px; height: 88px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01s !important; transition-duration: .01s !important; } }
@media (min-width: 520px) { #app { border-left: 1px solid #1c2038; border-right: 1px solid #1c2038; } }
