/* Moon-silver battle rails and result seal. All graphics are CSS or Canvas. */
.battle .unit-box .bar { position:relative; isolation:isolate; overflow:visible; height:12px; margin:7px 3px; border:1px solid #bac9df; border-radius:1px; background:#070d20; box-shadow:0 0 0 2px #0b1022,inset 0 1px 4px #000; }
.battle .unit-box .bar::before { content:''; position:absolute; inset:0; z-index:3; pointer-events:none; background:repeating-linear-gradient(90deg,transparent 0,transparent calc(25% - 1px),#08162688 calc(25% - 1px),#08162688 25%); }
.battle .unit-box .hp-rail::after { content:''; position:absolute; inset:3px -5px; border-inline:3px solid #d7e4f3; pointer-events:none; }
.battle .unit-box .bar > i,.battle .hp-trail { position:absolute; left:0; top:0; bottom:0; height:auto; border-radius:0; }
.battle .unit-box .hp-rail > i { z-index:2; background:linear-gradient(180deg,#ffffff99,transparent 35%,#0b263522),var(--hp-color,#9aefd0); transition:width .13s ease-out; }
.battle .hp-trail { z-index:1; background:#b95770; }
.battle .damaged .hp-trail { background:#fff0e1; }
.battle .healing { filter:drop-shadow(0 0 5px #8fffc1); }
.battle .unit-box .gauge { height:7px; min-width:65px; border-color:#9d8cb4; }
.battle .unit-box .gauge > i { background:linear-gradient(90deg,#8170b8,#dfccfa); }
.battle .unit-box .gauge.charged { border-color:#ffe9b9; animation:gauge-light 1.2s ease-in-out infinite; }
.battle .unit-box .gauge.charged > i { background:linear-gradient(90deg,#c6a66a,#fff1c9,#ddbd77); background-size:200% 100%; animation:gauge-flow 1.8s linear infinite; }
.battle .ub-hp { font-variant-numeric:tabular-nums; white-space:nowrap; font-size:12px; }
@keyframes gauge-light { 50% { box-shadow:0 0 9px #f6d58b88; } }
@keyframes gauge-flow { to { background-position:200% 0; } }
.battle-result { position:fixed; inset:0; width:100%; height:100%; z-index:30; border:0; border-radius:0; padding:0; display:grid; place-items:center; color:#f8f0de; background:radial-gradient(ellipse at 50% 44%,#293e6455,transparent 58%),linear-gradient(0deg,#080b2066,transparent 35%,#080b2033); cursor:pointer; animation:result-arrive .4s ease-out both; }
.result-seal { position:relative; display:flex; flex-direction:column; align-items:center; width:min(420px,90vw); margin-top:-30px; text-shadow:0 2px 3px #050921,0 0 24px #b5d7ff88; }
.result-seal strong { font-family:var(--serif); font-size:clamp(56px,14vw,88px); font-weight:800; letter-spacing:.3em; padding-left:.3em; line-height:1.6; animation:seal-arrive .65s cubic-bezier(.15,.75,.2,1) both; }
.result-ribbon { width:100%; padding:6px 0; font-family:var(--serif); font-size:15px; letter-spacing:.55em; padding-left:.55em; border-block:1px solid #dce9f2bb; background:linear-gradient(90deg,transparent,#23304fc9 22%,#23304fc9 78%,transparent); box-shadow:0 5px 20px #060a2033; }
.result-seal small { margin-top:18px; font-family:var(--serif); font-size:13px; letter-spacing:.16em; }
.result-moon { position:absolute; left:50%; top:43%; transform:translate(-50%,-50%) rotate(-20deg); font-family:var(--serif); font-size:280px; color:#dbeaff16; text-shadow:0 0 50px #8aafff33; }
.result-skip { position:absolute; bottom:calc(35px + env(safe-area-inset-bottom)); font-size:12px; letter-spacing:.12em; color:#e2e9f0; }
.is-loss { background:linear-gradient(#07091588,#070915e8); animation:defeat-sink 1.2s ease-out both; color:#bfc4d6; }
.is-loss .result-moon { color:#82839911; }
@keyframes result-arrive { from { opacity:0; } to { opacity:1; } }
@keyframes seal-arrive { from { opacity:0; transform:translateY(18px) scale(1.1); filter:blur(3px); } to { opacity:1; transform:none; filter:none; } }
@keyframes defeat-sink { from { opacity:0; } to { opacity:1; } }
@media (max-width:420px) { .battle .unit-box .bar { height:10px; } .battle .ub-bars { min-width:0; } .result-seal small { font-size:11px; } }
@media (prefers-reduced-motion:reduce) { .battle-result,.result-seal strong,.battle .unit-box .gauge { animation:none; } }

/* Selected terrain stays readable without covering the central battlefield. */
.field-terrain-info {
  position: absolute; right: 14px; bottom: max(calc(12px + env(safe-area-inset-bottom)), var(--terrain-bottom, 218px)); z-index: 5;
  padding: 9px 14px; min-width: 116px; pointer-events: none;
  max-width:calc(100% - 28px); color: #f1eedf; font-size: 13px; letter-spacing: .06em;
  background: linear-gradient(135deg, rgba(22,30,48,.94), rgba(38,43,63,.9));
  border: 1px solid #a99e81; border-radius: 3px;
  box-shadow: 0 3px 12px #090c1880, inset 0 0 0 2px #c4cad315;
}
@media (max-width: 700px) { .field-terrain-info { right: 8px; max-width:calc(100% - 16px); padding: 6px 9px; font-size: 12px; } }
/* Preserve the Codex rails; give their numbers room in the enlarged face panel. */
.battle .unit-box .ub-hp { font-size:20px; }
@media(max-width:640px) { .battle .unit-box .ub-hp { font-size:17px; } }

/* 一度きりの月針。判定はそのまま、残された機会を文字と縁で示す。 */
.battle .bhud-top .rewind-control {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 48px; min-width: 112px; flex-shrink: 0; padding: 7px 12px;
  font-family: var(--sans); line-height: 1.3; text-align: left;
  border-color: #8e9db9; background: var(--grain), linear-gradient(145deg,#293952,#111a2d);
  color: #dfe7f1; box-shadow: inset 0 0 0 2px #0c1424, 0 2px 6px #05091680;
}
.battle .rewind-control .rewind-mark { flex: none; font-size: 27px; line-height: 1; color: #c9e8fa; }
.battle .rewind-label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; white-space: nowrap; }
.battle .rewind-label small { font-family: var(--sans); font-size: 11px; font-weight: 400; letter-spacing: 0; color: #bdcadb; }
.battle .rewind-control.rewind-ready:not(:disabled) {
  border-color: #c5dcec; color: #fff2cf; background: var(--grain), linear-gradient(140deg,#344c64,#162239);
  box-shadow: inset 0 -2px #b5a273, inset 0 0 0 2px #0c1424, 0 0 12px #b8dcf422;
}
.battle .rewind-ready:not(:disabled) .rewind-mark { color: #f2dca5; }
.battle .rewind-control:disabled { opacity: 1; filter: none; color: #aeb9ca; background: var(--grain), #141c2c; }
.battle .rewind-control:disabled::before { opacity: .55; }
.battle .rewind-control:disabled .rewind-mark { color: #8693aa; }
.battle .rewind-empty .rewind-label small { color: #aeb9ca; }
.battle .rewind-spent { border-style: dashed; border-color: #6b7186; }
.battle .rewind-spent .rewind-mark { position: relative; }
.battle .rewind-spent .rewind-mark::after { content: ''; position: absolute; width: 27px; height: 1px; top: 50%; left: 0; background: #a0a8b8; transform: rotate(-40deg); }
.battle .rewind-spent .rewind-label small { color: #aab0c1; }
.battle .rewind-control:focus-visible { outline: 2px solid #f2dca5; outline-offset: 3px; }

/* 手番の記録は左から時間、人物、戻る向き。どの行も一つのタップ領域。 */
.modal:has(.rewind-panel) { width: min(560px,100%); background: var(--grain), linear-gradient(145deg,#29364e,#121a2e 72%); }
.rewind-panel { min-width: 0; font-family: var(--sans); }
.rewind-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.rewind-heading h2 { flex: 1 1 auto; margin: 0; font-family: var(--serif); }
.rewind-heading h2::after { max-width: 74px; }
.rewind-limit { flex: none; border: 1px solid #a08b60; padding: 4px 9px; background: #10182b; color: #ead4a0; font-size: 12px; white-space: nowrap; }
.rewind-description { margin: 0 0 16px; color: #d1d8e5; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.rewind-panel .rewind-points { gap: 8px; }
.rewind-panel .rewind-point {
  display: grid; grid-template-columns: 86px minmax(0,1fr) 20px; align-items: center; gap: 10px;
  min-width: 0; min-height: 64px; border-width: 1px; border-radius: 2px; border-color: #68758e;
  background: linear-gradient(110deg,#26364b,#131d31); color: #f3eee3; box-shadow: inset 0 0 0 2px #0c1424;
}
.rewind-age { display: flex; align-items: baseline; gap: 6px; font-family: var(--sans); color: #c6d9ec; font-size: 12px; white-space: nowrap; }
.rewind-age span { font-family: var(--sans); font-size: 26px; font-weight: 400; line-height: 1.2; color: #f6e5bb; min-width: 18px; text-align: center; }
.rewind-unit { display: block; min-width: 0; border-left: 1px solid #6f7d9366; padding-left: 12px; font-size: 12px; line-height: 1.65; color: #bac8da; overflow-wrap: anywhere; }
.rewind-unit strong { display: block; font-family: var(--sans); font-size: 15px; font-weight: 400; color: #f3eee3; }
.rewind-arrow { color: #bad8ed; font-size: 20px; text-align: center; }
.rewind-panel .rewind-point:focus-visible { outline: 2px solid #f3d59a; outline-offset: 2px; border-color: #d1dfeb; }
.rewind-panel .rewind-point:active { background: #354868; border-color: #eed19a; }
.rewind-panel .rewind-cancel { min-height: 46px; }
@media (hover:hover) { .rewind-panel .rewind-point:hover { background: linear-gradient(110deg,#344b65,#1b2a41); border-color: #c1d6e6; } }

/* 戦いのルールだけを四つの節に。永久離脱は静かな赤い欄として読む。 */
.modal:has(.rules-tip) { width: min(620px,100%); background: var(--grain), linear-gradient(145deg,#29364e,#121a2e 72%); }
.rules-tip { min-width: 0; font-family: var(--sans); }
.rules-tip > .tip-head { padding: 3px 10px; color: #c5dceb; background: #111b2f; font-size: 12px; border-color: #8597af; }
.rules-tip > h2 { font-family: var(--serif); font-size: 24px; padding-block: 6px; }
.rules-tip-grid { display: grid; gap: 11px; }
.rules-tip-rule { min-width: 0; padding: 14px 16px; background: #10192bee; border: 1px solid #596b84; border-left: 3px solid #90afc8; box-shadow: inset 0 0 0 2px #0b1424; }
.rules-tip-rule h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-family: var(--serif); font-size: 18px; line-height: 1.6; color: #e5edf4; }
.rules-tip-number { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; font-family: var(--sans); font-size: 13px; font-weight: 400; letter-spacing: 0; border: 1px solid #7690aa; background: #24364c; color: #c8ddea; }
.rules-tip-rule .tip-p { margin: 0; padding: 0; border: 0; color: #d4dbe7; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.rules-tip-rule .tip-p b { color: #efdcae; font-weight: 400; }
.rules-tip-danger { background: linear-gradient(120deg,#332337,#181d30); border-color: #986271; border-left-color: #e1a0ab; }
.rules-tip-danger h3 { color: #f3c9cf; }
.rules-tip-danger .rules-tip-number { border-color: #b77985; background: #462c3a; color: #ffd5d9; }
.rules-tip-danger .tip-p b { color: #ffc2ca; }
.rules-tip > .btn { min-height: 48px; }

/* 離脱の知らせは固有の復帰と永久の喪失を、同じ文章のまま分ける。 */
#toast > div:has(.battle-departure) { min-width: min(330px,calc(100vw - 28px)); padding: 14px 18px; text-align: left; background: linear-gradient(120deg,#26364c,#11192b); border-color: #95afc6; }
.battle-departure { display: block; min-width: 0; font-family: var(--sans); color: #e2e9f0; }
.departure-kicker { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.6; letter-spacing: .06em; margin-bottom: 6px; }
.departure-copy { display: block; font-size: 14px; line-height: 1.8; font-weight: 400; overflow-wrap: anywhere; }
.departure-copy b { font-family: var(--sans); font-weight: 400; color: #fff4db; }
.departure-return { display: block; color: #bdcddd; font-size: 12px; margin-top: 3px; }
#toast > div:has(.is-permanent) { border-color: #d196a2; background: linear-gradient(120deg,#3a2637,#141b2c); box-shadow: inset 3px 0 #b67887, inset 0 0 0 2px #171325, 0 5px 18px #050916aa; }
.battle-departure.is-permanent .departure-kicker { color: #f3bdc8; }
.battle-departure.is-permanent .departure-copy { color: #ead2da; }
.battle-departure.is-leave .departure-kicker { color: #d6e7f3; }
@media (max-width:640px) {
  .battle .bhud-top .rewind-control { min-height: 48px; min-width: 112px; padding: 6px 9px; gap: 5px; }
  .rewind-panel .rewind-point { grid-template-columns: 74px minmax(0,1fr) 16px; gap: 7px; }
  .rewind-age { gap: 4px; font-size: 11px; }
  .rewind-unit { padding-left: 9px; }
  .rules-tip > h2 { font-size: 22px; }
  .rules-tip-rule { padding: 12px; }
  .rules-tip-rule .tip-p { font-size: 14px; }
}
@media (prefers-reduced-motion:reduce) {
  .battle .rewind-control, .rewind-point, #toast > div:has(.battle-departure) { animation: none; transition: none; }
}

/* 名前の下にHPの数値、MPと必殺はそれぞれ専用の行を持つ。 */
.battle .unit-box .ub-hp { margin-top:2px; color:#f5f1e5; font-size:22px; font-weight:400; line-height:1.35; font-variant-numeric:tabular-nums; white-space:normal; overflow-wrap:anywhere; }
.battle .unit-box .hp-rail { margin:1px 3px 3px; height:11px; }
.battle .unit-box .mp-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; margin:2px 3px; min-width:0; }
.battle .unit-box .mp-row .bar.mp { min-width:0; height:7px; margin:0; border-color:#829fca; }
.battle .unit-box .ub-mp { color:#d1e5ff; font-size:13px; line-height:1.5; font-variant-numeric:tabular-nums; white-space:nowrap; }
.battle .unit-box .ub-ultimate { min-width:0; padding-top:19px; }
.battle .unit-box .gauge { min-width:0; margin:0 3px 2px; height:7px; }
.battle .unit-box .gauge::after { content:attr(aria-label); position:absolute; left:-3px; bottom:11px; color:#d8cceb; font-size:12px; line-height:1.3; white-space:nowrap; font-variant-numeric:tabular-nums; }
.battle .unit-box .gauge.charged::after { content:'必殺ゲージ 100% ・満タン'; color:#ffe6ab; }
@media(max-width:640px) {
 .battle .unit-box .ub-hp { font-size:20px; }
 .battle .unit-box .ub-mp { font-size:12px; }
}

/* 取得時は同じ札絵と光色で、人物・札名・効果の順に読む。 */
#toast > div:has(.card-pickup) { width:min(348px,calc(100vw - 28px)); max-width:100%; padding:12px 16px; text-align:left; font-weight:400; border-color:var(--line-strong); background:var(--grain),linear-gradient(115deg,#30405b,#121d31 70%); }
#toast .card-pickup { display:flex; align-items:center; gap:13px; min-width:0; }
#toast .card-pickup > .battle-card-art { width:32px; height:44px; filter:drop-shadow(0 0 9px var(--card-color)); }
#toast .card-pickup .battle-card-glyph { font-size:22px; border-width:2px; }
#toast .card-pickup-copy { display:grid; flex:1; gap:3px; min-width:0; }
#toast .card-pickup-kicker { display:flex; justify-content:space-between; align-items:center; gap:8px; color:#c7d5e8; font-size:11px; line-height:1.4; letter-spacing:.08em; }
#toast .card-pickup-kicker > span { color:var(--card-color); letter-spacing:.12em; }
#toast .card-pickup strong { color:#fff2dc; font-family:var(--serif); font-size:19px; line-height:1.5; overflow-wrap:anywhere; }
#toast .card-pickup-who { color:#c4d2e3; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
#toast .card-pickup-effect { color:var(--card-color); font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
@media(prefers-reduced-motion:reduce) { #toast > div:has(.card-pickup) { animation:none; } }

/* スマホ戦闘画面の詰め（2026-10-06）
   最後に読むCSSで既存のスキンと演出用余白を上書きする。
   高さ480px以下の横持ちは既存レイアウトを維持。
   HUD 64px + 下パネル最大45% - 64px = 中央のマップを最低55%確保。
   safe-areaの余白も下パネルの高さ上限に含める。 */
@media (max-width: 640px) {
 @media (min-height: 481px), (orientation: portrait) {
  .battle .bhud-top {
   display:grid; grid-template-columns:minmax(0,1fr) repeat(4,40px);
   grid-template-rows:40px 18px; gap:2px 4px;
   top:env(safe-area-inset-top); padding:2px 6px;
   height:64px; align-items:center;
   background:linear-gradient(#0c1024f5,#0c1024df);
  }
  .battle .bhud-top .order {
   grid-column:1; grid-row:1; order:0; position:relative; inset:auto;
   width:100%; min-width:0; max-width:none; height:40px;
   flex-wrap:nowrap; align-items:center; gap:4px; padding:4px;
   overflow-x:auto; overflow-y:hidden; scrollbar-width:none;
   overscroll-behavior-x:contain; touch-action:pan-x;
  }
  .battle .order::-webkit-scrollbar { display:none; }
  .battle .order .o:nth-child(n) { display:grid; flex:0 0 28px; width:28px; height:30px; }
  .battle .order::before { border-image-width:5px; }
  .battle .bhud-top > .btn {
   grid-row:1; order:0; width:40px; height:40px; min-width:40px;
   min-height:40px; padding:0; font-size:21px; line-height:1;
  }
  .battle .bhud-top .mute { grid-column:2; }
  .battle .bhud-top .settings-btn { grid-column:3; }
  .battle .bhud-top .rewind-control { grid-column:4; gap:0; }
  .battle .rewind-label { display:none; }
  .battle .bhud-top .rewind-control:disabled { opacity:.5; }
  .battle .bhud-top [data-act="retreat"] { grid-column:5; font-size:0; }
  .battle .bhud-top [data-act="retreat"]::after { content:'↗'; font-size:23px; }
  .battle .bhud-top > .btn::before { border-image-width:8px; }
  .battle .bhud-top .stage-label {
   grid-column:1 / -1; grid-row:2; order:0; display:flex;
   align-items:center; gap:6px; width:100%; min-width:0; height:18px;
   margin:0; padding:0 5px; font-size:10px; line-height:16px;
   white-space:nowrap; overflow-x:auto; overflow-y:hidden; scrollbar-width:none;
  }
  .battle .stage-label::before { border-image-width:3px; }
  .battle .stage-label::-webkit-scrollbar { display:none; }
  .battle .stage-title,.battle .stage-goal { flex:none; flex-wrap:nowrap; gap:4px; margin:0; }
  .battle .stage-title strong { font-size:11px; overflow-wrap:normal; }
  .battle .stage-sub,.battle .stage-label .goal-label { display:none; }
  .battle .stage-goal::before { content:'｜'; color:var(--brass); }
  .battle .stage-label .goal-copy { font-size:11px; line-height:16px; overflow-wrap:normal; }
  .battle .stage-practice { font-size:10px; }
  .battle .stage-risk { flex:none; margin:0; padding:0; font-size:10px; line-height:16px; }

  /* 絶対配置なのでdetailsを開いても上部帯の高さは変わらない。 */
  .battle .bhud-top .view-controls {
   position:absolute; top:70px; right:6px; display:grid;
   grid-template-columns:44px; gap:4px; width:44px; max-width:none;
   margin:0; padding:0; border:0; background:none; box-shadow:none;
  }
  .battle .view-heading {
   width:44px; height:40px; min-height:40px; padding:0;
   justify-content:center; border:1px solid #ac9263; border-radius:50%;
   background:var(--grain),#142139ee;
  }
  .battle .view-heading > span:first-child,.battle .view-chevron { display:none; }
  .battle .view-scale { gap:0; }
  .battle .zoom-now { font-size:11px; }
  .battle .zoom-btns {
   position:absolute; top:0; right:50px; width:158px;
   grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px;
   margin:0; padding:5px; border:1px solid var(--brass);
   background:var(--grain),#111c30f5; box-shadow:0 3px 10px #05091680;
  }
  .battle .zoom-btns .btn { min-width:0; min-height:40px; height:40px; font-size:11px; }
  .battle .rot-control { padding:0; border:0; }
  .battle .rot-label { display:none; }
  .battle .rot-btns { position:static; grid-template-columns:44px; gap:4px; padding:0; border:0; background:none; }
  .battle .rot-btns .btn { width:44px; height:40px; min-height:40px; border-radius:50%; font-size:25px; }
  .battle .rot-btns .btn::before { border-image-width:6px; border-radius:50%; }

  .battle .bpanel {
   display:flex; flex-direction:column; gap:4px; width:auto;
   left:0; right:0; padding:4px 6px calc(4px + env(safe-area-inset-bottom));
   max-height:min(270px,calc(45% - 64px - env(safe-area-inset-top)));
   overflow:hidden; background:linear-gradient(#0c1024e8,#0c1024fa);
  }
  .battle .bpanel:empty { padding:0; background:none; }
  .battle .unit-box {
   flex:0 1 auto; min-height:72px; max-height:110px; overflow:auto;
   grid-template-columns:48px minmax(0,1fr); gap:6px;
   max-width:none; padding:4px 6px; margin:0;
  }
  .battle .unit-box::before { border-image-width:6px; }
  .battle .ub-portrait { gap:2px; align-self:start; }
  .battle .ub-affiliation { padding:0; font-size:9px; line-height:12px; }
  .battle .unit-box .face { width:48px; height:48px; }
  .battle .unit-box .ub-bars {
   display:grid; grid-template-columns:minmax(0,1fr) auto auto;
   gap:2px 4px; align-items:center; align-self:start;
  }
  .battle .ub-bars > .ub-identity { display:contents; }
  .battle .ub-name {
   grid-column:1; grid-row:1; font-size:14px; line-height:18px;
   white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  .battle .ub-level { grid-column:2; grid-row:1; font-size:10px; line-height:18px; }
  .battle .ub-bars > .ub-meta {
   grid-column:3; grid-row:1; flex-wrap:nowrap; gap:2px;
   max-width:100px; overflow-x:auto; white-space:nowrap;
  }
  .battle .ub-bars .tag { flex:none; font-size:9px; padding:0 2px; line-height:14px; }
  .battle .ub-protect { flex:none; font-size:9px; line-height:14px; }
  .battle .ub-bars > .ub-status {
   grid-column:1 / -1; grid-row:5; flex-wrap:nowrap;
   overflow-x:auto; gap:3px; white-space:nowrap;
  }
  .battle .unit-box .ub-hp {
   grid-column:1; grid-row:2; margin:0; font-size:11px;
   line-height:14px; white-space:nowrap; overflow-wrap:normal;
  }
  .battle .unit-box .bar { height:6px; margin:0; }
  .battle .unit-box .hp-rail { grid-column:2 / -1; grid-row:2; height:6px; margin:0 2px; }
  .battle .unit-box .hp-rail::after { inset:1px -3px; border-inline-width:2px; }
  .battle .unit-box .mp-row {
   grid-column:1 / -1; grid-row:3; align-items:center;
   gap:5px; margin:0 2px; min-height:12px;
  }
  .battle .unit-box .mp-row .bar.mp { height:5px; }
  .battle .unit-box .ub-mp { font-size:10px; line-height:12px; }
  .battle .unit-box .ub-ultimate { grid-column:1; grid-row:4; padding:12px 4px 0 0; }
  .battle .unit-box .gauge { height:5px; margin:0; }
  .battle .unit-box .gauge::after { left:0; bottom:8px; font-size:9px; line-height:11px; }
  .battle .unit-box .gauge.charged::after { content:'必殺 100%'; }
  .battle .ub-cards {
   grid-column:2 / -1; grid-row:4; flex-wrap:nowrap;
   gap:3px; padding:0; margin:0; border:0; justify-content:flex-end;
  }
  .battle .ub-cards-heading { display:none; }
  .battle .ub-card-slots { gap:2px; }
  .battle .ub-card { width:40px; height:40px; padding:0; }
  .battle .ub-card-empty { width:18px; }
  .battle .ub-cards-count { font-size:10px; }
  .battle .ub-cards-count > span { font-size:9px; }
  .battle .hint {
   flex:0 0 auto; width:100%; margin:0; padding:2px 5px;
   max-height:44px; overflow:auto; font-size:11px; line-height:16px;
  }
  .battle .hint:has([data-card-info]) {
   display:flex; align-items:center; flex:0 0 44px;
   white-space:nowrap; overflow-x:auto; overflow-y:hidden;
  }
  .battle .hint:has([data-card-info]) br { display:none; }
  .battle .hint .link-btn { flex:none; min-height:40px; padding:0 5px; font-size:11px; }
  .battle .cmds {
   flex:none; display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
   gap:4px; width:100%; max-width:none;
  }
  .battle .cmds .btn {
   min-width:0; min-height:42px; height:42px;
   padding:0 3px; font-size:14px; line-height:18px; letter-spacing:0;
  }
  .battle .cmds .btn::before { border-image-width:8px 12px; }
  .battle .cmds:has([data-c="ult"]):not(:has([data-c="undo"])) { grid-template-columns:repeat(12,minmax(0,1fr)); }
  .battle .cmds:has([data-c="ult"]):not(:has([data-c="undo"])) .btn { grid-column:span 3; }
  .battle .cmds:has([data-c="ult"]):not(:has([data-c="undo"])) .btn:nth-child(n+5) { grid-column:span 4; }
  .battle .cmds:not(:has([data-c="move"])) { grid-template-columns:repeat(auto-fit,minmax(100px,1fr)); }
  .battle .skill-list,.battle .preview-box {
   flex:1 1 auto; min-height:40px; max-height:100px;
   overflow:auto; max-width:none; margin:0;
  }
  .battle .skill-list { gap:4px; }
  .battle .skill-list button { min-height:40px; padding:5px 8px; font-size:12px; }
  .battle .skill-list .sd { font-size:10px; line-height:14px; }
  .battle .preview-box { padding:5px 8px; font-size:11px; }
  .battle .preview-box > b { font-size:14px; }
  .battle .pv { flex-direction:row; align-items:center; gap:4px; padding:3px 0; line-height:16px; }
  .battle .recruit-preview .pv b { font-size:16px; }
  .battle .facing { flex:none; grid-template-columns:repeat(4,40px); gap:4px; margin:0; }
  .battle .facing button { height:40px; font-size:20px; }
  .battle .field-terrain-info {
   right:6px; min-width:0; max-width:calc(100% - 68px);
   padding:3px 6px; font-size:10px; line-height:16px; letter-spacing:0;
  }
 }
}
